1
/* This file is part of the KDE project
2
Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
3
Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License version 2 as published by the Free Software Foundation.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
Boston, MA 02110-1301, USA.
21
#ifndef SOLID_CONTROL_WIRELESSNETWORKINTERFACE_H
22
#define SOLID_CONTROL_WIRELESSNETWORKINTERFACE_H
24
#include "solid_control_export.h"
26
#include "networkinterface.h"
28
typedef QStringList AccessPointList;
34
class WirelessNetworkInterfacePrivate;
41
* This interface represents a wireless network interface
43
class SOLIDCONTROL_EXPORT WirelessNetworkInterface : public NetworkInterface
46
Q_ENUMS(OperationMode DeviceInterface)
48
Q_DECLARE_PRIVATE(WirelessNetworkInterface)
51
enum OperationMode { Unassociated, Adhoc, Managed, Master, Repeater };
52
// corresponding to 802.11 capabilities defined in NetworkManager.h
53
enum Capability { NoCapability = 0x0, Wep40 = 0x1, Wep104 = 0x2, Tkip = 0x4, Ccmp = 0x8, Wpa = 0x10, Rsn = 0x20 };
54
Q_DECLARE_FLAGS(Capabilities, Capability)
57
* Creates a new WirelessNetworkInterface object.
59
* @param backendObject the network object provided by the backend
61
WirelessNetworkInterface(QObject *backendObject = 0);
64
* Constructs a copy of a network.
66
* @param network the network to copy
68
WirelessNetworkInterface(const WirelessNetworkInterface &network);
71
* Destroys a WirelessNetworkInterface object.
73
virtual ~WirelessNetworkInterface();
76
* The NetworkInterface type.
78
* @return the NetworkInterface::Type. This always returns NetworkInterface::Ieee80211
80
virtual NetworkInterface::Type type() const;
83
* List of wireless networks currently visible to the hardware
85
AccessPointList accessPoints() const;
88
* Identifier of the network this interface is currently associated with
90
QString activeAccessPoint() const;
93
* The hardware address assigned to the network interface
95
QString hardwareAddress() const;
98
* Retrieves the operation mode of this network.
100
* @return the current mode
101
* @see Solid::Control::WirelessNetworkInterface::OperationMode
103
Solid::Control::WirelessNetworkInterface::OperationMode mode() const;
106
* Retrieves the effective bit rate currently attainable by this device.
108
* @return the bitrate in Kbit/s
113
* Retrieves the capabilities of this wifi network.
115
* @return the flag set describing the capabilities
116
* @see Solid::Control::WirelessNetworkInterface::DeviceInterface
118
Solid::Control::WirelessNetworkInterface::Capabilities wirelessCapabilities() const;
121
* Finds access point object given its Unique Network Identifier.
123
* @param uni the identifier of the AP to find from this network interface
124
* @returns a valid AccessPoint object if a network having the given UNI for this device is known to the system, 0 otherwise
126
AccessPoint *findAccessPoint(const QString & uni) const;
130
* This signal is emitted when the bitrate of this network has changed.
132
* @param bitrate the new bitrate value for this network
134
void bitRateChanged(int);
136
* The active network changed.
138
void activeAccessPointChanged(const QString &);
140
* The device switched operating mode.
142
void modeChanged(Solid::Control::WirelessNetworkInterface::OperationMode);
144
* A new wireless access point appeared
146
void accessPointAppeared(const QString &);
148
* A wireless access point disappeared
150
void accessPointDisappeared(const QString &);
155
WirelessNetworkInterface(WirelessNetworkInterfacePrivate &dd, QObject *backendObject);
160
WirelessNetworkInterface(WirelessNetworkInterfacePrivate &dd, const WirelessNetworkInterface &network);
162
void makeConnections(QObject * source);
163
QPair<AccessPoint *, Ifaces::AccessPoint *> findRegisteredAccessPoint(const QString &uni) const;
165
void _k_accessPointAdded(const QString &uni);
166
void _k_accessPointRemoved(const QString &uni);
167
void _k_destroyed(QObject *object);
172
#endif //SOLID_CONTROL_WIREDNETWORKINTERFACE_H