~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/solid/control/ifaces/networkmanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This file is part of the KDE project
 
2
    Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
 
3
 
 
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.
 
7
 
 
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.
 
12
 
 
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.
 
17
 
 
18
*/
 
19
 
 
20
#ifndef SOLID_IFACES_NETWORKMANAGER
 
21
#define SOLID_IFACES_NETWORKMANAGER
 
22
 
 
23
#include <QtCore/QObject>
 
24
#include <QtCore/QStringList>
 
25
#include <solid/networking.h>
 
26
#include "../solid_control_export.h"
 
27
#include "../networkmanager.h"
 
28
 
 
29
namespace Solid
 
30
{
 
31
namespace Control
 
32
{
 
33
namespace Ifaces
 
34
{
 
35
    /**
 
36
     * This class specifies the interface a backend will have to implement in
 
37
     * order to be used in the system.
 
38
     *
 
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.
 
42
     */
 
43
    class SOLIDCONTROLIFACES_EXPORT NetworkManager : public QObject
 
44
    {
 
45
        Q_OBJECT
 
46
    public:
 
47
        /**
 
48
         * Constructs a NetworkManager.
 
49
         *
 
50
         * @param parent the parent object
 
51
         */
 
52
        NetworkManager(QObject * parent = 0);
 
53
        /**
 
54
         * Destructs a NetworkManager object.
 
55
         */
 
56
        virtual ~NetworkManager();
 
57
 
 
58
        /**
 
59
         * Get the manager connection state
 
60
         */
 
61
        virtual Solid::Networking::Status status() const = 0;
 
62
 
 
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.
 
66
         *
 
67
         * @return the list of network interfaces available in this system
 
68
         */
 
69
        virtual QStringList networkInterfaces() const = 0;
 
70
 
 
71
        /**
 
72
         * Instantiates a new NetworkInterface object from this backend given its UNI.
 
73
         *
 
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
 
76
         */
 
77
        virtual QObject *createNetworkInterface(const QString &uni) = 0;
 
78
 
 
79
        /**
 
80
         * Retrieves the activation status of networking (as a whole) in the system.
 
81
         *
 
82
         * @return true if this networking is enabled, false otherwise
 
83
         */
 
84
        virtual bool isNetworkingEnabled() const = 0;
 
85
 
 
86
        /**
 
87
         * Retrieves the activation status of wireless networking in the system.
 
88
         *
 
89
         * @return true if this wireless networking is enabled, false otherwise
 
90
         */
 
91
        virtual bool isWirelessEnabled() const = 0;
 
92
 
 
93
        /**
 
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.
 
96
         *
 
97
         * @since KDE 4.1
 
98
         * @return true if this wireless networking is enabled, false otherwise
 
99
         */
 
100
        virtual bool isWirelessHardwareEnabled() const = 0;
 
101
 
 
102
        /**
 
103
         * Retrieves the activation status of wwan (mobile broadband) networking in the system.
 
104
         *
 
105
         * @return true if this wwan networking is enabled, false otherwise
 
106
         */
 
107
        virtual bool isWwanEnabled() const = 0;
 
108
 
 
109
        /**
 
110
         * Retrieves the status of wwan (mobile broadband) hardware in the system.
 
111
         *
 
112
         * @since KDE 4.7
 
113
         * @return true if this wwan networking is enabled, false otherwise
 
114
         */
 
115
        virtual bool isWwanHardwareEnabled() const = 0;
 
116
 
 
117
        virtual void activateConnection(const QString & interfaceUni, const QString & connectionUni, const QVariantMap & connectionParameters ) = 0;
 
118
 
 
119
        virtual void deactivateConnection(const QString & activeConnection) = 0;
 
120
 
 
121
        /**
 
122
         * Access the list of active connection UNIs
 
123
         */
 
124
        virtual QStringList activeConnections() const = 0;
 
125
 
 
126
        /**
 
127
         * Retrieves the interface types supported by this network manager.
 
128
         *
 
129
         * @return the interface types supported by the network manager
 
130
         * @see Solid::Control::NetworkManager::SupportedInterfaceType
 
131
         *
 
132
         * @since 4.3
 
133
         */
 
134
        virtual Solid::Control::NetworkInterface::Types supportedInterfaceTypes() const = 0;
 
135
 
 
136
    public Q_SLOTS:
 
137
        /**
 
138
         * Activates or deactivates networking (as a whole).
 
139
         *
 
140
         * @param enabled true to activate networking, false otherwise
 
141
         */
 
142
        virtual void setNetworkingEnabled(bool enabled) = 0;
 
143
 
 
144
        /**
 
145
         * Activates or deactivates wireless networking.
 
146
         *
 
147
         * @param enabled true to activate wireless networking, false otherwise
 
148
         */
 
149
        virtual void setWirelessEnabled(bool enabled) = 0;
 
150
 
 
151
        /**
 
152
         * Activates or deactivates wwan (mobile broadband) networking.
 
153
         *
 
154
         * @param enabled true to activate wwan (mobile broadband) networking, false otherwise
 
155
         */
 
156
        virtual void setWwanEnabled(bool enabled) = 0;
 
157
 
 
158
    Q_SIGNALS:
 
159
        /**
 
160
         * This signal is emitted when the system's connection state changes
 
161
         */
 
162
        void statusChanged(Solid::Networking::Status status);
 
163
 
 
164
        /**
 
165
         * This signal is emitted when a new network interface is available.
 
166
         *
 
167
         * @param uni the network interface identifier
 
168
         */
 
169
        void networkInterfaceAdded(const QString  & uni);
 
170
 
 
171
        /**
 
172
         * This signal is emitted when a network interface is not available anymore.
 
173
         *
 
174
         * @param uni the network interface identifier
 
175
         */
 
176
        void networkInterfaceRemoved(const QString  & uni);
 
177
 
 
178
        /**
 
179
         * This signal is emitted when the status of the wireless changed
 
180
         */
 
181
        void wirelessEnabledChanged(bool enabled);
 
182
 
 
183
        /**
 
184
         * This signal is emitted when the status of the wireless hardware changed
 
185
         */
 
186
        void wirelessHardwareEnabledChanged(bool enabled);
 
187
 
 
188
        /**
 
189
         * This signal is emitted when the status of the wwan (mobile broadband) changed
 
190
         */
 
191
        void wwanEnabledChanged(bool enabled);
 
192
 
 
193
        /**
 
194
         * This signal is emitted when the status of the wwan (mobile broadband) hardware changed
 
195
         */
 
196
        void wwanHardwareEnabledChanged(bool enabled);
 
197
 
 
198
        /**
 
199
         * This signal is emitted when the status of overall networking changed
 
200
         */
 
201
        void networkingEnabledChanged(bool enabled);
 
202
 
 
203
        /**
 
204
         * This signal is emitted when the set of active connections changes
 
205
         */
 
206
        void activeConnectionsChanged();
 
207
    };
 
208
 
 
209
} // Ifaces
 
210
 
 
211
} // Control
 
212
 
 
213
} // Solid
 
214
 
 
215
Q_DECLARE_INTERFACE(Solid::Control::Ifaces::NetworkManager, "org.kde.Solid.Control.Ifaces.NetworkManager/0.1")
 
216
 
 
217
#endif