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
)
28 Q_PROPERTY (QString caCertFile READ getCaCertFile WRITE setCaCertFile NOTIFY caCertFileChanged
)
29 Q_PROPERTY (QString clientCertFile READ getClientCertFile WRITE setClientCertFile NOTIFY clientCertFileChanged
)
30 Q_PROPERTY (QString clientKeyFile READ getClientKeyFile WRITE setClientKeyFile NOTIFY clientKeyFileChanged
)
31 Q_PROPERTY (QString tlsKeyFile READ getTlsKeyFile WRITE setTlsKeyFile NOTIFY tlsKeyFileChanged
)
33 Q_PROPERTY (QString logText READ getLogText WRITE setLogText NOTIFY logTextChanged
)
36 QProcess
* vpnProcess
;
38 QStringList arguments
;
41 // Configuration options
48 QString clientCertFile
;
49 QString clientKeyFile
;
52 void collectArguments ();
53 void setStatus (VPNSTATUS newStatus
);
54 void addArgument (QString key
, QString value
);
55 void addArgument (QString key
);
56 void addArgumentNonempty (QString key
, QString value
);
57 void addOption (QString key
, bool add
);
58 void addValue (QString key
);
59 void settingsSetValue (QString key
, QString value
);
60 void settingsSetValue (QString key
, int value
);
63 explicit VPNControl(QObject
*parent
= 0);
65 QString
getServer() const;
66 unsigned int getPort() const;
67 bool getCompressed() const;
68 bool getUseTLS() const;
69 int getTlsDirection() const;
70 QString
getCaCertFile () const;
71 QString
getClientCertFile () const;
72 QString
getClientKeyFile () const;
73 QString
getTlsKeyFile () const;
75 QString
getLogText() const;
78 void statusChanged(int status
);
79 void serverChanged(QString
&server
);
80 void portChanged(unsigned int port
);
81 void compressedChanged(bool compressed
);
82 void useTLSChanged(bool useTLS
);
83 void tlsDirectionChanged(int direction
);
84 void caCertFileChanged(QString
&caCertFile
);
85 void clientCertFileChanged(QString
&clientCertFile
);
86 void clientKeyFileChanged(QString
&clientKeyFile
);
87 void tlsKeyFileChanged(QString
&tlsKeyFile
);
89 void logTextChanged (QString
&logText
);
93 void vpnDisconnect ();
96 void finished (int code
);
97 void readError (QProcess::ProcessError error
);
98 void updateConfiguration ();
99 void setServer(const QString
&value
);
100 void setPort(unsigned int value
);
101 void setCompressed(bool value
);
102 void setUseTLS(bool value
);
103 void setTlsDirection(int value
);
104 void setCaCertFile(const QString
&value
);
105 void setClientCertFile(const QString
&value
);
106 void setClientKeyFile(const QString
&value
);
107 void setTlsKeyFile(const QString
&value
);
109 void setLogText(const QString
&value
);
110 void logAppend(const QString
&text
);
113 #endif // VPNCONTROL_H