#ifndef TRAINEESWIDGET_H
#define TRAINEESWIDGET_H

#include "traineesview.h"
#include "ammtaskswidget.h"
#include "fimtaskswidget.h"
#include "messangercontroller.h"
#include "dialogcardtrainee.h"
#include "dialogredactortrainees.h"

namespace Ui {
class ViewerTrainees;
}

//Виджет только для просмотра БД Обучаемых

class ViewerTrainees : public TraineesView
{
    Q_OBJECT

public:
    explicit ViewerTrainees(ConnectorToServer* connectorToServer, MessangerController* messangerController, QWidget *parent = nullptr);
    ~ViewerTrainees();

public:
    void setAuthComplited(bool authComplited);

    void deactivate();

    AMMtasksWidget* getAmmTasksWidgetCommon(){return ammTasksWidgetCommon;};
    FIMtasksWidget* getFimTasksWidgetCommon(){return fimTasksWidgetCommon;};

protected:
    void changeEvent(QEvent * event) override;

public Q_SLOTS:
    void on_btnEditorTrainees_clicked();
    void on_btnPersonalCard_clicked();
private Q_SLOTS:
    void on_itemDoubleClicked(QTreeWidgetItem *item, int column);
    void on_treeWidgetItemClicked(QTreeWidgetItem *item, int column);

Q_SIGNALS:
    //сигнал о выборе обучаемого
    void signal_traineeSelected(int id_trainee);

private:
    void updateButtons() override;

private:
    AMMtasksWidget* ammTasksWidgetCommon;
    FIMtasksWidget* fimTasksWidgetCommon;

    MessangerController* messangerController;

    DialogRedactorTrainees* dlgRedactor;
    DialogCardTrainee* dlgCardTrainee;

private:
    Ui::ViewerTrainees *ui;
};

#endif // TRAINEESWIDGET_H
