1
/* This file is part of the KDE project
2
Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License version 2 as published by the Free Software Foundation.
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public License
14
along with this library; see the file COPYING.LIB. If not, write to
15
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16
Boston, MA 02110-1301, USA.
20
#ifndef SOLID_IFACES_NETWORKMANAGER
21
#define SOLID_IFACES_NETWORKMANAGER
23
#include <QtCore/QObject>
24
#include <QtCore/QStringList>
25
#include <solid/networking.h>
26
#include "../solid_control_export.h"
27
#include "../networkmanager.h"
36
* This class specifies the interface a backend will have to implement in
37
* order to be used in the system.
39
* A network manager allow to query the underlying platform to discover the
40
* available network interfaces and reachable network. It has also the
41
* responsibility to notify when a network interface or a network appear or disappear.
43
class SOLIDCONTROLIFACES_EXPORT NetworkManager : public QObject
48
* Constructs a NetworkManager.
50
* @param parent the parent object
52
NetworkManager(QObject * parent = 0);
54
* Destructs a NetworkManager object.
56
virtual ~NetworkManager();
59
* Get the manager connection state
61
virtual Solid::Networking::Status status() const = 0;
64
* Retrieves the list of all the network interfaces Unique Network Identifiers (UNIs)
65
* in the system. It includes both hardware and virtual devices.
67
* @return the list of network interfaces available in this system
69
virtual QStringList networkInterfaces() const = 0;
72
* Instantiates a new NetworkInterface object from this backend given its UNI.
74
* @param uni the identifier of the network interface instantiated
75
* @returns a new NetworkInterface object if there's a device having the given UNI, 0 otherwise
77
virtual QObject *createNetworkInterface(const QString &uni) = 0;
80
* Retrieves the activation status of networking (as a whole) in the system.
82
* @return true if this networking is enabled, false otherwise
84
virtual bool isNetworkingEnabled() const = 0;
87
* Retrieves the activation status of wireless networking in the system.
89
* @return true if this wireless networking is enabled, false otherwise
91
virtual bool isWirelessEnabled() const = 0;
94
* Retrieves the status of wireless hardware in the system. This is typically
95
* controlled by a physical switch so there is no way to set this in software.
98
* @return true if this wireless networking is enabled, false otherwise
100
virtual bool isWirelessHardwareEnabled() const = 0;
103
* Retrieves the activation status of wwan (mobile broadband) networking in the system.
105
* @return true if this wwan networking is enabled, false otherwise
107
virtual bool isWwanEnabled() const = 0;
110
* Retrieves the status of wwan (mobile broadband) hardware in the system.
113
* @return true if this wwan networking is enabled, false otherwise
115
virtual bool isWwanHardwareEnabled() const = 0;
117
virtual void activateConnection(const QString & interfaceUni, const QString & connectionUni, const QVariantMap & connectionParameters ) = 0;
119
virtual void deactivateConnection(const QString & activeConnection) = 0;
122
* Access the list of active connection UNIs
124
virtual QStringList activeConnections() const = 0;
127
* Retrieves the interface types supported by this network manager.
129
* @return the interface types supported by the network manager
130
* @see Solid::Control::NetworkManager::SupportedInterfaceType
134
virtual Solid::Control::NetworkInterface::Types supportedInterfaceTypes() const = 0;
138
* Activates or deactivates networking (as a whole).
140
* @param enabled true to activate networking, false otherwise
142
virtual void setNetworkingEnabled(bool enabled) = 0;
145
* Activates or deactivates wireless networking.
147
* @param enabled true to activate wireless networking, false otherwise
149
virtual void setWirelessEnabled(bool enabled) = 0;
152
* Activates or deactivates wwan (mobile broadband) networking.
154
* @param enabled true to activate wwan (mobile broadband) networking, false otherwise
156
virtual void setWwanEnabled(bool enabled) = 0;
160
* This signal is emitted when the system's connection state changes
162
void statusChanged(Solid::Networking::Status status);
165
* This signal is emitted when a new network interface is available.
167
* @param uni the network interface identifier
169
void networkInterfaceAdded(const QString & uni);
172
* This signal is emitted when a network interface is not available anymore.
174
* @param uni the network interface identifier
176
void networkInterfaceRemoved(const QString & uni);
179
* This signal is emitted when the status of the wireless changed
181
void wirelessEnabledChanged(bool enabled);
184
* This signal is emitted when the status of the wireless hardware changed
186
void wirelessHardwareEnabledChanged(bool enabled);
189
* This signal is emitted when the status of the wwan (mobile broadband) changed
191
void wwanEnabledChanged(bool enabled);
194
* This signal is emitted when the status of the wwan (mobile broadband) hardware changed
196
void wwanHardwareEnabledChanged(bool enabled);
199
* This signal is emitted when the status of overall networking changed
201
void networkingEnabledChanged(bool enabled);
204
* This signal is emitted when the set of active connections changes
206
void activeConnectionsChanged();
215
Q_DECLARE_INTERFACE(Solid::Control::Ifaces::NetworkManager, "org.kde.Solid.Control.Ifaces.NetworkManager/0.1")