2
* Copyright (C) 2012 Canonical, Ltd.
2
* Copyright (C) 2012-2013 Canonical, Ltd.
5
5
* Ugo Riboni <ugo.riboni@canonical.com>
7
* This file is part of telephony-app.
7
* This file is part of phone-app.
9
* telephony-app is free software; you can redistribute it and/or modify
9
* phone-app is free software; you can redistribute it and/or modify
10
10
* it under the terms of the GNU General Public License as published by
11
11
* the Free Software Foundation; version 3.
13
* telephony-app is distributed in the hope that it will be useful,
13
* phone-app is distributed in the hope that it will be useful,
14
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
16
* GNU General Public License for more details.
19
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
#include "telephonyappdbus.h"
23
#include "telephonyappadaptor.h"
22
#include "phoneappdbus.h"
23
#include "phoneappadaptor.h"
26
26
#include <QtDBus/QDBusConnection>
28
static const char* DBUS_SERVICE = "com.canonical.TelephonyApp";
29
static const char* DBUS_OBJECT_PATH = "/com/canonical/TelephonyApp";
28
static const char* DBUS_SERVICE = "com.canonical.PhoneApp";
29
static const char* DBUS_OBJECT_PATH = "/com/canonical/PhoneApp";
31
TelephonyAppDBus::TelephonyAppDBus(QObject* parent) : QObject(parent)
31
PhoneAppDBus::PhoneAppDBus(QObject* parent) : QObject(parent)
35
TelephonyAppDBus::~TelephonyAppDBus()
35
PhoneAppDBus::~PhoneAppDBus()
40
TelephonyAppDBus::connectToBus()
40
PhoneAppDBus::connectToBus()
42
42
bool ok = QDBusConnection::sessionBus().registerService(DBUS_SERVICE);
46
new TelephonyAppAdaptor(this);
46
new PhoneAppAdaptor(this);
47
47
QDBusConnection::sessionBus().registerObject(DBUS_OBJECT_PATH, this);
53
TelephonyAppDBus::ShowMessages(const QString &number)
53
PhoneAppDBus::ShowMessages(const QString &number)
55
55
Q_EMIT request(QString("message://%1").arg(number));
58
void TelephonyAppDBus::ShowMessage(const QString &messageId)
58
void PhoneAppDBus::ShowMessage(const QString &messageId)
60
60
Q_EMIT request(QString("messageId://%1").arg(messageId));
63
void TelephonyAppDBus::NewMessage()
63
void PhoneAppDBus::NewMessage()
65
65
Q_EMIT request(QString("message://"));
68
void TelephonyAppDBus::SendMessage(const QString &number, const QString &message)
68
void PhoneAppDBus::SendMessage(const QString &number, const QString &message)
70
70
Q_EMIT messageSendRequested(number, message);
73
void TelephonyAppDBus::ShowVoicemail()
73
void PhoneAppDBus::ShowVoicemail()
75
75
Q_EMIT request(QString("voicemail://"));
79
TelephonyAppDBus::CallNumber(const QString &number)
79
PhoneAppDBus::CallNumber(const QString &number)
81
81
Q_EMIT request(QString("call://%1").arg(number));
84
void TelephonyAppDBus::SendAppMessage(const QString &message)
84
void PhoneAppDBus::SendAppMessage(const QString &message)
86
86
Q_EMIT request(message);