using System.Collections;
using System.Collections.ObjectModel;
using System.ComponentModel;
using InABox.Core;


namespace InABox.Avalonia
{
    public class CoreRepositoryChangedEventArgs : EventArgs
    {
        
    }
    
    public delegate void CoreRepositoryChangedEvent(object sender, CoreRepositoryChangedEventArgs args);
    
    public interface ICoreRepository :  INotifyPropertyChanged
    {
        //IColumns GetColumns();
        
        IEnumerable AvailableFilters { get; }
        void SelectFilter(string? name);
        bool FiltersVisible { get; }
        
        byte[]? GetImageSource(Guid id);
        bool HasImages();

        bool Loaded { get; }
        
        ICoreRepository Refresh(bool force);
        Task<ICoreRepository> RefreshAsync(bool force);
        void Refresh(bool force, Action loaded);

        void Save(string auditMessage);
        Task SaveAsync(string auditMessage);
        
        DateTime LastUpdated { get; }

        event CoreRepositoryChangedEvent Changed;
        
        IModelHost Host { get; }
        
        object CreateItem();
        void CommitItem(object item);
        object AddItem();
        void DeleteItem(object item);
        IEnumerable Items { get; }
        int ItemCount { 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; }
    }
}