add more spacing
[personal-kdebase.git] / workspace / libs / solid / control / wirelessnetworkinterface.h
blobf13de3e97477e6d541fe9462fcb45c0e75ce2898
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;
29 namespace Solid
31 namespace Control
33 class AccessPoint;
34 class WirelessNetworkInterfacePrivate;
35 namespace Ifaces
37 class AccessPoint;
40 /**
41 * This interface represents a wireless network interface
43 class SOLIDCONTROL_EXPORT WirelessNetworkInterface : public NetworkInterface
45 Q_OBJECT
46 Q_ENUMS(OperationMode DeviceInterface)
47 Q_FLAGS(Capabilities)
48 Q_DECLARE_PRIVATE(WirelessNetworkInterface)
50 public:
51 enum OperationMode { Unassociated, Adhoc, Managed, Master, Repeater };
52 // corresponding to 802.11 capabilities defined in NetworkManager.h
53 enum Capability { NoCapability = 0x0, Wep40 = 0x2, Wep104, Tkip = 0x4, Ccmp = 0x8, Wpa = 0x10,
54 Rsn };
55 Q_DECLARE_FLAGS(Capabilities, Capability)
57 /**
58 * Creates a new WirelessNetworkInterface object.
60 * @param backendObject the network object provided by the backend
62 WirelessNetworkInterface(QObject *backendObject = 0);
64 /**
65 * Constructs a copy of a network.
67 * @param network the network to copy
69 WirelessNetworkInterface(const WirelessNetworkInterface &network);
71 /**
72 * Destroys a WirelessNetworkInterface object.
74 virtual ~WirelessNetworkInterface();
76 /**
77 * The NetworkInterface type.
79 * @return the NetworkInterface::Type. This always returns NetworkInterface::Ieee80211
81 virtual NetworkInterface::Type type() const;
83 /**
84 * List of wireless networks currently visible to the hardware
86 AccessPointList accessPoints() const;
88 /**
89 * Identifier of the network this interface is currently associated with
91 QString activeAccessPoint() const;
93 /**
94 * The hardware address assigned to the network interface
96 QString hardwareAddress() const;
98 /**
99 * Retrieves the operation mode of this network.
101 * @return the current mode
102 * @see Solid::Control::WirelessNetworkInterface::OperationMode
104 Solid::Control::WirelessNetworkInterface::OperationMode mode() const;
107 * Retrieves the effective bit rate currently attainable by this device.
109 * @return the bitrate in bit/s
111 int bitRate() const;
114 * Retrieves the capabilities of this wifi network.
116 * @return the flag set describing the capabilities
117 * @see Solid::Control::WirelessNetworkInterface::DeviceInterface
119 Solid::Control::WirelessNetworkInterface::Capabilities wirelessCapabilities() const;
122 * Finds access point object given its Unique Network Identifier.
124 * @param uni the identifier of the AP to find from this network interface
125 * @returns a valid AccessPoint object if a network having the given UNI for this device is known to the system, 0 otherwise
127 AccessPoint *findAccessPoint(const QString & uni) const;
129 Q_SIGNALS:
131 * This signal is emitted when the bitrate of this network has changed.
133 * @param bitrate the new bitrate value for this network
135 void bitRateChanged(int);
137 * The active network changed.
139 void activeAccessPointChanged(const QString &);
141 * The device switched operating mode.
143 void modeChanged(Solid::Control::WirelessNetworkInterface::OperationMode);
145 * A new wireless access point appeared
147 void accessPointAppeared(const QString &);
149 * A wireless access point disappeared
151 void accessPointDisappeared(const QString &);
152 protected:
154 * @internal
156 WirelessNetworkInterface(WirelessNetworkInterfacePrivate &dd, QObject *backendObject);
159 * @internal
161 WirelessNetworkInterface(WirelessNetworkInterfacePrivate &dd, const WirelessNetworkInterface &network);
163 void makeConnections(QObject * source);
164 QPair<AccessPoint *, Ifaces::AccessPoint *> findRegisteredAccessPoint(const QString &uni) const;
165 private Q_SLOTS:
166 void _k_accessPointAdded(const QString &uni);
167 void _k_accessPointRemoved(const QString &uni);
168 void _k_destroyed(QObject *object);
170 } //Control
171 } //Solid
173 #endif //SOLID_CONTROL_WIREDNETWORKINTERFACE_H