Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QVPNClient Class Reference

The QVPNClient class abstracts data and state of a virtual private network. More...

    #include <QVPNClient>

Inherits QObject.

Public Types

Public Functions

Signals

Protected Functions

Additional Inherited Members


Detailed Description

The QVPNClient class abstracts data and state of a virtual private network.

An instance of a QVPNClient can be created by using QVPNFactory. Qt Extended currently supports OpenVPN only. New VPN implementations must subclass this abstract class.

Each VPNClient instance operates in one of the follwoing two modes:

Every VPN can be identified via a unique identifier returned by id(), has a name() and a type(). The VPN configuration can be changed via configure(). connect() will establish the VPN connection. Once the VPN has been started its state() will change from QVPNCLient::Disconnected to QVPNClient::Pending and eventually to QVPNClient::Connected. Each state change is indicated via the connectionStateChanged() signal. If an error occurs during the startup period the user can obtain a human-readable string describing the nature of the error.

If the user decides to delete a VPN connection cleanup() should be called to remove any configuration file that has been created previously. By default Qt Extended saves VPN configuration files in $HOME/Applications/Netork/vpn.

See also QVPNFactory.


Member Type Documentation

enum QVPNClient::State

This enum is used to describe the state of a VPN connection.

ConstantValueDescription
QVPNClient::Disconnected0The VPN connection is offline.
QVPNClient::Pending1The VPN connection is in a transitional phase between Disconnected and Connected.
QVPNClient::Connected20The VPN connection is active and can be used.

enum QVPNClient::Type

This enum is used to describe the type of a VPN connection.

ConstantValueDescription
QVPNClient::OpenVPN0VPN solution based on OpenVPN (for details see http://openvpn.net)
QVPNClient::IPSec20VPN solution based on IPSec (not yet implemented in Qt Extended and serves as place holder for future implementation)


Member Function Documentation

QVPNClient::QVPNClient ( bool serverMode, QObject * parent = 0 )   [protected]

Creates a new QVPNClient instance with the given parent. QVPNClient instances can only be created via QVPNFactory::create().

serverMode determines whether this VPN object operates in server mode. Qt Extended applications usually obtain client mode instances of QVPNClient. In this mode all request are forwarded to the QtopiaVpnManager which keeps a reference to a VPNClient instance running in server mode. This allows the synchronization of multiple VPN requests to the same VPN.

This constructor is used internally by QVPNFactory whenever the user creates a new VPN that doesn't exist yet.

See also QtopiaVpnManager and QVPNFactory.

QVPNClient::QVPNClient ( bool serverMode, uint vpnID, QObject * parent = 0 )   [protected]

Creates a new QVPNClient instance with the given parent. QVPNClient instances can only be created via QVPNFactory::create().

serverMode determines whether this VPN object operates in server mode. Qt Extended applications usually obtain client mode instances of QVPNClient. In this mode all request are forwarded to the QtopiaVpnManager which keeps a reference to a VPNClient instance running in server mode. This allows the synchronization of multiple VPN requests to the same VPN.

vpnID acts as an identifier for a particular VPN.

See also QtopiaVpnManager and QVPNFactory.

QVPNClient::~QVPNClient ()   [virtual]

Destroys the virtual private network.

void QVPNClient::cleanup ()   [pure virtual]

Deletes the VPN client and all files associated to it. This function does nothing if the client is still connected.

QDialog * QVPNClient::configure ( QWidget * parent = 0 )   [pure virtual]

Returns the default configuration dialog that is shown to the user when he configures this interface. parent is the parent widget for the returned dialog.

void QVPNClient::connect ()   [pure virtual]

This function starts the VPN connection.

void QVPNClient::connectionStateChanged ( bool error )   [signal]

This signal is emitted when the state of the VPN connection changes.

error will be set to true if an error occurred during the last state transition. A human-readable string of the error can be obtained via errorString()

This signal must be emitted by subclasses of QVPNClient when state transitions occur.

void QVPNClient::disconnect ()   [pure virtual]

This function stops the active connection.

QString QVPNClient::errorString () const

Returns a human-readable description of the last error that occurred. This is useful for presenting an error message to the user when receiving a connectionStateChanged() signal with the error argument set to true;

uint QVPNClient::id () const

Returns the unique ID of this virtual private network.

QString QVPNClient::name () const   [virtual]

Returns the user set name for this VPN.

State QVPNClient::state () const   [pure virtual]

Returns the current state of this VPN client.

See also QVPNClient::State.

Type QVPNClient::type () const   [pure virtual]

Returns the VPN client type.

See also QVPNClient::Type.


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3