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

« back to all changes in this revision

Viewing changes to libs/solid/control/modemgsmsmsinterface.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
#include <KLocale>
 
22
 
 
23
#include "modemgsmsmsinterface.h"
 
24
#include "modemgsmsmsinterface_p.h"
 
25
 
 
26
#include "frontendobject_p.h"
 
27
#include "soliddefs_p.h"
 
28
#include "ifaces/modemgsmsmsinterface.h"
 
29
 
 
30
Solid::Control::ModemGsmSmsInterface::ModemGsmSmsInterface(QObject *backendObject)
 
31
    : ModemInterface(*new ModemGsmSmsInterfacePrivate(this), backendObject)
 
32
{
 
33
    Q_D(ModemGsmSmsInterface);
 
34
    d->setBackendObject(backendObject);
 
35
    makeConnections( backendObject );
 
36
}
 
37
 
 
38
Solid::Control::ModemGsmSmsInterface::ModemGsmSmsInterface(const ModemGsmSmsInterface &smsinterface)
 
39
    : ModemInterface(*new ModemGsmSmsInterfacePrivate(this), smsinterface)
 
40
{
 
41
    Q_D(ModemGsmSmsInterface);
 
42
    d->setBackendObject(smsinterface.d_ptr->backendObject());
 
43
    makeConnections( smsinterface.d_ptr->backendObject() );
 
44
}
 
45
 
 
46
Solid::Control::ModemGsmSmsInterface::~ModemGsmSmsInterface()
 
47
{
 
48
}
 
49
 
 
50
void Solid::Control::ModemGsmSmsInterface::deleteSms(const int index) const
 
51
{
 
52
    Q_D(const ModemGsmSmsInterface);
 
53
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), deleteSms(index));
 
54
}
 
55
 
 
56
QVariantMap Solid::Control::ModemGsmSmsInterface::get(const int index) const
 
57
{
 
58
    Q_D(const ModemGsmSmsInterface);
 
59
    return_SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), QVariantMap(), get(index));
 
60
}
 
61
 
 
62
int Solid::Control::ModemGsmSmsInterface::getFormat() const
 
63
{
 
64
    Q_D(const ModemGsmSmsInterface);
 
65
    return_SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), -1, getFormat());
 
66
}
 
67
 
 
68
void Solid::Control::ModemGsmSmsInterface::setFormat(const int format) const
 
69
{
 
70
    Q_D(const ModemGsmSmsInterface);
 
71
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), setFormat(format));
 
72
}
 
73
 
 
74
QString Solid::Control::ModemGsmSmsInterface::getSmsc() const
 
75
{
 
76
    Q_D(const ModemGsmSmsInterface);
 
77
    return_SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), QString(), getSmsc());
 
78
}
 
79
 
 
80
QList<QVariantMap> Solid::Control::ModemGsmSmsInterface::list() const
 
81
{
 
82
    Q_D(const ModemGsmSmsInterface);
 
83
    return_SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), QList<QVariantMap>(), list());
 
84
}
 
85
 
 
86
void Solid::Control::ModemGsmSmsInterface::save(const QVariantMap & properties) const
 
87
{
 
88
    Q_D(const ModemGsmSmsInterface);
 
89
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), save(properties));
 
90
}
 
91
 
 
92
void Solid::Control::ModemGsmSmsInterface::send(const QVariantMap & properties) const
 
93
{
 
94
    Q_D(const ModemGsmSmsInterface);
 
95
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), send(properties));
 
96
}
 
97
 
 
98
void Solid::Control::ModemGsmSmsInterface::sendFromStorage(const int index) const
 
99
{
 
100
    Q_D(const ModemGsmSmsInterface);
 
101
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), sendFromStorage(index));
 
102
}
 
103
 
 
104
void Solid::Control::ModemGsmSmsInterface::setIndication(const int mode, const int mt, const int bm, const int ds, const int brf) const
 
105
{
 
106
    Q_D(const ModemGsmSmsInterface);
 
107
    SOLID_CALL(Ifaces::ModemGsmSmsInterface *, d->backendObject(), setIndication(mode, mt, bm, ds, brf));
 
108
}
 
109
 
 
110
void Solid::Control::ModemGsmSmsInterface::makeConnections(QObject * source)
 
111
{
 
112
    if (source) {
 
113
        QObject::connect(source, SIGNAL(smsReceived(int, bool)),
 
114
                this, SIGNAL(smsReceived(int, bool)));
 
115
        QObject::connect(source, SIGNAL(completed(int, bool)),
 
116
                this, SIGNAL(completed(int, bool)));
 
117
    }
 
118
}
 
119
 
 
120
void Solid::Control::ModemGsmSmsInterfacePrivate::setBackendObject(QObject *object)
 
121
{
 
122
    ModemInterfacePrivate::setBackendObject(object);
 
123
}
 
124
 
 
125
void Solid::Control::ModemGsmSmsInterface::_k_destroyed(QObject *object)
 
126
{
 
127
    Q_UNUSED(object);
 
128
}