not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / solid / control / wirelessaccesspoint.h
blob00eed89637364a3440a1f51c944f35fa8b70053f
1 /*
2 Copyright 2008 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 Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) version 3, or any
8 later version accepted by the membership of KDE e.V. (or its
9 successor approved by the membership of KDE e.V.), which shall
10 act as a proxy defined in Section 6 of version 3 of the license.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef SOLID_CONTROL_WIRELESSAP_H
22 #define SOLID_CONTROL_WIRELESSAP_H
24 #include <QtCore/QObject>
26 #include "wirelessnetworkinterface.h"
28 namespace Solid
30 namespace Control
32 class AccessPointPrivate;
33 class SOLIDCONTROL_EXPORT AccessPoint : public QObject
35 Q_OBJECT
36 Q_DECLARE_PRIVATE(AccessPoint)
37 Q_FLAGS(Capabilities WpaFlags)
38 public:
39 /**
40 * General capabilities of an access point
42 enum Capability { Privacy = 0x1 };
43 /**
44 * Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
46 enum WpaFlag { PairWep40 = 0x1, PairWep104 = 0x2, PairTkip = 0x4, PairCcmp = 0x8,
47 GroupWep40 = 0x10, GroupWep104 = 0x20, GroupTkip = 0x40, GroupCcmp = 0x80,
48 KeyMgmtPsk = 0x100, KeyMgmt8021x = 0x200 };
49 Q_DECLARE_FLAGS(Capabilities, Capability)
50 Q_DECLARE_FLAGS(WpaFlags, WpaFlag)
52 /**
53 * Creates a new Network object.
55 * @param backendObject the network object provided by the backend
57 AccessPoint(QObject *backendObject = 0);
58 /**
59 * Copy ctor
61 AccessPoint(const AccessPoint &);
63 virtual ~AccessPoint();
65 /**
66 * Opaque and unique string identifier for this access point
68 QString uni() const;
70 /**
71 * Flags describing the capabilities of the access point
73 Solid::Control::AccessPoint::Capabilities capabilities() const;
75 /**
76 * Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
78 Solid::Control::AccessPoint::WpaFlags wpaFlags() const;
80 /**
81 * Flags describing the access point's capabilities according to RSN (Robust Secure Network)
82 * aka WPA2
84 Solid::Control::AccessPoint::WpaFlags rsnFlags() const;
86 /**
87 * The Service Set Identifier of the access point
89 QString ssid() const;
91 /**
92 * Retrieves the frequency in MHz of the radio channel that this access point is operating on
94 * @return the frequency
96 uint frequency() const;
98 /**
99 * The hardware address assigned to the access point's wireless interface
101 QString hardwareAddress() const;
104 * Retrieves the maximum bit rate currently attainable with this access point
106 * @return the maximum bitrate in kilobit/s
108 uint maxBitRate() const;
111 * Retrieves the operation mode of this access point
113 * @return the current mode
114 * @see Solid::Control::WirelessNetworkInterface::OperationMode
116 Solid::Control::WirelessNetworkInterface::OperationMode mode() const;
119 * Retrieves the current signal strength of this wifi network.
121 * @return the signal strength as a percentage
123 int signalStrength() const;
125 Q_SIGNALS:
127 * This signal is emitted when the signal strength of this network has changed.
129 * @param strength the new signal strength value for this network
131 void signalStrengthChanged(int strength);
134 * This signal is emitted when the bitrate of this network has changed.
136 * @param bitrate the new bitrate value for this network
138 void bitRateChanged(int bitrate);
141 * This signal is emitted when the WPA flags in use by this access point change
143 * @param flags the new flags
145 void wpaFlagsChanged(Solid::Control::AccessPoint::WpaFlags flags) const;
148 * This signal is emitted when the RSN(WPA2) flags in use by this access point change
150 * @param flags the new flags
152 void rsnFlagsChanged(Solid::Control::AccessPoint::WpaFlags flags) const;
154 * This signal is emitted when the ssid of this Access Point changes
156 * @param ssid the new SSID
158 void ssidChanged(const QString & ssid) const;
161 * This signal is emitted when the frequency used by this Access Point changes
163 * @param frequency the new frequency
165 void frequencyChanged(uint frequency) const;
166 protected:
168 * @internal
170 AccessPoint(AccessPointPrivate &dd, QObject *backendObject);
172 * @internal
174 AccessPoint(AccessPointPrivate &dd, const AccessPoint & ap);
175 AccessPointPrivate * d_ptr;
176 private Q_SLOTS:
177 void _k_destroyed(QObject *object);
179 typedef QStringList AccessPointList;
180 } // Control
181 } // Solid
183 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::AccessPoint::Capabilities)
184 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::AccessPoint::WpaFlags)
185 #endif // SOLID_CONTROL_WIRELESSAP_H