2
* Copyright (C) 2013 Canonical, Ltd.
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.
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.
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/>.
17
* Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
20
#include "handlercontroller.h"
22
#define HANDLER_SERVICE "com.canonical.TelephonyServiceHandler"
23
#define HANDLER_OBJECT "/com/canonical/TelephonyServiceHandler"
24
#define HANDLER_INTERFACE "com.canonical.TelephonyServiceHandler"
26
HandlerController *HandlerController::instance()
28
static HandlerController *self = new HandlerController();
32
HandlerController::HandlerController(QObject *parent) :
34
mHandlerInterface(HANDLER_SERVICE, HANDLER_OBJECT, HANDLER_INTERFACE)
38
void HandlerController::startCall(const QString &number)
40
mHandlerInterface.call("StartCall", number);
43
void HandlerController::hangUpCall(const QString &objectPath)
45
mHandlerInterface.call("HangUpCall", objectPath);
48
void HandlerController::setHold(const QString &objectPath, bool hold)
50
mHandlerInterface.call("SetHold", objectPath, hold);
53
void HandlerController::setMuted(const QString &objectPath, bool muted)
55
mHandlerInterface.call("SetMuted", objectPath, muted);
58
void HandlerController::setSpeakerMode(const QString &objectPath, bool enabled)
60
mHandlerInterface.call("SetSpeakerMode", objectPath, enabled);
63
void HandlerController::sendDTMF(const QString &objectPath, const QString &key)
65
mHandlerInterface.call("SendDTMF", objectPath, key);
68
void HandlerController::sendMessage(const QString &number, const QString &message)
70
mHandlerInterface.call("SendMessage", number, message);
73
void HandlerController::acknowledgeMessages(const QString &number, const QStringList &messageIds)
75
mHandlerInterface.call("AcknowledgeMessages", number, messageIds);