Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceNetwork::NetworkHost Class Reference

Root of the NetworkManager surface. More...

#include <PhosphorServiceNetwork/NetworkHost.h>

Inheritance diagram for PhosphorServiceNetwork::NetworkHost:
[legend]

Public Types

enum  Connectivity {
  UnknownConnectivity = 0 , NoConnectivity = 1 , Portal = 2 , Limited = 3 ,
  Full = 4
}

Signals

void networkingEnabledChanged ()
void wirelessEnabledChanged ()
void connectivityChanged ()
void primaryConnectionTypeChanged ()
void deviceAdded (PhosphorServiceNetwork::NetworkDevice *device)
void deviceRemoved (PhosphorServiceNetwork::NetworkDevice *device)
void deviceCountChanged ()
void availableChanged ()
void wirelessHardwareEnabledChanged ()
void wwanChanged ()
void connectivityCheckUriChanged ()
void operationFinished (const QString &operation, const QString &path, const QString &errorName)

Public Member Functions

 NetworkHost (QObject *parent=nullptr)
 NetworkHost (QDBusConnection connection, QObject *parent=nullptr)
 ~NetworkHost () override
bool networkingEnabled () const
bool available () const
bool wirelessHardwareEnabled () const
bool wwanSupported () const
bool wwanEnabled () const
bool wwanHardwareEnabled () const
void setWwanEnabled (bool enabled)
QString connectivityCheckUri () const
void refresh ()
void disconnectDevice (PhosphorServiceNetwork::NetworkDevice *device)
bool wirelessEnabled () const
void setWirelessEnabled (bool enabled)
 Toggle the global Wi-Fi radio (NetworkManager WirelessEnabled).
Connectivity connectivity () const
QString primaryConnectionType () const
int deviceCount () const
QList< NetworkDevice * > devices () const
PhosphorServiceNetwork::NetworkDevice * deviceAt (int index) const
void scanWifi ()
 Trigger a Wi-Fi scan on every managed Wi-Fi device (NM Device.Wireless.RequestScan).
void activateConnection (PhosphorServiceNetwork::NetworkConnection *connection, PhosphorServiceNetwork::NetworkDevice *device)
 Activate an existing saved connection on a device (NM ActivateConnection).
void connectToAccessPoint (PhosphorServiceNetwork::NetworkDevice *device, PhosphorServiceNetwork::AccessPoint *accessPoint, const QString &passphrase={}, bool autoConnect=true, PhosphorServiceNetwork::NetworkConnection *existing=nullptr)
 Create and activate a new Wi-Fi connection for an access point (NM AddAndActivateConnection).

Detailed Description

Root of the NetworkManager surface.

Binds the system bus, exposes the manager-level connectivity / radio-toggle state, and materialises one NetworkDevice per org.freedesktop.NetworkManager.Device. Construct one, hand its pointer to a NetworkDeviceModel for list views, or bind the scalar properties directly for a status indicator.

Member Enumeration Documentation

◆ Connectivity

Enumerator
UnknownConnectivity 
NoConnectivity 
Portal 
Limited 
Full 

Constructor & Destructor Documentation

◆ NetworkHost() [1/2]

PhosphorServiceNetwork::NetworkHost::NetworkHost ( QObject * parent = nullptr)
explicit

◆ NetworkHost() [2/2]

PhosphorServiceNetwork::NetworkHost::NetworkHost ( QDBusConnection connection,
QObject * parent = nullptr )
explicit

◆ ~NetworkHost()

PhosphorServiceNetwork::NetworkHost::~NetworkHost ( )
override

Member Function Documentation

◆ activateConnection()

void PhosphorServiceNetwork::NetworkHost::activateConnection ( PhosphorServiceNetwork::NetworkConnection * connection,
PhosphorServiceNetwork::NetworkDevice * device )

Activate an existing saved connection on a device (NM ActivateConnection).

Fire-and-forget; the result surfaces through the device's state and the manager's connectivity. No-op if either argument is null or the bus is unavailable.

◆ available()

bool PhosphorServiceNetwork::NetworkHost::available ( ) const
nodiscard

◆ availableChanged

void PhosphorServiceNetwork::NetworkHost::availableChanged ( )
signal

◆ connectivity()

Connectivity PhosphorServiceNetwork::NetworkHost::connectivity ( ) const
nodiscard

◆ connectivityChanged

void PhosphorServiceNetwork::NetworkHost::connectivityChanged ( )
signal

◆ connectivityCheckUri()

QString PhosphorServiceNetwork::NetworkHost::connectivityCheckUri ( ) const
nodiscard

◆ connectivityCheckUriChanged

void PhosphorServiceNetwork::NetworkHost::connectivityCheckUriChanged ( )
signal

