Version 0.7-0
[vicar] / src / vicar-daemon / cpp / callrouter.h
1 /*
2 @version: 0.6
3 @author: Sudheer K. <scifi1947 at gmail.com>
4 @license: GNU General Public License
5 */
6
7 #ifndef CALLROUTER_H
8 #define CALLROUTER_H
9
10 #include <QObject>
11 #include <QDBusMessage>
12 #include <dbusutility.h>
13 #include <gconfutility.h>
14 #include "vicardbusadaptor.h"
15
16 #define APPLICATION_DBUS_PATH "/org/maemo/vicar"
17 #define APPLICATION_DBUS_INTERFACE "org.maemo.vicar"
18 #define APPLICATION_DBUS_SERVICE "org.maemo.vicar"
19 #define APPLICATION_FRIENDLY_NAME "VICaR"
20
21 /* CSD CALL plugin D-Bus definitions */
22 #define CSD_CALL_BUS_NAME       "com.nokia.csd.Call"
23 #define CSD_CALL_INTERFACE      "com.nokia.csd.Call"
24 #define CSD_CALL_INSTANCE_INTERFACE     "com.nokia.csd.Call.Instance"
25 #define CSD_CALL_CONFERENCE     "com.nokia.csd.Call.Conference"
26 #define CSD_CALL_PATH           "/com/nokia/csd/call"
27 #define CSD_CALL_INSTANCE_PATH  "/com/nokia/csd/call/1"
28 #define CSD_CALL_SERVICE        "com.nokia.csd.Call"
29 #define CSD_SERVICE             "com.nokia.csd"
30
31 class CallRouterPrivate;
32
33 class CallRouter : public QObject
34 {
35 Q_OBJECT
36 Q_CLASSINFO("D-Bus Interface", "org.maemo.vicar")
37
38 public:
39     CallRouter(QObject *parent = 0);
40     ~CallRouter();
41     void registerDBusService();
42     void unregisterDBusService();
43     bool isValidPhoneNumber(QString);
44
45 protected:
46     void startCallStatusMonitors();
47     QString convertToDTMFCode(QString);
48     bool isExcludedNumber(QString);
49     bool placeCall(QString);
50
51 protected slots:
52     QString callViaCallingCard(QString);
53     void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
54     void displayDTMFConfirmation();
55     void stopCallStatusMonitors();
56
57     //D-Bus Interface Methods
58 public slots:
59     bool isRunning();
60     QString callInternationalNumber(const QString& internationalNumber);
61
62 private:
63     CallRouterPrivate * const d;
64 };
65
66 #endif // CALLROUTER_H