2
Copyright 2008 Will Stephenson <wstephenson@kde.org>
3
Copyright 2010 Lamarque Souza <lamarque@gmail.com>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of
7
the License or (at your option) version 3 or any later version
8
accepted by the membership of KDE e.V. (or its successor approved
9
by the membership of KDE e.V.), which shall act as a proxy
10
defined in Section 14 of version 3 of the license.
12
This program 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
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include "modemgsmcontactsinterface.h"
23
#include "modemgsmcontactsinterface_p.h"
27
MMModemGsmContactsInterfacePrivate::MMModemGsmContactsInterfacePrivate(const QString &path, QObject *owner)
28
: MMModemInterfacePrivate(path, owner), modemGsmContactsIface(MMModemManager::DBUS_SERVICE, path, QDBusConnection::systemBus())
32
MMModemGsmContactsInterface::MMModemGsmContactsInterface(const QString & path, MMModemManager * manager, QObject * parent)
33
: MMModemInterface(*new MMModemGsmContactsInterfacePrivate(path, this), manager, parent)
37
MMModemGsmContactsInterface::~MMModemGsmContactsInterface()
41
int MMModemGsmContactsInterface::addContact(const QString & name, const QString & number)
43
Q_D(MMModemGsmContactsInterface);
44
QDBusReply<uint> index = d->modemGsmContactsIface.Add(name, number);
46
if (index.isValid()) {
52
void MMModemGsmContactsInterface::deleteContact(const int index)
54
Q_D(MMModemGsmContactsInterface);
55
d->modemGsmContactsIface.Delete(index);
58
ContactType MMModemGsmContactsInterface::get(const int index)
60
Q_D(MMModemGsmContactsInterface);
61
QDBusReply<ContactType> contact = d->modemGsmContactsIface.Get(index);
63
if (contact.isValid()) {
64
return contact.value();
70
Solid::Control::ModemGsmContactsInterface::ContactTypeList MMModemGsmContactsInterface::list()
72
Q_D(MMModemGsmContactsInterface);
73
QDBusReply<ContactTypeList> contacts = d->modemGsmContactsIface.List();
75
if (contacts.isValid()) {
76
return contacts.value();
79
return ContactTypeList();
82
Solid::Control::ModemGsmContactsInterface::ContactTypeList MMModemGsmContactsInterface::find(const QString & pattern)
84
Q_D(MMModemGsmContactsInterface);
85
QDBusReply<ContactTypeList > contacts = d->modemGsmContactsIface.Find(pattern);
87
if (contacts.isValid()) {
88
return contacts.value();
91
return ContactTypeList();
94
int MMModemGsmContactsInterface::getCount()
96
Q_D(MMModemGsmContactsInterface);
97
QDBusReply<uint> count = d->modemGsmContactsIface.GetCount();
99
if (count.isValid()) {
100
return count.value();
106
#include "modemgsmcontactsinterface.moc"