#ifndef DCHUBLINKLISTENER_H
#define DCHUBLINKLISTENER_H

#include <QWidget>
#include <QFile>

#include <dclib/core/cstring.h>

#include "dcconnectionmanager.h"

class DCHubLinkListener : public QWidget {
    Q_OBJECT

    /**
        @author Andrey Karlov
     */

public:
    DCHubLinkListener(QWidget * parent = 0);
    virtual ~DCHubLinkListener();
    void connect(QString hub);

    /** */
    static void SetInstance(DCHubLinkListener*);
    /** */
    static DCHubLinkListener *Instance();
protected:
    void timerEvent(QTimerEvent *event);

private:
    int timerId;
    void testFile();
    QFile *file;

    static DCHubLinkListener *pHubLinkListener;
};

/** */
inline void DCHubLinkListener::SetInstance(DCHubLinkListener *listener) {
    pHubLinkListener = listener;
}

/** */
inline DCHubLinkListener *DCHubLinkListener::Instance() {
    return pHubLinkListener;
}

#endif
