mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
89 lines
2.5 KiB
C++
89 lines
2.5 KiB
C++
#ifndef CLIENTHANDLER_H
|
|
#define CLIENTHANDLER_H
|
|
|
|
#include <QObject>
|
|
#include <QTcpSocket>
|
|
#include <QThread>
|
|
|
|
#include <Systems/sendsystem.h>
|
|
#include <Systems/tools.h>
|
|
#include <Data/Client.h>
|
|
#include <Data/PacketType.h>
|
|
|
|
class SendSystem;
|
|
class DataParser;
|
|
class Logger;
|
|
class ServerLMSWidget;
|
|
class UpdateController;
|
|
class RecognizeSystem;
|
|
class ClientAnswerParser;
|
|
|
|
class ClientHandler : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
ClientHandler(QObject* parent = nullptr);
|
|
void initSender(DataParser *dataParser,Logger *logger);
|
|
void sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER);
|
|
void sendFolderBlock(QString path);
|
|
void sendFileBlock(QString path);
|
|
bool getIsSendStopped();
|
|
void sendDeleteBlock(QString path);
|
|
void sendFinish();
|
|
void sendMessageBlock(QString text);
|
|
void sendNeedUpdate(bool flag, quint64 size,quint64 fileCount,quint64 deleteCount);
|
|
void sendDisable();
|
|
void recognize();
|
|
void sendHash();
|
|
void sendVersionList();
|
|
void sendPacketType(PacketType packetType);
|
|
void sendVersion();
|
|
|
|
~ClientHandler();
|
|
|
|
Client *getClient() const;
|
|
SendSystem *getSendSystem() const;
|
|
|
|
QTcpSocket *getSocket() const;
|
|
|
|
signals:
|
|
void sigSendXmlAnswer(QByteArray array, PacketType packetType);
|
|
void sigInitSender (DataParser *dataParse,Logger *logger);
|
|
void sigFolderBlock(QString path);
|
|
void sigFileBlock(QString path);
|
|
bool sigGetIsSendStopped();
|
|
void sigSendDeleteBlock(QString path);
|
|
void sigSendFinish(PacketType packetType);
|
|
void sigSendMessageBlock(QString text);
|
|
void sigNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount);
|
|
void sigClientDisconnected(QString address,QString port);
|
|
void sigSendHash();
|
|
void sigRecognize(ClientHandler *handler);
|
|
void sigSendNotify(QString notify);
|
|
void sigSendFileBlockWithRename (QString path,QString newName);
|
|
void sigSocketWrite(QByteArray array);
|
|
void sigSocketClose();
|
|
bool sigSocketFlush();
|
|
void sigSendVersion();
|
|
void sigSendPacketType(PacketType packetType);
|
|
void sigSendStop();
|
|
|
|
public :
|
|
QThread *thread;
|
|
QTcpSocket *socket;
|
|
|
|
void initialize(int descriptor, ServerLMSWidget *serverWidget,
|
|
UpdateController *updateController, DataParser *dataParser,Logger *logger);
|
|
void setClient(Client *value);
|
|
private:
|
|
UpdateController *updateController;
|
|
RecognizeSystem *recognizeSystem;
|
|
Client *client;
|
|
|
|
SendSystem *sendSystem;
|
|
ServerLMSWidget *server;
|
|
};
|
|
|
|
#endif // CLIENTHANDLER_H
|