update source documentation

This commit is contained in:
Simon Stürz 2016-11-24 16:21:14 +01:00 committed by Michael Zanetti
parent 93ff0fcdbc
commit 68d0ed1b34
18 changed files with 253 additions and 14 deletions

View File

@ -24,7 +24,8 @@ plugins.depends = libguh
tests.depends = libguh tests.depends = libguh
doc.depends = libguh server doc.depends = libguh server
doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf; cp images/logo.png html/images/; \ # Note: some how extraimages in qdocconf did not the trick
doc.commands = cd $$top_srcdir/doc; qdoc config.qdocconf; cp images/* html/images/; \
cp favicons/* html/; cp -r $$top_srcdir/doc/html $$top_builddir/ cp favicons/* html/; cp -r $$top_srcdir/doc/html $$top_builddir/
licensecheck.commands = $$top_srcdir/tests/auto/checklicenseheaders.sh $$top_srcdir licensecheck.commands = $$top_srcdir/tests/auto/checklicenseheaders.sh $$top_srcdir

View File

@ -86,7 +86,7 @@ QString QtAvahiService::serviceType() const
return d_ptr->type; return d_ptr->type;
} }
/*! Returns true if a new avahi service to the network with the given \a name, \a port \a serviceType and \a txt can be registered. */ /*! Register a new \l{QtAvahiService} with the given \a name and \a port. The service type can be specified with the \a serviceType string. The \a txt records inform about additional information. Returns true if the service could be registered. */
bool QtAvahiService::registerService(const QString &name, const quint16 &port, const QString &serviceType, const QHash<QString, QString> &txt) bool QtAvahiService::registerService(const QString &name, const quint16 &port, const QString &serviceType, const QHash<QString, QString> &txt)
{ {
// check if the client is running // check if the client is running
@ -128,10 +128,7 @@ bool QtAvahiService::registerService(const QString &name, const quint16 &port, c
return true; return true;
} }
/*! Remove this service from the local network. This \l{QtAvahiService} can be reused to register a new avahi service. /*! Remove this service from the local network. This \l{QtAvahiService} can be reused to register a new avahi service. */
\sa registerService()
*/
void QtAvahiService::resetService() void QtAvahiService::resetService()
{ {
if (!d_ptr->group) if (!d_ptr->group)

View File

@ -43,7 +43,7 @@
namespace guhserver { namespace guhserver {
static const QBluetoothUuid serviceUuid(QUuid("997936b5-d2cd-4c57-b41b-c6048320cd2b")); static const QBluetoothUuid serviceUuid(QUuid("997936b5-d2cd-4c57-b41b-c6048320cd2b"));
/*! Constructs a \l{BluetoothServer} with the given \a parent. */
BluetoothServer::BluetoothServer(QObject *parent) : BluetoothServer::BluetoothServer(QObject *parent) :
TransportInterface(parent), TransportInterface(parent),
m_server(0) m_server(0)
@ -51,6 +51,7 @@ BluetoothServer::BluetoothServer(QObject *parent) :
} }
/*! Destructs this \l{BluetoothServer}. */
BluetoothServer::~BluetoothServer() BluetoothServer::~BluetoothServer()
{ {
if (m_server && m_server->isListening()) if (m_server && m_server->isListening())
@ -59,12 +60,14 @@ BluetoothServer::~BluetoothServer()
stopServer(); stopServer();
} }
/*! Returns true if a Bleutooth hardware is available. */
bool BluetoothServer::hardwareAvailable() bool BluetoothServer::hardwareAvailable()
{ {
QBluetoothLocalDevice localDevice; QBluetoothLocalDevice localDevice;
return localDevice.isValid(); return localDevice.isValid();
} }
/*! Send \a data to the client with the given \a clientId.*/
void BluetoothServer::sendData(const QUuid &clientId, const QVariantMap &data) void BluetoothServer::sendData(const QUuid &clientId, const QVariantMap &data)
{ {
QBluetoothSocket *client = 0; QBluetoothSocket *client = 0;
@ -73,6 +76,7 @@ void BluetoothServer::sendData(const QUuid &clientId, const QVariantMap &data)
client->write(QJsonDocument::fromVariant(data).toJson(QJsonDocument::Compact) + '\n'); client->write(QJsonDocument::fromVariant(data).toJson(QJsonDocument::Compact) + '\n');
} }
/*! Send the given \a data to the \a clients. */
void BluetoothServer::sendData(const QList<QUuid> &clients, const QVariantMap &data) void BluetoothServer::sendData(const QList<QUuid> &clients, const QVariantMap &data)
{ {
foreach (const QUuid &client, clients) foreach (const QUuid &client, clients)

View File

@ -18,6 +18,16 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::NetworkDevice
\brief Represents a generic network device the \l{NetworkManager}.
\ingroup networkmanager
\inmodule core
\sa WiredNetworkDevice, WirelessNetworkDevice
*/
#include "networkdevice.h" #include "networkdevice.h"
#include "loggingcategories.h" #include "loggingcategories.h"
@ -25,6 +35,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{NetworkDevice} with the given dbus \a objectPath and \a parent. */
NetworkDevice::NetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) : NetworkDevice::NetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) :
QObject(parent), QObject(parent),
m_objectPath(objectPath), m_objectPath(objectPath),
@ -66,96 +77,115 @@ NetworkDevice::NetworkDevice(const QDBusObjectPath &objectPath, QObject *parent)
QDBusConnection::systemBus().connect(serviceString, m_objectPath.path(), deviceInterfaceString, "StateChanged", this, SLOT(onStateChanged(uint,uint,uint))); QDBusConnection::systemBus().connect(serviceString, m_objectPath.path(), deviceInterfaceString, "StateChanged", this, SLOT(onStateChanged(uint,uint,uint)));
} }
/*! Returns the dbus object path of this \l{NetworkDevice}. */
QDBusObjectPath NetworkDevice::objectPath() const QDBusObjectPath NetworkDevice::objectPath() const
{ {
return m_objectPath; return m_objectPath;
} }
/*! Returns the udi of this \l{NetworkDevice}. */
QString NetworkDevice::udi() const QString NetworkDevice::udi() const
{ {
return m_udi; return m_udi;
} }
/*! Returns the interface name of this \l{NetworkDevice}. */
QString NetworkDevice::interface() const QString NetworkDevice::interface() const
{ {
return m_interface; return m_interface;
} }
/*! Returns the ip interface of this \l{NetworkDevice}. */
QString NetworkDevice::ipInterface() const QString NetworkDevice::ipInterface() const
{ {
return m_ipInterface; return m_ipInterface;
} }
/*! Returns the used driver name for this \l{NetworkDevice}. */
QString NetworkDevice::driver() const QString NetworkDevice::driver() const
{ {
return m_driver; return m_driver;
} }
/*! Returns the version of the used driver for this \l{NetworkDevice}. */
QString NetworkDevice::driverVersion() const QString NetworkDevice::driverVersion() const
{ {
return m_driverVersion; return m_driverVersion;
} }
/*! Returns the firmware version of this \l{NetworkDevice}. */
QString NetworkDevice::firmwareVersion() const QString NetworkDevice::firmwareVersion() const
{ {
return m_firmwareVersion; return m_firmwareVersion;
} }
/*! Returns the physical port id of this \l{NetworkDevice}. */
QString NetworkDevice::physicalPortId() const QString NetworkDevice::physicalPortId() const
{ {
return m_physicalPortId; return m_physicalPortId;
} }
/*! Returns the mtu of this \l{NetworkDevice}. */
uint NetworkDevice::mtu() const uint NetworkDevice::mtu() const
{ {
return m_mtu; return m_mtu;
} }
/*! Returns the metered property of this \l{NetworkDevice}. */
uint NetworkDevice::metered() const uint NetworkDevice::metered() const
{ {
return m_metered; return m_metered;
} }
/*! Returns true if autoconnect is enabled for this \l{NetworkDevice}. */
bool NetworkDevice::autoconnect() const bool NetworkDevice::autoconnect() const
{ {
return m_autoconnect; return m_autoconnect;
} }
/*! Returns the device state of this \l{NetworkDevice}. \sa NetworkDeviceState, */
NetworkDevice::NetworkDeviceState NetworkDevice::deviceState() const NetworkDevice::NetworkDeviceState NetworkDevice::deviceState() const
{ {
return m_deviceState; return m_deviceState;
} }
/*! Returns the human readable device state of this \l{NetworkDevice}. \sa NetworkDeviceState, */
QString NetworkDevice::deviceStateString() const QString NetworkDevice::deviceStateString() const
{ {
return NetworkDevice::deviceStateToString(m_deviceState); return NetworkDevice::deviceStateToString(m_deviceState);
} }
/*! Returns the reason for the current state of this \l{NetworkDevice}. \sa NetworkDeviceStateReason, */
NetworkDevice::NetworkDeviceStateReason NetworkDevice::deviceStateReason() const NetworkDevice::NetworkDeviceStateReason NetworkDevice::deviceStateReason() const
{ {
return m_deviceStateReason; return m_deviceStateReason;
} }
/*! Returns the device type of this \l{NetworkDevice}. \sa NetworkDeviceType, */
NetworkDevice::NetworkDeviceType NetworkDevice::deviceType() const NetworkDevice::NetworkDeviceType NetworkDevice::deviceType() const
{ {
return m_deviceType; return m_deviceType;
} }
/*! Returns the dbus object path of the currently active connection of this \l{NetworkDevice}. */
QDBusObjectPath NetworkDevice::activeConnection() const QDBusObjectPath NetworkDevice::activeConnection() const
{ {
return m_activeConnection; return m_activeConnection;
} }
/*! Returns the dbus object path from the IPv4 configuration of this \l{NetworkDevice}. */
QDBusObjectPath NetworkDevice::ip4Config() const QDBusObjectPath NetworkDevice::ip4Config() const
{ {
return m_ip4Config; return m_ip4Config;
} }
/*! Returns the list of dbus object paths for the currently available connection of this \l{NetworkDevice}. */
QList<QDBusObjectPath> NetworkDevice::availableConnections() const QList<QDBusObjectPath> NetworkDevice::availableConnections() const
{ {
return m_availableConnections; return m_availableConnections;
} }
/*! Disconnect the current connection from this \l{NetworkDevice}. */
void NetworkDevice::disconnectDevice() void NetworkDevice::disconnectDevice()
{ {
QDBusMessage query = m_networkDeviceInterface->call("Disconnect"); QDBusMessage query = m_networkDeviceInterface->call("Disconnect");
@ -164,6 +194,7 @@ void NetworkDevice::disconnectDevice()
} }
/*! Returns the human readable deviceType of this \l{NetworkDevice}. \sa NetworkDeviceType, */
QString NetworkDevice::deviceTypeToString(const NetworkDevice::NetworkDeviceType &deviceType) QString NetworkDevice::deviceTypeToString(const NetworkDevice::NetworkDeviceType &deviceType)
{ {
QMetaObject metaObject = NetworkDevice::staticMetaObject; QMetaObject metaObject = NetworkDevice::staticMetaObject;
@ -172,6 +203,7 @@ QString NetworkDevice::deviceTypeToString(const NetworkDevice::NetworkDeviceType
return QString(metaEnum.valueToKey(deviceType)).remove("NetworkDeviceType"); return QString(metaEnum.valueToKey(deviceType)).remove("NetworkDeviceType");
} }
/*! Returns the human readable device state of this \l{NetworkDevice}. \sa NetworkDeviceState, */
QString NetworkDevice::deviceStateToString(const NetworkDevice::NetworkDeviceState &deviceState) QString NetworkDevice::deviceStateToString(const NetworkDevice::NetworkDeviceState &deviceState)
{ {
QMetaObject metaObject = NetworkDevice::staticMetaObject; QMetaObject metaObject = NetworkDevice::staticMetaObject;
@ -180,6 +212,7 @@ QString NetworkDevice::deviceStateToString(const NetworkDevice::NetworkDeviceSta
return QString(metaEnum.valueToKey(deviceState)); return QString(metaEnum.valueToKey(deviceState));
} }
/*! Returns the human readable device state reason of this \l{NetworkDevice}. \sa NetworkDeviceStateReason, */
QString NetworkDevice::deviceStateReasonToString(const NetworkDevice::NetworkDeviceStateReason &deviceStateReason) QString NetworkDevice::deviceStateReasonToString(const NetworkDevice::NetworkDeviceStateReason &deviceStateReason)
{ {
QMetaObject metaObject = NetworkDevice::staticMetaObject; QMetaObject metaObject = NetworkDevice::staticMetaObject;

View File

@ -18,6 +18,92 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::NetworkManager
\brief Represents the dbus network-manager.
\ingroup networkmanager
\inmodule core
*/
/*! \fn void NetworkManager::versionChanged();
This signal will be emitted when the version of this \l{WiredNetworkDevice} has changed.
*/
/*! \fn void NetworkManager::networkingEnabledChanged();
This signal will be emitted when the networking of this \l{WiredNetworkDevice} has changed. \sa networkingEnabled()
*/
/*! \fn void NetworkManager::wirelessEnabledChanged();
This signal will be emitted when the wireless networking of this \l{WiredNetworkDevice} has changed. \sa wirelessEnabled()
*/
/*! \fn void NetworkManager::stateChanged();
This signal will be emitted when the state of this \l{WiredNetworkDevice} has changed. \sa NetworkManagerState
*/
/*! \fn void NetworkManager::connectivityStateChanged();
This signal will be emitted when the connectivity state of this \l{WiredNetworkDevice} has changed. \sa NetworkManagerConnectivityState
*/
/*! \fn void NetworkManager::wirelessDeviceAdded(WirelessNetworkDevice *wirelessDevice);
This signal will be emitted when a new \a wirelessDevice was added to this \l{NetworkManager}. \sa WirelessNetworkDevice
*/
/*! \fn void NetworkManager::wirelessDeviceRemoved(const QString &interface);
This signal will be emitted when the \l{WirelessNetworkDevice} with the given \a interface was removed from this \l{NetworkManager}. \sa WirelessNetworkDevice
*/
/*! \fn void NetworkManager::wirelessDeviceChanged(WirelessNetworkDevice *wirelessDevice);
This signal will be emitted when the given \a wirelessDevice has changed. \sa WirelessNetworkDevice
*/
/*! \fn void NetworkManager::wiredDeviceAdded(WiredNetworkDevice *wiredDevice);
This signal will be emitted when a new \a wiredDevice was added to this \l{NetworkManager}. \sa WiredNetworkDevice
*/
/*! \fn void NetworkManager::wiredDeviceRemoved(const QString &interface);
This signal will be emitted when the \l{WiredNetworkDevice} with the given \a interface was removed from this \l{NetworkManager}. \sa WiredNetworkDevice
*/
/*! \fn void NetworkManager::wiredDeviceChanged(WiredNetworkDevice *wiredDevice);
This signal will be emitted when the given \a wiredDevice has changed. \sa WiredNetworkDevice
*/
/*! \enum guhserver::NetworkManager::NetworkManagerState
\value NetworkManagerStateUnknown
\value NetworkManagerStateAsleep
\value NetworkManagerStateDisconnected
\value NetworkManagerStateDisconnecting
\value NetworkManagerStateConnecting
\value NetworkManagerStateConnectedLocal
\value NetworkManagerStateConnectedSite
\value NetworkManagerStateConnectedGlobal
*/
/*! \enum guhserver::NetworkManager::NetworkManagerConnectivityState
\value NetworkManagerConnectivityStateUnknown
\value NetworkManagerConnectivityStateNone
\value NetworkManagerConnectivityStatePortal
\value NetworkManagerConnectivityStateLimited
\value NetworkManagerConnectivityStateFull
*/
/*! \enum guhserver::NetworkManager::NetworkManagerError
\value NetworkManagerErrorNoError
\value NetworkManagerErrorUnknownError
\value NetworkManagerErrorWirelessNotAvailable
\value NetworkManagerErrorAccessPointNotFound
\value NetworkManagerErrorNetworkInterfaceNotFound
\value NetworkManagerErrorInvalidNetworkDeviceType
\value NetworkManagerErrorWirelessNetworkingDisabled
\value NetworkManagerErrorWirelessConnectionFailed
\value NetworkManagerErrorNetworkingDisabled
\value NetworkManagerErrorNetworkManagerNotAvailable
*/
#include "networkmanager.h" #include "networkmanager.h"
#include "loggingcategories.h" #include "loggingcategories.h"
#include "networkconnection.h" #include "networkconnection.h"
@ -27,6 +113,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{NetworkManager} object with the given \a parent. */
NetworkManager::NetworkManager(QObject *parent) : NetworkManager::NetworkManager(QObject *parent) :
QObject(parent), QObject(parent),
m_networkManagerInterface(0), m_networkManagerInterface(0),
@ -71,31 +158,37 @@ NetworkManager::NetworkManager(QObject *parent) :
m_networkSettings = new NetworkSettings(this); m_networkSettings = new NetworkSettings(this);
} }
/*! Returns true if the network-manager is available on this system. */
bool NetworkManager::available() bool NetworkManager::available()
{ {
return m_available; return m_available;
} }
/*! Returns true if wifi is available on this system. */
bool NetworkManager::wifiAvailable() bool NetworkManager::wifiAvailable()
{ {
return m_wifiAvailable; return m_wifiAvailable;
} }
/*! Returns the list of \l{NetworkDevice}{NetworkDevices} from this \l{NetworkManager}. */
QList<NetworkDevice *> NetworkManager::networkDevices() const QList<NetworkDevice *> NetworkManager::networkDevices() const
{ {
return m_networkDevices.values(); return m_networkDevices.values();
} }
/*! Returns the list of \l{WirelessNetworkDevice}{WirelessNetworkDevices} from this \l{NetworkManager}. */
QList<WirelessNetworkDevice *> NetworkManager::wirelessNetworkDevices() const QList<WirelessNetworkDevice *> NetworkManager::wirelessNetworkDevices() const
{ {
return m_wirelessNetworkDevices.values(); return m_wirelessNetworkDevices.values();
} }
/*! Returns the list of \l{WiredNetworkDevice}{WiredNetworkDevices} from this \l{NetworkManager}. */
QList<WiredNetworkDevice *> NetworkManager::wiredNetworkDevices() const QList<WiredNetworkDevice *> NetworkManager::wiredNetworkDevices() const
{ {
return m_wiredNetworkDevices.values(); return m_wiredNetworkDevices.values();
} }
/*! Returns the \l{NetworkDevice} with the given \a interface from this \l{NetworkManager}. If there is no such \a interface returns Q_NULLPTR. */
NetworkDevice *NetworkManager::getNetworkDevice(const QString &interface) NetworkDevice *NetworkManager::getNetworkDevice(const QString &interface)
{ {
foreach (NetworkDevice *device, m_networkDevices.values()) { foreach (NetworkDevice *device, m_networkDevices.values()) {
@ -105,26 +198,31 @@ NetworkDevice *NetworkManager::getNetworkDevice(const QString &interface)
return Q_NULLPTR; return Q_NULLPTR;
} }
/*! Returns the version of the running \l{NetworkManager}. */
QString NetworkManager::version() const QString NetworkManager::version() const
{ {
return m_version; return m_version;
} }
/*! Returns the state of this \l{NetworkManager}. \sa NetworkManagerState, */
NetworkManager::NetworkManagerState NetworkManager::state() const NetworkManager::NetworkManagerState NetworkManager::state() const
{ {
return m_state; return m_state;
} }
/*! Returns the human readable string of the current state of this \l{NetworkManager}. \sa NetworkManagerState, */
QString NetworkManager::stateString() const QString NetworkManager::stateString() const
{ {
return networkManagerStateToString(m_state); return networkManagerStateToString(m_state);
} }
/*! Returns the current connectivity state of this \l{NetworkManager}. \sa NetworkManagerConnectivityState, */
NetworkManager::NetworkManagerConnectivityState NetworkManager::connectivityState() const NetworkManager::NetworkManagerConnectivityState NetworkManager::connectivityState() const
{ {
return m_connectivityState; return m_connectivityState;
} }
/*! Connect the given \a interface to a wifi network with the given \a ssid and \a password. Returns the \l{NetworkManagerError} to inform about the result. \sa NetworkManagerError, */
NetworkManager::NetworkManagerError NetworkManager::connectWifi(const QString &interface, const QString &ssid, const QString &password) NetworkManager::NetworkManagerError NetworkManager::connectWifi(const QString &interface, const QString &ssid, const QString &password)
{ {
// Check interface // Check interface
@ -199,11 +297,13 @@ NetworkManager::NetworkManagerError NetworkManager::connectWifi(const QString &i
return NetworkManagerErrorNoError; return NetworkManagerErrorNoError;
} }
/*! Returns true if the networking of this \l{NetworkManager} is enabled. */
bool NetworkManager::networkingEnabled() const bool NetworkManager::networkingEnabled() const
{ {
return m_networkingEnabled; return m_networkingEnabled;
} }
/*! Returns true if the networking of this \l{NetworkManager} could be \a enabled. */
bool NetworkManager::enableNetworking(const bool &enabled) bool NetworkManager::enableNetworking(const bool &enabled)
{ {
if (m_networkingEnabled == enabled) if (m_networkingEnabled == enabled)
@ -217,6 +317,7 @@ bool NetworkManager::enableNetworking(const bool &enabled)
return true; return true;
} }
/*! Sets the networking of this \l{NetworkManager} to \a enabled. */
void NetworkManager::setNetworkingEnabled(const bool &enabled) void NetworkManager::setNetworkingEnabled(const bool &enabled)
{ {
qCDebug(dcNetworkManager()) << "Networking" << (enabled ? "enabled" : "disabled"); qCDebug(dcNetworkManager()) << "Networking" << (enabled ? "enabled" : "disabled");
@ -224,11 +325,13 @@ void NetworkManager::setNetworkingEnabled(const bool &enabled)
emit networkingEnabledChanged(); emit networkingEnabledChanged();
} }
/*! Returns true if the wireless networking of this \l{NetworkManager} is enabled. */
bool NetworkManager::wirelessEnabled() const bool NetworkManager::wirelessEnabled() const
{ {
return m_wirelessEnabled; return m_wirelessEnabled;
} }
/*! Returns true if the wireless networking of this \l{NetworkManager} could be set to \a enabled. */
bool NetworkManager::enableWireless(const bool &enabled) bool NetworkManager::enableWireless(const bool &enabled)
{ {
if (m_wirelessEnabled == enabled) if (m_wirelessEnabled == enabled)

View File

@ -145,9 +145,9 @@ signals:
void wirelessDeviceRemoved(const QString &interface); void wirelessDeviceRemoved(const QString &interface);
void wirelessDeviceChanged(WirelessNetworkDevice *wirelessDevice); void wirelessDeviceChanged(WirelessNetworkDevice *wirelessDevice);
void wiredDeviceAdded(WiredNetworkDevice *wirelessDevice); void wiredDeviceAdded(WiredNetworkDevice *wiredDevice);
void wiredDeviceRemoved(const QString &interface); void wiredDeviceRemoved(const QString &interface);
void wiredDeviceChanged(WiredNetworkDevice *wirelessDevice); void wiredDeviceChanged(WiredNetworkDevice *wiredDevice);
private slots: private slots:
void onDeviceAdded(const QDBusObjectPath &deviceObjectPath); void onDeviceAdded(const QDBusObjectPath &deviceObjectPath);

View File

@ -18,12 +18,21 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::NetworkSettings
\brief Represents the network settings in the \l{NetworkManager}.
\ingroup networkmanager
\inmodule core
*/
#include "networksettings.h" #include "networksettings.h"
#include "dbus-interfaces.h" #include "dbus-interfaces.h"
#include "loggingcategories.h" #include "loggingcategories.h"
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{NetworkSettings} object with the given \a parent. */
NetworkSettings::NetworkSettings(QObject *parent) : QObject(parent) NetworkSettings::NetworkSettings(QObject *parent) : QObject(parent)
{ {
m_settingsInterface = new QDBusInterface(serviceString, settingsPathString, settingsInterfaceString, QDBusConnection::systemBus(), this); m_settingsInterface = new QDBusInterface(serviceString, settingsPathString, settingsInterfaceString, QDBusConnection::systemBus(), this);
@ -39,6 +48,7 @@ NetworkSettings::NetworkSettings(QObject *parent) : QObject(parent)
QDBusConnection::systemBus().connect(serviceString, settingsPathString, settingsInterfaceString, "PropertiesChanged", this, SLOT(propertiesChanged(QVariantMap))); QDBusConnection::systemBus().connect(serviceString, settingsPathString, settingsInterfaceString, "PropertiesChanged", this, SLOT(propertiesChanged(QVariantMap)));
} }
/*! Add the given \a settings to this \l{NetworkSettings}. Returns the dbus object path from the new settings. */
QDBusObjectPath NetworkSettings::addConnection(const ConnectionSettings &settings) QDBusObjectPath NetworkSettings::addConnection(const ConnectionSettings &settings)
{ {
QDBusMessage query = m_settingsInterface->call("AddConnection", QVariant::fromValue(settings)); QDBusMessage query = m_settingsInterface->call("AddConnection", QVariant::fromValue(settings));
@ -53,6 +63,7 @@ QDBusObjectPath NetworkSettings::addConnection(const ConnectionSettings &setting
return query.arguments().at(0).value<QDBusObjectPath>(); return query.arguments().at(0).value<QDBusObjectPath>();
} }
/*! Returns the list of current \l{NetworkConnection}{NetworkConnections} from this \l{NetworkSettings}. */
QList<NetworkConnection *> NetworkSettings::connections() const QList<NetworkConnection *> NetworkSettings::connections() const
{ {
return m_connections.values(); return m_connections.values();

View File

@ -18,11 +18,24 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::WiredNetworkDevice
\brief Represents an ethernet device in the \l{NetworkManager}.
\ingroup networkmanager
\inmodule core
*/
/*! \fn void WiredNetworkDevice::propertiesChanged(const QVariantMap &properties);
This signal will be emitted when the \a properties of this \l{WiredNetworkDevice} have changed.
*/
#include "wirednetworkdevice.h" #include "wirednetworkdevice.h"
#include "loggingcategories.h" #include "loggingcategories.h"
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{WiredNetworkDevice} with the given dbus \a objectPath and \a parent. */
WiredNetworkDevice::WiredNetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) : WiredNetworkDevice::WiredNetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) :
NetworkDevice(objectPath, parent) NetworkDevice(objectPath, parent)
{ {
@ -45,16 +58,19 @@ WiredNetworkDevice::WiredNetworkDevice(const QDBusObjectPath &objectPath, QObjec
QDBusConnection::systemBus().connect(serviceString, this->objectPath().path(), wiredInterfaceString, "PropertiesChanged", this, SLOT(propertiesChanged(QVariantMap))); QDBusConnection::systemBus().connect(serviceString, this->objectPath().path(), wiredInterfaceString, "PropertiesChanged", this, SLOT(propertiesChanged(QVariantMap)));
} }
/*! Returns the mac address of this \l{WiredNetworkDevice}. */
QString WiredNetworkDevice::macAddress() const QString WiredNetworkDevice::macAddress() const
{ {
return m_macAddress; return m_macAddress;
} }
/*! Returns the current bit rate [Mb/s] of this \l{WiredNetworkDevice}. */
int WiredNetworkDevice::bitRate() const int WiredNetworkDevice::bitRate() const
{ {
return m_bitRate; return m_bitRate;
} }
/*! Returns true if this \l{WiredNetworkDevice} has a cable plugged in. */
bool WiredNetworkDevice::pluggedIn() const bool WiredNetworkDevice::pluggedIn() const
{ {
return m_pluggedIn; return m_pluggedIn;

View File

@ -18,12 +18,41 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::WirelessAccessPoint
\brief Represents a wireless access point from a \l{WirelessNetworkDevice}.
\ingroup networkmanager
\inmodule core
\sa WirelessNetworkDevice
*/
/*! \enum guhserver::WirelessAccessPoint::ApSecurityMode
\value ApSecurityModeNone
\value ApSecurityModePairWep40
\value ApSecurityModePairWep104
\value ApSecurityModePairTkip
\value ApSecurityModePairCcmp
\value ApSecurityModeGroupWep40
\value ApSecurityModeGroupWep104
\value ApSecurityModeGroupTkip
\value ApSecurityModeGroupCcmp
\value ApSecurityModeKeyMgmtPsk
\value ApSecurityModeKeyMgmt8021X
*/
/*! \fn void WirelessAccessPoint::signalStrengthChanged();
This signal will be emitted when the signalStrength of this \l{WirelessAccessPoint} has changed.
*/
#include "wirelessaccesspoint.h" #include "wirelessaccesspoint.h"
#include "loggingcategories.h" #include "loggingcategories.h"
#include "dbus-interfaces.h" #include "dbus-interfaces.h"
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{WirelessAccessPoint} with the given dbus \a objectPath and \a parent. */
WirelessAccessPoint::WirelessAccessPoint(const QDBusObjectPath &objectPath, QObject *parent) : WirelessAccessPoint::WirelessAccessPoint(const QDBusObjectPath &objectPath, QObject *parent) :
QObject(parent), QObject(parent),
m_objectPath(objectPath), m_objectPath(objectPath),
@ -46,11 +75,13 @@ WirelessAccessPoint::WirelessAccessPoint(const QDBusObjectPath &objectPath, QObj
QDBusConnection::systemBus().connect(serviceString, objectPath.path(), accessPointInterfaceString, "PropertiesChanged", this, SLOT(onPropertiesChanged(QVariantMap))); QDBusConnection::systemBus().connect(serviceString, objectPath.path(), accessPointInterfaceString, "PropertiesChanged", this, SLOT(onPropertiesChanged(QVariantMap)));
} }
/*! Returns the dbus object path of this \l{WirelessAccessPoint}. */
QDBusObjectPath WirelessAccessPoint::objectPath() const QDBusObjectPath WirelessAccessPoint::objectPath() const
{ {
return m_objectPath; return m_objectPath;
} }
/*! Returns the ssid of this \l{WirelessAccessPoint}. */
QString WirelessAccessPoint::ssid() const QString WirelessAccessPoint::ssid() const
{ {
return m_ssid; return m_ssid;
@ -61,6 +92,7 @@ void WirelessAccessPoint::setSsid(const QString &ssid)
m_ssid = ssid; m_ssid = ssid;
} }
/*! Returns the mac address of this \l{WirelessAccessPoint}. */
QString WirelessAccessPoint::macAddress() const QString WirelessAccessPoint::macAddress() const
{ {
return m_macAddress; return m_macAddress;
@ -71,6 +103,7 @@ void WirelessAccessPoint::setMacAddress(const QString &macAddress)
m_macAddress = macAddress; m_macAddress = macAddress;
} }
/*! Returns the frequency of this \l{WirelessAccessPoint}. (2.4 GHz or 5GHz) */
double WirelessAccessPoint::frequency() const double WirelessAccessPoint::frequency() const
{ {
return m_frequency; return m_frequency;
@ -81,6 +114,7 @@ void WirelessAccessPoint::setFrequency(const double &frequency)
m_frequency = frequency; m_frequency = frequency;
} }
/*! Returns the signal strength in percentage [0, 100] % of this \l{WirelessAccessPoint}. */
int WirelessAccessPoint::signalStrength() const int WirelessAccessPoint::signalStrength() const
{ {
return m_signalStrength; return m_signalStrength;
@ -97,11 +131,13 @@ void WirelessAccessPoint::setIsProtected(const bool &isProtected)
m_isProtected = isProtected; m_isProtected = isProtected;
} }
/*! Returns true if this \l{WirelessAccessPoint} is password protected. */
bool WirelessAccessPoint::isProtected() const bool WirelessAccessPoint::isProtected() const
{ {
return m_isProtected; return m_isProtected;
} }
/*! Returns the security flags of this \l{WirelessAccessPoint}. \sa WirelessAccessPoint::ApSecurityModes */
WirelessAccessPoint::ApSecurityModes WirelessAccessPoint::securityFlags() const WirelessAccessPoint::ApSecurityModes WirelessAccessPoint::securityFlags() const
{ {
return m_securityFlags; return m_securityFlags;

View File

@ -64,7 +64,6 @@ public:
bool isProtected() const; bool isProtected() const;
WirelessAccessPoint::ApSecurityModes securityFlags() const; WirelessAccessPoint::ApSecurityModes securityFlags() const;
void setSecurityFlags(const WirelessAccessPoint::ApSecurityModes &securityFlags);
private: private:
QDBusObjectPath m_objectPath; QDBusObjectPath m_objectPath;
@ -80,6 +79,7 @@ private:
void setFrequency(const double &frequency); void setFrequency(const double &frequency);
void setSignalStrength(const int &signalStrength); void setSignalStrength(const int &signalStrength);
void setIsProtected(const bool &isProtected); void setIsProtected(const bool &isProtected);
void setSecurityFlags(const WirelessAccessPoint::ApSecurityModes &securityFlags);
signals: signals:
void signalStrengthChanged(); void signalStrengthChanged();

View File

@ -18,6 +18,26 @@
* * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*!
\class guhserver::WirelessNetworkDevice
\brief Represents a wireless device (adapter) in the networkmanager.
\ingroup networkmanager
\inmodule core
*/
/*! \fn void WirelessNetworkDevice::bitRateChanged(const bool &bitRate);
This signal will be emitted when the \a bitRate of this \l{WirelessNetworkDevice} has changed.
*/
/*! \fn void WirelessNetworkDevice::stateChanged(const NetworkDeviceState &state);
This signal will be emitted when the current \a state of this \l{WirelessNetworkDevice} has changed.
\sa NetworkDeviceState
*/
#include "wirelessnetworkdevice.h" #include "wirelessnetworkdevice.h"
#include "dbus-interfaces.h" #include "dbus-interfaces.h"
@ -28,6 +48,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a new \l{WirelessNetworkDevice} with the given dbus \a objectPath and \a parent. */
WirelessNetworkDevice::WirelessNetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) : WirelessNetworkDevice::WirelessNetworkDevice(const QDBusObjectPath &objectPath, QObject *parent) :
NetworkDevice(objectPath, parent), NetworkDevice(objectPath, parent),
m_activeAccessPoint(Q_NULLPTR) m_activeAccessPoint(Q_NULLPTR)
@ -55,21 +76,25 @@ WirelessNetworkDevice::WirelessNetworkDevice(const QDBusObjectPath &objectPath,
setActiveAccessPoint(qdbus_cast<QDBusObjectPath>(m_wirelessInterface->property("ActiveAccessPoint"))); setActiveAccessPoint(qdbus_cast<QDBusObjectPath>(m_wirelessInterface->property("ActiveAccessPoint")));
} }
/*! Returns the mac address of this \l{WirelessNetworkDevice}. */
QString WirelessNetworkDevice::macAddress() const QString WirelessNetworkDevice::macAddress() const
{ {
return m_macAddress; return m_macAddress;
} }
/*! Returns the bit rate [Mb/s] of this \l{WirelessNetworkDevice}. */
int WirelessNetworkDevice::bitRate() const int WirelessNetworkDevice::bitRate() const
{ {
return m_bitRate; return m_bitRate;
} }
/*! Returns the current active \l{WirelessAccessPoint} of this \l{WirelessNetworkDevice}. */
WirelessAccessPoint *WirelessNetworkDevice::activeAccessPoint() WirelessAccessPoint *WirelessNetworkDevice::activeAccessPoint()
{ {
return m_activeAccessPoint; return m_activeAccessPoint;
} }
/*! Perform a wireless network scan on this \l{WirelessNetworkDevice}. */
void WirelessNetworkDevice::scanWirelessNetworks() void WirelessNetworkDevice::scanWirelessNetworks()
{ {
qCDebug(dcNetworkManager()) << this << "Request scan"; qCDebug(dcNetworkManager()) << this << "Request scan";
@ -80,11 +105,13 @@ void WirelessNetworkDevice::scanWirelessNetworks()
} }
} }
/*! Returns the list of all \l{WirelessAccessPoint}{WirelessAccessPoints} of this \l{WirelessNetworkDevice}. */
QList<WirelessAccessPoint *> WirelessNetworkDevice::accessPoints() QList<WirelessAccessPoint *> WirelessNetworkDevice::accessPoints()
{ {
return m_accessPointsTable.values(); return m_accessPointsTable.values();
} }
/*! Returns the \l{WirelessAccessPoint} with the given \a ssid. If the \l{WirelessAccessPoint} could not be found, return Q_NULLPTR. */
WirelessAccessPoint *WirelessNetworkDevice::getAccessPoint(const QString &ssid) WirelessAccessPoint *WirelessNetworkDevice::getAccessPoint(const QString &ssid)
{ {
foreach (WirelessAccessPoint *accessPoint, m_accessPointsTable.values()) { foreach (WirelessAccessPoint *accessPoint, m_accessPointsTable.values()) {
@ -94,6 +121,7 @@ WirelessAccessPoint *WirelessNetworkDevice::getAccessPoint(const QString &ssid)
return Q_NULLPTR; return Q_NULLPTR;
} }
/*! Returns the \l{WirelessAccessPoint} with the given \a objectPath. If the \l{WirelessAccessPoint} could not be found, return Q_NULLPTR. */
WirelessAccessPoint *WirelessNetworkDevice::getAccessPoint(const QDBusObjectPath &objectPath) WirelessAccessPoint *WirelessNetworkDevice::getAccessPoint(const QDBusObjectPath &objectPath)
{ {
return m_accessPointsTable.value(objectPath); return m_accessPointsTable.value(objectPath);

View File

@ -76,7 +76,7 @@ private slots:
void propertiesChanged(const QVariantMap &properties); void propertiesChanged(const QVariantMap &properties);
signals: signals:
void bitRateChanged(const bool &connected); void bitRateChanged(const bool &bitRate);
void stateChanged(const NetworkDeviceState &state); void stateChanged(const NetworkDeviceState &state);
}; };

View File

@ -55,6 +55,11 @@ RestServer::RestServer(const QSslConfiguration &sslConfiguration, QObject *paren
QMetaObject::invokeMethod(this, "setup", Qt::QueuedConnection); QMetaObject::invokeMethod(this, "setup", Qt::QueuedConnection);
} }
/*! Register the given \a webServer in this \l{RestServer}.
*
* \sa WebServer
*
*/
void RestServer::registerWebserver(WebServer *webServer) void RestServer::registerWebserver(WebServer *webServer)
{ {
m_webserver = webServer; m_webserver = webServer;

View File

@ -32,6 +32,7 @@
\sa EventDescriptor, State, RuleAction \sa EventDescriptor, State, RuleAction
*/ */
#include "rule.h" #include "rule.h"
#include "loggingcategories.h" #include "loggingcategories.h"

View File

@ -44,7 +44,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a \l{TcpServer} with the given \a parent. /*! Constructs a \l{TcpServer} with the given \a host, \a port and \a parent.
* *
* \sa ServerManager * \sa ServerManager
*/ */
@ -145,6 +145,7 @@ void TcpServer::onAvahiServiceStateChanged(const QtAvahiService::QtAvahiServiceS
} }
/*! Returns true if this \l{TcpServer} could be reconfigured with the given \a address and \a port. */
bool TcpServer::reconfigureServer(const QHostAddress &address, const uint &port) bool TcpServer::reconfigureServer(const QHostAddress &address, const uint &port)
{ {
if (m_host == address && m_port == (qint16)port && m_server->isListening()) if (m_host == address && m_port == (qint16)port && m_server->isListening())

View File

@ -101,6 +101,7 @@ QDate TimeManager::currentDate() const
return QDateTime::currentDateTimeUtc().toTimeZone(m_timeZone).date(); return QDateTime::currentDateTimeUtc().toTimeZone(m_timeZone).date();
} }
/*! Returns a list of available time zones on this system. */
QList<QByteArray> TimeManager::availableTimeZones() const QList<QByteArray> TimeManager::availableTimeZones() const
{ {
return QTimeZone::availableTimeZoneIds(); return QTimeZone::availableTimeZoneIds();

View File

@ -91,7 +91,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a \l{WebServer} with the given \a sslConfiguration and \a parent. /*! Constructs a \l{WebServer} with the given \a host, \a port, \a publicFolder and \a parent.
* *
* \sa ServerManager * \sa ServerManager
*/ */
@ -520,6 +520,7 @@ void WebServer::onAvahiServiceStateChanged(const QtAvahiService::QtAvahiServiceS
} }
} }
/*! Returns true if this \l{WebServer} could be reconfigured with the given \a address and \a port. */
bool WebServer::reconfigureServer(const QHostAddress &address, const uint &port) bool WebServer::reconfigureServer(const QHostAddress &address, const uint &port)
{ {
if (m_host == address && m_port == (qint16)port && isListening()) if (m_host == address && m_port == (qint16)port && isListening())

View File

@ -57,7 +57,7 @@
namespace guhserver { namespace guhserver {
/*! Constructs a \l{WebSocketServer} with the given \a sslConfiguration and \a parent. /*! Constructs a \l{WebSocketServer} with the given \a address, \a port \a sslEnabled and \a parent.
* *
* \sa ServerManager * \sa ServerManager
*/ */
@ -179,6 +179,7 @@ void WebSocketServer::onAvahiServiceStateChanged(const QtAvahiService::QtAvahiSe
} }
} }
/*! Returns true if this \l{WebSocketServer} could be reconfigured with the given \a address and \a port. */
bool WebSocketServer::reconfigureServer(const QHostAddress &address, const uint &port) bool WebSocketServer::reconfigureServer(const QHostAddress &address, const uint &port)
{ {
if (m_host == address && m_port == (qint16)port && m_server->isListening()) { if (m_host == address && m_port == (qint16)port && m_server->isListening()) {