#ifndef TCPCLIENT_H
#define TCPCLIENT_H

#include "Core/sendsystem.h"
#include <QObject>
#include <QTcpSocket>
#include <QHostAddress>
#include <QDataStream>
#include <QTcpServer>
#include <QFile>
#include <QDir>
#include <QCoreApplication>
#include <Core\recognizesystem.h>
#include <Core\tools.h>
#include <Core\externalexecuter.h>

class TCPClient : public QObject
{
    Q_OBJECT

public:
    explicit TCPClient(QObject *parent = 0);
    void initialize(RecognizeSystem *recognize,SendSystem *sendSystem);
    void setConnect(ServerSettings *serverSettings);
    ~TCPClient(){};
    void setDisconnect();
    bool getIsConnected() const;

signals:
    void sigSendDebugLog(QString message);
    void sigServerDisconnect();
    void sigConnectionState(bool flag);

public slots:
    void slotConnectNotify();

private slots:
    void slotReadyRead();


private:
    SendSystem *sendSystem;
    QTcpSocket *socket;
    RecognizeSystem *recognizeSystem;
    bool isConnected;
};

#endif // TCPCLIENT_H
