~ken-vandine/libqofono/0.90-suggests

3 by Lorn Potter
2nd initial commit. Long Live QOfono!
1
/****************************************************************************
2
**
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
3
** Copyright (C) 2013-2014 Jolla Ltd.
13 by Lorn Potter
change email
4
** Contact: lorn.potter@jollamobile.com
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
5
**
6
** GNU Lesser General Public License Usage
7
** Alternatively, this file may be used under the terms of the GNU Lesser
8
** General Public License version 2.1 as published by the Free Software
9
** Foundation and appearing in the file LICENSE.LGPL included in the
10
** packaging of this file.  Please review the following information to
11
** ensure the GNU Lesser General Public License version 2.1 requirements
12
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
13
**
14
****************************************************************************/
15
16
#ifndef QOFONONETWORKREGISTRATION_H
17
#define QOFONONETWORKREGISTRATION_H
18
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
19
#include "qofonomodeminterface.h"
20
#include "qofononetworkoperator.h"
20 by Lorn Potter
fix export visibility and correct dbus type in xml/class manager
21
#include "qofono_global.h"
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
22
37 by Lorn Potter
add url to ofono documentation
23
//! This class is used to access ofono network operator API
24
/*!
25
 * The API is documented in
26
 * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/network-api.txt
27
 */
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
28
class QOFONOSHARED_EXPORT QOfonoNetworkRegistration : public QOfonoModemInterface
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
29
{
30
    Q_OBJECT
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
31
    Q_PROPERTY(bool scanning READ scanning NOTIFY scanningChanged)
77.1.1 by Samuel Nevala
[libqofono] Fix notifier for OOfonoNetworkRegistration::mode.
32
    Q_PROPERTY(QString mode READ mode NOTIFY modeChanged)
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
33
    Q_PROPERTY(QString status READ status NOTIFY statusChanged)
34
    Q_PROPERTY(uint locationAreaCode READ locationAreaCode NOTIFY locationAreaCodeChanged)
35
    Q_PROPERTY(uint cellId READ cellId NOTIFY cellIdChanged)
36
    Q_PROPERTY(QString mcc READ mcc NOTIFY mccChanged)
37
    Q_PROPERTY(QString mnc READ mnc NOTIFY mncChanged)
38
    Q_PROPERTY(QString technology READ technology NOTIFY technologyChanged)
39
    Q_PROPERTY(QString name READ name NOTIFY nameChanged)
40
    Q_PROPERTY(uint strength READ strength NOTIFY strengthChanged)
41
    Q_PROPERTY(QString baseStation READ baseStation NOTIFY baseStationChanged)
42
27 by Lorn Potter
add currentOperator to net reg and other fixes
43
    Q_PROPERTY(QStringList networkOperators READ networkOperators NOTIFY networkOperatorsChanged)
28 by Lorn Potter
various fixes needed for qml settings
44
    Q_PROPERTY(QString currentOperatorPath READ currentOperatorPath NOTIFY currentOperatorPathChanged)
27 by Lorn Potter
add currentOperator to net reg and other fixes
45
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
46
public:
47
    explicit QOfonoNetworkRegistration(QObject *parent = 0);
48
    ~QOfonoNetworkRegistration();
49
    
171.1.2 by Slava Monich
[libqofono] Restore public ABI
50
    QString modemPath() const;
51
    void setModemPath(const QString &path);
52
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
53
    QString mode() const;
54
    QString status() const;
55
    uint locationAreaCode() const;
56
    uint cellId() const;
57
    QString mcc() const;
58
    QString mnc() const;
59
    QString technology() const;
60
    QString name() const;
61
    uint strength() const;
62
    QString baseStation() const;
63
171.1.2 by Slava Monich
[libqofono] Restore public ABI
64
    QStringList networkOperators(); // For ABI compatibility
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
65
    QStringList networkOperators() const;
66
    QOfonoNetworkOperator* networkOperator(const QString &path) const;
27 by Lorn Potter
add currentOperator to net reg and other fixes
67
8 by Lorn Potter
fix contexts and modems bug
68
    Q_INVOKABLE void registration();
69
    Q_INVOKABLE void scan();
70
28 by Lorn Potter
various fixes needed for qml settings
71
    QString currentOperatorPath();
27 by Lorn Potter
add currentOperator to net reg and other fixes
72
59 by Lorn Potter
[libqofono] add isValid to many classes.
73
    bool isValid() const;
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
74
    bool scanning() const;
75
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
76
Q_SIGNALS:
77
    void modeChanged(const QString &mode);
78
    void statusChanged(const QString &status);
79
    void locationAreaCodeChanged(uint locationAreaCode);
80
    void cellIdChanged(uint cellId);
81
    void mccChanged(const QString &mcc);
82
    void mncChanged(const QString &mnc);
83
    void technologyChanged(const QString &technology);
84
    void nameChanged(const QString &name);
85
    void strengthChanged(uint strength);
86
    void baseStationChanged(const QString &baseStation);
87
27 by Lorn Potter
add currentOperator to net reg and other fixes
88
    void networkOperatorsChanged(const QStringList &networkOperators);
28 by Lorn Potter
various fixes needed for qml settings
89
    void currentOperatorPathChanged(const QString &);
90
    void scanFinished();
91
    void scanError(const QString &message);
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
92
    void scanningChanged(bool value);
27 by Lorn Potter
add currentOperator to net reg and other fixes
93
156.2.1 by Lorn Potter
Add error reporting for network registration
94
    void registrationFinished();
95
    void registrationError(const QString &errorMessage);
96
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
97
private slots:
175.1.1 by Slava Monich
[libqofono] Handle NetworkRegistration.OperatorsChanged signal
98
    void onOperatorsChanged(const ObjectPathPropertiesList &operators);
171.1.1 by Slava Monich
[libqofono] Added base classes for modem interfaces
99
    void onOperatorStatusChanged(const QString &status);
100
    void onScanFinished(QDBusPendingCallWatcher *watch);
101
    void onGetOperatorsFinished(QDBusPendingCallWatcher *watch);
102
    void onRegistrationFinished(QDBusPendingCallWatcher *watch);
103
104
protected:
105
    QDBusAbstractInterface *createDbusInterface(const QString &path);
106
    void dbusInterfaceDropped();
107
    void propertyChanged(const QString &property, const QVariant &value);
108
109
private:
110
    class Private;
171.1.2 by Slava Monich
[libqofono] Restore public ABI
111
    Private *privateData() const;
3 by Lorn Potter
2nd initial commit. Long Live QOfono!
112
};
113
114
#endif // QOFONONETWORKREGISTRATION_H