#ifndef PERSONALCARDTRAINEE_H
#define PERSONALCARDTRAINEE_H

#include"connectortoserver.h"
#include "ammtaskswidget.h"
#include "fimtaskswidget.h"
#include "messangerwidget.h"
#include "messangercontroller.h"
#include <QWidget>

namespace Ui {
class PersonalCardTrainee;
}

class PersonalCardTrainee : public QWidget
{
    Q_OBJECT

public:
    explicit PersonalCardTrainee(ConnectorToServer* connectorToServer, MessangerController* messangerController, int id_trainee, AMMtasksWidget* ammTasksWidget_common, FIMtasksWidget* fimTasksWidget_common, QWidget *parent = nullptr);
    ~PersonalCardTrainee();

    void closeEvent(QCloseEvent *event) override;

private:
    void loadInfo();

public slots:
    void slot_countTasksAMMforTraineeChanged(int trainee_id, int count);
    void slot_countTasksFIMforTraineeChanged(int trainee_id, int count);

    void slot_NeedUpdateUI(bool treeInstructor, bool treeTrainee);

private:
    ConnectorToServer* connectorToServer;
    MessangerController* messangerController;
    int id_trainee;

    AMMtasksWidget* ammTasksWidget_personal;
    FIMtasksWidget* fimTasksWidget_personal;

    AMMtasksWidget* ammTasksWidget_common;
    FIMtasksWidget* fimTasksWidget_common;

    MessangerWidget* messangerWidget;

private:
    Ui::PersonalCardTrainee *ui;
};

#endif // PERSONALCARDTRAINEE_H
