NetworkManager::VpnConnection Class

class NetworkManager::VpnConnection

An active VPN connection. More...

Header: #include <NetworkManagerQt/VpnConnection>
CMake: find_package(KF6 REQUIRED COMPONENTS NetworkManagerQt)
target_link_libraries(mytarget PRIVATE KF6::NetworkManagerQt)
Inherits: NetworkManager::ActiveConnection

Public Types

List
Ptr
enum State { Unknown, Prepare, NeedAuth, Connecting, GettingIpConfig, …, Disconnected }
enum StateChangeReason { UnknownReason, NoneReason, UserDisconnectedReason, DeviceDisconnectedReason, ServiceStoppedReason, …, ConnectionRemovedReason }

Public Functions

VpnConnection(const QString &path, QObject *parent = nullptr)
virtual ~VpnConnection() override
QString banner() const
NetworkManager::VpnConnection::State state() const
NetworkManager::VpnConnection *operator NetworkManager::VpnConnection *()

Signals

void bannerChanged(const QString &banner)
void stateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason)

Detailed Description

Member Type Documentation

VpnConnection::List

VpnConnection::Ptr

enum VpnConnection::State

Enum describing the possible VPN connection states

ConstantValueDescription
NetworkManager::VpnConnection::Unknown0The state of the VPN connection is unknown.
NetworkManager::VpnConnection::Prepare1The VPN connection is preparing to connect.
NetworkManager::VpnConnection::NeedAuth2The VPN connection needs authorization credentials.
NetworkManager::VpnConnection::Connecting3The VPN connection is being established.
NetworkManager::VpnConnection::GettingIpConfig4The VPN connection is getting an IP address.
NetworkManager::VpnConnection::Activated5The VPN connection is active.
NetworkManager::VpnConnection::Failed6The VPN connection failed.
NetworkManager::VpnConnection::Disconnected7The VPN connection is disconnected.

enum VpnConnection::StateChangeReason

ConstantValueDescription
NetworkManager::VpnConnection::UnknownReason0The reason for the VPN connection state change is unknown.
NetworkManager::VpnConnection::NoneReason1No reason was given for the VPN connection state change.
NetworkManager::VpnConnection::UserDisconnectedReason2The VPN connection changed state because the user disconnected it.
NetworkManager::VpnConnection::DeviceDisconnectedReason3The VPN connection changed state because the device it was using was disconnected.
NetworkManager::VpnConnection::ServiceStoppedReason4The service providing the VPN connection was stopped.
NetworkManager::VpnConnection::IpConfigInvalidReason5The IP config of the VPN connection was invalid.
NetworkManager::VpnConnection::ConnectTimeoutReason6The connection attempt to the VPN service timed out.
NetworkManager::VpnConnection::ServiceStartTimeoutReason7A timeout occurred while starting the service providing the VPN connection.
NetworkManager::VpnConnection::ServiceStartFailedReason8Starting the service starting the service providing the VPN connection failed.
NetworkManager::VpnConnection::NoSecretsReason9Necessary secrets for the VPN connection were not provided.
NetworkManager::VpnConnection::LoginFailedReason10Authentication to the VPN server failed.
NetworkManager::VpnConnection::ConnectionRemovedReason11The connection was deleted from settings.

Member Function Documentation

[explicit] VpnConnection::VpnConnection(const QString &path, QObject *parent = nullptr)

Creates a new VpnConnection object.

path the DBus path of the device

[override virtual noexcept] VpnConnection::~VpnConnection()

Destroys a VpnConnection object.

Return the current login banner

[signal] void VpnConnection::bannerChanged(const QString &banner)

This signal is emitted when the connection banner has changed

NetworkManager::VpnConnection::State VpnConnection::state() const

returns the current state

[signal] void VpnConnection::stateChanged(NetworkManager::VpnConnection::State state, NetworkManager::VpnConnection::StateChangeReason reason)

This signal is emitted when the VPN connection state has changed

NetworkManager::VpnConnection *VpnConnection::operator NetworkManager::VpnConnection *()

operator for casting an ActiveConnection into a VpnConnection. Returns 0 if this object is not a VPN connection. Introduced to make it possible to create a VpnConnection object for every active connection, without creating an ActiveConnection object, checking if it's a VPN connection, deleting the ActiveConnection and creating a VpnConnection