#ifndef SENDSYSTEM_H #define SENDSYSTEM_H #include #include #include #include #include #include #include #include class DataParser; class FileData; class SendSystem : public QObject { Q_OBJECT public: explicit SendSystem(QObject* parent = nullptr); ~SendSystem(); void initialize(DataParser* dataParser,QMutex *globalMutex); void setClient(Client* client,QTcpSocket *socket); void updateFiles(QList fileSendList, QList deleteList); private: bool waitWrittenData(QString marker, int msec = 500); public slots: void slot_BytesWrittenToSocket(qint64 bytes); bool slot_getIsSendingStopped() const; void slot_stopSending(); void slot_socketClose(); void slot_sendVersion(); void slot_sendNotify(QString notify); void slot_sendPacketType(PacketType packet); void slot_sendXmlAnswer(QByteArray array, PacketType packetType = PacketType::TYPE_XMLANSWER); void slot_sendDocs_forQtClient(QString docPath); void slot_sendNeedUpdate(bool flag,quint64 size,quint64 fileCount,quint64 deleteCount); void slot_sendFolderBlock(QString path); void slot_sendDeleteBlock(QString path); void slot_sendFileBlock_forGUI(QString path); void slot_sendFileBlock_forQtClient(QString path); void slot_sendFileBlockByteArray(QByteArray array, PacketType packetType); void slot_sendFileBlockWithRename_Hash_forQtClient(QString path,QString newName); signals: QByteArray sigSendNotify(QString message); private: Client *client; QTcpSocket* socket; DataParser* dataParser; QMutex *globalMutex; //Не используется (но пока оставлен) char* buffer; TypeClientAutorization type; bool flSendingStopped; bool flWaitWritenToSocket; qint64 bytesWritedToSocket; qint64 fileSize; int countSend; }; #endif // SENDSYSTEM_H