Initial Import
[profile/ivi/hfdialer.git] / src / managerproxy.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 MANAGERPROXY_H
12 #define MANAGERPROXY_H
13
14 #include "manager_interface.h"
15 #include "modemproxy.h"
16 #include "networkproxy.h"
17 #include "callmanager.h"
18 #include "common.h"
19 #include <QtDBus>
20 #include <QDebug>
21
22 #define OFONO_SERVICE "org.ofono"
23 #define OFONO_MANAGER_PATH "/"
24
25 class ManagerProxy: public org::ofono::Manager
26 {
27     Q_OBJECT;
28     Q_PROPERTY(ModemProxy* modem READ modem);
29     Q_PROPERTY(NetworkProxy* network READ network);
30
31 public:
32     virtual ~ManagerProxy();
33
34     static ManagerProxy *instance();
35     QStringList getModemList();
36     void setModem(QString modempath);
37     void setNetwork(QString modempath);
38     void setCallManager(QString modempath);
39     void setVolumeManager(QString modempath);
40     void setVoicemail(QString modempath);
41
42     ModemProxy* modem() const;
43     NetworkProxy* network() const;
44     CallManager* callManager() const;
45     VolumeManager* volumeManager() const;
46     VoicemailProxy* voicemail() const;
47
48 public slots:
49     void managerDBusGetModemsDone(QDBusPendingCallWatcher *call);
50
51 Q_SIGNALS:
52     void modemChanged();
53     void networkChanged();
54     void callManagerChanged();
55     void volumeManagerChanged();
56     void voicemailChanged();
57
58 private Q_SLOTS:
59     void modemAdded(const QDBusObjectPath &in0, const QVariantMap &in1);
60     void modemRemoved(const QDBusObjectPath &in0);
61
62 protected:
63     ManagerProxy(const QString &service=OFONO_SERVICE,
64                  const QString &path=OFONO_MANAGER_PATH,
65                  const QDBusConnection &connection=QDBusConnection::systemBus(),
66                  QObject *parent = 0);
67
68 private:
69     ManagerProxy(const ManagerProxy&);
70     ManagerProxy& operator= (ManagerProxy&);
71
72     QString       m_modemPath;
73     ModemProxy   *m_modem;
74     NetworkProxy *m_network;
75     CallManager  *m_callManager;
76     VolumeManager *m_volumeManager;
77     VoicemailProxy *m_voicemail;
78     QStringList m_modemList;
79
80     static ManagerProxy *gManager;
81 };
82
83 #endif
84
85 /* Local Variables:      */
86 /* mode:c++              */
87 /* c-basic-offset:4      */
88 /* indent-tabs-mode: nil */
89 /* End:                  */