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

« back to all changes in this revision

Viewing changes to libs/solid/control/modemgsmussdinterface.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 "modemgsmussdinterface.h"
 
23
#include "modemgsmussdinterface_p.h"
 
24
 
 
25
#include "frontendobject_p.h"
 
26
#include "soliddefs_p.h"
 
27
#include "ifaces/modemgsmussdinterface.h"
 
28
 
 
29
Solid::Control::ModemGsmUssdInterface::ModemGsmUssdInterface(QObject *backendObject)
 
30
    : ModemInterface(*new ModemGsmUssdInterfacePrivate(this), backendObject)
 
31
{
 
32
    Q_D(ModemGsmUssdInterface);
 
33
    d->setBackendObject(backendObject);
 
34
    makeConnections( backendObject );
 
35
}
 
36
 
 
37
Solid::Control::ModemGsmUssdInterface::ModemGsmUssdInterface(const ModemGsmUssdInterface &ussdinterface)
 
38
    : ModemInterface(*new ModemGsmUssdInterfacePrivate(this), ussdinterface)
 
39
{
 
40
    Q_D(ModemGsmUssdInterface);
 
41
    d->setBackendObject(ussdinterface.d_ptr->backendObject());
 
42
    makeConnections(ussdinterface.d_ptr->backendObject());
 
43
}
 
44
 
 
45
Solid::Control::ModemGsmUssdInterface::~ModemGsmUssdInterface()
 
46
{
 
47
}
 
48
 
 
49
QString Solid::Control::ModemGsmUssdInterface::initiate(const QString & command) const
 
50
{
 
51
    Q_D(const ModemGsmUssdInterface);
 
52
    return_SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), QString(), initiate(command));
 
53
}
 
54
 
 
55
void Solid::Control::ModemGsmUssdInterface::respond(const QString response) const
 
56
{
 
57
    Q_D(const ModemGsmUssdInterface);
 
58
    SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), respond(response));
 
59
}
 
60
 
 
61
void Solid::Control::ModemGsmUssdInterface::cancel() const
 
62
{
 
63
    Q_D(const ModemGsmUssdInterface);
 
64
    SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), cancel());
 
65
}
 
66
 
 
67
QString Solid::Control::ModemGsmUssdInterface::getState() const
 
68
{
 
69
    Q_D(const ModemGsmUssdInterface);
 
70
    return_SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), QString(), getState());
 
71
}
 
72
 
 
73
QString Solid::Control::ModemGsmUssdInterface::getNetworkNotification() const
 
74
{
 
75
    Q_D(const ModemGsmUssdInterface);
 
76
    return_SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), QString(), getNetworkNotification());
 
77
}
 
78
 
 
79
QString Solid::Control::ModemGsmUssdInterface::getNetworkRequest() const
 
80
{
 
81
    Q_D(const ModemGsmUssdInterface);
 
82
    return_SOLID_CALL(Ifaces::ModemGsmUssdInterface *, d->backendObject(), QString(), getNetworkRequest());
 
83
}
 
84
 
 
85
void Solid::Control::ModemGsmUssdInterface::slotStateChanged(const QString & state)
 
86
{
 
87
    emit stateChanged(state);
 
88
}
 
89
 
 
90
void Solid::Control::ModemGsmUssdInterface::slotNetworkNotificationChanged(const QString & networkNotification)
 
91
{
 
92
    emit networkNotificationChanged(networkNotification);
 
93
}
 
94
 
 
95
void Solid::Control::ModemGsmUssdInterface::slotNetworkRequestChanged(const QString & networkRequest)
 
96
{
 
97
    emit networkRequestChanged(networkRequest);
 
98
}
 
99
 
 
100
void Solid::Control::ModemGsmUssdInterface::makeConnections(QObject * source)
 
101
{
 
102
    if (source) {
 
103
        QObject::connect(source, SIGNAL(stateChanged(const QString &)),
 
104
                this, SLOT(slotStateChanged(const QString &)));
 
105
        QObject::connect(source, SIGNAL(networkNotificationChanged(const QString &)),
 
106
                this, SLOT(slotNetworkNotificationChanged(const QString &)));
 
107
        QObject::connect(source, SIGNAL(networkRequestChanged(const QString &)),
 
108
                this, SLOT(slotNetworkRequestChanged(const QString &)));
 
109
    }
 
110
}
 
111
 
 
112
void Solid::Control::ModemGsmUssdInterfacePrivate::setBackendObject(QObject *object)
 
113
{
 
114
    ModemInterfacePrivate::setBackendObject(object);
 
115
}
 
116
 
 
117
void Solid::Control::ModemGsmUssdInterface::_k_destroyed(QObject *object)
 
118
{
 
119
    Q_UNUSED(object);
 
120
}