Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / solid / control / ifaces / networkmanager.h
blobd239a9415f26e4f9d44a3d63a15f1fb24f317345
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 <solid/networking.h>
25 #include <solid/control/solid_control_export.h>
26 #include <solid/control/networkmanager.h>
28 namespace Solid
30 namespace Control
32 namespace Ifaces
34 /**
35 * This class specifies the interface a backend will have to implement in
36 * order to be used in the system.
38 * A network manager allow to query the underlying platform to discover the
39 * available network interfaces and reachable network. It has also the
40 * responsibility to notify when a network interface or a network appear or disappear.
42 class SOLIDCONTROLIFACES_EXPORT NetworkManager : public QObject
44 Q_OBJECT
45 public:
46 /**
47 * Constructs a NetworkManager.
49 * @param parent the parent object
51 NetworkManager(QObject * parent = 0);
52 /**
53 * Destructs a NetworkManager object.
55 virtual ~NetworkManager();
58 /**
59 * Get the manager connection state
61 virtual Solid::Networking::Status status() const = 0;
63 /**
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;
71 /**
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;
79 /**
80 * Instantiates a new AuthenticationValidator object.
82 * @returns a new AuthenticationValidator object, or 0 on failure
84 virtual QObject *createAuthenticationValidator() = 0;
87 /**
88 * Retrieves the activation status of networking (as a whole) in the system.
90 * @return true if this networking is enabled, false otherwise
92 virtual bool isNetworkingEnabled() const = 0;
94 /**
95 * Retrieves the activation status of wireless networking in the system.
97 * @return true if this wireless networking is enabled, false otherwise
99 virtual bool isWirelessEnabled() const = 0;
102 public Q_SLOTS:
104 * Activates or deactivates networking (as a whole).
106 * @param enabled true to activate networking, false otherwise
108 virtual void setNetworkingEnabled(bool enabled) = 0;
111 * Activates or deactivates wireless networking.
113 * @param enabled true to activate wireless networking, false otherwise
115 virtual void setWirelessEnabled(bool enabled) = 0;
118 * Informs the system of hidden networks.
120 * @param networkName the name of the hidden network that could be discovered
122 virtual void notifyHiddenNetwork(const QString &networkName) = 0;
124 Q_SIGNALS:
126 * This signal is emitted when the system's connection state changes
128 void statusChanged(Solid::Networking::Status status);
131 * This signal is emitted when a new network interface is available.
133 * @param uni the network interface identifier
135 void networkInterfaceAdded(const QString & uni);
138 * This signal is emitted when a network interface is not available anymore.
140 * @param uni the network interface identifier
142 void networkInterfaceRemoved(const QString & uni);
145 } // Ifaces
147 } // Control
149 } // Solid
151 #endif