Mark (non-public API's) ctor's as explicit
[profile/ivi/qtbase.git] / src / plugins / bearer / connman / qofonoservice_linux_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
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.
16 **
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.
20 **
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.
28 **
29 ** Other Usage
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.
32 **
33 **
34 **
35 **
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
87 QT_BEGIN_NAMESPACE
88
89 QT_END_NAMESPACE
90
91
92 QT_BEGIN_NAMESPACE
93
94 class QOfonoManagerInterface : public  QDBusAbstractInterface
95 {
96     Q_OBJECT
97
98 public:
99
100     QOfonoManagerInterface( QObject *parent = 0);
101     ~QOfonoManagerInterface();
102
103      QDBusObjectPath path() const;
104
105     QVariantMap getProperties();
106     bool setProperty(const QString &name, const QDBusVariant &value);
107     QList <QDBusObjectPath> getModems();
108     QDBusObjectPath currentModem();
109
110 Q_SIGNALS:
111     void propertyChanged(const QString &, const QDBusVariant &value);
112     void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
113 protected:
114     void connectNotify(const QMetaMethod &signal);
115     void disconnectNotify(const QMetaMethod &signal);
116     QVariant getProperty(const QString &);
117
118 };
119
120
121 class QOfonoDBusHelper: public QObject, protected QDBusContext
122  {
123      Q_OBJECT
124  public:
125     QOfonoDBusHelper(QObject *parent = 0);
126     ~QOfonoDBusHelper();
127
128  public slots:
129     void propertyChanged(const QString &, const QDBusVariant &);
130  Q_SIGNALS:
131     void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
132 };
133
134 class QOfonoModemInterface : public QDBusAbstractInterface
135 {
136     Q_OBJECT
137
138 public:
139
140     explicit QOfonoModemInterface(const QString &dbusModemPathName, QObject *parent = 0);
141     ~QOfonoModemInterface();
142
143     QVariantMap getProperties();
144     //properties
145     bool isPowered();
146     bool isOnline();
147     QString getName();
148     QString getManufacturer();
149     QString getModel();
150     QString getRevision();
151     QString getSerial();
152
153     QStringList getFeatures(); //sms, sim
154     QStringList getInterfaces();
155     QString defaultInterface();
156
157 protected:
158     void connectNotify(const QMetaMethod &signal);
159     void disconnectNotify(const QMetaMethod &signal);
160     QVariant getProperty(const QString &);
161 Q_SIGNALS:
162     void propertyChanged(const QString &, const QDBusVariant &value);
163     void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
164 };
165
166
167 class QOfonoNetworkRegistrationInterface : public QDBusAbstractInterface
168 {
169     Q_OBJECT
170
171 public:
172
173     explicit QOfonoNetworkRegistrationInterface(const QString &dbusModemPathName, QObject *parent = 0);
174     ~QOfonoNetworkRegistrationInterface();
175
176     QVariantMap getProperties();
177
178     //properties
179     QString getStatus();
180     quint16 getLac();
181     quint32 getCellId();
182     QString getTechnology();
183     QString getOperatorName();
184     int getSignalStrength();
185     QString getBaseStation();
186     QList <QDBusObjectPath> getOperators();
187
188 protected:
189     void connectNotify(const QMetaMethod &signal);
190     void disconnectNotify(const QMetaMethod &signal);
191     QVariant getProperty(const QString &);
192 Q_SIGNALS:
193     void propertyChanged(const QString &, const QDBusVariant &value);
194     void propertyChangedContext(const QString &,const QString &,const QDBusVariant &);
195
196 };
197
198 class QOfonoNetworkOperatorInterface : public QDBusAbstractInterface
199 {
200     Q_OBJECT
201
202 public:
203 //modem or operator paths
204     explicit QOfonoNetworkOperatorInterface(const QString &dbusPathName, QObject *parent = 0);
205     ~QOfonoNetworkOperatorInterface();
206
207     QVariantMap getProperties();
208
209     //properties
210     QString getName();
211     QString getStatus();// "unknown", "available", "current" and "forbidden"
212     QString getMcc();
213     QString getMnc();
214     QStringList getTechnologies();
215
216 protected:
217     void connectNotify(const QMetaMethod &signal);
218     void disconnectNotify(const QMetaMethod &signal);
219     QVariant getProperty(const QString &);
220 };
221
222 class QOfonoSimInterface : public QDBusAbstractInterface
223 {
224     Q_OBJECT
225
226 public:
227
228     explicit QOfonoSimInterface(const QString &dbusModemPathName, QObject *parent = 0);
229     ~QOfonoSimInterface();
230
231     QVariantMap getProperties();
232
233     //properties
234     bool isPresent();
235     QString getHomeMcc();
236     QString getHomeMnc();
237 //    QStringList subscriberNumbers();
238 //    QMap<QString,QString> serviceNumbers();
239     QString pinRequired();
240     QString lockedPins();
241     QString cardIdentifier();
242
243 protected:
244     void connectNotify(const QMetaMethod &signal);
245     void disconnectNotify(const QMetaMethod &signal);
246     QVariant getProperty(const QString &);
247 };
248
249
250 class QOfonoDataConnectionManagerInterface : public QDBusAbstractInterface
251 {
252     Q_OBJECT
253
254 public:
255
256     explicit QOfonoDataConnectionManagerInterface(const QString &dbusPathName, QObject *parent = 0);
257     ~QOfonoDataConnectionManagerInterface();
258
259     QVariantMap getProperties();
260
261     //properties
262     QList<QDBusObjectPath> getPrimaryContexts();
263     bool isAttached();
264     bool isRoamingAllowed();
265     bool isPowered();
266
267     bool setPower(bool on);
268
269 protected:
270     void connectNotify(const QMetaMethod &signal);
271     void disconnectNotify(const QMetaMethod &signal);
272     QVariant getProperty(const QString &);
273 };
274
275
276 class QOfonoPrimaryDataContextInterface : public QDBusAbstractInterface
277 {
278     Q_OBJECT
279
280 public:
281
282     explicit QOfonoPrimaryDataContextInterface(const QString &dbusPathName, QObject *parent = 0);
283     ~QOfonoPrimaryDataContextInterface();
284
285     QVariantMap getProperties();
286
287     //properties
288     bool isActive();
289     QString getApName();
290     QString getType();
291     QString getName();
292     QVariantMap getSettings();
293     QString getInterface();
294     QString getAddress();
295
296     bool setActive(bool on);
297     bool setApn(const QString &name);
298
299 protected:
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);
304 };
305
306 class QOfonoSmsInterface : public QDBusAbstractInterface
307 {
308     Q_OBJECT
309
310 public:
311
312     explicit QOfonoSmsInterface(const QString &dbusModemPathName, QObject *parent = 0);
313     ~QOfonoSmsInterface();
314
315     QVariantMap getProperties();
316     void sendMessage(const QString &to, const QString &message);
317
318     //properties
319     QString  serviceCenterAddress();
320     bool useDeliveryReports();
321     QString bearer();
322
323 protected:
324     void connectNotify(const QMetaMethod &signal);
325     void disconnectNotify(const QMetaMethod &signal);
326     QVariant getProperty(const QString &);
327
328 Q_SIGNALS:
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);
333 };
334
335 QT_END_NAMESPACE
336
337 #endif // QT_NO_DBUS
338 #endif // QT_NO_BEARERMANAGEMENT
339
340 #endif //QOFONOSERVICE_H