2 * This file is part of ofono-qt
4 * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
6 * Contact: Alexander Kanavin <alexander.kanavin@nokia.com>
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.
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.
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
24 #ifndef OFONONETWORKREGISTRATION_H
25 #define OFONONETWORKREGISTRATION_H
27 #include <QtCore/QObject>
28 #include <QStringList>
30 #include <QDBusObjectPath>
31 #include "ofonomodeminterface.h"
32 #include "libofono-qt_global.h"
34 struct OfonoOperatorStruct {
36 QVariantMap properties;
38 typedef QList<OfonoOperatorStruct> OfonoOperatorList;
39 Q_DECLARE_METATYPE(OfonoOperatorStruct)
40 Q_DECLARE_METATYPE(OfonoOperatorList)
42 //! This class is used to access oFono network registration API
44 * The API is documented in
45 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/network-api.txt
47 class OFONO_QT_EXPORT OfonoNetworkRegistration : public OfonoModemInterface
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)
63 OfonoNetworkRegistration(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0);
64 ~OfonoNetworkRegistration();
68 QString status() const;
69 uint locationAreaCode() const;
73 QString technology() const;
75 uint strength() const;
76 QString baseStation() const;
83 void modeChanged(const QString &mode);
84 void statusChanged(const QString &status);
85 void locationAreaCodeChanged(uint locationAreaCode);
86 void cellIdChanged(uint cellId);
87 void mccChanged(const QString &mcc);
88 void mncChanged(const QString &mnc);
89 void technologyChanged(const QString &technology);
90 void nameChanged(const QString &name);
91 void strengthChanged(uint strength);
92 void baseStationChanged(const QString &baseStation);
94 void registerComplete(bool success);
95 void getOperatorsComplete(bool success, const QStringList &operatorIds);
96 void scanComplete(bool success, const QStringList &operatorIds);
99 void propertyChanged(const QString& property, const QVariant& value);
101 void registerErr(QDBusError error);
102 void getOperatorsResp(OfonoOperatorList list);
103 void getOperatorsErr(QDBusError error);
104 void scanResp(OfonoOperatorList list);
105 void scanErr(QDBusError error);
111 #endif /* !OFONONETWORKREGISTRATION_H */