1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the plugins of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
42 #ifndef QOFONOSERVICE_H
43 #define QOFONOSERVICE_H
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
56 #include <QtDBus/QtDBus>
57 #include <QtDBus/QDBusConnection>
58 #include <QtDBus/QDBusError>
59 #include <QtDBus/QDBusInterface>
60 #include <QtDBus/QDBusMessage>
61 #include <QtDBus/QDBusReply>
63 #include <QtDBus/QDBusPendingCallWatcher>
64 #include <QtDBus/QDBusObjectPath>
65 #include <QtDBus/QDBusContext>
68 #ifndef QT_NO_BEARERMANAGEMENT
71 #define OFONO_SERVICE "org.ofono"
72 #define OFONO_MANAGER_INTERFACE "org.ofono.Manager"
73 #define OFONO_MANAGER_PATH "/"
74 #define OFONO_MODEM_INTERFACE "org.ofono.Modem"
75 #define OFONO_NETWORK_REGISTRATION_INTERFACE "org.ofono.NetworkRegistration"
76 #define OFONO_NETWORK_OPERATOR_INTERFACE "org.ofono.NetworkOperator"
77 #define OFONO_DATA_CONNECTION_MANAGER_INTERFACE "org.ofono.DataConnectionManager"
78 #define OFONO_SIM_MANAGER_INTERFACE "org.ofono.SimManager"
79 #define OFONO_DATA_CONTEXT_INTERFACE "org.ofono.PrimaryDataContext"
81 #define OFONO_SMS_MANAGER_INTERFACE "org.ofono.SmsManager"
82 #define OFONO_PHONEBOOK_INTERFACE "org.ofono.Phonebook"
83 #define OFONO_MESSAGE_WAITING_INTERFACE "org.ofono.MessageWaiting"
94 class QOfonoManagerInterface : public QDBusAbstractInterface
100 QOfonoManagerInterface( QObject *parent = 0);
101 ~QOfonoManagerInterface();
103 QDBusObjectPath path() const;
105 QVariantMap getProperties();
106 bool setProperty(const QString &name, const QDBusVariant &value);
107 QList <QDBusObjectPath> getModems();
108 QDBusObjectPath currentModem();
111 void propertyChanged(const QString &, const QDBusVariant &value);
112 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
114 void connectNotify(const QMetaMethod &signal);
115 void disconnectNotify(const QMetaMethod &signal);
116 QVariant getProperty(const QString &);
121 class QOfonoDBusHelper: public QObject, protected QDBusContext
125 QOfonoDBusHelper(QObject *parent = 0);
129 void propertyChanged(const QString &, const QDBusVariant &);
131 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
134 class QOfonoModemInterface : public QDBusAbstractInterface
140 explicit QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
141 ~QOfonoModemInterface();
143 QVariantMap getProperties();
148 QString getManufacturer();
150 QString getRevision();
153 QStringList getFeatures(); //sms, sim
154 QStringList getInterfaces();
155 QString defaultInterface();
158 void connectNotify(const QMetaMethod &signal);
159 void disconnectNotify(const QMetaMethod &signal);
160 QVariant getProperty(const QString &);
162 void propertyChanged(const QString &, const QDBusVariant &value);
163 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
167 class QOfonoNetworkRegistrationInterface : public QDBusAbstractInterface
173 explicit QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
174 ~QOfonoNetworkRegistrationInterface();
176 QVariantMap getProperties();
182 QString getTechnology();
183 QString getOperatorName();
184 int getSignalStrength();
185 QString getBaseStation();
186 QList <QDBusObjectPath> getOperators();
189 void connectNotify(const QMetaMethod &signal);
190 void disconnectNotify(const QMetaMethod &signal);
191 QVariant getProperty(const QString &);
193 void propertyChanged(const QString &, const QDBusVariant &value);
194 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
198 class QOfonoNetworkOperatorInterface : public QDBusAbstractInterface
203 //modem or operator paths
204 explicit QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0);
205 ~QOfonoNetworkOperatorInterface();
207 QVariantMap getProperties();
211 QString getStatus();// "unknown", "available", "current" and "forbidden"
214 QStringList getTechnologies();
217 void connectNotify(const QMetaMethod &signal);
218 void disconnectNotify(const QMetaMethod &signal);
219 QVariant getProperty(const QString &);
222 class QOfonoSimInterface : public QDBusAbstractInterface
228 explicit QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0);
229 ~QOfonoSimInterface();
231 QVariantMap getProperties();
235 QString getHomeMcc();
236 QString getHomeMnc();
237 // QStringList subscriberNumbers();
238 // QMap<QString,QString> serviceNumbers();
239 QString pinRequired();
240 QString lockedPins();
241 QString cardIdentifier();
244 void connectNotify(const QMetaMethod &signal);
245 void disconnectNotify(const QMetaMethod &signal);
246 QVariant getProperty(const QString &);
250 class QOfonoDataConnectionManagerInterface : public QDBusAbstractInterface
256 explicit QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
257 ~QOfonoDataConnectionManagerInterface();
259 QVariantMap getProperties();
262 QList<QDBusObjectPath> getPrimaryContexts();
264 bool isRoamingAllowed();
267 bool setPower(bool on);
270 void connectNotify(const QMetaMethod &signal);
271 void disconnectNotify(const QMetaMethod &signal);
272 QVariant getProperty(const QString &);
276 class QOfonoPrimaryDataContextInterface : public QDBusAbstractInterface
282 explicit QOfonoPrimaryDataContextInterface(const QString &dbusPathName, QObject *parent = 0);
283 ~QOfonoPrimaryDataContextInterface();
285 QVariantMap getProperties();
292 QVariantMap getSettings();
293 QString getInterface();
294 QString getAddress();
296 bool setActive(bool on);
297 bool setApn(const QString &name);
300 void connectNotify(const QMetaMethod &signal);
301 void disconnectNotify(const QMetaMethod &signal);
302 QVariant getProperty(const QString &);
303 bool setProp(const QString &, const QVariant &var);
306 class QOfonoSmsInterface : public QDBusAbstractInterface
312 explicit QOfonoSmsInterface(const QString &dbusModemPathName, QObject *parent = 0);
313 ~QOfonoSmsInterface();
315 QVariantMap getProperties();
316 void sendMessage(const QString &to, const QString &message);
319 QString serviceCenterAddress();
320 bool useDeliveryReports();
324 void connectNotify(const QMetaMethod &signal);
325 void disconnectNotify(const QMetaMethod &signal);
326 QVariant getProperty(const QString &);
329 void propertyChanged(const QString &, const QDBusVariant &value);
330 void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
331 void immediateMessage(const QString &message, const QVariantMap &info);
332 void incomingMessage(const QString &message, const QVariantMap &info);
338 #endif // QT_NO_BEARERMANAGEMENT
340 #endif //QOFONOSERVICE_H