8 VPNSTATUS_INVALID
= -1,
10 VPNSTATUS_UNINITIALISED
,
11 VPNSTATUS_INITIALISING
,
14 VPNSTATUS_DISCONNECTING
,
19 class VPNControl
: public QObject
23 Q_PROPERTY (QString server READ getServer WRITE setServer NOTIFY serverChanged
)
24 Q_PROPERTY (unsigned int port READ getPort WRITE setPort NOTIFY portChanged
)
25 Q_PROPERTY (bool compressed READ getCompressed WRITE setCompressed NOTIFY compressedChanged
)
26 Q_PROPERTY (bool useTLS READ getUseTLS WRITE setUseTLS NOTIFY useTLSChanged
)
27 Q_PROPERTY (int tlsDirection READ getTlsDirection WRITE setTlsDirection NOTIFY tlsDirectionChanged
)
29 Q_PROPERTY (QString logText READ getLogText WRITE setLogText NOTIFY logTextChanged
)
32 QProcess
* vpnProcess
;
34 QStringList arguments
;
36 // Configuration options
44 void collectArguments ();
45 void setStatus (VPNSTATUS newStatus
);
46 void addArgument (QString key
, QString value
);
47 void addArgument (QString key
);
48 void addOption (QString key
, bool add
);
49 void addValue (QString key
);
50 void settingsSetValue (QString key
, QString value
);
51 void settingsSetValue (QString key
, int value
);
54 explicit VPNControl(QObject
*parent
= 0);
56 QString
getServer() const;
57 unsigned int getPort() const;
58 bool getCompressed() const;
59 bool getUseTLS() const;
60 int getTlsDirection() const;
61 QString
getLogText() const;
64 void statusChanged(int status
);
65 void serverChanged(QString server
);
66 void portChanged(unsigned int port
);
67 void compressedChanged(bool compressed
);
68 void useTLSChanged(bool useTLS
);
69 void tlsDirectionChanged (int direction
);
70 void logTextChanged (QString logText
);
74 void vpnDisconnect ();
77 void finished (int code
);
78 void readError (QProcess::ProcessError error
);
79 void updateConfiguration ();
80 void setServer(const QString
&value
);
81 void setPort(unsigned int value
);
82 void setCompressed(bool value
);
83 void setUseTLS(bool value
);
84 void setTlsDirection(int value
);
85 void setLogText(const QString
&value
);
86 void logAppend(const QString
&text
);
89 #endif // VPNCONTROL_H