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

« back to all changes in this revision

Viewing changes to libs/solid/control/wirelessaccesspoint.cpp

  • 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
#include "wirelessaccesspoint.h"
 
22
#include "frontendobject_p.h"
 
23
#include "soliddefs_p.h"
 
24
#include "ifaces/wirelessaccesspoint.h"
 
25
 
 
26
namespace Solid
 
27
{
 
28
namespace Control
 
29
{
 
30
    class AccessPointPrivate : public FrontendObjectPrivate
 
31
    {
 
32
    public:
 
33
        AccessPointPrivate(QObject *parent)
 
34
            : FrontendObjectPrivate(parent) { }
 
35
 
 
36
        void setBackendObject(QObject *object);
 
37
    };
 
38
}
 
39
}
 
40
 
 
41
Solid::Control::AccessPoint::AccessPoint(QObject *backendObject)
 
42
    : QObject(), d_ptr(new AccessPointPrivate(this))
 
43
{
 
44
    Q_D(AccessPoint);
 
45
    d->setBackendObject(backendObject);
 
46
}
 
47
 
 
48
Solid::Control::AccessPoint::AccessPoint(const AccessPoint &network)
 
49
    : QObject(), d_ptr(new AccessPointPrivate(this))
 
50
{
 
51
    Q_D(AccessPoint);
 
52
    d->setBackendObject(network.d_ptr->backendObject());
 
53
}
 
54
 
 
55
Solid::Control::AccessPoint::AccessPoint(AccessPointPrivate &dd, QObject *backendObject)
 
56
    : QObject(), d_ptr(&dd)
 
57
{
 
58
    Q_D(AccessPoint);
 
59
    d->setBackendObject(backendObject);
 
60
}
 
61
 
 
62
Solid::Control::AccessPoint::AccessPoint(AccessPointPrivate &dd, const AccessPoint &ap)
 
63
    : d_ptr(&dd)
 
64
{
 
65
    Q_D(AccessPoint);
 
66
    d->setBackendObject(ap.d_ptr->backendObject());
 
67
}
 
68
 
 
69
Solid::Control::AccessPoint::~AccessPoint()
 
70
{
 
71
    delete d_ptr;
 
72
}
 
73
 
 
74
QString Solid::Control::AccessPoint::uni() const
 
75
{
 
76
    Q_D(const AccessPoint);
 
77
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), QString(), uni());
 
78
}
 
79
 
 
80
Solid::Control::AccessPoint::Capabilities Solid::Control::AccessPoint::capabilities() const
 
81
{
 
82
    Q_D(const AccessPoint);
 
83
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, capabilities());
 
84
 
 
85
}
 
86
 
 
87
Solid::Control::AccessPoint::WpaFlags Solid::Control::AccessPoint::wpaFlags() const
 
88
{
 
89
    Q_D(const AccessPoint);
 
90
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, wpaFlags());
 
91
 
 
92
}
 
93
 
 
94
Solid::Control::AccessPoint::WpaFlags Solid::Control::AccessPoint::rsnFlags() const
 
95
{
 
96
    Q_D(const AccessPoint);
 
97
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, rsnFlags());
 
98
 
 
99
}
 
100
 
 
101
QString Solid::Control::AccessPoint::ssid() const
 
102
{
 
103
    Q_D(const AccessPoint);
 
104
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), QString(), ssid());
 
105
}
 
106
 
 
107
QByteArray Solid::Control::AccessPoint::rawSsid() const
 
108
{
 
109
    Q_D(const AccessPoint);
 
110
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), QByteArray(), rawSsid());
 
111
}
 
112
 
 
113
uint Solid::Control::AccessPoint::frequency() const
 
114
{
 
115
    Q_D(const AccessPoint);
 
116
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, frequency());
 
117
 
 
118
}
 
119
 
 
120
QString Solid::Control::AccessPoint::hardwareAddress() const
 
121
{
 
122
    Q_D(const AccessPoint);
 
123
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), QString(), hardwareAddress());
 
124
 
 
125
}
 
126
 
 
127
uint Solid::Control::AccessPoint::maxBitRate() const
 
128
{
 
129
    Q_D(const AccessPoint);
 
130
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, maxBitRate());
 
131
}
 
132
 
 
133
Solid::Control::WirelessNetworkInterface::OperationMode Solid::Control::AccessPoint::mode() const
 
134
{
 
135
    Q_D(const AccessPoint);
 
136
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), (Solid::Control::WirelessNetworkInterface::OperationMode)0, mode());
 
137
}
 
138
 
 
139
int Solid::Control::AccessPoint::signalStrength() const
 
140
{
 
141
    Q_D(const AccessPoint);
 
142
    return_SOLID_CALL(Ifaces::AccessPoint *, d->backendObject(), 0, signalStrength());
 
143
}
 
144
 
 
145
void Solid::Control::AccessPointPrivate::setBackendObject(QObject *object)
 
146
{
 
147
    FrontendObjectPrivate::setBackendObject(object);
 
148
 
 
149
    if (object) {
 
150
        QObject::connect(object, SIGNAL(signalStrengthChanged(int)),
 
151
                parent(), SIGNAL(signalStrengthChanged(int)));
 
152
        QObject::connect(object, SIGNAL(bitRateChanged(int)),
 
153
                parent(), SIGNAL(bitRateChanged(int)));
 
154
        QObject::connect(object, SIGNAL(wpaFlagsChanged(Solid::Control::AccessPoint::WpaFlags)),
 
155
                parent(), SIGNAL(wpaFlagsChanged(Solid::Control::AccessPoint::WpaFlags)));
 
156
        QObject::connect(object, SIGNAL(rsnFlagsChanged(Solid::Control::AccessPoint::WpaFlags)),
 
157
                parent(), SIGNAL(rsnFlagsChanged(Solid::Control::AccessPoint::WpaFlags)));
 
158
        QObject::connect(object, SIGNAL(ssidChanged(const QString&)),
 
159
                parent(), SIGNAL(ssidChanged(const QString&)));
 
160
        QObject::connect(object, SIGNAL(frequencyChanged(uint)),
 
161
                parent(), SIGNAL(frequencyChanged(uint)));
 
162
    }
 
163
}
 
164
 
 
165
void Solid::Control::AccessPoint::_k_destroyed(QObject *object)
 
166
{
 
167
    Q_UNUSED(object);
 
168
    // nothing to do yet
 
169
}
 
170
 
 
171
#include "wirelessaccesspoint.moc"