Added the ability to edit the PID number using the number pad.
[profile/ivi/hfdialer.git] / src / networkproxy.h
1 /*
2  * hfdialer - Hands Free Voice Call Manager
3  * Copyright (c) 2012, Intel Corporation.
4  *
5  * This program is licensed under the terms and conditions of the
6  * Apache License, version 2.0.  The full text of the Apache License is at
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  */
10
11 #ifndef NETWORKPROXY_H
12 #define NETWORKPROXY_H
13
14 #include "modem_interface.h"
15 #include "operator_interface.h"
16 #include <QtDBus>
17 #include <QDebug>
18
19 #define OFONO_SERVICE "org.ofono"
20 #define OFONO_MANAGER_PATH "/"
21
22 /* **************************************************************
23  * Network Operator Class
24  * **************************************************************/
25 class OperatorProxy: public org::ofono::NetworkOperator
26 {
27     Q_OBJECT
28     Q_PROPERTY(QString path READ path)
29     Q_PROPERTY(QString countryCode READ countryCode)
30     Q_PROPERTY(QString networkCode READ networkCode)
31     Q_PROPERTY(QString name READ name)
32     Q_PROPERTY(QString status READ status)
33     Q_PROPERTY(QStringList technologies READ technologies)
34
35 public:
36     OperatorProxy(const QString &objectPath);
37     virtual ~OperatorProxy();
38
39     QString path() const;
40     QString countryCode() const;
41     QString networkCode() const;
42     QString name() const;
43     QString status() const;
44     QStringList technologies() const;
45
46 public slots:
47     void operatorDBusGetPropDone(QDBusPendingCallWatcher *call);
48
49 Q_SIGNALS:
50     void propertyChanged();
51
52 private:
53     QStringList m_properties; // raw return from GetProperties
54     QString     m_path;
55     QString     m_countryCode;
56     QString     m_networkCode;
57     QString     m_name;
58     QString     m_status;
59     QStringList m_technologies;
60 };
61
62 /* **************************************************************
63  * Network Registration Class
64  * **************************************************************/
65 class NetworkProxy: public org::ofono::NetworkRegistration
66 {
67     Q_OBJECT
68     Q_PROPERTY(QList<OperatorProxy*> operators READ operators)
69     Q_PROPERTY(OperatorProxy currentOperator READ currentOperator)
70     Q_PROPERTY(QString mode READ mode)
71     Q_PROPERTY(QString name READ name)
72     Q_PROPERTY(QString status READ status)
73
74 public:
75     NetworkProxy(const QString &objectPath);
76     virtual ~NetworkProxy();
77
78     QList<OperatorProxy*> operators() const;
79     OperatorProxy* currentOperator() const;
80     QString mode() const;
81     QString name() const;
82     QString status() const;
83
84 public slots:
85     void networkDBusGetPropDone(QDBusPendingCallWatcher *call);
86
87 Q_SIGNALS:
88     void propertyChanged();
89     void connected();
90     void disconnected();
91
92 private:
93     OperatorProxy *m_currentOperator;
94
95     QStringList m_properties; // raw return from GetProperties
96     QStringList m_operatorPaths;
97     QList<OperatorProxy*> m_operators;
98     QString     m_mode;
99     QString     m_name;
100     QString     m_status;
101     bool        m_connected;
102 };
103
104 #endif