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
)
30 QProcess
* vpnProcess
;
32 QStringList arguments
;
34 // Configuration options
41 void collectArguments ();
42 void setStatus (VPNSTATUS newStatus
);
43 void addArgument (QString key
, QString value
);
44 void addArgument (QString key
);
45 void addOption (QString key
, bool add
);
46 void addValue (QString key
);
47 void settingsSetValue (QString key
, QString value
);
48 void settingsSetValue (QString key
, int value
);
51 explicit VPNControl(QObject
*parent
= 0);
53 QString
getServer() const;
54 unsigned int getPort() const;
55 bool getCompressed() const;
56 bool getUseTLS() const;
57 int getTlsDirection() const;
60 void statusChanged(int status
);
61 void serverChanged(QString server
);
62 void portChanged(unsigned int port
);
63 void compressedChanged(bool compressed
);
64 void useTLSChanged(bool useTLS
);
65 void tlsDirectionChanged (int direction
);
69 void vpnDisconnect ();
72 void finished (int code
);
73 void readError (QProcess::ProcessError error
);
74 void updateConfiguration ();
75 void setServer(const QString
&value
);
76 void setPort(unsigned int value
);
77 void setCompressed(bool value
);
78 void setUseTLS(bool value
);
79 void setTlsDirection(int value
);
82 #endif // VPNCONTROL_H