RetroShare/retroshare-gui/src/TorControl/TorControlWindow.h

49 lines
1.2 KiB
C
Raw Normal View History

2017-12-21 09:32:42 -05:00
#include "ui_TorControlWindow.h"
2017-12-21 12:16:32 -05:00
class QTcpServer ;
namespace Tor {
class HiddenService ;
class TorManager ;
}
2017-12-21 09:32:42 -05:00
class TorControlDialog: public QWidget, public Ui::TorControlDialog
2017-12-21 09:32:42 -05:00
{
Q_OBJECT
public:
TorControlDialog(Tor::TorManager *tm,QWidget *parent =NULL);
2017-12-21 12:16:32 -05:00
enum TorStatus {
TOR_STATUS_UNKNOWN = 0x00,
TOR_STATUS_OK = 0x01,
TOR_STATUS_FAIL = 0x02
};
enum HiddenServiceStatus {
HIDDEN_SERVICE_STATUS_UNKNOWN = 0x00, // no information known.
HIDDEN_SERVICE_STATUS_FAIL = 0x01, // some error occurred
HIDDEN_SERVICE_STATUS_REQUESTED = 0x02, // one service at least has been requested. Still being tested.
HIDDEN_SERVICE_STATUS_OK = 0x03 // one service responds and has been tested
2017-12-21 12:16:32 -05:00
};
// Should be called multiple times in a loop until it returns something else than *_UNKNOWN
TorStatus checkForTor(QString& error_msg) ;
2017-12-21 12:16:32 -05:00
HiddenServiceStatus checkForHiddenService() ;
2017-12-21 09:32:42 -05:00
protected slots:
void showLog();
void statusChanged();
2017-12-21 12:16:32 -05:00
void onIncomingConnection();
2017-12-21 09:32:42 -05:00
private:
QString mErrorMsg ;
HiddenServiceStatus mHiddenServiceStatus ;
2017-12-21 09:32:42 -05:00
Tor::TorManager *mTorManager ;
2017-12-21 12:16:32 -05:00
Tor::HiddenService *mHiddenService ;
QTcpServer *mIncomingServer ;
2017-12-21 09:32:42 -05:00
};