Qt 4.8
qofonoservice_linux_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QOFONOSERVICE_H
43 #define QOFONOSERVICE_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
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.
52 //
53 // We mean it.
54 //
55 
56 #include <QtDBus/QtDBus>
57 #include <QtDBus/QDBusConnection>
58 #include <QtDBus/QDBusError>
59 #include <QtDBus/QDBusInterface>
60 #include <QtDBus/QDBusMessage>
61 #include <QtDBus/QDBusReply>
62 
63 #include <QtDBus/QDBusPendingCallWatcher>
64 #include <QtDBus/QDBusObjectPath>
65 #include <QtDBus/QDBusContext>
66 #include <QMap>
67 
68 #ifndef QT_NO_BEARERMANAGEMENT
69 #ifndef QT_NO_DBUS
70 
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"
80 
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"
84 
85 
86 
88 
90 
92 {
95 };
99 
101 
103 {
104  Q_OBJECT
105 
106 public:
107 
108  QOfonoManagerInterface( QObject *parent = 0);
110 
111  QDBusObjectPath path() const;
112 
113  QVariantMap getProperties();
114  bool setProperty(const QString &name, const QDBusVariant &value);
115  QList <QDBusObjectPath> getModems();
116  QDBusObjectPath currentModem();
117 
118 Q_SIGNALS:
119  void propertyChanged(const QString &, const QDBusVariant &value);
120  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
121 protected:
122  void connectNotify(const char *signal);
123  void disconnectNotify(const char *signal);
124  QVariant getProperty(const QString &);
125 
126 };
127 
128 
129 class QOfonoDBusHelper: public QObject, protected QDBusContext
130  {
131  Q_OBJECT
132  public:
133  QOfonoDBusHelper(QObject *parent = 0);
134  ~QOfonoDBusHelper();
135 
136  public slots:
137  void propertyChanged(const QString &, const QDBusVariant &);
138  Q_SIGNALS:
139  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
140 };
141 
143 {
144  Q_OBJECT
145 
146 public:
147 
148  QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
150 
151  QVariantMap getProperties();
152  //properties
153  bool isPowered();
154  bool isOnline();
155  QString getName();
156  QString getManufacturer();
157  QString getModel();
158  QString getRevision();
159  QString getSerial();
160 
161  QStringList getFeatures(); //sms, sim
162  QStringList getInterfaces();
163  QString defaultInterface();
164 
165 protected:
166  void connectNotify(const char *signal);
167  void disconnectNotify(const char *signal);
168  QVariant getProperty(const QString &);
169 Q_SIGNALS:
170  void propertyChanged(const QString &, const QDBusVariant &value);
171  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
172 };
173 
174 
176 {
177  Q_OBJECT
178 
179 public:
180 
181  QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
183 
184  QVariantMap getProperties();
185 
186  //properties
187  QString getStatus();
188  quint16 getLac();
189  quint32 getCellId();
190  QString getTechnology();
191  QString getOperatorName();
192  int getSignalStrength();
193  QString getBaseStation();
194  QList <QDBusObjectPath> getOperators();
195 
196 protected:
197  void connectNotify(const char *signal);
198  void disconnectNotify(const char *signal);
199  QVariant getProperty(const QString &);
200 Q_SIGNALS:
201  void propertyChanged(const QString &, const QDBusVariant &value);
202  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
203 
204 };
205 
207 {
208  Q_OBJECT
209 
210 public:
211 //modem or operator paths
212  QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0);
214 
215  QVariantMap getProperties();
216 
217  //properties
218  QString getName();
219  QString getStatus();// "unknown", "available", "current" and "forbidden"
220  QString getMcc();
221  QString getMnc();
222  QStringList getTechnologies();
223 
224 protected:
225  void connectNotify(const char *signal);
226  void disconnectNotify(const char *signal);
227  QVariant getProperty(const QString &);
228 };
229 
231 {
232  Q_OBJECT
233 
234 public:
235 
236  QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0);
238 
239  QVariantMap getProperties();
240 
241  //properties
242  bool isPresent();
243  QString getHomeMcc();
244  QString getHomeMnc();
245 // QStringList subscriberNumbers();
246 // QMap<QString,QString> serviceNumbers();
247  QString pinRequired();
248  QString lockedPins();
249  QString cardIdentifier();
250 
251 protected:
252  void connectNotify(const char *signal);
253  void disconnectNotify(const char *signal);
254  QVariant getProperty(const QString &);
255 };
256 
257 
259 {
260  Q_OBJECT
261 
262 public:
263 
264  QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
266 
267  QVariantMap getProperties();
268 
269  //properties
270  QList<QDBusObjectPath> getPrimaryContexts();
271  bool isAttached();
272  bool isRoamingAllowed();
273  bool isPowered();
274 
275  bool setPower(bool on);
276 
277 protected:
278  void connectNotify(const char *signal);
279  void disconnectNotify(const char *signal);
280  QVariant getProperty(const QString &);
281 };
282 
283 
285 {
286  Q_OBJECT
287 
288 public:
289 
290  QOfonoPrimaryDataContextInterface(const QString &dbusPathName, QObject *parent = 0);
292 
293  QVariantMap getProperties();
294 
295  //properties
296  bool isActive();
297  QString getApName();
298  QString getType();
299  QString getName();
300  QVariantMap getSettings();
301  QString getInterface();
302  QString getAddress();
303 
304  bool setActive(bool on);
305  bool setApn(const QString &name);
306 
307 protected:
308  void connectNotify(const char *signal);
309  void disconnectNotify(const char *signal);
310  QVariant getProperty(const QString &);
311  bool setProp(const QString &, const QVariant &var);
312 };
313 
315 {
316  Q_OBJECT
317 
318 public:
319 
320  QOfonoSmsInterface(const QString &dbusModemPathName, QObject *parent = 0);
322 
323  QVariantMap getProperties();
324  void sendMessage(const QString &to, const QString &message);
325 
326  //properties
327  QString serviceCenterAddress();
328  bool useDeliveryReports();
329  QString bearer();
330 
331 protected:
332  void connectNotify(const char *signal);
333  void disconnectNotify(const char *signal);
334  QVariant getProperty(const QString &);
335 
336 Q_SIGNALS:
337  void propertyChanged(const QString &, const QDBusVariant &value);
338  void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
339  void immediateMessage(const QString &message, const QVariantMap &info);
340  void incomingMessage(const QString &message, const QVariantMap &info);
341 };
342 
344 
345 #endif // QT_NO_DBUS
346 #endif // QT_NO_BEARERMANAGEMENT
347 
348 #endif //QOFONOSERVICE_H
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QDBusContext class allows slots to determine the D-Bus context of the calls.
Definition: qdbuscontext.h:60
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
The QDBusAbstractInterface class is the base class for all D-Bus interfaces in the QtDBus binding...
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
const char * name
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
unsigned short quint16
Definition: qglobal.h:936
#define Q_OBJECT
Definition: qobjectdefs.h:157
#define Q_DECLARE_METATYPE(TYPE)
This macro makes the type Type known to QMetaType as long as it provides a public default constructor...
Definition: qmetatype.h:265
unsigned int quint32
Definition: qglobal.h:938
The QDBusObjectPath class enables the programmer to identify the OBJECT_PATH type provided by the D-B...
#define slots
Definition: qobjectdefs.h:68
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus type...
The QList class is a template class that provides lists.
Definition: qdatastream.h:62
QList< ObjectPathProperties > PathPropertiesList