package com.zhaohaoting.framework.abs.contract;

import android.arch.lifecycle.Lifecycle;
import android.arch.lifecycle.LifecycleObserver;
import android.arch.lifecycle.LifecycleOwner;
import android.arch.lifecycle.OnLifecycleEvent;

import com.zhaohaoting.framework.mvchelper.task.TaskHelper;

/**
 * author：Created by ZHT on 2017/12/11 15:28
 * email：526309416@qq.com
 * desc：
 */
public interface BaseContract {
    interface BasePresenter extends LifecycleObserver {

        @OnLifecycleEvent(Lifecycle.Event.ON_CREATE)
        void onCreate(LifecycleOwner owner);

        @OnLifecycleEvent(Lifecycle.Event.ON_START)
        void onStart(LifecycleOwner owner);

        @OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
        void onResume(LifecycleOwner owner);

        @OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
        void onPause(LifecycleOwner owner);

        @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
        void onStop(LifecycleOwner owner);

        @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
        void onDestroy(LifecycleOwner owner);

        BaseView getView();

        void cancel(Object task);
    }

    interface BaseView {

        TaskHelper getTaskHelper();

        void showLoading(Object... task);

        void dismissLoading(Object... task);
    }
}
