Added the ability to edit the PID number using the number pad.
[profile/ivi/hfdialer.git] / src / dialercontext.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 DIALERCONTEXT_H
12 #define DIALERCONTEXT_H
13
14 // libofono-qt headers
15 #include <ofonomodemmanager.h>
16 #include <ofonocallvolume.h>
17 #include <ofonomessagewaiting.h>
18
19 // local headers
20 #include "callmanager.h"
21 //#include "resourceproxy.h"
22
23 // Convienence Macro for access to Class instance
24 #define DC DialerContext::instance()
25
26 class DialerContext: public QObject
27 {
28     Q_OBJECT
29
30     Q_PROPERTY(OfonoModemManager* modemManager READ modemManager)
31     Q_PROPERTY(OfonoCallVolume* volumeManager READ volumeManager)
32     Q_PROPERTY(OfonoMessageWaiting* voicemailManager READ voicemailManager)
33     Q_PROPERTY(CallManager* callManager READ callManager)
34 //    Q_PROPERTY(ResourceProxy* policyManager READ policyManager)
35     Q_PROPERTY(QStringList modes READ modes WRITE setModes)
36
37 public:
38     virtual ~DialerContext();
39
40     static DialerContext *instance();
41
42     OfonoModemManager*   modemManager() const;
43     OfonoCallVolume*     volumeManager() const;
44     OfonoMessageWaiting* voicemailManager() const;
45     CallManager*         callManager() const;
46     //ResourceProxy*       policyManager() const;
47     QStringList          modes() const;
48
49 public slots:
50     // Slot to set current mode at runtime
51     void setModes(const QStringList &modeList);
52
53 Q_SIGNALS:
54     void modesChanged();
55
56 private Q_SLOTS:
57
58     // Slots to handle signals from Manager oFono service
59     void onModemAdded(const QString &path);
60     void onModemRemoved(const QString &path);
61
62     // Slots to handle signals from CallVolume oFono service
63     void onCallVolumeValidityChanged(bool valid);
64
65     // Slots to handle signals from MessageWaiting oFono service
66     void onVoicemailValidityChanged(bool valid);
67     void onVoicemailWaitingChanged(bool waiting);
68     void onVoicemailCountChanged(int count);
69
70     // Slots to handle signals from CallManager oFono service
71     void onCallManagerValidityChanged(bool valid);
72     void onCallsChanged();
73
74     // Slot to handle runtime mode changes in GConf key
75     void onModesChanged();
76
77 protected:
78     DialerContext(QObject *parent = 0);
79
80 private:
81     DialerContext(const DialerContext&);
82     DialerContext& operator= (DialerContext&);
83
84     class DialerContextPrivate *d;
85
86     static DialerContext *gContext;
87 };
88
89 #endif // DIALERCONTEXT_H