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

« back to all changes in this revision

Viewing changes to libs/solid/control/wirelessaccesspoint.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
/*
 
2
Copyright 2008 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 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.
 
11
 
 
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.
 
16
 
 
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/>.
 
19
*/
 
20
 
 
21
#ifndef SOLID_CONTROL_WIRELESSAP_H
 
22
#define SOLID_CONTROL_WIRELESSAP_H
 
23
 
 
24
#include <QtCore/QObject>
 
25
 
 
26
#include "wirelessnetworkinterface.h"
 
27
 
 
28
namespace Solid
 
29
{
 
30
namespace Control
 
31
{
 
32
    class AccessPointPrivate;
 
33
    class SOLIDCONTROL_EXPORT AccessPoint : public QObject
 
34
    {
 
35
        Q_OBJECT
 
36
        Q_DECLARE_PRIVATE(AccessPoint)
 
37
        Q_FLAGS(Capabilities WpaFlags)
 
38
    public:
 
39
        /**
 
40
         * General capabilities of an access point
 
41
         */
 
42
        enum Capability { Privacy = 0x1 };
 
43
        /**
 
44
         * Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
 
45
         */
 
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)
 
51
 
 
52
        /**
 
53
         * Creates a new Network object.
 
54
         *
 
55
         * @param backendObject the network object provided by the backend
 
56
         */
 
57
        AccessPoint(QObject *backendObject = 0);
 
58
        /**
 
59
         * Copy ctor
 
60
         */
 
61
        AccessPoint(const AccessPoint &);
 
62
 
 
63
        virtual ~AccessPoint();
 
64
 
 
65
        /**
 
66
         * Opaque and unique string identifier for this access point
 
67
         */
 
68
        QString uni() const;
 
69
 
 
70
        /**
 
71
         * Flags describing the capabilities of the access point
 
72
         */
 
73
        Solid::Control::AccessPoint::Capabilities capabilities() const;
 
74
 
 
75
        /**
 
76
         * Flags describing the access point's capabilities according to WPA (Wifi Protected Access)
 
77
         */
 
78
        Solid::Control::AccessPoint::WpaFlags wpaFlags() const;
 
79
 
 
80
        /**
 
81
         * Flags describing the access point's capabilities according to RSN (Robust Secure Network)
 
82
         * aka WPA2
 
83
         */
 
84
        Solid::Control::AccessPoint::WpaFlags rsnFlags() const;
 
85
 
 
86
        /**
 
87
         * The Service Set Identifier of the access point
 
88
         */
 
89
        QString ssid() const;
 
90
 
 
91
        /**
 
92
         * The raw bytes of the Service Set Identifier of the access point
 
93
         */
 
94
        QByteArray rawSsid() const;
 
95
 
 
96
        /**
 
97
         * Retrieves the frequency in MHz of the radio channel that this access point is operating on
 
98
         *
 
99
         * @return the frequency
 
100
         */
 
101
        uint frequency() const;
 
102
 
 
103
        /**
 
104
         * The hardware address assigned to the access point's wireless interface
 
105
         */
 
106
        QString hardwareAddress() const;
 
107
 
 
108
        /**
 
109
         * Retrieves the maximum bit rate currently attainable with this access point
 
110
         *
 
111
         * @return the maximum bitrate in kilobit/s
 
112
         */
 
113
        uint maxBitRate() const;
 
114
 
 
115
        /**
 
116
         * Retrieves the operation mode of this access point
 
117
         *
 
118
         * @return the current mode
 
119
         * @see Solid::Control::WirelessNetworkInterface::OperationMode
 
120
         */
 
121
        Solid::Control::WirelessNetworkInterface::OperationMode mode() const;
 
122
 
 
123
        /**
 
124
         * Retrieves the current signal strength of this access point
 
125
         *
 
126
         * @return the signal strength as a percentage
 
127
         */
 
128
        int signalStrength() const;
 
129
 
 
130
    Q_SIGNALS:
 
131
        /**
 
132
         * This signal is emitted when the signal strength of this access point has changed.
 
133
         *
 
134
         * @param strength the new signal strength value for this access point.
 
135
         */
 
136
        void signalStrengthChanged(int strength);
 
137
 
 
138
        /**
 
139
         * This signal is emitted when the bitrate of this access point has changed.
 
140
         *
 
141
         * @param bitrate the new bitrate value for this access point
 
142
         */
 
143
        void bitRateChanged(int bitrate);
 
144
 
 
145
        /**
 
146
         * This signal is emitted when the WPA flags in use by this access point change
 
147
         *
 
148
         * @param flags the new flags
 
149
         */
 
150
        void wpaFlagsChanged(Solid::Control::AccessPoint::WpaFlags flags) const;
 
151
 
 
152
        /**
 
153
         * This signal is emitted when the RSN(WPA2) flags in use by this access point change
 
154
         *
 
155
         * @param flags the new flags
 
156
         */
 
157
        void rsnFlagsChanged(Solid::Control::AccessPoint::WpaFlags flags) const;
 
158
        /**
 
159
         * This signal is emitted when the ssid of this Access Point changes
 
160
         *
 
161
         * @param ssid the new SSID
 
162
         */
 
163
        void ssidChanged(const QString & ssid) const;
 
164
 
 
165
        /**
 
166
         * This signal is emitted when the frequency used by this Access Point changes
 
167
         *
 
168
         * @param frequency the new frequency
 
169
         */
 
170
        void frequencyChanged(uint frequency) const;
 
171
    protected:
 
172
        /**
 
173
         * @internal
 
174
         */
 
175
        AccessPoint(AccessPointPrivate &dd, QObject *backendObject);
 
176
        /**
 
177
         * @internal
 
178
         */
 
179
        AccessPoint(AccessPointPrivate &dd, const AccessPoint & ap);
 
180
        AccessPointPrivate * d_ptr;
 
181
    private Q_SLOTS:
 
182
        void _k_destroyed(QObject *object);
 
183
    };
 
184
    typedef QStringList AccessPointList;
 
185
} // Control
 
186
} // Solid
 
187
 
 
188
Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::AccessPoint::Capabilities)
 
189
Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::Control::AccessPoint::WpaFlags)
 
190
#endif // SOLID_CONTROL_WIRELESSAP_H
 
191