#ifndef COMMONCLIENTHANDLER_H
#define COMMONCLIENTHANDLER_H

#include <QObject>
#include "clienthandler.h"

class ProcessingSystem;
class DataParser;
class Logger;

class CommonClientHandler : public QObject
{
    Q_OBJECT
public:
    explicit CommonClientHandler(QObject *parent = nullptr);
    void initialize(QMap<int, ClientHandler*> *clientsMap,
                    ProcessingSystem *processingSystem,
                    DataParser *dataParser);

    void sendNewVersionListToAllClient();
    void sendCurrentVersionToAllClient();
    void slot_ListsInstructorsTraineesChanged();
    void slot_StatusTasksAMMofTraineeChanged(int trainee_id);
    void slot_StatusTasksFIMofTraineeChanged(int trainee_id);
    void slot_sendPacketToAllClients(PacketType packetType);
    bool slotSendMessage(QString loginFrom, QString loginTo, QString text);
    void slot_sendTaskToClient(QString fullNameClient, QString textTask);
signals:
    void sigSendToLogger(QString text);
private:
    QMap<int, ClientHandler*> *clientsMap;
    ProcessingSystem *processingSystem;
    DataParser *dataParser;
};

#endif // COMMONCLIENTHANDLER_H
