Version 0.7-0
[vicar] / src / vicar-daemon / cpp / callrouter.h
diff --git a/src/vicar-daemon/cpp/callrouter.h b/src/vicar-daemon/cpp/callrouter.h
new file mode 100755 (executable)
index 0000000..65288b1
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef CALLROUTER_H
+#define CALLROUTER_H
+
+#include <QObject>
+#include <QDBusMessage>
+#include <dbusutility.h>
+#include <gconfutility.h>
+#include "vicardbusadaptor.h"
+
+#define APPLICATION_DBUS_PATH "/org/maemo/vicar"
+#define APPLICATION_DBUS_INTERFACE "org.maemo.vicar"
+#define APPLICATION_DBUS_SERVICE "org.maemo.vicar"
+#define APPLICATION_FRIENDLY_NAME "VICaR"
+
+/* CSD CALL plugin D-Bus definitions */
+#define CSD_CALL_BUS_NAME      "com.nokia.csd.Call"
+#define CSD_CALL_INTERFACE     "com.nokia.csd.Call"
+#define CSD_CALL_INSTANCE_INTERFACE    "com.nokia.csd.Call.Instance"
+#define CSD_CALL_CONFERENCE    "com.nokia.csd.Call.Conference"
+#define CSD_CALL_PATH          "/com/nokia/csd/call"
+#define CSD_CALL_INSTANCE_PATH  "/com/nokia/csd/call/1"
+#define CSD_CALL_SERVICE       "com.nokia.csd.Call"
+#define CSD_SERVICE             "com.nokia.csd"
+
+class CallRouterPrivate;
+
+class CallRouter : public QObject
+{
+Q_OBJECT
+Q_CLASSINFO("D-Bus Interface", "org.maemo.vicar")
+
+public:
+    CallRouter(QObject *parent = 0);
+    ~CallRouter();
+    void registerDBusService();
+    void unregisterDBusService();
+    bool isValidPhoneNumber(QString);
+
+protected:
+    void startCallStatusMonitors();
+    QString convertToDTMFCode(QString);
+    bool isExcludedNumber(QString);
+    bool placeCall(QString);
+
+protected slots:
+    QString callViaCallingCard(QString);
+    void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
+    void displayDTMFConfirmation();
+    void stopCallStatusMonitors();
+
+    //D-Bus Interface Methods
+public slots:
+    bool isRunning();
+    QString callInternationalNumber(const QString& internationalNumber);
+
+private:
+    CallRouterPrivate * const d;
+};
+
+#endif // CALLROUTER_H