◆ connectToAccessPoint()

void PhosphorServiceNetwork::NetworkHost::connectToAccessPoint ( PhosphorServiceNetwork::NetworkDevice * device,
PhosphorServiceNetwork::AccessPoint * accessPoint,
const QString & passphrase = {},
bool autoConnect = true,
PhosphorServiceNetwork::NetworkConnection * existing = nullptr )

Create and activate a new Wi-Fi connection for an access point (NM AddAndActivateConnection).

An empty passphrase builds an open profile; a non-empty one builds a WPA-PSK/SAE profile. Passing an existing matching profile updates its credentials without creating a duplicate. Request errors are delivered through operationFinished. No-op if either argument is null or the bus is unavailable.

◆ deviceAdded

void PhosphorServiceNetwork::NetworkHost::deviceAdded ( PhosphorServiceNetwork::NetworkDevice * device)
signal

◆ deviceAt()

PhosphorServiceNetwork::NetworkDevice * PhosphorServiceNetwork::NetworkHost::deviceAt ( int index) const
nodiscard

◆ deviceCount()

int PhosphorServiceNetwork::NetworkHost::deviceCount ( ) const
nodiscard

◆ deviceCountChanged

void PhosphorServiceNetwork::NetworkHost::deviceCountChanged ( )
signal

◆ deviceRemoved

void PhosphorServiceNetwork::NetworkHost::deviceRemoved ( PhosphorServiceNetwork::NetworkDevice * device)
signal

◆ devices()

QList< NetworkDevice * > PhosphorServiceNetwork::NetworkHost::devices ( ) const
nodiscard

◆ disconnectDevice()

void PhosphorServiceNetwork::NetworkHost::disconnectDevice ( PhosphorServiceNetwork::NetworkDevice * device)

◆ networkingEnabled()

bool PhosphorServiceNetwork::NetworkHost::networkingEnabled ( ) const
nodiscard

◆ networkingEnabledChanged

void PhosphorServiceNetwork::NetworkHost::networkingEnabledChanged ( )
signal

◆ operationFinished

void PhosphorServiceNetwork::NetworkHost::operationFinished ( const QString & operation,
const QString & path,
const QString & errorName )
signal

◆ primaryConnectionType()

QString PhosphorServiceNetwork::NetworkHost::primaryConnectionType ( ) const
nodiscard

◆ primaryConnectionTypeChanged

void PhosphorServiceNetwork::NetworkHost::primaryConnectionTypeChanged ( )
signal

◆ refresh()

void PhosphorServiceNetwork::NetworkHost::refresh ( )

◆ scanWifi()

void PhosphorServiceNetwork::NetworkHost::scanWifi ( )

Trigger a Wi-Fi scan on every managed Wi-Fi device (NM Device.Wireless.RequestScan).

Fire-and-forget; the scan refreshes each device's access-point list daemon-side, which an AccessPointModel bound to that device then surfaces (its rows update as the daemon emits AccessPointAdded/Removed). No-op when no Wi-Fi device is present.

◆ setWirelessEnabled()

void PhosphorServiceNetwork::NetworkHost::setWirelessEnabled ( bool enabled)

Toggle the global Wi-Fi radio (NetworkManager WirelessEnabled).

Issues an async Properties.Set; the cached value updates when the daemon echoes the change back via PropertiesChanged, so reading the property immediately after the call still returns the old value.

◆ setWwanEnabled()

void PhosphorServiceNetwork::NetworkHost::setWwanEnabled ( bool enabled)

◆ wirelessEnabled()

bool PhosphorServiceNetwork::NetworkHost::wirelessEnabled ( ) const
nodiscard

◆ wirelessEnabledChanged

void PhosphorServiceNetwork::NetworkHost::wirelessEnabledChanged ( )
signal

◆ wirelessHardwareEnabled()

bool PhosphorServiceNetwork::NetworkHost::wirelessHardwareEnabled ( ) const
nodiscard

◆ wirelessHardwareEnabledChanged

void PhosphorServiceNetwork::NetworkHost::wirelessHardwareEnabledChanged ( )
signal

◆ wwanChanged

void PhosphorServiceNetwork::NetworkHost::wwanChanged ( )
signal

◆ wwanEnabled()

bool PhosphorServiceNetwork::NetworkHost::wwanEnabled ( ) const
nodiscard

◆ wwanHardwareEnabled()

bool PhosphorServiceNetwork::NetworkHost::wwanHardwareEnabled ( ) const
nodiscard

◆ wwanSupported()

bool PhosphorServiceNetwork::NetworkHost::wwanSupported ( ) const
nodiscard

The documentation for this class was generated from the following file:
  • phosphor-service-network/include/PhosphorServiceNetwork/NetworkHost.h