#ifndef INTERFACEDATABASELMS_H
#define INTERFACEDATABASELMS_H

#include <QObject>
#include <QWidget>
#include <QTranslator>

#include "DataBaseLMS_global.h"
#include "databaselms.h"

class DATABASELMS_EXPORT InterfaceDataBaseLMS : public /*QObject*/QWidget,  DataBaseLMS
{
    Q_OBJECT

public:
    InterfaceDataBaseLMS(QWidget* parent = nullptr);

public Q_SLOTS:
    void slot_LanguageChanged(QString language);

public:
    //Соединение
    bool ConnectionToDB();
    bool DisConnectionFromDB();
    bool DBisConnected();

    //Инструкторы

    bool AuthorizationInstructor(QString login, QString password);
    bool deAuthorizationInstructor(QString login);
    bool deAuthorizationAllInstructors();

    QString getNameInstructorByLogin(QString login);

    QList<Instructor> getListInstructors();
    Instructor getInstructor(int id);

    int newInstructor();
    int delInstructor(int id);
    int editInstructor(Instructor instructor);

    bool isAdminInstructor(int id);
    bool isArchivedInstructor(int id);
    bool isLoggedInInstructor(int id);


    //Обучаемые

    bool AuthorizationTrainee(QString login, QString password, QString classroom_name, QString computer_name);
    bool deAuthorizationTrainee(QString login);
    bool deAuthorizationAllTrainees();

    //void setTasks(QString login, QStringList tasks);
    QList<Task> getTasksTrainee(int id);

    QString getNameTraineeOnComputer(QString computer_name);
    Trainee getTraineeOnComputer(QString computer_name);

    QString getNameTraineeByLogin(QString login);

    QList<Trainee> getListTraineesInGroup(int id);
    QList<Group> getListGroups();
    QList<Trainee> getListTrainees();

    Trainee getTrainee(int id);
    Group getGroup(int group_id);

    int newGroup();
    int delGroup(int id);
    int editGroup(Group group);

    int newTrainee(int id_group);
    int delTrainee(int id);
    int editTrainee(Trainee trainee);

    bool isArchivedTrainee(int id);
    bool isLoggedInTrainee(int id);

private:
    QTranslator qtLanguageTranslator;
};

#endif // INTERFACEDATABASELMS_H
