WIP: main
This commit is contained in:
parent
f25f34565a
commit
15730b470e
52 changed files with 2438 additions and 208 deletions
40
client/vpnconnection.h
Normal file
40
client/vpnconnection.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
#ifndef VPNCONNECTION_H
|
||||
#define VPNCONNECTION_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QScopedPointer>
|
||||
|
||||
#include "vpnprotocol.h"
|
||||
|
||||
class VpnConnection : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit VpnConnection(QObject* parent = nullptr);
|
||||
~VpnConnection();
|
||||
|
||||
enum class Protocol{OpenVpn};
|
||||
void connectToVpn(Protocol protocol = Protocol::OpenVpn);
|
||||
|
||||
bool connected() const;
|
||||
bool disconnected() const;
|
||||
void disconnectFromVpn();
|
||||
|
||||
static QString bytesToText(quint64 bytes);
|
||||
|
||||
signals:
|
||||
void bytesChanged(quint64 receivedBytes, quint64 sentBytes);
|
||||
void connectionStateChanged(VpnProtocol::ConnectionState state);
|
||||
|
||||
protected slots:
|
||||
void onBytesChanged(quint64 receivedBytes, quint64 sentBytes);
|
||||
void onConnectionStateChanged(VpnProtocol::ConnectionState state);
|
||||
|
||||
protected:
|
||||
|
||||
QScopedPointer<VpnProtocol> m_vpnProtocol;
|
||||
};
|
||||
|
||||
#endif // VPNCONNECTION_H
|
Loading…
Add table
Add a link
Reference in a new issue