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

« back to all changes in this revision

Viewing changes to libs/solid/control/modemgsmnetworkinterface.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
/*  This file is part of the KDE project
 
2
    Copyright (C) 2010 Lamarque Souza <lamarque@gmail.com>
 
3
 
 
4
    This library is free software; you can redistribute it and/or
 
5
    modify it under the terms of the GNU Library General Public
 
6
    License version 2 as published by the Free Software Foundation.
 
7
 
 
8
    This library is distributed in the hope that it will be useful,
 
9
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
    Library General Public License for more details.
 
12
 
 
13
    You should have received a copy of the GNU Library General Public License
 
14
    along with this library; see the file COPYING.LIB.  If not, write to
 
15
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
16
    Boston, MA 02110-1301, USA.
 
17
 
 
18
*/
 
19
 
 
20
#include <KDebug>
 
21
 
 
22
#include "modemgsmnetworkinterface.h"
 
23
#include "modemgsmnetworkinterface_p.h"
 
24
 
 
25
#include "frontendobject_p.h"
 
26
#include "soliddefs_p.h"
 
27
#include "ifaces/modemgsmnetworkinterface.h"
 
28
 
 
29
Solid::Control::ModemGsmNetworkInterface::ModemGsmNetworkInterface(QObject *backendObject)
 
30
    : ModemInterface(*new ModemGsmNetworkInterfacePrivate(this), backendObject)
 
31
{
 
32
    Q_D(ModemGsmNetworkInterface);
 
33
    d->setBackendObject(backendObject);
 
34
    makeConnections( backendObject );
 
35
}
 
36
 
 
37
Solid::Control::ModemGsmNetworkInterface::ModemGsmNetworkInterface(const ModemGsmNetworkInterface &networkinterface)
 
38
    : ModemInterface(*new ModemGsmNetworkInterfacePrivate(this), networkinterface)
 
39
{
 
40
    Q_D(ModemGsmNetworkInterface);
 
41
    d->setBackendObject(networkinterface.d_ptr->backendObject());
 
42
    makeConnections( networkinterface.d_ptr->backendObject() );
 
43
}
 
44
 
 
45
Solid::Control::ModemGsmNetworkInterface::~ModemGsmNetworkInterface()
 
46
{
 
47
}
 
48
 
 
49
Solid::Control::ModemInterface::Type Solid::Control::ModemGsmNetworkInterface::type() const
 
50
{
 
51
    return GsmType;
 
52
}
 
53
 
 
54
void Solid::Control::ModemGsmNetworkInterface::registerToNetwork(const QString & networkId) const
 
55
{
 
56
    Q_D(const ModemGsmNetworkInterface);
 
57
    SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), registerToNetwork(networkId));
 
58
}
 
59
 
 
60
Solid::Control::ModemGsmNetworkInterface::ScanResultsType Solid::Control::ModemGsmNetworkInterface::scan() const
 
61
{
 
62
    Q_D(const ModemGsmNetworkInterface);
 
63
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), ScanResultsType(), scan());
 
64
}
 
65
 
 
66
void Solid::Control::ModemGsmNetworkInterface::setApn(const QString & apn) const
 
67
{
 
68
    Q_D(const ModemGsmNetworkInterface);
 
69
    SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), setApn(apn));
 
70
}
 
71
 
 
72
uint Solid::Control::ModemGsmNetworkInterface::getSignalQuality() const
 
73
{
 
74
    Q_D(const ModemGsmNetworkInterface);
 
75
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), 0, getSignalQuality());
 
76
}
 
77
 
 
78
void Solid::Control::ModemGsmNetworkInterface::setBand(const Band band) const
 
79
{
 
80
    Q_D(const ModemGsmNetworkInterface);
 
81
    SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), setBand(band));
 
82
}
 
83
 
 
84
Solid::Control::ModemInterface::Band Solid::Control::ModemGsmNetworkInterface::getBand() const
 
85
{
 
86
    Q_D(const ModemGsmNetworkInterface);
 
87
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), UnknownBand, getBand());
 
88
}
 
89
 
 
90
Solid::Control::ModemGsmNetworkInterface::RegistrationInfoType Solid::Control::ModemGsmNetworkInterface::getRegistrationInfo() const
 
91
{
 
92
    Q_D(const ModemGsmNetworkInterface);
 
93
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), RegistrationInfoType(), getRegistrationInfo());
 
94
}
 
95
 
 
96
void Solid::Control::ModemGsmNetworkInterface::setAllowedMode(const AllowedMode mode) const
 
97
{
 
98
    Q_D(const ModemGsmNetworkInterface);
 
99
    SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), setAllowedMode(mode));
 
100
}
 
101
 
 
102
Solid::Control::ModemInterface::AllowedMode Solid::Control::ModemGsmNetworkInterface::getAllowedMode() const
 
103
{
 
104
    Q_D(const ModemGsmNetworkInterface);
 
105
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), AnyModeAllowed, getAllowedMode());
 
106
}
 
107
 
 
108
Solid::Control::ModemInterface::AccessTechnology Solid::Control::ModemGsmNetworkInterface::getAccessTechnology() const
 
109
{
 
110
    Q_D(const ModemGsmNetworkInterface);
 
111
    return_SOLID_CALL(Ifaces::ModemGsmNetworkInterface *, d->backendObject(), UnknownTechnology, getAccessTechnology());
 
112
}
 
113
 
 
114
void Solid::Control::ModemGsmNetworkInterface::makeConnections(QObject * source)
 
115
{
 
116
    if (source) {
 
117
        QObject::connect(source, SIGNAL(registrationInfoChanged(const Solid::Control::ModemGsmNetworkInterface::RegistrationInfoType &)),
 
118
                this, SIGNAL(registrationInfoChanged(const Solid::Control::ModemGsmNetworkInterface::RegistrationInfoType &)));
 
119
        QObject::connect(source, SIGNAL(signalQualityChanged(uint)),
 
120
                this, SIGNAL(signalQualityChanged(uint)));
 
121
        QObject::connect(source, SIGNAL(allowedModeChanged(const Solid::Control::ModemInterface::AllowedMode)),
 
122
                this, SIGNAL(allowedModeChanged(const Solid::Control::ModemInterface::AllowedMode)));
 
123
        QObject::connect(source, SIGNAL(accessTechnologyChanged(const Solid::Control::ModemInterface::AccessTechnology)),
 
124
                this, SIGNAL(accessTechnologyChanged(const Solid::Control::ModemInterface::AccessTechnology)));
 
125
    }
 
126
}
 
127
 
 
128
void Solid::Control::ModemGsmNetworkInterfacePrivate::setBackendObject(QObject *object)
 
129
{
 
130
    ModemInterfacePrivate::setBackendObject(object);
 
131
}
 
132
 
 
133
void Solid::Control::ModemGsmNetworkInterface::_k_destroyed(QObject *object)
 
134
{
 
135
    Q_UNUSED(object);
 
136
}
 
137
 
 
138