~phablet-team/telephony-service/rtm-15.04

« back to all changes in this revision

Viewing changes to phoneappdbus.cpp

  • Committer: Gustavo Pichorim Boiko
  • Date: 2013-03-12 18:15:29 UTC
  • mto: This revision was merged to the branch mainline in revision 610.
  • Revision ID: gustavo.boiko@canonical.com-20130312181529-rabifvte8sfls914
Rename the main app files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2012 Canonical, Ltd.
 
2
 * Copyright (C) 2012-2013 Canonical, Ltd.
3
3
 *
4
4
 * Authors:
5
5
 *  Ugo Riboni <ugo.riboni@canonical.com>
6
6
 *
7
 
 * This file is part of telephony-app.
 
7
 * This file is part of phone-app.
8
8
 *
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.
12
12
 *
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/>.
20
20
 */
21
21
 
22
 
#include "telephonyappdbus.h"
23
 
#include "telephonyappadaptor.h"
 
22
#include "phoneappdbus.h"
 
23
#include "phoneappadaptor.h"
24
24
 
25
25
// Qt
26
26
#include <QtDBus/QDBusConnection>
27
27
 
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";
30
30
 
31
 
TelephonyAppDBus::TelephonyAppDBus(QObject* parent) : QObject(parent)
 
31
PhoneAppDBus::PhoneAppDBus(QObject* parent) : QObject(parent)
32
32
{
33
33
}
34
34
 
35
 
TelephonyAppDBus::~TelephonyAppDBus()
 
35
PhoneAppDBus::~PhoneAppDBus()
36
36
{
37
37
}
38
38
 
39
39
bool
40
 
TelephonyAppDBus::connectToBus()
 
40
PhoneAppDBus::connectToBus()
41
41
{
42
42
    bool ok = QDBusConnection::sessionBus().registerService(DBUS_SERVICE);
43
43
    if (!ok) {
44
44
        return false;
45
45
    }
46
 
    new TelephonyAppAdaptor(this);
 
46
    new PhoneAppAdaptor(this);
47
47
    QDBusConnection::sessionBus().registerObject(DBUS_OBJECT_PATH, this);
48
48
 
49
49
    return true;
50
50
}
51
51
 
52
52
void
53
 
TelephonyAppDBus::ShowMessages(const QString &number)
 
53
PhoneAppDBus::ShowMessages(const QString &number)
54
54
{
55
55
    Q_EMIT request(QString("message://%1").arg(number));
56
56
}
57
57
 
58
 
void TelephonyAppDBus::ShowMessage(const QString &messageId)
 
58
void PhoneAppDBus::ShowMessage(const QString &messageId)
59
59
{
60
60
    Q_EMIT request(QString("messageId://%1").arg(messageId));
61
61
}
62
62
 
63
 
void TelephonyAppDBus::NewMessage()
 
63
void PhoneAppDBus::NewMessage()
64
64
{
65
65
    Q_EMIT request(QString("message://"));
66
66
}
67
67
 
68
 
void TelephonyAppDBus::SendMessage(const QString &number, const QString &message)
 
68
void PhoneAppDBus::SendMessage(const QString &number, const QString &message)
69
69
{
70
70
    Q_EMIT messageSendRequested(number, message);
71
71
}
72
72
 
73
 
void TelephonyAppDBus::ShowVoicemail()
 
73
void PhoneAppDBus::ShowVoicemail()
74
74
{
75
75
    Q_EMIT request(QString("voicemail://"));
76
76
}
77
77
 
78
78
void
79
 
TelephonyAppDBus::CallNumber(const QString &number)
 
79
PhoneAppDBus::CallNumber(const QString &number)
80
80
{
81
81
    Q_EMIT request(QString("call://%1").arg(number));
82
82
}
83
83
 
84
 
void TelephonyAppDBus::SendAppMessage(const QString &message)
 
84
void PhoneAppDBus::SendAppMessage(const QString &message)
85
85
{
86
86
    Q_EMIT request(message);
87
87
}