using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using Xamarin.Forms;

namespace InABox.Mobile
{
    public class CoreRepositoryChangedEventArgs : EventArgs
    {
        
    }
    
    public delegate void CoreRepositoryChangedEvent(object sender, CoreRepositoryChangedEventArgs args);
    
    public interface ICoreRepository :  INotifyPropertyChanged
    {
        //IColumns GetColumns();
        
        ImageSource GetImageSource(Guid id);
        bool HasImages();

        bool Loaded { get; }
        
        ICoreRepository Refresh(bool force);
        void Refresh(bool force, Action loaded);
        
        DateTime LastUpdated { get; }

        event CoreRepositoryChangedEvent Changed;
        
        IModelHost Host { get; }
        
        object CreateItem();
        void CommitItem(object item);
        object AddItem();
        void DeleteItem(object item);
        IEnumerable Items { get; }
        ICoreRepository Search();
        ICoreRepository Search(Func<object,bool> predicate);
        
        void ToggleSelection(object item);
        void SelectItem(object item);
        void UnselectItem(object item);
        void SelectAll();
        void SelectNone();
        bool IsSelected(object item);
        void SetSelectedItems(IEnumerable<object> items);
        IEnumerable SelectedItems { get; }
        
    }
}