package com.bernard.mcqinator.api.frageable;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Parcelable;
import android.view.View;
import android.view.ViewGroup;

import com.bernard.mcqinator.api.IdentifiedQuiz;
import com.bernard.mcqinator.api.fragen.Frage;
import com.bernard.mcqinator.view.activities.fragenActivities.FrageActivity;
import com.bernard.mcqinator.api.fragenStats.QuizStat;

import java.util.List;

/**
 * @author samy
 * @date on 05/05/17.
 */

public interface Frageable<FrData extends Frageable.Data,FrReply extends Frage.Reply,QzConfig extends Frageable.Configurator,S extends QuizStat,ID extends Frage.Identifier,F extends Frage> {

    IdentifiedQuiz<F,ID> genFragen(S stat, FrData frageData, Context context, ProgressDialog wait);
    S updateStats(S oldStats, List<FrReply> replies, ID identifier);

    //LATER remove parcelable
    abstract class Data implements Parcelable {
        public abstract Class<? extends FrageActivity<? extends Frage>> getFrageActivityClass();
    }

    //LATER move to view package
    abstract class Configurator{
        public abstract int getTypStringID();

        public abstract int getIconDrawableID();

        public abstract View attachConfigLayout(Activity a,ViewGroup frame);

        public abstract Frageable.Data genDataFromConfigLayout(View v);
    }
}
