#ifndef SENDSYSTEM_H
#define SENDSYSTEM_H

#include <QObject>
#include <QTcpSocket>
#include <QDataStream>
#include <mainwindow.h>
#include <Core/tools.h>

class MainWindow;
class DataParser;
class Tools;

class SendSystem :public QObject
{
    Q_OBJECT
public:
    explicit SendSystem(QObject* parent = nullptr);
    void initialize(MainWindow *mainWindow,DataParser *dataParser);
    void setSocket(QTcpSocket *socket);
    void sendClientAutorization();
    void sendDisable();
    void sendFileBlock(QString path);
    void sendFolderBlock(QString path);
    void sendQTConnect();
    void sendXMLAnswer(QByteArray array);
    void sendFinish();
    void sendChangeVersion(StreamingVersionData *streamingVersion);
    void sendDeleteVersion(StreamingVersionData *streamingVersion);
    void sendCopyVersion(QString versionName);

    ~SendSystem();
signals:
    void sigSend();
    QByteArray sigGetXmlAnswer(QString);

public slots:
    void xmlAnswer(QString message);
private:
    QTcpSocket *socket;
    MainWindow *mainWindow;

};

#endif // SENDSYSTEM_H
