~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to handler/tests/handlercontroller.cpp

  • Committer: Michael Terry
  • Date: 2014-01-29 15:16:16 UTC
  • mfrom: (766 trunk)
  • mto: This revision was merged to the branch mainline in revision 769.
  • Revision ID: michael.terry@canonical.com-20140129151616-63986zad796m4gtl
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright (C) 2013 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU General Public License version 3, as published by
 
6
 * the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
 
9
 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
 
10
 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authors:
 
17
 *  Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
 
18
 */
 
19
 
 
20
#include "handlercontroller.h"
 
21
 
 
22
#define HANDLER_SERVICE "com.canonical.TelephonyServiceHandler"
 
23
#define HANDLER_OBJECT "/com/canonical/TelephonyServiceHandler"
 
24
#define HANDLER_INTERFACE "com.canonical.TelephonyServiceHandler"
 
25
 
 
26
HandlerController *HandlerController::instance()
 
27
{
 
28
    static HandlerController *self = new HandlerController();
 
29
    return self;
 
30
}
 
31
 
 
32
HandlerController::HandlerController(QObject *parent) :
 
33
    QObject(parent),
 
34
    mHandlerInterface(HANDLER_SERVICE, HANDLER_OBJECT, HANDLER_INTERFACE)
 
35
{
 
36
}
 
37
 
 
38
void HandlerController::startCall(const QString &number)
 
39
{
 
40
    mHandlerInterface.call("StartCall", number);
 
41
}
 
42
 
 
43
void HandlerController::hangUpCall(const QString &objectPath)
 
44
{
 
45
    mHandlerInterface.call("HangUpCall", objectPath);
 
46
}
 
47
 
 
48
void HandlerController::setHold(const QString &objectPath, bool hold)
 
49
{
 
50
    mHandlerInterface.call("SetHold", objectPath, hold);
 
51
}
 
52
 
 
53
void HandlerController::setMuted(const QString &objectPath, bool muted)
 
54
{
 
55
    mHandlerInterface.call("SetMuted", objectPath, muted);
 
56
}
 
57
 
 
58
void HandlerController::setSpeakerMode(const QString &objectPath, bool enabled)
 
59
{
 
60
    mHandlerInterface.call("SetSpeakerMode", objectPath, enabled);
 
61
}
 
62
 
 
63
void HandlerController::sendDTMF(const QString &objectPath, const QString &key)
 
64
{
 
65
    mHandlerInterface.call("SendDTMF", objectPath, key);
 
66
}
 
67
 
 
68
void HandlerController::sendMessage(const QString &number, const QString &message)
 
69
{
 
70
    mHandlerInterface.call("SendMessage", number, message);
 
71
}
 
72
 
 
73
void HandlerController::acknowledgeMessages(const QString &number, const QStringList &messageIds)
 
74
{
 
75
    mHandlerInterface.call("AcknowledgeMessages", number, messageIds);
 
76
}