2 * hfdialer - Hands Free Voice Call Manager
3 * Copyright (c) 2012, Intel Corporation.
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
11 #ifndef DIALERCONTEXT_H
12 #define DIALERCONTEXT_H
14 // libofono-qt headers
15 #include <ofonomodemmanager.h>
16 #include <ofonocallvolume.h>
17 #include <ofonomessagewaiting.h>
20 #include "callmanager.h"
22 // Convienence Macro for access to Class instance
23 #define DC DialerContext::instance()
25 class DialerContext: public QObject
29 Q_PROPERTY(OfonoModemManager* modemManager READ modemManager);
30 Q_PROPERTY(OfonoCallVolume* volumeManager READ volumeManager);
31 Q_PROPERTY(OfonoMessageWaiting* voicemailManager READ voicemailManager);
32 Q_PROPERTY(CallManager* callManager READ callManager);
33 Q_PROPERTY(QStringList modes READ modes WRITE setModes);
36 virtual ~DialerContext();
38 static DialerContext *instance();
40 OfonoModemManager* modemManager() const;
41 OfonoCallVolume* volumeManager() const;
42 OfonoMessageWaiting* voicemailManager() const;
43 CallManager* callManager() const;
44 QStringList modes() const;
47 // Slot to set current mode at runtime
48 void setModes(const QStringList &modeList);
55 // Slots to handle signals from Manager oFono service
56 void onModemAdded(const QString &path);
57 void onModemRemoved(const QString &path);
59 // Slots to handle signals from CallVolume oFono service
60 void onCallVolumeValidityChanged(bool valid);
62 // Slots to handle signals from MessageWaiting oFono service
63 void onVoicemailValidityChanged(bool valid);
64 void onVoicemailWaitingChanged(bool waiting);
65 void onVoicemailCountChanged(int count);
67 // Slots to handle signals from CallManager oFono service
68 void onCallManagerValidityChanged(bool valid);
69 void onCallsChanged();
71 // Slot to handle runtime mode changes in GConf key
72 void onModesChanged();
75 DialerContext(QObject *parent = 0);
78 DialerContext(const DialerContext&);
79 DialerContext& operator= (DialerContext&);
81 class DialerContextPrivate *d;
83 static DialerContext *gContext;
86 #endif // DIALERCONTEXT_H
88 /* Local Variables: */
90 /* c-basic-offset:4 */
91 /* indent-tabs-mode: nil */