Debian Codegraph @

tests/mocks/Lomiri/Telephony/MockTelepathyHelper.cpp

raw
1 /*
2 * Copyright (C) 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU 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 * Authored by: Nick Dedekind <[email protected]
17 */
18
19 #include "MockTelepathyHelper.h"
20
21 MockTelepathyHelper::MockTelepathyHelper(QObject *parent)
22 : QObject(parent)
23 , m_ready(true)
24 , m_emergencyCallsAvailable(true)
25 {
26 }
27
28 MockTelepathyHelper *MockTelepathyHelper::instance()
29 {
30 static MockTelepathyHelper* helper = new MockTelepathyHelper();
31 return helper;
32 }
33
34 void MockTelepathyHelper::registerChannelObserver(const QString& name)
35 {
36 Q_UNUSED(name);
37 }
38
39 bool MockTelepathyHelper::ready() const
40 {
41 return m_ready;
42 }
43
44 void MockTelepathyHelper::setReady(bool value)
45 {
46 if (m_ready != value) {
47 m_ready = value;
48 Q_EMIT readyChanged();
49 }
50 }
51 bool MockTelepathyHelper::emergencyCallsAvailable() const
52 {
53 return m_emergencyCallsAvailable;
54 }
55
56 void MockTelepathyHelper::setEmergencyCallsAvailable(bool value)
57 {
58 if (m_emergencyCallsAvailable != value) {
59 m_emergencyCallsAvailable = value;
60 Q_EMIT emergencyCallsAvailableChanged();
61 }
62 }