Added the ability to edit the PID number using the number pad.
[profile/ivi/hfdialer.git] / src / modemproxy.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 MODEMPROXY_H
12 #define MODEMPROXY_H
13
14 #include "modem_interface.h"
15 #include <QtDBus>
16 #include <QDebug>
17
18 #define OFONO_SERVICE "org.ofono"
19 #define OFONO_MANAGER_PATH "/"
20
21 class ModemProxy: public org::ofono::Modem
22 {
23     Q_OBJECT
24     Q_PROPERTY(QStringList interfaces READ interfaces)
25     Q_PROPERTY(QString path READ path)
26     Q_PROPERTY(QString manufacturer READ manufacturer)
27     Q_PROPERTY(QString model READ model)
28     Q_PROPERTY(QString revision READ revision)
29     Q_PROPERTY(QString serial READ serial)
30     Q_PROPERTY(bool powered READ powered WRITE setPowered)
31     Q_PROPERTY(bool online READ online WRITE setOnline)
32
33 public:
34     ModemProxy(const QString &objectPath);
35     virtual ~ModemProxy();
36
37     QStringList interfaces() const;
38     QString path() const;
39     QString manufacturer() const;
40     QString model() const;
41     QString revision() const;
42     QString serial() const;
43     bool powered() const;
44     bool online() const;
45
46 public slots:
47     void setPowered(bool is_powered);
48     void setOnline(bool is_online);
49
50     void modemDBusGetPropDone(QDBusPendingCallWatcher *call);
51
52 Q_SIGNALS:
53     void interfacesChanged(QStringList interfaces);
54     void poweredChanged(bool powered);
55     void onlineChanged(bool powered);
56     void connected();
57     void disconnected();
58
59 private Q_SLOTS:
60     // Slots to handle DBus signals from ofono
61     void propertyChanged(const QString &in0, const QDBusVariant &in1);
62
63 private:
64     QStringList m_properties; // raw return from GetProperties
65     QStringList m_interfaces;
66     QString     m_path;
67     QString     m_manufacturer;
68     QString     m_model;
69     QString     m_revision;
70     QString     m_serial;
71     bool        m_powered;
72     bool        m_online;
73     bool        m_connected;
74 };
75
76 class VoicemailProxy: public org::ofono::MessageWaiting
77 {
78     Q_OBJECT
79
80     Q_PROPERTY(bool isConnected READ isConnected NOTIFY connected)
81     Q_PROPERTY(bool waiting READ waiting)
82     Q_PROPERTY(int count  READ count)
83     Q_PROPERTY(QString mailbox READ mailbox WRITE setMailbox)
84
85 public:
86     VoicemailProxy(const QString &objectPath);
87     virtual ~VoicemailProxy();
88
89     bool isConnected() const;
90
91     QString  path() const;
92     bool     waiting() const;
93     int      count() const;
94     QString  mailbox() const;
95
96 public slots:
97     void setMailbox(QString lineid);
98
99 Q_SIGNALS:
100     void messagesWaitingChanged();
101     void mailboxChanged();
102     void connected();
103     void disconnected();
104
105 private slots:
106     void voicemailDBusGetPropDone(QDBusPendingCallWatcher *call);
107     void voicemailPropertyChanged(const QString &in0, const QDBusVariant &in1);
108
109 private:
110     QStringList m_properties; // raw return from GetProperties
111     QString     m_path;
112     bool        m_waiting;
113     int         m_count;
114     QString     m_mailbox;
115     bool        m_connected;
116 };
117
118 class VolumeManager: public org::ofono::CallVolume
119 {
120     Q_OBJECT
121     Q_PROPERTY(int speakerVolume READ speakerVolume WRITE setSpeakerVolume)
122     Q_PROPERTY(int micVolume READ micVolume WRITE setMicVolume)
123     Q_PROPERTY(bool muted READ muted WRITE setMuted)
124     Q_PROPERTY(bool isConnected READ isConnected)
125
126 public:
127     VolumeManager(const QString &objectPath);
128     virtual ~VolumeManager();
129
130     QString path() const;
131     int  speakerVolume() const;
132     int  micVolume() const;
133     bool muted() const;
134     bool isConnected() const;
135
136 public slots:
137     void setSpeakerVolume(int volume);
138     void setMicVolume(int volume);
139     void setMuted(bool is_muted);
140     void volumeDBusGetPropDone(QDBusPendingCallWatcher *call);
141
142 Q_SIGNALS:
143     void speakerVolumeChanged(int volume);
144     void micVolumeChanged(int volume);
145     void muteChanged(bool muted);
146     void connected();
147     void disconnected();
148
149 private:
150     QStringList m_properties; // raw return from GetProperties
151     QString     m_path;
152     int         m_speakerVolume;
153     int         m_micVolume;
154     bool        m_muted;
155     bool        m_connected;
156 };
157
158 #endif