NetworkManager::VpnConnection Class
class NetworkManager::VpnConnectionAn 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
Constant | Value | Description |
---|---|---|
NetworkManager::VpnConnection::Unknown | 0 | The state of the VPN connection is unknown. |
NetworkManager::VpnConnection::Prepare | 1 | The VPN connection is preparing to connect. |
NetworkManager::VpnConnection::NeedAuth | 2 | The VPN connection needs authorization credentials. |
NetworkManager::VpnConnection::Connecting | 3 | The VPN connection is being established. |
NetworkManager::VpnConnection::GettingIpConfig | 4 | The VPN connection is getting an IP address. |
NetworkManager::VpnConnection::Activated | 5 | The VPN connection is active. |
NetworkManager::VpnConnection::Failed | 6 | The VPN connection failed. |
NetworkManager::VpnConnection::Disconnected | 7 | The VPN connection is disconnected. |
enum VpnConnection::StateChangeReason
Constant | Value | Description |
---|---|---|
NetworkManager::VpnConnection::UnknownReason | 0 | The reason for the VPN connection state change is unknown. |
NetworkManager::VpnConnection::NoneReason | 1 | No reason was given for the VPN connection state change. |
NetworkManager::VpnConnection::UserDisconnectedReason | 2 | The VPN connection changed state because the user disconnected it. |
NetworkManager::VpnConnection::DeviceDisconnectedReason | 3 | The VPN connection changed state because the device it was using was disconnected. |
NetworkManager::VpnConnection::ServiceStoppedReason | 4 | The service providing the VPN connection was stopped. |
NetworkManager::VpnConnection::IpConfigInvalidReason | 5 | The IP config of the VPN connection was invalid. |
NetworkManager::VpnConnection::ConnectTimeoutReason | 6 | The connection attempt to the VPN service timed out. |
NetworkManager::VpnConnection::ServiceStartTimeoutReason | 7 | A timeout occurred while starting the service providing the VPN connection. |
NetworkManager::VpnConnection::ServiceStartFailedReason | 8 | Starting the service starting the service providing the VPN connection failed. |
NetworkManager::VpnConnection::NoSecretsReason | 9 | Necessary secrets for the VPN connection were not provided. |
NetworkManager::VpnConnection::LoginFailedReason | 10 | Authentication to the VPN server failed. |
NetworkManager::VpnConnection::ConnectionRemovedReason | 11 | The 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.
QString VpnConnection::banner() const
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