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 Lesser 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
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authors: Tiago Salem Herrmann <tiago.herrmann@canonical.com>
17
* Gustavo Pichorim Boiko <gustavo.boiko@gmail.com>
20
#ifndef OFONOEMERGENCYMODEIFACE_H
21
#define OFONOEMERGENCYMODEIFACE_H
24
#include <TelepathyQt/Constants>
25
#include <TelepathyQt/BaseConnection>
26
#include <TelepathyQt/AbstractAdaptor>
27
#include <TelepathyQt/DBusError>
28
#include <TelepathyQt/Callbacks>
30
class BaseConnectionEmergencyModeInterface;
32
typedef Tp::SharedPtr<BaseConnectionEmergencyModeInterface> BaseConnectionEmergencyModeInterfacePtr;
34
#define TP_QT_IFACE_CONNECTION_EMERGENCYMODE "com.canonical.Telephony.EmergencyMode"
36
class TP_QT_EXPORT BaseConnectionEmergencyModeInterface : public Tp::AbstractConnectionInterface
39
Q_DISABLE_COPY(BaseConnectionEmergencyModeInterface)
42
static BaseConnectionEmergencyModeInterfacePtr create() {
43
return BaseConnectionEmergencyModeInterfacePtr(new BaseConnectionEmergencyModeInterface());
45
template<typename BaseConnectionEmergencyModeInterfaceSubclass>
46
static Tp::SharedPtr<BaseConnectionEmergencyModeInterfaceSubclass> create() {
47
return Tp::SharedPtr<BaseConnectionEmergencyModeInterfaceSubclass>(
48
new BaseConnectionEmergencyModeInterfaceSubclass());
50
QVariantMap immutableProperties() const;
51
virtual ~BaseConnectionEmergencyModeInterface();
53
typedef Tp::Callback1<QStringList, Tp::DBusError*> EmergencyNumbersCallback;
54
void setEmergencyNumbersCallback(const EmergencyNumbersCallback &cb);
57
void setEmergencyNumbers(const QStringList &numbers);
60
BaseConnectionEmergencyModeInterface();
68
friend struct Private;
73
class TP_QT_EXPORT ConnectionInterfaceEmergencyModeAdaptor : public Tp::AbstractAdaptor
76
Q_CLASSINFO("D-Bus Interface", TP_QT_IFACE_CONNECTION_EMERGENCYMODE)
77
Q_CLASSINFO("D-Bus Introspection", ""
78
" <interface name=\"com.canonical.Telephony.EmergencyMode\">\n"
79
" <method name=\"EmergencyNumbers\">\n"
80
" <arg direction=\"out\" type=\"as\" name=\"emergencyNumbers\"/>\n"
82
" <signal name=\"EmergencyNumbersChanged\">\n"
83
" <arg type=\"as\" name=\"numbers\"/>\n"
89
ConnectionInterfaceEmergencyModeAdaptor(const QDBusConnection& dbusConnection, QObject* adaptee, QObject* parent);
90
virtual ~ConnectionInterfaceEmergencyModeAdaptor();
92
typedef Tp::MethodInvocationContextPtr< QStringList > EmergencyNumbersContextPtr;
94
public Q_SLOTS: // METHODS
95
QStringList EmergencyNumbers(const QDBusMessage& dbusMessage);
98
void EmergencyNumbersChanged(const QStringList &numbers);
102
class TP_QT_NO_EXPORT BaseConnectionEmergencyModeInterface::Adaptee : public QObject
107
Adaptee(BaseConnectionEmergencyModeInterface *interface);
111
void emergencyNumbers(const ConnectionInterfaceEmergencyModeAdaptor::EmergencyNumbersContextPtr &context);
114
void emergencyNumbersChanged(const QStringList &numbers);
117
BaseConnectionEmergencyModeInterface *mInterface;