package com.hikapro.backpack.model;

import android.graphics.Bitmap;
import android.os.Message;

import java.util.List;

import com.hikapro.backpack.model.entities.Category;
import com.hikapro.backpack.model.entities.Item;
import com.hikapro.backpack.presenter.Presenter;

/**
 * Created by tariel on 19/04/16.
 */
public interface Model {

    interface Base {
        void onDestroy(boolean isConfigurationChanging);
        void executeQuery();
        void notifyDataSetChanged();
        void onEvent(Message event);
    }

    interface Set extends Base {
        com.hikapro.backpack.model.entities.Set getSetByPosition(int position);
        com.hikapro.backpack.model.entities.Set findSet(int id);
        int getSetsCount();
        void setPresenter(Presenter.SetList presenter);
        Presenter.SetList getPresenter();
        int getLastVisiblePosition();
        void setLastVisiblePosition(int position);
        List<com.hikapro.backpack.model.entities.Set> getSets();

        void setsReorderNotify();
    }

    interface Item extends Base {
        void filter(String query);
        int getHeaderId(int position);
        int getItemId(int position);
        // leave at home
        void pendingRemove(com.hikapro.backpack.model.entities.Item item);
        void pendingRemoveCancel(com.hikapro.backpack.model.entities.Item item);
        void remove(com.hikapro.backpack.model.entities.Item item);
        int getItemsCount();
        int getActiveItemsCount();
        int getPackedQty();

        int getLastVisiblePosition();
        void setLastVisiblePosition(int position);

        com.hikapro.backpack.model.entities.Item getItemByPosition(int position);

        com.hikapro.backpack.model.entities.Category getCategoryByPosition(int position);
        void setPresenter(Presenter.ItemList presenter);
        Presenter.ItemList getPresenter();

        void packItem(com.hikapro.backpack.model.entities.Item item);
        void unpackItem(com.hikapro.backpack.model.entities.Item item);
        void unpackSet(int setId);
        void restoreSet(int setId);
    }

    interface Detail extends Base {
        int getCount();
        com.hikapro.backpack.model.entities.Item getCurrentItem();
        void setCurrentItem(com.hikapro.backpack.model.entities.Item item);
        Bitmap getPicture();
        void setPresenter(Presenter.ItemDetail presenter);
        Presenter.ItemDetail getPresenter();
        void pendingRemove(com.hikapro.backpack.model.entities.Item item);
        void pendingRemoveCancel(com.hikapro.backpack.model.entities.Item item);
        void packItem(com.hikapro.backpack.model.entities.Item item);
        void unpackItem(com.hikapro.backpack.model.entities.Item item);
    }

    interface Share extends Base {
        void setPresenter(Presenter.Share presenter);
        Presenter.Share getPresenter();
        Bitmap[] getSharingPics();

    }

    interface Add extends Base {
        void setPresenter(Presenter.Add presenter);
        Presenter.Add getPresenter();
        void filter(String query, int checkThisSet);
        int getItemsCount();
        com.hikapro.backpack.model.entities.Item getItemByPosition(int position);
        int getCategoriesCount();
        Category getCategoryByPosition(int position);
        Category getCategoryById(int id);
        void add(com.hikapro.backpack.model.entities.Item item, int setId);
    }



}
