Qt bindings for oFono cellular services 1.30
ofononetworkregistration.h
1/*
2 * This file is part of ofono-qt
3 *
4 * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
5 *
6 * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * version 2.1 as published by the Free Software Foundation.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#ifndef OFONONETWORKREGISTRATION_H
25#define OFONONETWORKREGISTRATION_H
26
27#include <QtCore/QObject>
28#include <QStringList>
29#include <QDBusError>
30#include <QDBusObjectPath>
31#include "ofonomodeminterface.h"
32#include "libofono-qt_global.h"
33
34struct OfonoOperatorStruct {
35 QDBusObjectPath path;
36 QVariantMap properties;
37};
38typedef QList<OfonoOperatorStruct> OfonoOperatorList;
39Q_DECLARE_METATYPE(OfonoOperatorStruct)
40Q_DECLARE_METATYPE(OfonoOperatorList)
41
42
47class OFONO_QT_EXPORT OfonoNetworkRegistration : public OfonoModemInterface
48{
49 Q_OBJECT
50
51 Q_PROPERTY(QString mode READ mode NOTIFY modeChanged)
52 Q_PROPERTY(QString status READ status NOTIFY statusChanged)
53 Q_PROPERTY(uint locationAreaCode READ locationAreaCode NOTIFY locationAreaCodeChanged)
54 Q_PROPERTY(uint cellId READ cellId NOTIFY cellIdChanged)
55 Q_PROPERTY(QString mcc READ mcc NOTIFY mccChanged)
56 Q_PROPERTY(QString mnc READ mnc NOTIFY mncChanged)
57 Q_PROPERTY(QString technology READ technology NOTIFY technologyChanged)
58 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
59 Q_PROPERTY(uint strength READ strength NOTIFY strengthChanged)
60 Q_PROPERTY(QString baseStation READ baseStation NOTIFY baseStationChanged)
61
62public:
63 OfonoNetworkRegistration(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
65
66 /* Properties */
67 QString mode() const;
68 QString status() const;
69 uint locationAreaCode() const;
70 uint cellId() const;
71 QString mcc() const;
72 QString mnc() const;
73 QString technology() const;
74 QString name() const;
75 uint strength() const;
76 QString baseStation() const;
77
78public Q_SLOTS:
79 void registerOp();
80 void getOperators();
81 void scan();
82
83Q_SIGNALS:
84 void modeChanged(const QString &mode);
85 void statusChanged(const QString &status);
86 void locationAreaCodeChanged(uint locationAreaCode);
87 void cellIdChanged(uint cellId);
88 void mccChanged(const QString &mcc);
89 void mncChanged(const QString &mnc);
90 void technologyChanged(const QString &technology);
91 void nameChanged(const QString &name);
92 void strengthChanged(uint strength);
93 void baseStationChanged(const QString &baseStation);
94
95 void registerComplete(bool success);
96 void getOperatorsComplete(bool success, const QStringList &operatorIds);
97 void scanComplete(bool success, const QStringList &operatorIds);
98
99private Q_SLOTS:
100 void propertyChanged(const QString& property, const QVariant& value);
101 void registerResp();
102 void registerErr(QDBusError error);
103 void getOperatorsResp(OfonoOperatorList list);
104 void getOperatorsErr(QDBusError error);
105 void scanResp(OfonoOperatorList list);
106 void scanErr(QDBusError error);
107
108private:
109
110};
111
112#endif /* !OFONONETWORKREGISTRATION_H */
This class implements a generic modem interface object.
Definition ofonomodeminterface.h:42
SelectionSetting
How the modem object should select a modem.
Definition ofonomodem.h:68
This class is used to access oFono network registration API.
Definition ofononetworkregistration.h:48