From 11d5c26f3a622a0fc32f9cb89e1658846201af4d Mon Sep 17 00:00:00 2001 From: sudheer Date: Fri, 10 Sep 2010 09:19:55 -0700 Subject: [PATCH] Release 0.5-1 contains (Muti-profile support, Contacts Integration) --- debian/changelog | 12 +- debian/control | 67 ++- debian/copyright | 6 +- debian/dirs | 2 - debian/files | 2 +- debian/postinst | 34 +- debian/postrm | 3 - debian/prerm | 54 +++ debian/rules | 2 +- debian/vicar.substvars | 2 +- src/data/icons/26x26/vicar_phone.png | Bin 0 -> 1076 bytes src/data/icons/32x32/vicar_phone.png | Bin 0 -> 1439 bytes src/data/icons/48x48/vicar_phone.png | Bin 0 -> 2517 bytes src/data/icons/64x64/vicar_phone.png | Bin 0 -> 3670 bytes src/data/icons/Icon Source.txt | 5 + src/data/icons/vicar-application.png.base64 | 64 +++ src/data/icons/vicar_application.png | Bin 0 -> 2759 bytes src/data/icons/vicar_scalable_icon.png | Bin 0 -> 10549 bytes ...sktop.Telepathy.ConnectionManager.vicar.service | 3 + src/data/org.maemo.vicar.service | 3 +- src/data/vicar-config.desktop | 2 +- src/data/vicar.manager | 24 + src/data/vicar.profile | 19 + .../xml/connectioninterfacerequestsadaptor.cpp | 53 +++ src/data/xml/connectioninterfacerequestsadaptor.h | 77 ++++ src/data/xml/org.freedesktop.Telepathy.Account.xml | 106 +++++ .../org.freedesktop.Telepathy.AccountManager.xml | 69 +++ ...freedesktop.Telepathy.Connection.I.Requests.xml | 30 ++ .../xml/org.freedesktop.Telepathy.Connection.xml | 112 +++++ src/data/xml/org.maemo.vicar.xml | 21 + src/src.pro | 27 +- src/vicar-config/src/main.cpp | 13 +- src/vicar-config/src/profilesettingsdialog.cpp | 77 ++++ src/vicar-config/src/profilesettingsdialog.h | 33 ++ src/vicar-config/src/profileswindow.cpp | 195 ++++++++ src/vicar-config/src/profileswindow.h | 38 ++ src/vicar-config/uis/profilesettingsdialog.ui | 312 +++++++++++++ src/vicar-config/uis/profileswindow.ui | 147 ++++++ src/vicar-config/uis/ui_profilesettingsdialog.h | 224 +++++++++ src/vicar-config/uis/ui_profileswindow.h | 148 ++++++ src/vicar-config/vicar-config.pro | 13 +- src/vicar-daemon/src/callrouter.cpp | 421 +++++++---------- src/vicar-daemon/src/callrouter.h | 30 +- src/vicar-daemon/src/main.cpp | 24 +- src/vicar-daemon/src/vicardbusadaptor.cpp | 67 +++ src/vicar-daemon/src/vicardbusadaptor.h | 61 +++ src/vicar-daemon/vicar-daemon.pro | 8 +- src/vicar-lib/src/accountcompatproxy.cpp | 26 ++ src/vicar-lib/src/accountcompatproxy.h | 58 +++ src/vicar-lib/src/accountmanagerproxy.cpp | 26 ++ src/vicar-lib/src/accountmanagerproxy.h | 58 +++ src/vicar-lib/src/accountproxy.cpp | 26 ++ src/vicar-lib/src/accountproxy.h | 70 +++ src/vicar-lib/src/databaseutility.cpp | 182 ++++++++ src/vicar-lib/src/databaseutility.h | 38 ++ src/vicar-lib/src/dbusutility.cpp | 27 +- src/vicar-lib/src/dbusutility.h | 12 +- src/vicar-lib/src/gconfutility.cpp | 4 +- src/vicar-lib/src/gconfutility.h | 4 +- src/vicar-lib/src/telepathyutility.cpp | 208 +++++++++ src/vicar-lib/src/telepathyutility.h | 58 +++ src/vicar-lib/src/vicarprofiletypes.h | 31 ++ src/vicar-lib/vicar-lib.pro | 17 +- src/vicar-telepathy/src/basetypes.h | 35 ++ src/vicar-telepathy/src/connection.cpp | 480 ++++++++++++++++++++ src/vicar-telepathy/src/connection.h | 145 ++++++ src/vicar-telepathy/src/connectionadaptor.cpp | 133 ++++++ src/vicar-telepathy/src/connectionadaptor.h | 121 +++++ .../src/connectioninterfacecapabilitiesadaptor.cpp | 51 +++ .../src/connectioninterfacecapabilitiesadaptor.h | 65 +++ .../src/connectioninterfacecapabilitiestypes.cpp | 98 ++++ .../src/connectioninterfacecapabilitiestypes.h | 98 ++++ .../src/connectioninterfacerequestsadaptor.cpp | 55 +++ .../src/connectioninterfacerequestsadaptor.h | 79 ++++ .../src/connectioninterfacerequeststypes.cpp | 75 +++ .../src/connectioninterfacerequeststypes.h | 78 ++++ src/vicar-telepathy/src/connectionmanager.cpp | 187 ++++++++ src/vicar-telepathy/src/connectionmanager.h | 75 +++ .../src/connectionmanageradaptor.cpp | 62 +++ src/vicar-telepathy/src/connectionmanageradaptor.h | 69 +++ src/vicar-telepathy/src/connectionmanagertypes.cpp | 48 ++ src/vicar-telepathy/src/connectionmanagertypes.h | 64 +++ src/vicar-telepathy/src/connectiontypes.cpp | 48 ++ src/vicar-telepathy/src/connectiontypes.h | 93 ++++ src/vicar-telepathy/src/main.cpp | 123 +++++ src/vicar-telepathy/src/names.h | 48 ++ src/vicar-telepathy/src/vicarcallrouterproxy.cpp | 26 ++ src/vicar-telepathy/src/vicarcallrouterproxy.h | 72 +++ src/vicar-telepathy/vicar-telepathy.pro | 56 +++ src/vicar-utils/src/main.cpp | 82 ++++ src/vicar-utils/vicar-utils.pro | 24 + 91 files changed, 5699 insertions(+), 346 deletions(-) mode change 100644 => 100755 debian/changelog mode change 100644 => 100755 debian/compat mode change 100644 => 100755 debian/control mode change 100644 => 100755 debian/copyright mode change 100644 => 100755 debian/dirs mode change 100644 => 100755 debian/docs mode change 100644 => 100755 debian/postinst mode change 100644 => 100755 debian/postrm create mode 100644 debian/prerm create mode 100755 src/data/icons/26x26/vicar_phone.png create mode 100755 src/data/icons/32x32/vicar_phone.png create mode 100755 src/data/icons/48x48/vicar_phone.png create mode 100755 src/data/icons/64x64/vicar_phone.png create mode 100644 src/data/icons/Icon Source.txt create mode 100644 src/data/icons/vicar-application.png.base64 create mode 100755 src/data/icons/vicar_application.png create mode 100755 src/data/icons/vicar_scalable_icon.png create mode 100644 src/data/org.freedesktop.Telepathy.ConnectionManager.vicar.service mode change 100644 => 100755 src/data/org.maemo.vicar.service mode change 100644 => 100755 src/data/vicar-config.desktop create mode 100644 src/data/vicar.manager create mode 100644 src/data/vicar.profile create mode 100644 src/data/xml/connectioninterfacerequestsadaptor.cpp create mode 100644 src/data/xml/connectioninterfacerequestsadaptor.h create mode 100644 src/data/xml/org.freedesktop.Telepathy.Account.xml create mode 100644 src/data/xml/org.freedesktop.Telepathy.AccountManager.xml create mode 100644 src/data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml create mode 100644 src/data/xml/org.freedesktop.Telepathy.Connection.xml create mode 100755 src/data/xml/org.maemo.vicar.xml mode change 100644 => 100755 src/src.pro mode change 100644 => 100755 src/vicar-config/src/main.cpp create mode 100644 src/vicar-config/src/profilesettingsdialog.cpp create mode 100644 src/vicar-config/src/profilesettingsdialog.h create mode 100644 src/vicar-config/src/profileswindow.cpp create mode 100644 src/vicar-config/src/profileswindow.h create mode 100644 src/vicar-config/uis/profilesettingsdialog.ui create mode 100644 src/vicar-config/uis/profileswindow.ui create mode 100644 src/vicar-config/uis/ui_profilesettingsdialog.h create mode 100644 src/vicar-config/uis/ui_profileswindow.h mode change 100644 => 100755 src/vicar-config/vicar-config.pro mode change 100644 => 100755 src/vicar-daemon/src/callrouter.cpp mode change 100644 => 100755 src/vicar-daemon/src/callrouter.h mode change 100644 => 100755 src/vicar-daemon/src/main.cpp create mode 100755 src/vicar-daemon/src/vicardbusadaptor.cpp create mode 100755 src/vicar-daemon/src/vicardbusadaptor.h mode change 100644 => 100755 src/vicar-daemon/vicar-daemon.pro create mode 100644 src/vicar-lib/src/accountcompatproxy.cpp create mode 100644 src/vicar-lib/src/accountcompatproxy.h create mode 100644 src/vicar-lib/src/accountmanagerproxy.cpp create mode 100644 src/vicar-lib/src/accountmanagerproxy.h create mode 100644 src/vicar-lib/src/accountproxy.cpp create mode 100644 src/vicar-lib/src/accountproxy.h create mode 100644 src/vicar-lib/src/databaseutility.cpp create mode 100644 src/vicar-lib/src/databaseutility.h mode change 100644 => 100755 src/vicar-lib/src/dbusutility.cpp mode change 100644 => 100755 src/vicar-lib/src/dbusutility.h mode change 100644 => 100755 src/vicar-lib/src/gconfutility.cpp mode change 100644 => 100755 src/vicar-lib/src/gconfutility.h create mode 100644 src/vicar-lib/src/telepathyutility.cpp create mode 100644 src/vicar-lib/src/telepathyutility.h create mode 100644 src/vicar-lib/src/vicarprofiletypes.h mode change 100644 => 100755 src/vicar-lib/vicar-lib.pro create mode 100644 src/vicar-telepathy/src/basetypes.h create mode 100644 src/vicar-telepathy/src/connection.cpp create mode 100644 src/vicar-telepathy/src/connection.h create mode 100644 src/vicar-telepathy/src/connectionadaptor.cpp create mode 100644 src/vicar-telepathy/src/connectionadaptor.h create mode 100644 src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.cpp create mode 100644 src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.h create mode 100644 src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.cpp create mode 100644 src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.h create mode 100644 src/vicar-telepathy/src/connectioninterfacerequestsadaptor.cpp create mode 100644 src/vicar-telepathy/src/connectioninterfacerequestsadaptor.h create mode 100644 src/vicar-telepathy/src/connectioninterfacerequeststypes.cpp create mode 100644 src/vicar-telepathy/src/connectioninterfacerequeststypes.h create mode 100644 src/vicar-telepathy/src/connectionmanager.cpp create mode 100644 src/vicar-telepathy/src/connectionmanager.h create mode 100644 src/vicar-telepathy/src/connectionmanageradaptor.cpp create mode 100644 src/vicar-telepathy/src/connectionmanageradaptor.h create mode 100644 src/vicar-telepathy/src/connectionmanagertypes.cpp create mode 100644 src/vicar-telepathy/src/connectionmanagertypes.h create mode 100644 src/vicar-telepathy/src/connectiontypes.cpp create mode 100644 src/vicar-telepathy/src/connectiontypes.h create mode 100644 src/vicar-telepathy/src/main.cpp create mode 100644 src/vicar-telepathy/src/names.h create mode 100644 src/vicar-telepathy/src/vicarcallrouterproxy.cpp create mode 100644 src/vicar-telepathy/src/vicarcallrouterproxy.h create mode 100644 src/vicar-telepathy/vicar-telepathy.pro create mode 100755 src/vicar-utils/src/main.cpp create mode 100755 src/vicar-utils/vicar-utils.pro mode change 100644 => 100755 vicar.pro mode change 100644 => 100755 welcome diff --git a/debian/changelog b/debian/changelog old mode 100644 new mode 100755 index 2d320ad..23aeca2 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,6 @@ -vicar (0.2-1) unstable; urgency=low +vicar (0.5-1) unstable; urgency=low - * Fixed a bug that does not allow Country Codes to Exclude to be blank - * Save button now displays a success notification - * Settings will be automatically saved on close - * Save and Reset buttons moved to Hildon application menu - * Calling Card Number and Country Codes to Exclude fields accept numbers by default for hardware keyboard - * Merged basic and advanced settings into one screen - * Code cleanup + * Fixed Dbus activation error. - -- Sudheer K. Sat, 8 May 2010 13:57:08 -0700 + -- Sudheer K. Fri, 03 Sep 2010 08:10:00 +0530 diff --git a/debian/compat b/debian/compat old mode 100644 new mode 100755 diff --git a/debian/control b/debian/control old mode 100644 new mode 100755 index 3b47fc0..0200b85 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: vicar Section: user/network Priority: extra -Maintainer: Sudheer K. +Maintainer: Sudheer K. Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev Standards-Version: 3.7.2 Homepage: vicar.garage.maemo.org @@ -11,7 +11,70 @@ XB-Maemo-Display-Name: VICaR - Value International Call Router Package: vicar Architecture: any Depends: ${shlibs:Depends} -Description: Automatically routes international GSM calls through a calling card number. +Description: Automatically routes international GSM calls through a calling card or skype-out number. * Calling card number and other options can be configured by launching VICaR from applications menu. * Make sure to update all your international numbers to start with the appropriate dialing code and a prefix of + or 00. * To avoid routing local calls through VICaR, add the local country codes to the list of country codes to exclude. +XB-Maemo-Icon-26: + iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c + 6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0 + SU1FB9oIAwM2Kg1VlzwAAApHSURBVGje7VhtbBxX2T3PvfM9s971bhon7iaO + k7ROrLgpiS3SgigNRUWq3legKEitGkpBohGQIISIUPiDUFWVikJlVQj4QdUK + FCGIUsTbvqIFRwltCaqw7LbIdWIlthOc9W52vVnv7szOzL2XH+ysnAJtWsof + 8JEezezM3J1z7j17n+dZYBWrWMUqVrGKVazivxf0fn/hwYMHTSGEqWmaJqXk + UkqmlCKlFGzbhq7rsaZpcRRFwrIs/9FHH41Xjn/sscdw5MiRf5+Affv24fjx + 49dcO3DgwMY4jm/RNO0DSqkhxlgf5zwDoAuABcBQSild1yUR1TjnS1LKq0R0 + jjF2njE2qWnan5544om//NtW4PDhwxgbG8Mbb7wBANi7d+9HOOcHAHw4juMs + gBQR2UopKKXAGIOmaZ3gnIOIoGkaGGOQUgIANE1DHMc+gCYRXTJN82ddXV0/ + efLJJ8v79u2DEALPPvvsvyagu7sbS0tL2L17t+t53ueFEF/3fT+/vLyMRqOB + MAwhpYSUEpxzZZomXblyBYwxEBGUUiAiMMbAGAMAeJ6nlFJERCAimKapPM+j + XC6HVCoFTdN+6HnekWeeeWb57bjx6xEQBAEA5DzP+1V/f//BfD7flU6nIaVU + pVKJ6vX6m4yxX99www1OPp9f43keHMeBrutIp9Po7e2F67qwbRs333wzLMvC + tm3baN26dbJYLH6/UqncEARBLp1Oq82bN6O3t5c458O1Wu0u0zR/WygUqv+y + hWzbPrJ169bv3HLLLcp1XTDGKIoiXLhwAWfPnt12++23XxJCPAVgfyqVwubN + mxGGIbZs2YK5uTls374dMzMzKBQKsCwLs7Oz4Jyjt7d3w+jo6NYNGzac3L17 + N3K5HBzHUZqmoVar0czMzI/m5ua+PDMzE/8jXuztSDuO87eHGOsFsD8IAhQK + BapUKtRsNhGGoVpcXITv+19JpVKqu7s729PTgyiKsLy8jCiKUK1WMT8/j1df + fRVxHGNoaAitVgs33XQT1q5dC6XU5jiO3xRCoFarYXl5GeVymYrFIlWrVVSr + 1fuWl5fXvScLRVEEIrqZiH5BRMNCiI7Xfd+HlJIsy1Lnz58fOX/+fPfIyMh2 + znnPrl27kEqlUC6XkcvlMDw8jPXr12NpaQmFQgH5fB5xHMMwDGiaVn7ppZeK + YRh+zrIscM4RBAGazSauXr2qLl++bDYajekgCP70jzhq72QdXde/adv2sO/7 + aDabanFxkWq1GjKZDHp6elSlUiEpJVzXvRtA/549e+D7PiYnJzEyMgLP86CU + gmEY2LlzJyYmJrCwsICuri4lhCAhxP8opT4axzHm5uZUtVolXdeTXYuazSak + lNv/Gb93FEBEH2q1WtB1HVJKtFotFUUR1et1XLp0Ka7X6xduvPHGxx5++OET + Z86cKV+5cgVRFOHcuXPo6+tLZrmzGRQKheQzEZHinA9ks9lweXlZ+b5PrVYL + jDEopcA5h2VZcF13zdWrV9/bLkREX5FSdm3cuLERx7GpaRrpuo4gCH4fBMG3 + 8vn8ly9evPiqbdu9tm0fHhwcRBiGmJqawosvvphYAWfPnsXJkydx5swZNBoN + mKaZiEAYhl+dnZ39raZp5xhj86ZpthzHYaZpeoZhwHGcn1QqlT++6xXYv3+/ + d/z4cQvAJdd1jzUajW/UarUpIjokpTwjhGjMz88nCWmgWCzihRdewH333YfB + wUEIIfD888+DiOB5Hmzbxvbt27G0tISpqSlIKbFp0yYMDQ39+fTp02NBEBAA + w3Vdq6ury1BKGUSkLMsqvScLPffcc7dLKTMAzimlvrmwsPBjABdWPvPggw/i + qaeegmmaH1tcXIRlWeqVV16hdDqNLVu2oNFowDAMKKWQSqUwNDQEx3FQKpUw + NjaW2GkHgLHDhw+r0dHRVqlUapVKpeva3t9WAGNshIgcpdRrk5OTMiH/1lIA + ADjnH8pmszh58iSZpomBgQH09/cjm82iUqnAcRxkMhm4rosoinD58mXUajVw + zsE5/wSA0bat3p9aaOfOndbMzMzPhRD/GwRBBsDf/YqOHj2KRx55BA888EDe + dd2LQgicOnUKYRhCCIE77rgDd999NyzLAhFhcXERJ06cwNTUFHK5HDZt2oTe + 3l4YhrEgpbx1dHS09L4JSKfTfc1m803O+R+DIPjo233JQw89dIIx9kmllBof + H6e1a9ei2Wzi9OnTiONrE2g2m8Wdd96J+fl5uK6LgYEBZVkWEdEPhoeHD91/ + //1y7969GBsbe28Cbr31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Z + Nvm1AHp0XV971113bUmn0ykhhDE7O6tNTEyEURSFK8bTW1rW5MViRUQAIsdx + 1D333OMZhhEFQeDruu6PjY39X7FYvASgBKAMYAlAvT3uupt6tiI0AHo7jLcc + 9fb9hDxfQZ4ls90O2SYRr4ioHeGKSK4nYpPxq1jFKlaxilX85+Cv1id6eRL3 + 1HwAAAAASUVORK5CYII= diff --git a/debian/copyright b/debian/copyright old mode 100644 new mode 100755 index e3a2b07..6327fef --- a/debian/copyright +++ b/debian/copyright @@ -1,9 +1,9 @@ -This package was debianized by Sudheer K. on +This package was debianized by Sudheer K. on Sat, 8 May 2010 13:57:08 -0700. It was downloaded from https://garage.maemo.org/projects/vicar -Upstream Author: Sudheer K. +Upstream Author: Sudheer K. Copyright: 2010, Sudheer K. @@ -26,7 +26,7 @@ License: On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. -The Debian packaging is (C) 2010, Sudheer K. and +The Debian packaging is (C) 2010, Sudheer K. and is licensed under the GPL, see above. diff --git a/debian/dirs b/debian/dirs old mode 100644 new mode 100755 index ca882bb..e69de29 --- a/debian/dirs +++ b/debian/dirs @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff --git a/debian/docs b/debian/docs old mode 100644 new mode 100755 diff --git a/debian/files b/debian/files index 7ee41dd..a9cf3e7 100644 --- a/debian/files +++ b/debian/files @@ -1 +1 @@ -vicar_0.2-1_armel.deb user/network extra +vicar_0.5-1_armel.deb user/network extra diff --git a/debian/postinst b/debian/postinst old mode 100644 new mode 100755 index 56eb403..0b39348 --- a/debian/postinst +++ b/debian/postinst @@ -23,9 +23,39 @@ case "$1" in # Kill any running instances of the daemon (only used on Linux based systems) killall -q vicar-daemon || true + killall -q vicar-telepathy || true + + echo "Starting Vicar daemon ..." + [[ -x /opt/vicar/vicar-daemon ]] && su - user -c "exec /opt/vicar/vicar-daemon& >/dev/null" + + echo "Starting Vicar-Telepathy ..." + [[ -x /opt/vicar/vicar-telepathy ]] && su - user -c "exec /opt/vicar/vicar-telepathy& >/dev/null" + + echo "Removing Vicar launch script..." + [[ -x /etc/event.d/launch-vicar ]] && rm -f /etc/event.d/launch-vicar + + echo "Deleting previous release configuration from GConf ..." + gconftool-2 --unset /apps/Maemo/vicar/routing_enabled + gconftool-2 --unset /apps/Maemo/vicar/calling_card_number + gconftool-2 --unset /apps/Maemo/vicar/dtmf_delay + gconftool-2 --unset /apps/Maemo/vicar/numbers_to_exclude + gconftool-2 --unset /apps/Maemo/vicar/dtmf_format + gconftool-2 --unset /apps/Maemo/vicar/dtmf_prefix + gconftool-2 --unset /apps/Maemo/vicar/dtmf_suffix + + echo "Creating Vicar Telepathy account ..." + [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils INSTALL" + + echo "Updating permissions on Vicar DB file ..." + [[ -e /home/user/vicar.db.sqlite ]] && chown user:users /home/user/vicar.db.sqlite + + echo "Creating Vicar Profiles database ..." + [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils CREATEDB" + + dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"Starting with this release, Multiple profiles can be created for routing calls via VICaR. + + Please launch VICaR to setup routing profiles." uint32:0 string:"OK" - echo "Sarting VICaR daemon ..." - [[ -x /opt/vicar/vicar-daemon ]] && exec /opt/vicar/vicar-daemon& >/dev/null ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/postrm b/debian/postrm old mode 100644 new mode 100755 index ce5c981..f832c85 --- a/debian/postrm +++ b/debian/postrm @@ -25,13 +25,10 @@ case "$1" in gconftool-2 --recursive-unset /apps/Maemo/vicar echo "Removing logs ..." [[ -x /var/log/vicar.log ]] && rm -f /var/log/vicar.log - killall -q vicar-daemon || true ;; remove|abort-install) echo "Removing unused scripts ..." - [[ -x /etc/event.d/launch-vicar ]] && rm -f /etc/event.d/launch-vicar - killall -q vicar-daemon || true ;; upgrade|failed-upgrade|abort-upgrade|disappear) diff --git a/debian/prerm b/debian/prerm new file mode 100644 index 0000000..9885c6f --- /dev/null +++ b/debian/prerm @@ -0,0 +1,54 @@ +#!/bin/sh +# prerm script for vicar +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|deconfigure) + + echo "Deleting Vicar Telepathy account ..." + [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils REMOVE" + + echo "Deleting Vicar Profiles database ..." + [[ -x /opt/vicar/vicar-utils ]] && su - user -c "exec /opt/vicar/vicar-utils DROPDB" + + # Kill any running instances of the daemon (only used on Linux based systems) + killall -q vicar-daemon || true + killall -q vicar-telepathy || true + ;; + + upgrade) + # Kill any running instances of the daemon (only used on Linux based systems) + killall -q vicar-daemon || true + killall -q vicar-telepathy || true + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index e90b551..fd099c3 100755 --- a/debian/rules +++ b/debian/rules @@ -14,7 +14,7 @@ builddir: mkdir -p builddir builddir/Makefile: builddir - cd builddir && /opt/qt4-maemo5/bin/qmake ../$(APPNAME).pro + cd builddir && qmake ../$(APPNAME).pro build: build-stamp diff --git a/debian/vicar.substvars b/debian/vicar.substvars index 766fde0..cc87600 100644 --- a/debian/vicar.substvars +++ b/debian/vicar.substvars @@ -1 +1 @@ -shlibs:Depends=libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libgconf2-6 (>= 2.13.5), libglib2.0-0 (>= 2.20.0), libqt4-maemo5-core (>= 4.6.2~git20100212), libqt4-maemo5-dbus (>= 4.6.2~git20100212), libqt4-maemo5-gui (>= 4.6.2~git20100212), libqt4-maemo5-xml (>= 4.6.2~git20100212), libstdc++6 (>= 4.2.1) +shlibs:Depends=libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libgconf2-6 (>= 2.13.5), libglib2.0-0 (>= 2.20.0), libqt4-core (>= 4.6.2~git20100401), libqt4-dbus (>= 4.6.2~git20100401), libqt4-gui (>= 4.6.2~git20100401), libqt4-sql (>= 4.6.2~git20100401), libqt4-xml (>= 4.6.2~git20100401), libstdc++6 (>= 4.2.1) diff --git a/src/data/icons/26x26/vicar_phone.png b/src/data/icons/26x26/vicar_phone.png new file mode 100755 index 0000000000000000000000000000000000000000..c28ff95365b10058acf574bdd618e63685cdf9ec GIT binary patch literal 1076 zcmV-41k3x0P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igb% z1UfT#cmWUq00Xp1L_t(Y$L*HAFDz{shp(AgV|Q6QS$2gW5>_Xxktk>sbP6AZe}MnM z79ydf)QCp0Q7N_&Dv=NoL`V>p0&C+dODqPv^Z8ch*n@N4<~@0f^K|pfJloCP1679q95ppHL?RJ}hli=DsmX)oMfCn+Wo3nE zG)hxb6E80>gu`JXkqC2hbCi~rq9_WMWnr2oS65f`_xCe9J4-g3rMkMBtE(%fr>9XA z#c@a)9UUG07|q$)8H0m^TwY#c+cvgsv%bDgU0oe+w;M%K2!%ov6%`=}0$#5dNs>4} zKj-A+1YOs;zrW|{>510X*6*c@$Kz~mZQ=EL+1S`191hdh*M}_2ghC+_i3H8f&1jm& z>gp=NV315E!{Xv14-XFs8AfhNTH8q7S%k1s# zv9z>=$K%1aZTx;ee!ri?!$Z>PG)G5AB$G)xIy!z0ipS%OkB`&a+w1JTd+K((X=!QU z;^KlpAb{WR=l=eli;D|P)16Pv$MnD z;UOg@CA_}Al1L<2TU(>5s*0VRolnJ^m);+#(P)&Rp&>-^N5k0O-ezQEgxlL&TrL-z zo0~j6Jz-fEWo2b3io)*hE~!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7I=BEa< zA_GDQE?>S(Utb@cot=E&_Ta$-6h*<~@!nWld7u9=g*(Zuiux;WjQ=NEZ44GD_dJzWp{VC?CtH9kw`?g zwzkSZARvRmpzP}ElJR(4wzs#-Xf!J0@wj~QTMVG&Dq|Qo*)uCt0mlqh7CLSr&~(!vWH0G#ouiDV;Oo_3PIw zYd}g#Hk&1xOj4~@@%emCV<;5j=+UDTi$z>67p7@CrlP7Ux~@A3bX|AASeE5nQc84P z|924zA@KQpoH=ubv9U2UO~Wt@hK7dd@9!s(NO1V@VQRISvnt!Ru`J6Gr=loMxfDfl z+Ls;jd;kBsyh2JTmzI`Dr_;>L%&@q)NIsv(Fbpb{3UhOFeEISPpU+3JSY%>i0sz~# zv2EL#YC>l)L?U!_bbQ0Iux(p@y?(Efy)2@002ovPDHLkV1h%AwY&fT literal 0 HcmV?d00001 diff --git a/src/data/icons/48x48/vicar_phone.png b/src/data/icons/48x48/vicar_phone.png new file mode 100755 index 0000000000000000000000000000000000000000..9379353fa9aae898548bef8a301ff5932b8394b8 GIT binary patch literal 2517 zcmX9=2{>C>8%B*aw3sSt8JgnPP*km{4njr6zSlmMVl1^(QA?|W8e5DYZAL@GU?P?& zLSrcr9b45{Lm5jkX)U!xRG8D}f9`YcdCtA}-0z(Cd%yQR*>*O!M1*97xVX4Pkd_Ds z&})8c0({`^%EQhC9e0ewEmN-g5!nqe;PbzI3&C~z?Rr72E&@*kqb%KHxVVHRzBO(x z+;b`LkUtiQGUuNa;Ndk;LFS|D!Dr4$go)GL51&i#-1VHe(4V@dy*70HT9Dy*RW=DF zs1@o_@TA52y{ePXC$kMRlNw@{z>)~>0Y|mWv)!D}m4XU^!hm6oms_L{qLu*53 zU-nyTqk`U3Y_&^bo}G>xLqlGLIG+g2L=6lDY$bO_k|RmfNsLUcMf&M>0Xsk6nWv7| zMeq-Cx62JyzQx_AF~6Vgp{qjt-6ivu+iWYxe#AhbNKBT{Poc=^7Li2{ zlX0DjF;xzSv$wx52H_LS{^BE6=z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MW<2o$esW^OLq1aQJ(kOg)NWIX_pSyAWn7s?+vN4Gj zVSKb+dC_npvWwH7Euo^HxTjiXjrJg+N7pJT6lnn0E04J4cGaH)+%3j+Tpd7`+^~Rr zhn$pHueBb2g_X~(3qha;uPFT^?gqo3;THvBJ95G2VNXjqqn@$OBzJwx)%(zWPxgCr zf(OZ8iZ7*W;c}Q1ANbSeMvh|W8L=`*FR&3ERPXW**P^~?Bz0f1(@n zI9BsdbkR5eG}JkBPcHAY`7-z0g-4oTPR?GY1Dd}uc`{WK`)F-SDv~+2ctaX{cWsCL z@EEW`)*w0{d&d06#T=SIhAHsEKEef8A5*24@DA-eo-2%&&sLU0+;gKjtFewerVLgRuVYaMyw1Hv%a+jyk&R#r~JmSDGf9lEhQ!8_QiqQ`q&FrOk-v0`h)n%onQBxXxYFt81ISloRRdJz=>88M(i;p=eH$ioS z3KGw!XIoT8;F@0RVrA(ebC!3OR^R-o1eZZKu7E>8F{WWMR{*y4m%6gzQ~5F2Ih#Lf zYr{koYgXM(|0G4%sduI(9ZSozgUmU@x}56n`MrKlM=ojN;7IM!|Bo_rcaP5sye|JI UO#oVmD=<~E3WQ{Tt`0l7uyjsO4v literal 0 HcmV?d00001 diff --git a/src/data/icons/64x64/vicar_phone.png b/src/data/icons/64x64/vicar_phone.png new file mode 100755 index 0000000000000000000000000000000000000000..1c578a9854c6630339993fc64bc6081a266ba679 GIT binary patch literal 3670 zcmY*cc|26__a9}MP$rFCH6*4Q`^3l+MT~tLlD){1v2QIy5kj(s#56urh)NknW0Xkt zOiZ@y+aOK$bu8bf|9-#MecgLs_qoqK&w0*yzu)KFL`!qSgS_Ir5D4TT)=1wP+;#t* zP;PK7^$8jVH;xc%!wZnI4#`>YzS)oZ|47pSe7@HLqiNIdQ zB?;{ti*0N^=@P^7Foomd13|PenWTR}S+wM^ppM&*f+xsq?{O|gtNr4KU+5LQfqTzZ zK9FxCprG`v z8d%{+pqxk~5&?sbE=D5dq8Om-@k{YT*4MwzhL+@A=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_+n(5=O!hSN$TcUYwgF0=5+wyz0s`=4fjJ*Qc{%F)Ig7d1jhLV1SW#1ppTS- zK{0+CpaOgQ`qs0;HDBen#GHw}#!T|0)U5?MN`B8%PpzZ|IuIrJ6X|75fkXFto&VZ@&iHI@AyY1lPSp0y?E;rz>h6%hb|U)Rz8Fae?sL1JHTMaRM@E{zCBe| zW#Zna-)r-9=QVAKnltCWY%p}vnxka0{{Mf_hO2MaNT;_Wdv$GXmms#VHTTxW**V3{ s!EVbJy}W0WtS@bAZ?CGO({UccTcM1>r5soXKYb9afw_L!1-F?00SDIj9RL6T literal 0 HcmV?d00001 diff --git a/src/data/icons/Icon Source.txt b/src/data/icons/Icon Source.txt new file mode 100644 index 0000000..78dd38c --- /dev/null +++ b/src/data/icons/Icon Source.txt @@ -0,0 +1,5 @@ +http://www.iconfinder.com/browse/iconset/DarkGlass_Reworked/#readme + +All credits to creators of the icons (Licensed under GPL) + + diff --git a/src/data/icons/vicar-application.png.base64 b/src/data/icons/vicar-application.png.base64 new file mode 100644 index 0000000..3373c3e --- /dev/null +++ b/src/data/icons/vicar-application.png.base64 @@ -0,0 +1,64 @@ +begin-base64 777 vicar-application.png +iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c +6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0 +SU1FB9oIAwM2Kg1VlzwAAApHSURBVGje7VhtbBxX2T3PvfM9s971bhon7iaO +k7ROrLgpiS3SgigNRUWq3legKEitGkpBohGQIISIUPiDUFWVikJlVQj4QdUK +FCGIUsTbvqIFRwltCaqw7LbIdWIlthOc9W52vVnv7szOzL2XH+ysnAJtWsof +8JEezezM3J1z7j17n+dZYBWrWMUqVrGKVazivxf0fn/hwYMHTSGEqWmaJqXk +UkqmlCKlFGzbhq7rsaZpcRRFwrIs/9FHH41Xjn/sscdw5MiRf5+Affv24fjx +49dcO3DgwMY4jm/RNO0DSqk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diff --git a/src/data/icons/vicar_application.png b/src/data/icons/vicar_application.png new file mode 100755 index 0000000000000000000000000000000000000000..2b1188752eff68439475fe6d1f53bee2775c8f1a GIT binary patch literal 2759 zcmXw5XH=8P8va0#&=w+514JNEN?2rRi*bQa3`^%?mM$S8q67iyY^V`JFN)wI9d#3K zj6{%*1cI!fv@A;r7%2)0Y$z(y4CQ|QxM$AHduD#jyz|aeCd9K_n7yV+F8=5zFA@=oJSW9B}x(RkLdf!4=6cTdzm}kXHEKMS#+B zIJhVgW#?oq@dk3_h_SY;Td^qsNZHuoEL{Uoe#xr zBts-0*R3?aioT-WtWdrg8pHNlUmF}AWEZQhJSi6q@$OgsRG>1nGWfP4a?LEhYSHWR zai-@>ZTI?YwU9=XsuwN!T2x7n6T;#Ax-1Jp0J+8S-D5~W`_tc`8;;r2D2yu zBw+IAbto|Cls#ID#(}5ONfmSDshQOzCAj|`yeMGgbOF(arD#A222LB-2?T;U`O9m~ z0pZqas=O!{D_rT)sDA!j*}=hKk{#b7AkQqO$rHB|&AU1}a({hvOHT$#qZS=2j|?c) zAhbn@=jzKti|}eFyw{kj0xY|NIW@RdVIa&MO zi;qKP&~#*T@Kj1$+xg(x&QpelhFUPGIvweThK9LvaQE1rrKP0_S!Lt$x9s?H5p4)W z-^Eh;19#@g;Nalxj~_pFni?7^9G>=FS+zCE-)PBz3&iWpA)+uT@yD*(W5LGI^atKP zKGby~(T;|H{QS8Ie{?ieE4vP?uU588t-HRt`E3tk;_+~Ve_$Y_)?NDCbdKP=Z z<@S6vNRp~pcgvUEz2cvIJ9Zw2@Y&5FswxNs4xWC$wDd*JPo4KYzr*R}>q5=&kAsRv zO0xIqC7BlRbYewC#eOZFv zpFb3%j5OEIRCxz34p&To)Z(VeA1aGk9_7sLXXmS!W!tEb#pFysSQYEPmM#~P-kX*;pz2iw2tVgsK&3IlAy9A z4qe-D8s1e+RohwOC%(QQXBL&Bzhy@&Qc_i|X}ZCCI2HUJtYzl>4FwS2FDqhavUYdL zV7lNP0=!N@N958oGUTR{5BDS1XV{<~$KMnUWpBDWIy!=UCgKL4x&vFo65ZTUnsT892id8JQl69~?{&)E;|u zJ@`y{%gf8_q8yOCdRXkin%F|b`J#b<+}zxRg-ssOT+w>uC#TUp$A+n3cJyT;aaO{h zWbk^~(8rTOO{K@hZaoVrdp4y53MxocBPB>mbs<~PUr*+dKO>HvkIC;o@4*t>rIWzR zKO~jPIXgPSVpb+c(6h4_IUEi^uc;~EE(*^Me4BombJC2vfpya@CLaA8oh5RaTWKay zgy%Lo1bh%;U+A6b3%~4j0#K8=Feca>UU~Xz(uJzRE>_9!}ZeA^e`>Sr7t~-=C9=!-d(_rex zS@W$5rSxt+83fN`F0=7$>M8AZj7 zw^5P7V17!Xw+8)bl58p`5r8Y~_O%N2?n- zDXeQK2x^=w{%sBsKF2kl2Av z75W@Bm|Co!`0YmV)CmfV5(-Qi?=}H(Q3PTY&Ev@-Aj literal 0 HcmV?d00001 diff --git a/src/data/icons/vicar_scalable_icon.png b/src/data/icons/vicar_scalable_icon.png new file mode 100755 index 0000000000000000000000000000000000000000..8ad8f4a1090f05cf40468fed9378496f12197b95 GIT binary patch literal 10549 zcmdsdRajJC*zcx?9uN@$5fA}k2t52 zw|LI;-JGj)ePEawYVS2`zwfW!iB*50KukbQ06`G3;&VAo@F;cr1;YjRD0}x6@POf| zsUQPYkI`;{Z*VP?7383s+s}gbvbW$T_-@Y)JRyki&g~Zll$ApTeu(F#s49=Q03(3N zaI>-GxPEk%;+i&5oL4ea;J^!2BOkQ4Jo83<}4`-Qwn~M(gIi}1#B|)+v7E?Km zYEw|sis|}=_LJXI%AG&jH|k8FCUvFbwAsRoP)481=V4En>==ei=U+cAaVImE?dqW- z!pM%Xq%r*w@b}_f0NVS-&0OZB)I5a$9(8j4Ud?k)Z2VNTb1!Ev5RbJuf#=Krb@z`0 z>#RlMqy1EAoN@-|l?1viLemh-3_Qkp(pe@{M8ab|cUj|lo|M>YPz+*AH(4$EPOqeB{ zUW%fBH7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z9@;M? z0nroDW74+Y&ewGNv za-kVTU%DYg%kDSD$MxU4j5|{N40?A~JQDwif6jnSj~%!~DC}8dw(T>gZI-wlgf7Po zM2}=b3%pqR#yi5%{UxT4(#C&&Vb&H1_f?6}npZ)POZSS3ONRE}Kops(s6ZQQp3K`8 z=#^4}vas|?rUwYqFOu%+e%enVuoUJWBWTK!YM+!_7Mnd8}JDuYC zvc3YQmp{sF;1v_)W^;+C!1D(&@^?9(cD~6xe-%`FDguTH@*dHH zZ^~Q`TF6gNf;WgXe|^e;X^T#*m{tu23>R8Fk=``15WrC8PoDi=+h_G7;w)j+qG~^w zPwErh82OBiz~JG^e@>++l$-_yrW8x$yGVEhT$3?!Gx9Yf!+Y!kAyLunE>Va4vy%naMKumtpfzt^zO7p_~vkBzjS_S zq7_E;UQ!De~B(K1Kyv9eOrb~D{s3Rjp zeRRw+bD(}}uM6n4K@-PJd^hkO)pd|kw0=9Z}d6H%Lv=7*7iNJsRz@YuV aJ_&rke*-=5SA2O+wBCL@^ZDNy(Ek8{Kj;_$ literal 0 HcmV?d00001 diff --git a/src/data/org.freedesktop.Telepathy.ConnectionManager.vicar.service b/src/data/org.freedesktop.Telepathy.ConnectionManager.vicar.service new file mode 100644 index 0000000..8702fca --- /dev/null +++ b/src/data/org.freedesktop.Telepathy.ConnectionManager.vicar.service @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.freedesktop.Telepathy.ConnectionManager.vicar +Exec=/opt/vicar/vicar-telepathy diff --git a/src/data/org.maemo.vicar.service b/src/data/org.maemo.vicar.service old mode 100644 new mode 100755 index 4e71e50..b39eaaf --- a/src/data/org.maemo.vicar.service +++ b/src/data/org.maemo.vicar.service @@ -1,5 +1,4 @@ -# Author: Sudheer K. -# Service description file [D-BUS Service] Name=org.maemo.vicar Exec=/opt/vicar/vicar-daemon +User=user diff --git a/src/data/vicar-config.desktop b/src/data/vicar-config.desktop old mode 100644 new mode 100755 index b81911b..be24c3c --- a/src/data/vicar-config.desktop +++ b/src/data/vicar-config.desktop @@ -5,4 +5,4 @@ Version=1.0 Type=Application Name=Vicar Exec=/opt/vicar/vicar-config -Icon=qgn_list_gene_default_app +Icon=vicar_scalable_icon diff --git a/src/data/vicar.manager b/src/data/vicar.manager new file mode 100644 index 0000000..bdd8fc0 --- /dev/null +++ b/src/data/vicar.manager @@ -0,0 +1,24 @@ +[ConnectionManager] +BusName=org.freedesktop.Telepathy.ConnectionManager.vicar +ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/vicar + +[Protocol tel] +param-com.nokia.Telepathy.Connection.Interface.GSM.IMSI=s dbus-property + +param-com.nokia.Telepathy.Connection.Interface.GSM.Privacy=s dbus-property +# empty - set by network - let network decide +# "id" - no - do not send caller id (by default) +# "no-id" - yes - send caller id (by default) +default-com.nokia.Telepathy.Connection.Interface.GSM.Privacy= + +# SMS Service Centre +param-com.nokia.Telepathy.Connection.Interface.GSM.SMSServiceCentre=s dbus-property + +# SMS validity period in seconds +# Range from 300 ... 38102400 (5 minutes to 63 weeks) +param-com.nokia.Telepathy.Connection.Interface.GSM.SMSValidityPeriod=u dbus-property +default-com.nokia.Telepathy.Connection.Interface.GSM.SMSValidityPeriod=0 + +# Deprecated +param-account=s +param-password=s diff --git a/src/data/vicar.profile b/src/data/vicar.profile new file mode 100644 index 0000000..838b9e2 --- /dev/null +++ b/src/data/vicar.profile @@ -0,0 +1,19 @@ +[Profile] +DisplayName = Vicar +IconName = vicar_phone +Manager = vicar +Protocol = tel +Priority = -1 +VCardDefault = 1 +VCardField = X-VICAR +#SecondaryVCardFields = TEL +Capabilities = voice-p2p, split-account +ConfigurationUI = osso-accounts +LocalizationDomain = rtcom-call-ui + +[Action call] +Name = Call via Vicar +IconName = vicar_phone +VCardFields = X-VICAR,TEL +#SecondaryVCardFields = TEL +prop-org.freedesktop.Telepathy.Channel.ChannelType-s = org.freedesktop.Telepathy.Channel.Type.StreamedMedia diff --git a/src/data/xml/connectioninterfacerequestsadaptor.cpp b/src/data/xml/connectioninterfacerequestsadaptor.cpp new file mode 100644 index 0000000..4ddb520 --- /dev/null +++ b/src/data/xml/connectioninterfacerequestsadaptor.cpp @@ -0,0 +1,53 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i ../../connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a connectioninterfacerequestsadaptor.h:connectioninterfacerequestsadaptor.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "connectioninterfacerequestsadaptor.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class ConnectionInterfaceRequestsAdaptor + */ + +ConnectionInterfaceRequestsAdaptor::ConnectionInterfaceRequestsAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +ConnectionInterfaceRequestsAdaptor::~ConnectionInterfaceRequestsAdaptor() +{ + // destructor +} + +org::freedesktop::Telepathy::RequestableChannelClassList ConnectionInterfaceRequestsAdaptor::requestableChannelClasses() const +{ + // get the value of property RequestableChannelClasses + return qvariant_cast< org::freedesktop::Telepathy::RequestableChannelClassList >(parent()->property("RequestableChannelClasses")); +} + +QDBusObjectPath ConnectionInterfaceRequestsAdaptor::CreateChannel(const QVariantMap &request, QVariantMap &channel_properties) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.CreateChannel + //return static_cast(parent())->CreateChannel(request, channel_properties); +} + +bool ConnectionInterfaceRequestsAdaptor::EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.EnsureChannel + //return static_cast(parent())->EnsureChannel(request, channel_object, channel_properties); +} + diff --git a/src/data/xml/connectioninterfacerequestsadaptor.h b/src/data/xml/connectioninterfacerequestsadaptor.h new file mode 100644 index 0000000..fb99320 --- /dev/null +++ b/src/data/xml/connectioninterfacerequestsadaptor.h @@ -0,0 +1,77 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i ../../connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a connectioninterfacerequestsadaptor.h:connectioninterfacerequestsadaptor.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef CONNECTIONINTERFACEREQUESTSADAPTOR_H_1282550631 +#define CONNECTIONINTERFACEREQUESTSADAPTOR_H_1282550631 + +#include +#include +#include "../../connectioninterfacerequeststypes.h" +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface org.freedesktop.Telepathy.Connection.Interface.Requests + */ +class ConnectionInterfaceRequestsAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Telepathy.Connection.Interface.Requests") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + ConnectionInterfaceRequestsAdaptor(QObject *parent); + virtual ~ConnectionInterfaceRequestsAdaptor(); + +public: // PROPERTIES + Q_PROPERTY(org::freedesktop::Telepathy::RequestableChannelClassList RequestableChannelClasses READ requestableChannelClasses) + org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses() const; + +public Q_SLOTS: // METHODS + QDBusObjectPath CreateChannel(const QVariantMap &request, QVariantMap &channel_properties); + bool EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties); +Q_SIGNALS: // SIGNALS + void ChannelClosed(const QDBusObjectPath &removed_channel_object); + void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels); +}; + +#endif diff --git a/src/data/xml/org.freedesktop.Telepathy.Account.xml b/src/data/xml/org.freedesktop.Telepathy.Account.xml new file mode 100644 index 0000000..d6c5e5c --- /dev/null +++ b/src/data/xml/org.freedesktop.Telepathy.Account.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/xml/org.freedesktop.Telepathy.AccountManager.xml b/src/data/xml/org.freedesktop.Telepathy.AccountManager.xml new file mode 100644 index 0000000..883e074 --- /dev/null +++ b/src/data/xml/org.freedesktop.Telepathy.AccountManager.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml b/src/data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml new file mode 100644 index 0000000..75d026c --- /dev/null +++ b/src/data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/xml/org.freedesktop.Telepathy.Connection.xml b/src/data/xml/org.freedesktop.Telepathy.Connection.xml new file mode 100644 index 0000000..1cd18fc --- /dev/null +++ b/src/data/xml/org.freedesktop.Telepathy.Connection.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/data/xml/org.maemo.vicar.xml b/src/data/xml/org.maemo.vicar.xml new file mode 100755 index 0000000..0e04435 --- /dev/null +++ b/src/data/xml/org.maemo.vicar.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/src.pro b/src/src.pro old mode 100644 new mode 100755 index 7d78c54..a0b7ed3 --- a/src/src.pro +++ b/src/src.pro @@ -3,16 +3,37 @@ CONFIG += ordered SUBDIRS += vicar-lib SUBDIRS += vicar-daemon SUBDIRS += vicar-config +SUBDIRS += vicar-telepathy +SUBDIRS += vicar-utils #MAKE INSTALL -INSTALLS += desktop service vicar-up +INSTALLS += desktop service manager profile icon26 icon32 icon48 icon64 scalable desktop.path = /usr/share/applications/hildon desktop.files += data/vicar-config.desktop service.path = /usr/share/dbus-1/services service.files = data/org.maemo.vicar.service +service.files += data/org.freedesktop.Telepathy.ConnectionManager.vicar.service -vicar-up.path = /etc/event.d/ -vicar-up.files = data/event.d/launch-vicar +manager.path = /usr/share/telepathy/managers +manager.files = data/vicar.manager + +profile.path = /usr/share/osso-rtcom +profile.files = data/vicar.profile + +icon26.path = /opt/usr/share/icons/hicolor/26x26/apps +icon26.files += data/icons/26x26/vicar_phone.png + +icon32.path = /opt/usr/share/icons/hicolor/32x32/apps +icon32.files += data/icons/32x32/vicar_phone.png + +icon48.path = /opt/usr/share/icons/hicolor/48x48/apps +icon48.files += data/icons/48x48/vicar_phone.png + +icon64.path = /opt/usr/share/icons/hicolor/64x64/apps +icon64.files += data/icons/64x64/vicar_phone.png + +scalable.path = /opt/usr/share/icons/hicolor/scalable/apps +scalable.files += data/icons/vicar_scalable_icon.png diff --git a/src/vicar-config/src/main.cpp b/src/vicar-config/src/main.cpp old mode 100644 new mode 100755 index e8b3418..b43a23e --- a/src/vicar-config/src/main.cpp +++ b/src/vicar-config/src/main.cpp @@ -1,16 +1,21 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ + #include -#include "configwindow.h" +#include "profileswindow.h" +#include "vicarprofiletypes.h" + int main(int argc, char *argv[]) { + //qDBusRegisterMetaType(); + //qDBusRegisterMetaType(); QApplication a(argc, argv); - ConfigWindow w; + ProfilesWindow w; w.show(); return a.exec(); } diff --git a/src/vicar-config/src/profilesettingsdialog.cpp b/src/vicar-config/src/profilesettingsdialog.cpp new file mode 100644 index 0000000..314e9ca --- /dev/null +++ b/src/vicar-config/src/profilesettingsdialog.cpp @@ -0,0 +1,77 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ + +#include "profilesettingsdialog.h" +#include "ui_profilesettingsdialog.h" +#include "vicarprofiletypes.h" +#include + +ProfileSettingsDialog::ProfileSettingsDialog(QWidget *parent, org::maemo::vicar::Profile *profile) : + QDialog(parent), + ui(new Ui::ProfileSettingsDialog) +{ + ui->setupUi(this); + this->profile = profile; + + if (profile != 0){ + //Load Profile values + ui->lineEditNumberStartsWith->setText(profile->phoneNumberPattern); + ui->lineEditCallingCardNumber->setText(profile->gatewayNumber); + int intIndex = ui->comboBoxDTMFFormat->findText(profile->dtmfFormat); + ui->comboBoxDTMFFormat->setCurrentIndex(intIndex); + ui->lineEditDTMFPrefix->setText(profile->dtmfPrefix); + ui->lineEditDTMFSuffix->setText(profile->dtmfSuffix); + } + + ui->lineEditCallingCardNumber->setValidator(new QRegExpValidator(QRegExp( "^-?\\d\\d*$"), this)); + ui->lineEditDTMFPrefix->setValidator(new QRegExpValidator(QRegExp( "^[0-9p#\\*]*$"), this)); + ui->lineEditDTMFSuffix->setValidator(new QRegExpValidator(QRegExp( "^[0-9p#\\*]*$"), this)); +} + +ProfileSettingsDialog::~ProfileSettingsDialog() +{ + delete ui; +} + + +void ProfileSettingsDialog::on_saveButton_clicked() +{ + QString strMessage = QString(""); + if (profile != 0){ + QString strNumberStartsWith = ui->lineEditNumberStartsWith->text(); + if (strNumberStartsWith.isEmpty()){ + strMessage.append("Enter Phone number starts with\n"); + ui->lineEditNumberStartsWith->setFocus(); + } + + QString strCallingCardNumber = ui->lineEditCallingCardNumber->text(); + + if (strCallingCardNumber.isEmpty()){ + strMessage.append("Enter a calling card number\n"); + ui->lineEditCallingCardNumber->setFocus(); + } + + if (strMessage.isEmpty()){ + profile->phoneNumberPattern = ui->lineEditNumberStartsWith->text(); + profile->gatewayNumber = ui->lineEditCallingCardNumber->text(); + profile->dtmfFormat = ui->comboBoxDTMFFormat->currentText(); + profile->dtmfPrefix = ui->lineEditDTMFPrefix->text(); + profile->dtmfSuffix = ui->lineEditDTMFSuffix->text(); + this->accept(); + } + else{ + QMessageBox::warning(this,"Invalid Data",strMessage); + } + } + else{ + this->accept(); + } +} + +void ProfileSettingsDialog::on_closeButton_clicked() +{ + this->reject(); +} diff --git a/src/vicar-config/src/profilesettingsdialog.h b/src/vicar-config/src/profilesettingsdialog.h new file mode 100644 index 0000000..e73aad4 --- /dev/null +++ b/src/vicar-config/src/profilesettingsdialog.h @@ -0,0 +1,33 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ +#ifndef PROFILESETTINGSDIALOG_H +#define PROFILESETTINGSDIALOG_H + +#include +#include "vicarprofiletypes.h" + +namespace Ui { + class ProfileSettingsDialog; +} + +class ProfileSettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ProfileSettingsDialog(QWidget *parent = 0,org::maemo::vicar::Profile *profile = 0); + ~ProfileSettingsDialog(); + +private: + Ui::ProfileSettingsDialog *ui; + org::maemo::vicar::Profile *profile; + +private slots: + void on_closeButton_clicked(); + void on_saveButton_clicked(); +}; + +#endif // PROFILESETTINGSDIALOG_H diff --git a/src/vicar-config/src/profileswindow.cpp b/src/vicar-config/src/profileswindow.cpp new file mode 100644 index 0000000..78785a8 --- /dev/null +++ b/src/vicar-config/src/profileswindow.cpp @@ -0,0 +1,195 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ + +#include "profileswindow.h" +#include "ui_profileswindow.h" +#include "profilesettingsdialog.h" +#include "gconfutility.h" +#include "dbusutility.h" +#include "telepathyutility.h" +#include "databaseutility.h" +#include +#include + +class ProfilesWindowPrivate +{ +public: + ProfilesWindowPrivate(ProfilesWindow * p) : + gconfUtility(new GConfUtility(p)), + dbusUtility(new DbusUtility(p)), + tpUtility(new TelepathyUtility(p)), + databaseUtility(new DatabaseUtility(p)), + parent(p) + { + databaseUtility->openDatabase(); + + } + + ~ProfilesWindowPrivate() + { + databaseUtility->closeDatabase(); + qDebug() << "VICaR: ProfilesWindowPrivate Destructing"; + } + + GConfUtility * gconfUtility; + DbusUtility * dbusUtility; + TelepathyUtility *tpUtility; + DatabaseUtility *databaseUtility; + org::maemo::vicar::Profile *profile; + ProfilesWindow * const parent; +}; + +// --------------------------------------------------------------------------- + +ProfilesWindow::ProfilesWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::ProfilesWindow), + d(new ProfilesWindowPrivate(this)) +{ + ui->setupUi(this); + loadProfilesList(); + + ui->actionRoutingEnabled->setChecked(d->tpUtility->accountExists()); + + bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default"); + ui->actionRouteOnDefault->setChecked(routeOnDefault); + +} + +ProfilesWindow::~ProfilesWindow() +{ + delete ui; +} + +void ProfilesWindow::loadProfilesList(){ + org::maemo::vicar::ProfileList profileList; + bool result = d->databaseUtility->getAllProfiles(&profileList); + if (!result){ + d->dbusUtility->displayNotification("Unable to get profiles list."); + qDebug() << "Error fetching profiles list. "<< d->databaseUtility->lastError(); + } + else{ + //ui->profilesListWidget->clear(); + org::maemo::vicar::Profile currentProfile; + foreach (currentProfile,profileList){ + QString strProfileDetails = QString("Number starts with %1 then call via %2") + .arg(currentProfile.phoneNumberPattern) + .arg(currentProfile.gatewayNumber); + QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget); + item->setData(Qt::UserRole,currentProfile.profileID); + } + } +} + +void ProfilesWindow::on_addButton_clicked() +{ + org::maemo::vicar::Profile newProfile; + ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&newProfile); + int result = dialog->exec(); + if (result == QDialog::Accepted){ + qDebug() << "Inserting new profile record"; + int result = d->databaseUtility->insertProfile(newProfile); + if (result == -1){ + d->dbusUtility->displayNotification("Unable to create new profile."); + qDebug() << "Error inserting new profile record. "<< d->databaseUtility->lastError(); + } + else{ + QString strProfileDetails = QString("Number starts with %1 then call via %2") + .arg(newProfile.phoneNumberPattern) + .arg(newProfile.gatewayNumber); + QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget); + item->setData(Qt::UserRole,result); + } + } +} + +void ProfilesWindow::on_editButton_clicked(){ + QListWidgetItem *item = ui->profilesListWidget->currentItem(); + if (item != 0){ + int intProfileID = item->data(Qt::UserRole).toInt(); + org::maemo::vicar::Profile profile; + bool result = d->databaseUtility->selectProfile(intProfileID,&profile); + if (!result){ + d->dbusUtility->displayNotification("Unable to fetch profile details."); + qDebug() << "Error fetching profile record for id "<< intProfileID + <<". "<< d->databaseUtility->lastError(); + } + else{ + ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile); + int response = dialog->exec(); + if (response == QDialog::Accepted){ + qDebug() << "Updating profile record"; + bool result = d->databaseUtility->updateProfile(profile); + if (!result){ + d->dbusUtility->displayNotification("Unable to update profile."); + qDebug() << "Error fetching profile record for id "<< intProfileID + <<". "<< d->databaseUtility->lastError(); + } + else{ + QString strProfileDetails = QString("Number starts with %1 then \n call via %2") + .arg(profile.phoneNumberPattern) + .arg(profile.gatewayNumber); + item->setText(strProfileDetails); + item->setData(Qt::UserRole,result); + } + } + } + } + else{ + d->dbusUtility->displayNotification("Select a profile to edit."); + } +} + +void ProfilesWindow::on_removeButton_clicked(){ + QListWidgetItem *item = ui->profilesListWidget->currentItem(); + if (item != 0){ + int intProfileID = item->data(Qt::UserRole).toInt(); + bool result = d->databaseUtility->deleteProfile(intProfileID); + if (!result){ + d->dbusUtility->displayNotification("Unable to delete profile."); + qDebug() << "Error deleting profile record for id "<< intProfileID + <<". "<< d->databaseUtility->lastError(); + } + else{ + //ui->profilesListWidget->removeItemWidget(item); + ui->profilesListWidget->clear(); + this->loadProfilesList(); + } + } + else{ + d->dbusUtility->displayNotification("Select a profile to delete."); + } +} + +void ProfilesWindow::on_actionRoutingEnabled_triggered(bool checked){ + + qDBusRegisterMetaType(); + + bool result; + + if (checked){ + if (!d->tpUtility->accountExists()){ + result = d->tpUtility->createAccount(); + if (!result){ + d->dbusUtility->displayNotification("Unable to enable call routing."); + ui->actionRoutingEnabled->setChecked(false); + } + } + } + else{ + if (d->tpUtility->accountExists()){ + result = d->tpUtility->deleteAccount(); + if (!result){ + d->dbusUtility->displayNotification("Unable to disable call routing."); + ui->actionRoutingEnabled->setChecked(true); + } + } + } +} + +void ProfilesWindow::on_actionRouteOnDefault_triggered(bool checked){ + d->gconfUtility->setGconfValueBoolean("route_on_default",checked); +} diff --git a/src/vicar-config/src/profileswindow.h b/src/vicar-config/src/profileswindow.h new file mode 100644 index 0000000..3075ac7 --- /dev/null +++ b/src/vicar-config/src/profileswindow.h @@ -0,0 +1,38 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ +#ifndef PROFILESWINDOW_H +#define PROFILESWINDOW_H + +#include + +namespace Ui { + class ProfilesWindow; +} + +class ProfilesWindowPrivate; + +class ProfilesWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit ProfilesWindow(QWidget *parent = 0); + ~ProfilesWindow(); + void loadProfilesList(); + +private: + Ui::ProfilesWindow *ui; + ProfilesWindowPrivate * const d; + +private slots: + void on_addButton_clicked(); + void on_editButton_clicked(); + void on_removeButton_clicked(); + void on_actionRoutingEnabled_triggered(bool checked); + void on_actionRouteOnDefault_triggered(bool checked); +}; + +#endif // PROFILESWINDOW_H diff --git a/src/vicar-config/uis/profilesettingsdialog.ui b/src/vicar-config/uis/profilesettingsdialog.ui new file mode 100644 index 0000000..f55f5ee --- /dev/null +++ b/src/vicar-config/uis/profilesettingsdialog.ui @@ -0,0 +1,312 @@ + + + ProfileSettingsDialog + + + Qt::ApplicationModal + + + + 0 + 0 + 800 + 400 + + + + Edit Profile + + + true + + + + + 0 + 10 + 681 + 371 + + + + true + + + + + 0 + 0 + 679 + 369 + + + + + + 10 + 10 + 661 + 351 + + + + + QFormLayout::AllNonFixedFieldsGrow + + + 10 + + + + + + 0 + 0 + + + + + 280 + 25 + + + + + 280 + 16777215 + + + + Number starts with: + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 60 + + + + Qt::ImhDigitsOnly + + + + + + + Calling Card Number: + + + + + + + + 0 + 0 + + + + + 0 + 60 + + + + Qt::ImhDigitsOnly + + + + + + + + 0 + 0 + + + + + 280 + 25 + + + + + 280 + 16777215 + + + + Format required for DTMF tone: + + + true + + + + + + + + 0 + 0 + + + + + 50 + 60 + + + + + <Country Code><Area Code><Phone Number> + + + + + +<Country Code><Area Code><Phone Number> + + + + + 00<Country Code><Area Code><Phone Number> + + + + + 011<Country Code><Area Code><Phone Number> + + + + + + + + Prefix before DTMF tone: + + + + + + + + 0 + 0 + + + + + 0 + 60 + + + + Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers + + + + + + + Suffix after DTMF tone: + + + + + + + + 0 + 0 + + + + + 0 + 60 + + + + Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers + + + + + + + + + + + 696 + 22 + 101 + 124 + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + Save + + + + + + + Qt::Vertical + + + + 17 + 30 + + + + + + + + + 0 + 40 + + + + Close + + + + + + + + + diff --git a/src/vicar-config/uis/profileswindow.ui b/src/vicar-config/uis/profileswindow.ui new file mode 100644 index 0000000..8a76e4f --- /dev/null +++ b/src/vicar-config/uis/profileswindow.ui @@ -0,0 +1,147 @@ + + + ProfilesWindow + + + + 0 + 0 + 800 + 480 + + + + VICaR - Profiles + + + + + + 31 + 11 + 741 + 411 + + + + + + + + + Add + + + + + + + Qt::Horizontal + + + + 58 + 20 + + + + + + + + Edit + + + + + + + Qt::Horizontal + + + + 58 + 20 + + + + + + + + Remove + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + true + + + + + + + + + + 0 + 0 + 800 + 23 + + + + + VICaR - Profiles + + + + + + + + + true + + + Routing Enabled + + + Call Routing Enabled? + + + + + true + + + Call Directly on Default + + + Call directly if no match found? + + + + + + diff --git a/src/vicar-config/uis/ui_profilesettingsdialog.h b/src/vicar-config/uis/ui_profilesettingsdialog.h new file mode 100644 index 0000000..edc0067 --- /dev/null +++ b/src/vicar-config/uis/ui_profilesettingsdialog.h @@ -0,0 +1,224 @@ +/******************************************************************************** +** Form generated from reading UI file 'profilesettingsdialog.ui' +** +** Created: Tue Sep 7 04:21:07 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PROFILESETTINGSDIALOG_H +#define UI_PROFILESETTINGSDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ProfileSettingsDialog +{ +public: + QScrollArea *scrollArea; + QWidget *scrollAreaWidgetContents; + QWidget *formLayoutWidget; + QFormLayout *formLayoutBasic; + QLabel *labelNumberStartsWith; + QLineEdit *lineEditNumberStartsWith; + QLabel *labelCallingCardNumber; + QLineEdit *lineEditCallingCardNumber; + QLabel *labelDTMFFormat; + QComboBox *comboBoxDTMFFormat; + QLabel *labelDTMFPrefix; + QLineEdit *lineEditDTMFPrefix; + QLabel *labelDTMFSuffix; + QLineEdit *lineEditDTMFSuffix; + QWidget *layoutWidget; + QVBoxLayout *verticalLayout; + QPushButton *saveButton; + QSpacerItem *verticalSpacer; + QPushButton *closeButton; + + void setupUi(QDialog *ProfileSettingsDialog) + { + if (ProfileSettingsDialog->objectName().isEmpty()) + ProfileSettingsDialog->setObjectName(QString::fromUtf8("ProfileSettingsDialog")); + ProfileSettingsDialog->setWindowModality(Qt::ApplicationModal); + ProfileSettingsDialog->resize(800, 400); + ProfileSettingsDialog->setModal(true); + scrollArea = new QScrollArea(ProfileSettingsDialog); + scrollArea->setObjectName(QString::fromUtf8("scrollArea")); + scrollArea->setGeometry(QRect(0, 10, 681, 371)); + scrollArea->setWidgetResizable(true); + scrollAreaWidgetContents = new QWidget(); + scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents")); + scrollAreaWidgetContents->setGeometry(QRect(0, 0, 679, 369)); + formLayoutWidget = new QWidget(scrollAreaWidgetContents); + formLayoutWidget->setObjectName(QString::fromUtf8("formLayoutWidget")); + formLayoutWidget->setGeometry(QRect(10, 10, 661, 351)); + formLayoutBasic = new QFormLayout(formLayoutWidget); + formLayoutBasic->setObjectName(QString::fromUtf8("formLayoutBasic")); + formLayoutBasic->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); + formLayoutBasic->setContentsMargins(10, 0, 0, 0); + labelNumberStartsWith = new QLabel(formLayoutWidget); + labelNumberStartsWith->setObjectName(QString::fromUtf8("labelNumberStartsWith")); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(labelNumberStartsWith->sizePolicy().hasHeightForWidth()); + labelNumberStartsWith->setSizePolicy(sizePolicy); + labelNumberStartsWith->setMinimumSize(QSize(280, 25)); + labelNumberStartsWith->setMaximumSize(QSize(280, 16777215)); + labelNumberStartsWith->setMargin(0); + + formLayoutBasic->setWidget(0, QFormLayout::LabelRole, labelNumberStartsWith); + + lineEditNumberStartsWith = new QLineEdit(formLayoutWidget); + lineEditNumberStartsWith->setObjectName(QString::fromUtf8("lineEditNumberStartsWith")); + QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Fixed); + sizePolicy1.setHorizontalStretch(0); + sizePolicy1.setVerticalStretch(0); + sizePolicy1.setHeightForWidth(lineEditNumberStartsWith->sizePolicy().hasHeightForWidth()); + lineEditNumberStartsWith->setSizePolicy(sizePolicy1); + lineEditNumberStartsWith->setMinimumSize(QSize(0, 60)); + lineEditNumberStartsWith->setInputMethodHints(Qt::ImhDigitsOnly); + + formLayoutBasic->setWidget(0, QFormLayout::FieldRole, lineEditNumberStartsWith); + + labelCallingCardNumber = new QLabel(formLayoutWidget); + labelCallingCardNumber->setObjectName(QString::fromUtf8("labelCallingCardNumber")); + + formLayoutBasic->setWidget(1, QFormLayout::LabelRole, labelCallingCardNumber); + + lineEditCallingCardNumber = new QLineEdit(formLayoutWidget); + lineEditCallingCardNumber->setObjectName(QString::fromUtf8("lineEditCallingCardNumber")); + sizePolicy1.setHeightForWidth(lineEditCallingCardNumber->sizePolicy().hasHeightForWidth()); + lineEditCallingCardNumber->setSizePolicy(sizePolicy1); + lineEditCallingCardNumber->setMinimumSize(QSize(0, 60)); + lineEditCallingCardNumber->setInputMethodHints(Qt::ImhDigitsOnly); + + formLayoutBasic->setWidget(1, QFormLayout::FieldRole, lineEditCallingCardNumber); + + labelDTMFFormat = new QLabel(formLayoutWidget); + labelDTMFFormat->setObjectName(QString::fromUtf8("labelDTMFFormat")); + sizePolicy.setHeightForWidth(labelDTMFFormat->sizePolicy().hasHeightForWidth()); + labelDTMFFormat->setSizePolicy(sizePolicy); + labelDTMFFormat->setMinimumSize(QSize(280, 25)); + labelDTMFFormat->setMaximumSize(QSize(280, 16777215)); + labelDTMFFormat->setWordWrap(true); + + formLayoutBasic->setWidget(2, QFormLayout::LabelRole, labelDTMFFormat); + + comboBoxDTMFFormat = new QComboBox(formLayoutWidget); + comboBoxDTMFFormat->setObjectName(QString::fromUtf8("comboBoxDTMFFormat")); + QSizePolicy sizePolicy2(QSizePolicy::Minimum, QSizePolicy::Minimum); + sizePolicy2.setHorizontalStretch(0); + sizePolicy2.setVerticalStretch(0); + sizePolicy2.setHeightForWidth(comboBoxDTMFFormat->sizePolicy().hasHeightForWidth()); + comboBoxDTMFFormat->setSizePolicy(sizePolicy2); + comboBoxDTMFFormat->setMinimumSize(QSize(50, 60)); + + formLayoutBasic->setWidget(2, QFormLayout::FieldRole, comboBoxDTMFFormat); + + labelDTMFPrefix = new QLabel(formLayoutWidget); + labelDTMFPrefix->setObjectName(QString::fromUtf8("labelDTMFPrefix")); + + formLayoutBasic->setWidget(3, QFormLayout::LabelRole, labelDTMFPrefix); + + lineEditDTMFPrefix = new QLineEdit(formLayoutWidget); + lineEditDTMFPrefix->setObjectName(QString::fromUtf8("lineEditDTMFPrefix")); + sizePolicy1.setHeightForWidth(lineEditDTMFPrefix->sizePolicy().hasHeightForWidth()); + lineEditDTMFPrefix->setSizePolicy(sizePolicy1); + lineEditDTMFPrefix->setMinimumSize(QSize(0, 60)); + lineEditDTMFPrefix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers); + + formLayoutBasic->setWidget(3, QFormLayout::FieldRole, lineEditDTMFPrefix); + + labelDTMFSuffix = new QLabel(formLayoutWidget); + labelDTMFSuffix->setObjectName(QString::fromUtf8("labelDTMFSuffix")); + + formLayoutBasic->setWidget(4, QFormLayout::LabelRole, labelDTMFSuffix); + + lineEditDTMFSuffix = new QLineEdit(formLayoutWidget); + lineEditDTMFSuffix->setObjectName(QString::fromUtf8("lineEditDTMFSuffix")); + sizePolicy1.setHeightForWidth(lineEditDTMFSuffix->sizePolicy().hasHeightForWidth()); + lineEditDTMFSuffix->setSizePolicy(sizePolicy1); + lineEditDTMFSuffix->setMinimumSize(QSize(0, 60)); + lineEditDTMFSuffix->setInputMethodHints(Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhPreferLowercase|Qt::ImhPreferNumbers); + + formLayoutBasic->setWidget(4, QFormLayout::FieldRole, lineEditDTMFSuffix); + + scrollArea->setWidget(scrollAreaWidgetContents); + layoutWidget = new QWidget(ProfileSettingsDialog); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(696, 22, 101, 124)); + verticalLayout = new QVBoxLayout(layoutWidget); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setContentsMargins(0, 0, 0, 0); + saveButton = new QPushButton(layoutWidget); + saveButton->setObjectName(QString::fromUtf8("saveButton")); + QSizePolicy sizePolicy3(QSizePolicy::Minimum, QSizePolicy::Fixed); + sizePolicy3.setHorizontalStretch(0); + sizePolicy3.setVerticalStretch(0); + sizePolicy3.setHeightForWidth(saveButton->sizePolicy().hasHeightForWidth()); + saveButton->setSizePolicy(sizePolicy3); + saveButton->setMinimumSize(QSize(0, 40)); + + verticalLayout->addWidget(saveButton); + + verticalSpacer = new QSpacerItem(17, 30, QSizePolicy::Minimum, QSizePolicy::Expanding); + + verticalLayout->addItem(verticalSpacer); + + closeButton = new QPushButton(layoutWidget); + closeButton->setObjectName(QString::fromUtf8("closeButton")); + closeButton->setMinimumSize(QSize(0, 40)); + + verticalLayout->addWidget(closeButton); + + + retranslateUi(ProfileSettingsDialog); + + QMetaObject::connectSlotsByName(ProfileSettingsDialog); + } // setupUi + + void retranslateUi(QDialog *ProfileSettingsDialog) + { + ProfileSettingsDialog->setWindowTitle(QApplication::translate("ProfileSettingsDialog", "Edit Profile", 0, QApplication::UnicodeUTF8)); + labelNumberStartsWith->setText(QApplication::translate("ProfileSettingsDialog", "Number starts with:", 0, QApplication::UnicodeUTF8)); + labelCallingCardNumber->setText(QApplication::translate("ProfileSettingsDialog", "Calling Card Number:", 0, QApplication::UnicodeUTF8)); + labelDTMFFormat->setText(QApplication::translate("ProfileSettingsDialog", "Format required for DTMF tone:", 0, QApplication::UnicodeUTF8)); + comboBoxDTMFFormat->clear(); + comboBoxDTMFFormat->insertItems(0, QStringList() + << QApplication::translate("ProfileSettingsDialog", "", 0, QApplication::UnicodeUTF8) + << QApplication::translate("ProfileSettingsDialog", "+", 0, QApplication::UnicodeUTF8) + << QApplication::translate("ProfileSettingsDialog", "00", 0, QApplication::UnicodeUTF8) + << QApplication::translate("ProfileSettingsDialog", "011", 0, QApplication::UnicodeUTF8) + ); + labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "Prefix before DTMF tone:", 0, QApplication::UnicodeUTF8)); + labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "Suffix after DTMF tone:", 0, QApplication::UnicodeUTF8)); + saveButton->setText(QApplication::translate("ProfileSettingsDialog", "Save", 0, QApplication::UnicodeUTF8)); + closeButton->setText(QApplication::translate("ProfileSettingsDialog", "Close", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class ProfileSettingsDialog: public Ui_ProfileSettingsDialog {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PROFILESETTINGSDIALOG_H diff --git a/src/vicar-config/uis/ui_profileswindow.h b/src/vicar-config/uis/ui_profileswindow.h new file mode 100644 index 0000000..289dcdf --- /dev/null +++ b/src/vicar-config/uis/ui_profileswindow.h @@ -0,0 +1,148 @@ +/******************************************************************************** +** Form generated from reading UI file 'profileswindow.ui' +** +** Created: Tue Sep 7 04:21:07 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PROFILESWINDOW_H +#define UI_PROFILESWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_ProfilesWindow +{ +public: + QAction *actionRoutingEnabled; + QAction *actionRouteOnDefault; + QWidget *centralwidget; + QWidget *layoutWidget; + QVBoxLayout *verticalLayout; + QHBoxLayout *horizontalLayout; + QPushButton *addButton; + QSpacerItem *horizontalSpacer1; + QPushButton *editButton; + QSpacerItem *horizontalSpacer2; + QPushButton *removeButton; + QSpacerItem *verticalSpacer; + QListWidget *profilesListWidget; + QMenuBar *menubar; + QMenu *menuVicarProfiles; + + void setupUi(QMainWindow *ProfilesWindow) + { + if (ProfilesWindow->objectName().isEmpty()) + ProfilesWindow->setObjectName(QString::fromUtf8("ProfilesWindow")); + ProfilesWindow->resize(800, 480); + actionRoutingEnabled = new QAction(ProfilesWindow); + actionRoutingEnabled->setObjectName(QString::fromUtf8("actionRoutingEnabled")); + actionRoutingEnabled->setCheckable(true); + actionRouteOnDefault = new QAction(ProfilesWindow); + actionRouteOnDefault->setObjectName(QString::fromUtf8("actionRouteOnDefault")); + actionRouteOnDefault->setCheckable(true); + centralwidget = new QWidget(ProfilesWindow); + centralwidget->setObjectName(QString::fromUtf8("centralwidget")); + layoutWidget = new QWidget(centralwidget); + layoutWidget->setObjectName(QString::fromUtf8("layoutWidget")); + layoutWidget->setGeometry(QRect(31, 11, 741, 411)); + verticalLayout = new QVBoxLayout(layoutWidget); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + verticalLayout->setContentsMargins(0, 0, 0, 0); + horizontalLayout = new QHBoxLayout(); + horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); + addButton = new QPushButton(layoutWidget); + addButton->setObjectName(QString::fromUtf8("addButton")); + + horizontalLayout->addWidget(addButton); + + horizontalSpacer1 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer1); + + editButton = new QPushButton(layoutWidget); + editButton->setObjectName(QString::fromUtf8("editButton")); + + horizontalLayout->addWidget(editButton); + + horizontalSpacer2 = new QSpacerItem(58, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout->addItem(horizontalSpacer2); + + removeButton = new QPushButton(layoutWidget); + removeButton->setObjectName(QString::fromUtf8("removeButton")); + + horizontalLayout->addWidget(removeButton); + + + verticalLayout->addLayout(horizontalLayout); + + verticalSpacer = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Fixed); + + verticalLayout->addItem(verticalSpacer); + + profilesListWidget = new QListWidget(layoutWidget); + profilesListWidget->setObjectName(QString::fromUtf8("profilesListWidget")); + profilesListWidget->setAlternatingRowColors(true); + + verticalLayout->addWidget(profilesListWidget); + + ProfilesWindow->setCentralWidget(centralwidget); + menubar = new QMenuBar(ProfilesWindow); + menubar->setObjectName(QString::fromUtf8("menubar")); + menubar->setGeometry(QRect(0, 0, 800, 23)); + menuVicarProfiles = new QMenu(menubar); + menuVicarProfiles->setObjectName(QString::fromUtf8("menuVicarProfiles")); + ProfilesWindow->setMenuBar(menubar); + + menubar->addAction(menuVicarProfiles->menuAction()); + menuVicarProfiles->addAction(actionRoutingEnabled); + menuVicarProfiles->addAction(actionRouteOnDefault); + + retranslateUi(ProfilesWindow); + + QMetaObject::connectSlotsByName(ProfilesWindow); + } // setupUi + + void retranslateUi(QMainWindow *ProfilesWindow) + { + ProfilesWindow->setWindowTitle(QApplication::translate("ProfilesWindow", "VICaR - Profiles", 0, QApplication::UnicodeUTF8)); + actionRoutingEnabled->setText(QApplication::translate("ProfilesWindow", "Routing Enabled", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + actionRoutingEnabled->setToolTip(QApplication::translate("ProfilesWindow", "Call Routing Enabled?", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + actionRouteOnDefault->setText(QApplication::translate("ProfilesWindow", "Call Directly on Default", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_TOOLTIP + actionRouteOnDefault->setToolTip(QApplication::translate("ProfilesWindow", "Call directly if no match found?", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_TOOLTIP + addButton->setText(QApplication::translate("ProfilesWindow", "Add", 0, QApplication::UnicodeUTF8)); + editButton->setText(QApplication::translate("ProfilesWindow", "Edit", 0, QApplication::UnicodeUTF8)); + removeButton->setText(QApplication::translate("ProfilesWindow", "Remove", 0, QApplication::UnicodeUTF8)); + menuVicarProfiles->setTitle(QApplication::translate("ProfilesWindow", "VICaR - Profiles", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class ProfilesWindow: public Ui_ProfilesWindow {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PROFILESWINDOW_H diff --git a/src/vicar-config/vicar-config.pro b/src/vicar-config/vicar-config.pro old mode 100644 new mode 100755 index bd8d89c..640b2a3 --- a/src/vicar-config/vicar-config.pro +++ b/src/vicar-config/vicar-config.pro @@ -7,7 +7,7 @@ LIBS += /usr/lib/libgconf-2.so LIBS += ../lib/libvicar.a CONFIG += qt \ debug -QT += dbus +QT += dbus sql TEMPLATE = app TARGET = vicar-config VPATH += src \ @@ -17,10 +17,13 @@ MOC_DIR = mocs OBJECTS_DIR = objs # Input -HEADERS += configwindow.h -FORMS += configwindow.ui -SOURCES += src/main.cpp \ - configwindow.cpp +HEADERS += profileswindow.h \ + profilesettingsdialog.h +FORMS += profileswindow.ui \ + profilesettingsdialog.ui +SOURCES += main.cpp \ + profileswindow.cpp \ + profilesettingsdialog.cpp # MAKE INSTALL INSTALLDIR = /../../debian/vicar diff --git a/src/vicar-daemon/src/callrouter.cpp b/src/vicar-daemon/src/callrouter.cpp old mode 100644 new mode 100755 index e6155f5..9313b2f --- a/src/vicar-daemon/src/callrouter.cpp +++ b/src/vicar-daemon/src/callrouter.cpp @@ -1,265 +1,168 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ #include "callrouter.h" +#include "vicardbusadaptor.h" #include #include +#include +#include #include #include #include -#include +#include #include -//Create a statis Dbus utility object that will be shared across all member functions -static DbusUtility dbusUtility = DbusUtility(); -static QString strLastDialedNumber = QString(); + +//static QString strLastDialedNumber = QString(); +//static org::maemo::vicar::Profile currentProfile; + +class CallRouterPrivate +{ +public: + CallRouterPrivate(CallRouter * p) : + databaseUtility(new DatabaseUtility(p)), + dbusAdaptor(new VicarDbusAdaptor(p)), + dbusUtility(new DbusUtility(p)), + gconfUtility(new GConfUtility(p)), + tpUtility(new TelepathyUtility(p)), + parent(p) + { + Q_ASSERT(0 != dbusAdaptor); + //Do not open here - Unable to capture changes to DB if it is open too early and closed late. + //databaseUtility->openDatabase(); + } + + ~CallRouterPrivate() + { + qDebug() << "VICaR: Call Router Destructing"; + //databaseUtility->closeDatabase(); + } + + DatabaseUtility *databaseUtility; + VicarDbusAdaptor * dbusAdaptor; + DbusUtility * dbusUtility; + GConfUtility * gconfUtility; + TelepathyUtility *tpUtility; + QString strLastDialedNumber; + org::maemo::vicar::Profile *currentProfile; + CallRouter * const parent; +}; + +// --------------------------------------------------------------------------- CallRouter::CallRouter(QObject *parent) : - QObject(parent) + QObject(parent), + d(new CallRouterPrivate(this)) { - gconfUtility = new GConfUtility(); + Q_ASSERT(0 != d); + this->registerDBusService(); + qDebug() << "Registered DBus Service " << APPLICATION_DBUS_SERVICE; } CallRouter::~CallRouter(){ - delete gconfUtility; - gconfUtility = 0; } void CallRouter::registerDBusService(){ - QDBusConnection connection = dbusUtility.getConnection(); + //Connect to Session Bus + QDBusConnection connection = d->dbusUtility->getConnection(false); + + if (!connection.interface()->isServiceRegistered(APPLICATION_DBUS_SERVICE)){ - if (!connection.registerService(APPLICATION_DBUS_SERVICE)) { - qDebug() << dbusUtility.getErrorMessage(); - exit(1); + if (!connection.registerService(APPLICATION_DBUS_SERVICE)) { + qDebug() << d->dbusUtility->getErrorMessage(); + exit(1); + } } - if (!connection.registerObject(APPLICATION_DBUS_PATH, this, - QDBusConnection::ExportScriptableSlots)) { - qDebug() << dbusUtility.getErrorMessage(); + if (!connection.registerObject(APPLICATION_DBUS_PATH, this, QDBusConnection::ExportAdaptors)) { + qDebug() << d->dbusUtility->getErrorMessage(); exit(2); } - this->connectToDBusSignals(); - } void CallRouter::unregisterDBusService(){ - this->disconnectFromDBusSignals(); - - QDBusConnection connection = dbusUtility.getConnection(); + //Disconnect from Session bus + QDBusConnection connection = d->dbusUtility->getConnection(false); connection.unregisterObject(APPLICATION_DBUS_PATH,QDBusConnection::UnregisterTree); if (!connection.unregisterService(APPLICATION_DBUS_SERVICE)) { - qDebug() << dbusUtility.getErrorMessage(); + qDebug() << d->dbusUtility->getErrorMessage(); exit(3); } } -void CallRouter::connectToDBusSignals(){ +QString CallRouter::callViaCallingCard(QString strDestinationNumber){ - QDBusConnection connection = dbusUtility.getConnection(); + d->currentProfile = new org::maemo::vicar::Profile(); + d->currentProfile->profileID = 0; - // Connect to the signal to enable call routing - bool success = connection.connect(QString(""),QString(""), - APPLICATION_DBUS_INTERFACE, - QString("startOutgoingCallMonitor"),this, - SLOT(startOutgoingCallMonitor())); - - if (success){ - qDebug() << "Successfully connected to Dbus signal org.maemo.vicar.startOutgoingCallMonitor"; - } - else{ - qDebug() << "Failed to connect to Dbus signal org.maemo.vicar.startOutgoingCallMonitor"; - qDebug() <<"DBus Error: "<< qPrintable(dbusUtility.getErrorMessage()); - } - - // Connect to the signal to disable call routing - success = connection.connect(QString(""),QString(""), - APPLICATION_DBUS_INTERFACE, - QString("stopOutgoingCallMonitor"),this, - SLOT(stopOutgoingCallMonitor())); - - if (success){ - qDebug() << "Successfully connected to Dbus signal org.maemo.vicar.stopOutgoingCallMonitor"; - } - else{ - qDebug() << "Failed to connect to Dbus signal org.maemo.vicar.stopOutgoingCallMonitor"; - qDebug() <<"DBus Error: "<< qPrintable(dbusUtility.getErrorMessage()); - } - -} + d->databaseUtility->openDatabase(); + bool result = d->databaseUtility->findProfileByNumber(strDestinationNumber,d->currentProfile); -void CallRouter::disconnectFromDBusSignals(){ - - QDBusConnection connection = dbusUtility.getConnection(); - - // Disconnect from the signal to enable call routing - bool success = connection.disconnect(QString(""),QString(""), - APPLICATION_DBUS_INTERFACE, - QString("startOutgoingCallMonitor"),this, - SLOT(startOutgoingCallMonitor())); - - if (success){ - qDebug() << "Successfully disconnected from Dbus signal org.maemo.vicar.startOutgoingCallMonitor"; - } - else{ - qDebug() << "Failed to disconnect from Dbus signal org.maemo.vicar.startOutgoingCallMonitor"; - qDebug() <<"DBus Error: "<< qPrintable(dbusUtility.getErrorMessage()); - } - - // Disconnect from the signal to disable call routing - success = connection.connect(QString(""),QString(""), - APPLICATION_DBUS_INTERFACE, - QString("stopOutgoingCallMonitor"),this, - SLOT(stopOutgoingCallMonitor())); - - if (success){ - qDebug() << "Successfully disconnected from Dbus signal org.maemo.vicar.stopOutgoingCallMonitor"; - } - else{ - qDebug() << "Failed to disconnect from Dbus signal org.maemo.vicar.stopOutgoingCallMonitor"; - qDebug() <<"DBus Error: "<< qPrintable(dbusUtility.getErrorMessage()); - } - -} - -void CallRouter::startOutgoingCallMonitor(){ - - // Connect to DBus to monitor all outgoing calls - - QDBusConnection connection = dbusUtility.getConnection(); - - - // Declare the slot to be executed when new calls are placed - - bool success = connection.connect(QString(""), - CSD_CALL_PATH, - CSD_CALL_INTERFACE, - QString("CreateRequested"),this, - SLOT(processOutgoingCall(const QDBusMessage&))); - - if (success){ - qDebug() << "Successfully connected to Dbus signal CreateRequested in interface "<< CSD_CALL_INTERFACE; - } - else{ - qDebug() << "Failed to connect to Dbus signal CreateRequested in interface " << CSD_CALL_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); - } - - -} - -void CallRouter::stopOutgoingCallMonitor(){ - - this->stopCallStatusMonitors(); - - //Disconnect the slots from Dbus signals - QDBusConnection connection = dbusUtility.getConnection(); - - // Disconnect the slot for new calls - bool status = connection.disconnect(QString(""), - CSD_CALL_PATH, - CSD_CALL_INTERFACE, - QString("CreateRequested"),this, - SLOT(processOutgoingCall(const QDBusMessage&))); - - if (status){ - qDebug() << "Successfully disconnected from Dbus signal CreateRequested in interface "<< CSD_CALL_INTERFACE; - } - else{ - qDebug() << "Failed to disconnect from Dbus signal CreateRequested in interface "<< CSD_CALL_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); - } - -} - -void CallRouter::processOutgoingCall(const QDBusMessage& dbusMessage){ - - //Verify Whether Call Routing is Enabled - bool isRoutingEnabled = gconfUtility->getGconfValueBoolean("routing_enabled"); - - if (isRoutingEnabled){ - //User is making a phone call. Get the phone number and verify if it is an international number - QList listArguments = dbusMessage.arguments(); - QString strInternationalNumber = listArguments.first().toString(); - - qDebug() << "New Call Identified. Destination number is " << strInternationalNumber; - - if (strInternationalNumber.startsWith("+") || - strInternationalNumber.startsWith("00")) - { - qDebug() << "International number "<< strInternationalNumber << " recognized. Starting proceedings.."; - - //Check whether this is one of the excluded country codes - if (!isExcludedNumber(strInternationalNumber)){ - - //International number. Disconnect the current call (A new call will be placed) - - //No arguments required to cancel the current call - QList argsToSend; - bool status = dbusUtility.sendMethodCall(CSD_CALL_SERVICE, - CSD_CALL_PATH, - CSD_CALL_INTERFACE, - QString("Release"),argsToSend); - - QString strUserMessage; - if (status){ - strUserMessage = QString("Routing international call via ").append(APPLICATION_FRIENDLY_NAME).append(".."); - qDebug() << strUserMessage; - strLastDialedNumber = strInternationalNumber; - } - else{ - strUserMessage = QString("Call could not be cancelled."); - qDebug() << dbusUtility.getErrorMessage(); - } - - dbusUtility.displayNotification(strUserMessage); - - //Wait for a few seconds before the current call is completely disconnected - QTimer *timer = new QTimer(this); - timer->setSingleShot(true); - connect(timer, SIGNAL(timeout()), this, SLOT(callViaCallingCard())); - timer->start(3000); - } + QString strErrorMessage; + if (!result){ + strErrorMessage = QString("Error finding VICaR profile. %1").arg(d->databaseUtility->lastError().text()); } - } -} - -void CallRouter::callViaCallingCard(){ - //Now call the calling card number. This is generally a local and/or tollfree number + else if (d->currentProfile->profileID == 0){ + bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default"); + if (routeOnDefault){ + qDebug() << "Routing directly as per configuration"; + this->placeCall(strDestinationNumber); + } + else{ + qDebug() << "No profile found. Stopping.."; + strErrorMessage = "VICaR: No routing profile defined for this number."; + d->dbusUtility->displayNotification(strErrorMessage ); + } + } + else{ + //Now call the calling card number. This is generally a local and/or tollfree number + QString strCallingCardNumber = d->currentProfile->gatewayNumber; + qDebug() << "Initiating call to "<< strCallingCardNumber; + bool status = this->placeCall(strCallingCardNumber); + d->strLastDialedNumber = strDestinationNumber; - QString strCallingCardNumber = gconfUtility->getGconfValueString("calling_card_number"); + QString strUserMessage; - qDebug() << "Wait time elapsed. Initiating call to "<< strCallingCardNumber; + if (status){ + qDebug() << "Call initiated successfully. Connecting DBus slot for audio connection monitor"; + startCallStatusMonitors(); + } + else { + strUserMessage = QString("Unable to initiate new call to ").append(strCallingCardNumber); + strErrorMessage = d->dbusUtility->getErrorMessage(); + qDebug() << strErrorMessage; + d->strLastDialedNumber.clear(); + delete d->currentProfile; + d->currentProfile = 0; + } + d->dbusUtility->displayNotification(strUserMessage); + } - QList argsToSend; - argsToSend.append(strCallingCardNumber); - argsToSend.append(0); + d->databaseUtility->closeDatabase(); + return strErrorMessage; +} - bool status = dbusUtility.sendMethodCall(CSD_SERVICE, - CSD_CALL_PATH, - CSD_CALL_INTERFACE, - QString("CreateWith"),argsToSend); +bool CallRouter::placeCall(QString number){ - QString strUserMessage; - if (status){ - qDebug() << "Call initiated successfully. Connecting DBus slot for audio connection monitor"; - startCallStatusMonitors(); - } - else { - strUserMessage = QString("Unable to initiate new call to ").append(strCallingCardNumber); - qDebug() << dbusUtility.getErrorMessage(); - strLastDialedNumber.clear(); - } + QList argsToSend; + argsToSend.append(number); + argsToSend.append(0); - dbusUtility.displayNotification(strUserMessage); + bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE, + CSD_CALL_PATH, + CSD_CALL_INTERFACE, + QString("CreateWith"),argsToSend); + return status; } @@ -268,7 +171,7 @@ void CallRouter::startCallStatusMonitors(){ We need this to confirm whether a call went though successfully. */ - QDBusConnection connection = dbusUtility.getConnection(); + QDBusConnection connection = d->dbusUtility->getConnection(); bool success = connection.connect(QString(""), CSD_CALL_INSTANCE_PATH, @@ -281,7 +184,7 @@ void CallRouter::startCallStatusMonitors(){ } else{ qDebug() << "Failed to connect to Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } /* Declare the slot to be executed when the call is terminated (due to connection errors etc). @@ -299,7 +202,7 @@ void CallRouter::startCallStatusMonitors(){ } else{ qDebug() << "Failed to connect to Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } /* Declare the slot to be executed when a call is received @@ -322,15 +225,17 @@ void CallRouter::startCallStatusMonitors(){ } else{ qDebug() << "Failed to connect to Dbus signal Coming in interface" << CSD_CALL_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } } void CallRouter::stopCallStatusMonitors(){ - strLastDialedNumber.clear(); + d->strLastDialedNumber.clear(); + delete d->currentProfile; + d->currentProfile = 0; - QDBusConnection connection = dbusUtility.getConnection(); + QDBusConnection connection = d->dbusUtility->getConnection(); // Disconnect the slot for audio connection status bool status = connection.disconnect(QString(""), @@ -344,7 +249,7 @@ void CallRouter::stopCallStatusMonitors(){ } else{ qDebug() << "Failed to disconnect from Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } // Disconnect the slot for monitoring terminated calls @@ -359,7 +264,7 @@ void CallRouter::stopCallStatusMonitors(){ } else{ qDebug() << "Failed to disconnect from Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } // Disconnect the slot for monitoring incoming calls @@ -374,13 +279,13 @@ void CallRouter::stopCallStatusMonitors(){ } else{ qDebug() << "Failed to disconnect from Dbus signal Coming in interface" << CSD_CALL_INTERFACE; - qDebug() <<"DBus Error: "<< dbusUtility.getErrorMessage(); + qDebug() <<"DBus Error: "<< d->dbusUtility->getErrorMessage(); } } void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){ - if (!strLastDialedNumber.isEmpty()){ + if (!d->strLastDialedNumber.isEmpty() && d->currentProfile != 0){ //Verify whether we have the last dialed number available QList listArguments = dbusMessage.arguments(); @@ -388,14 +293,14 @@ void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){ if (audioConnected){ // Now that the call to Calling card number is successful. We can send the original number as DTMF tones - QString strDTMFCode = convertToDTMFCode(strLastDialedNumber); + QString strDTMFCode = convertToDTMFCode(d->strLastDialedNumber); qDebug() << "Audio connection established. Sending DTMF code "<< strDTMFCode; QList argsToSend; argsToSend.append(strDTMFCode); - bool status = dbusUtility.sendMethodCall(CSD_SERVICE, + bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE, CSD_CALL_PATH, CSD_CALL_INTERFACE, QString("SendDTMF"),argsToSend); @@ -403,7 +308,7 @@ void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){ if (status){ QString strMessage = strDTMFCode.append(" sent as DTMF code"); qDebug() << strMessage; - dbusUtility.displayNotification(strMessage); + d->dbusUtility->displayNotification(strMessage); } else{ qDebug() << "Unable to send DTMF code."; @@ -419,6 +324,9 @@ void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){ qDebug() << "Now disconnecting from call status monitors.."; stopCallStatusMonitors(); + d->strLastDialedNumber.clear(); + delete d->currentProfile; + d->currentProfile = 0; } else{ qDebug() << "Audio not yet connected."; @@ -434,16 +342,21 @@ QString CallRouter::convertToDTMFCode(QString strNumber){ QString strDTMFCode; if (!strNumber.isEmpty()){ + int intDTMFDelay = 1; - //Get the format required by calling card from coniguration - QString qstrDTMFFormat = gconfUtility->getGconfValueString("dtmf_format"); - int intDTMFDelay = gconfUtility->getGconfValueInteger("dtmf_delay"); + //Add the prefix p so that there is some delay after the call is picked up by the automated system to send DTMF tones. + strDTMFCode = QString("").fill('p',intDTMFDelay); - if (intDTMFDelay <1 ) intDTMFDelay = 1; - if (qstrDTMFFormat.isEmpty()) qstrDTMFFormat = ""; + //Now check whether we need a prefix + QString strDTMFPrefix = d->currentProfile->dtmfPrefix; - //Add the prefix p so that there is some delay after the call is picked up by the automated system to send DTMF tones. - strDTMFCode = QString("").fill('p',intDTMFDelay); + if (!strDTMFPrefix.isEmpty()){ + strDTMFCode = strDTMFCode.append(strDTMFPrefix); + } + + //Get the format required by calling card from coniguration + QString qstrDTMFFormat = d->currentProfile->dtmfFormat; + if (qstrDTMFFormat.isEmpty()) qstrDTMFFormat = ""; /* Replace 00 (international dialing code) at the beginning and also replace any character other than the numbers 0-9 and p. @@ -463,13 +376,12 @@ QString CallRouter::convertToDTMFCode(QString strNumber){ else if (qstrDTMFFormat.startsWith("011")){ strDTMFCode = strDTMFCode.append("011"); } - //Default case - we don't need any prefix strDTMFCode = strDTMFCode.append(strNumber); //Now check whether we need a suffix - QString strDTMFSuffix = gconfUtility->getGconfValueString("dtmf_suffix"); - if (!strDTMFSuffix.isEmpty() && !strDTMFSuffix.contains("--None--")){ + QString strDTMFSuffix = d->currentProfile->dtmfSuffix; + if (!strDTMFSuffix.isEmpty()){ strDTMFCode = strDTMFCode.append(strDTMFSuffix); } } @@ -477,24 +389,33 @@ QString CallRouter::convertToDTMFCode(QString strNumber){ return strDTMFCode; } -bool CallRouter::isExcludedNumber(QString strInternationalNumber){ +//DBus Method used by external applications to check whether VICaR is enabled and running +bool CallRouter::isRunning(){ - bool isExcluded = false; + return true; - //Get the list of excluded codes - QString qstrExcludedNumbers = gconfUtility->getGconfValueString("numbers_to_exclude"); - QStringList strExcludedCodeList = qstrExcludedNumbers.split(","); - QStringListIterator iterator(strExcludedCodeList); + //Verify Whether VICaR telepathy account is online + /* + if (d->tpUtility->getAccountStatus() == "Connected"){ + return true; + } + else{ + return false; + } + */ +} - QRegExp regexp = QRegExp("(^0{2})|[^0-9p]"); +//DBus Method used by external applications to call via VICaR +QString CallRouter::callInternationalNumber(const QString& strDestinationNumber){ - while (iterator.hasNext()){ - QString strCode = iterator.next(); - strCode = strCode.replace(regexp,""); - strInternationalNumber = strInternationalNumber.replace(regexp,""); - if (!strCode.isEmpty() && strInternationalNumber.startsWith(strCode)){ - isExcluded = true; - } + qDebug() << "New call requested by external application. Destination number is " << strDestinationNumber; + QString strErrorMessage = this->callViaCallingCard(strDestinationNumber); + qDebug() << strErrorMessage; + + if (strErrorMessage.isEmpty()){ + return QString("Success"); } - return isExcluded; -} + else{ + return strErrorMessage; + } + } diff --git a/src/vicar-daemon/src/callrouter.h b/src/vicar-daemon/src/callrouter.h old mode 100644 new mode 100755 index 44c2ed9..e6e994e --- a/src/vicar-daemon/src/callrouter.h +++ b/src/vicar-daemon/src/callrouter.h @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ @@ -9,7 +9,9 @@ #include #include +#include #include +#include "vicardbusadaptor.h" #define APPLICATION_DBUS_PATH "/org/maemo/vicar" #define APPLICATION_DBUS_INTERFACE "org.maemo.vicar" @@ -26,6 +28,8 @@ #define CSD_CALL_SERVICE "com.nokia.csd.Call" #define CSD_SERVICE "com.nokia.csd" +class CallRouterPrivate; + class CallRouter : public QObject { Q_OBJECT @@ -37,24 +41,24 @@ public: void registerDBusService(); void unregisterDBusService(); +protected: void startCallStatusMonitors(); QString convertToDTMFCode(QString); - void connectToDBusSignals(); - void disconnectFromDBusSignals(); bool isExcludedNumber(QString); + bool placeCall(QString); -public slots: - Q_SCRIPTABLE void startOutgoingCallMonitor(); - Q_SCRIPTABLE void stopOutgoingCallMonitor(); - Q_SCRIPTABLE void processOutgoingCall(const QDBusMessage& dbusMessage); - Q_SCRIPTABLE void callViaCallingCard(); - Q_SCRIPTABLE void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage); - Q_SCRIPTABLE void stopCallStatusMonitors(); - +protected slots: + QString callViaCallingCard(QString); + void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage); + void stopCallStatusMonitors(); + //D-Bus Interface Methods +public slots: + bool isRunning(); + QString callInternationalNumber(const QString& internationalNumber); private: - GConfUtility *gconfUtility; + CallRouterPrivate * const d; }; #endif // CALLROUTER_H diff --git a/src/vicar-daemon/src/main.cpp b/src/vicar-daemon/src/main.cpp old mode 100644 new mode 100755 index 53b074c..1874fbd --- a/src/vicar-daemon/src/main.cpp +++ b/src/vicar-daemon/src/main.cpp @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ @@ -8,26 +8,14 @@ #include #include #include "callrouter.h" -#include "gconfutility.h" +//#include "vicarprofiletypes.h" int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); + //qDBusRegisterMetaType(); + //qDBusRegisterMetaType(); + QCoreApplication a(argc, argv); CallRouter callRouter(&a); - callRouter.registerDBusService(); - qDebug() << "Registered DBus Service " << APPLICATION_DBUS_SERVICE; - - GConfUtility *gconfUtility = new GConfUtility(); - //If International call routing is already enabled, start monitoring calls - //Otherwise wait for the signal from the configuration app - if (gconfUtility->getGconfValueBoolean((char *)"routing_enabled")){ - qDebug() << "Call routing enabled. Starting call monitor.."; - callRouter.startOutgoingCallMonitor(); - } - - delete gconfUtility; - gconfUtility = 0; - return a.exec(); } diff --git a/src/vicar-daemon/src/vicardbusadaptor.cpp b/src/vicar-daemon/src/vicardbusadaptor.cpp new file mode 100755 index 0000000..5f387ca --- /dev/null +++ b/src/vicar-daemon/src/vicardbusadaptor.cpp @@ -0,0 +1,67 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c VicarDbusAdaptor -a vicardbusadaptor.h:vicardbusadaptor.cpp org.maemo.vicar.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "vicardbusadaptor.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class VicarDbusAdaptor + */ + +VicarDbusAdaptor::VicarDbusAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +VicarDbusAdaptor::~VicarDbusAdaptor() +{ + // destructor +} + +QString VicarDbusAdaptor::callInternationalNumber(const QString &number) +{ + // handle method call org.maemo.vicar.callInternationalNumber + QString out0; + QMetaObject::invokeMethod(parent(), "callInternationalNumber", Q_RETURN_ARG(QString, out0), Q_ARG(QString, number)); + return out0; +} + +bool VicarDbusAdaptor::isRunning() +{ + // handle method call org.maemo.vicar.isRunning + bool out0; + QMetaObject::invokeMethod(parent(), "isRunning", Q_RETURN_ARG(bool, out0)); + return out0; +} + +bool VicarDbusAdaptor::startOutgoingCallMonitor() +{ + // handle method call org.maemo.vicar.startOutgoingCallMonitor + bool out0; + QMetaObject::invokeMethod(parent(), "startOutgoingCallMonitor", Q_RETURN_ARG(bool, out0)); + return out0; +} + +bool VicarDbusAdaptor::stopOutgoingCallMonitor() +{ + // handle method call org.maemo.vicar.stopOutgoingCallMonitor + bool out0; + QMetaObject::invokeMethod(parent(), "stopOutgoingCallMonitor", Q_RETURN_ARG(bool, out0)); + return out0; +} + diff --git a/src/vicar-daemon/src/vicardbusadaptor.h b/src/vicar-daemon/src/vicardbusadaptor.h new file mode 100755 index 0000000..85256f2 --- /dev/null +++ b/src/vicar-daemon/src/vicardbusadaptor.h @@ -0,0 +1,61 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c VicarDbusAdaptor -a vicardbusadaptor.h:vicardbusadaptor.cpp org.maemo.vicar.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef VICARDBUSADAPTOR_H_1278741980 +#define VICARDBUSADAPTOR_H_1278741980 + +#include +#include +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface org.maemo.vicar + */ +class VicarDbusAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.maemo.vicar") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + VicarDbusAdaptor(QObject *parent); + virtual ~VicarDbusAdaptor(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + QString callInternationalNumber(const QString &number); + bool isRunning(); + bool startOutgoingCallMonitor(); + bool stopOutgoingCallMonitor(); +Q_SIGNALS: // SIGNALS +}; + +#endif diff --git a/src/vicar-daemon/vicar-daemon.pro b/src/vicar-daemon/vicar-daemon.pro old mode 100644 new mode 100755 index f4c6e78..0984e63 --- a/src/vicar-daemon/vicar-daemon.pro +++ b/src/vicar-daemon/vicar-daemon.pro @@ -7,7 +7,7 @@ LIBS += /usr/lib/libgconf-2.so LIBS += ../lib/libvicar.a CONFIG += qt debug -QT += dbus +QT += dbus sql QT -= gui TEMPLATE = app TARGET = vicar-daemon @@ -19,8 +19,10 @@ MOC_DIR = mocs OBJECTS_DIR = objs SOURCES += src/main.cpp \ - src/callrouter.cpp -HEADERS += src/callrouter.h + src/callrouter.cpp \ + src/vicardbusadaptor.cpp +HEADERS += src/callrouter.h \ + src/vicardbusadaptor.h #MAKE INSTALL INSTALLDIR = /../../debian/vicar diff --git a/src/vicar-lib/src/accountcompatproxy.cpp b/src/vicar-lib/src/accountcompatproxy.cpp new file mode 100644 index 0000000..97ffd81 --- /dev/null +++ b/src/vicar-lib/src/accountcompatproxy.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountCompatProxy -p accountcompatproxy.h:accountcompatproxy.cpp org.freedesktop.Telepathy.Account.xml com.nokia.Account.Interface.Compat + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "accountcompatproxy.h" + +/* + * Implementation of interface class AccountCompatProxy + */ + +AccountCompatProxy::AccountCompatProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +AccountCompatProxy::~AccountCompatProxy() +{ +} + diff --git a/src/vicar-lib/src/accountcompatproxy.h b/src/vicar-lib/src/accountcompatproxy.h new file mode 100644 index 0000000..024eba6 --- /dev/null +++ b/src/vicar-lib/src/accountcompatproxy.h @@ -0,0 +1,58 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountCompatProxy -p accountcompatproxy.h:accountcompatproxy.cpp org.freedesktop.Telepathy.Account.xml com.nokia.Account.Interface.Compat + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef ACCOUNTCOMPATPROXY_H_1281150160 +#define ACCOUNTCOMPATPROXY_H_1281150160 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface com.nokia.Account.Interface.Compat + */ +class AccountCompatProxy: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "com.nokia.Account.Interface.Compat"; } + +public: + AccountCompatProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~AccountCompatProxy(); + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> SetHasBeenOnline() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("SetHasBeenOnline"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void CompatPropertyChanged(const QVariantMap &in0); +}; + +namespace com { + namespace nokia { + namespace Account { + namespace Interface { + typedef ::AccountCompatProxy Compat; + } + } + } +} +#endif diff --git a/src/vicar-lib/src/accountmanagerproxy.cpp b/src/vicar-lib/src/accountmanagerproxy.cpp new file mode 100644 index 0000000..bdb9ac2 --- /dev/null +++ b/src/vicar-lib/src/accountmanagerproxy.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountManagerProxy -p accountmanagerproxy.h:accountmanagerproxy.cpp org.freedesktop.Telepathy.AccountManager.xml org.freedesktop.Telepathy.AccountManager + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "accountmanagerproxy.h" + +/* + * Implementation of interface class AccountManagerProxy + */ + +AccountManagerProxy::AccountManagerProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +AccountManagerProxy::~AccountManagerProxy() +{ +} + diff --git a/src/vicar-lib/src/accountmanagerproxy.h b/src/vicar-lib/src/accountmanagerproxy.h new file mode 100644 index 0000000..10a97b9 --- /dev/null +++ b/src/vicar-lib/src/accountmanagerproxy.h @@ -0,0 +1,58 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountManagerProxy -p accountmanagerproxy.h:accountmanagerproxy.cpp org.freedesktop.Telepathy.AccountManager.xml org.freedesktop.Telepathy.AccountManager + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef ACCOUNTMANAGERPROXY_H_1281083196 +#define ACCOUNTMANAGERPROXY_H_1281083196 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.freedesktop.Telepathy.AccountManager + */ +class AccountManagerProxy: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.freedesktop.Telepathy.AccountManager"; } + +public: + AccountManagerProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~AccountManagerProxy(); + +public Q_SLOTS: // METHODS + inline QDBusPendingReply CreateAccount(const QString &Connection_Manager, const QString &Protocol, const QString &Display_Name, const QVariantMap &Parameters, const QVariantMap &Properties) + { + QList argumentList; + argumentList << qVariantFromValue(Connection_Manager) << qVariantFromValue(Protocol) << qVariantFromValue(Display_Name) << qVariantFromValue(Parameters) << qVariantFromValue(Properties); + return asyncCallWithArgumentList(QLatin1String("CreateAccount"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void AccountRemoved(const QDBusObjectPath &in0); + void AccountValidityChanged(const QDBusObjectPath &in0, bool in1); +}; + +namespace org { + namespace freedesktop { + namespace Telepathy { + typedef ::AccountManagerProxy AccountManager; + } + } +} +#endif diff --git a/src/vicar-lib/src/accountproxy.cpp b/src/vicar-lib/src/accountproxy.cpp new file mode 100644 index 0000000..d6a4934 --- /dev/null +++ b/src/vicar-lib/src/accountproxy.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountProxy -p accountproxy.h:accountproxy.cpp org.freedesktop.Telepathy.Account.xml org.freedesktop.Telepathy.Account + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "accountproxy.h" + +/* + * Implementation of interface class AccountProxy + */ + +AccountProxy::AccountProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +AccountProxy::~AccountProxy() +{ +} + diff --git a/src/vicar-lib/src/accountproxy.h b/src/vicar-lib/src/accountproxy.h new file mode 100644 index 0000000..0f97df2 --- /dev/null +++ b/src/vicar-lib/src/accountproxy.h @@ -0,0 +1,70 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c AccountProxy -p accountproxy.h:accountproxy.cpp org.freedesktop.Telepathy.Account.xml org.freedesktop.Telepathy.Account + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef ACCOUNTPROXY_H_1281149702 +#define ACCOUNTPROXY_H_1281149702 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.freedesktop.Telepathy.Account + */ +class AccountProxy: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.freedesktop.Telepathy.Account"; } + +public: + AccountProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~AccountProxy(); + +public Q_SLOTS: // METHODS + inline QDBusPendingReply<> Reconnect() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("Reconnect"), argumentList); + } + + inline QDBusPendingReply<> Remove() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("Remove"), argumentList); + } + + inline QDBusPendingReply UpdateParameters(const QVariantMap &Set, const QStringList &Unset) + { + QList argumentList; + argumentList << qVariantFromValue(Set) << qVariantFromValue(Unset); + return asyncCallWithArgumentList(QLatin1String("UpdateParameters"), argumentList); + } + +Q_SIGNALS: // SIGNALS + void AccountPropertyChanged(const QVariantMap &in0); + void Removed(); +}; + +namespace org { + namespace freedesktop { + namespace Telepathy { + typedef ::AccountProxy Account; + } + } +} +#endif diff --git a/src/vicar-lib/src/databaseutility.cpp b/src/vicar-lib/src/databaseutility.cpp new file mode 100644 index 0000000..19ffdf7 --- /dev/null +++ b/src/vicar-lib/src/databaseutility.cpp @@ -0,0 +1,182 @@ +#include "databaseutility.h" +#include +#include +#include +#include +#include +#include +#include + +DatabaseUtility::DatabaseUtility(QObject *parent) : + QObject(parent) +{ +} + +DatabaseUtility::~DatabaseUtility(){ +} + +bool DatabaseUtility::openDatabase(){ + profilesDB = QSqlDatabase::addDatabase("QSQLITE"); + //QString path(QDir::home().path()); + //path.append(QDir::separator()).append("vicar.db.sqlite"); + QString path("/home/user/vicar.db.sqlite"); + path = QDir::toNativeSeparators(path); + qDebug()<< "Opening database at "<"<profileID = query.value(0).toInt(); + profile->phoneNumberPattern = query.value(1).toString(); + profile->gatewayNumber = query.value(2).toString(); + profile->dtmfFormat = query.value(3).toString(); + profile->dtmfPrefix = query.value(4).toString(); + profile->dtmfSuffix = query.value(5).toString(); + result = true; + } + } + return result; +} + +bool DatabaseUtility::getAllProfiles(org::maemo::vicar::ProfileList* profileList){ + bool result = false; + if (profilesDB.isOpen()){ + QString strQuery = QString("select * from profiles order by id"); + qDebug() << "SQL>"<append(profile); + } + result = true; + } + return result; +} + +bool DatabaseUtility::findProfileByNumber(QString number,org::maemo::vicar::Profile* profile){ + bool result = false; + if (profilesDB.isOpen()){ + QString strQuery = QString("select * from profiles where '%1' like numberpattern||'%' order by length(numberpattern) desc") + .arg(number); + qDebug() << "SQL>"<profileID = query.value(0).toInt(); + profile->phoneNumberPattern = query.value(1).toString(); + profile->gatewayNumber = query.value(2).toString(); + profile->dtmfFormat = query.value(3).toString(); + profile->dtmfPrefix = query.value(4).toString(); + profile->dtmfSuffix = query.value(5).toString(); + } + result = true; + } + return result; +} + +int DatabaseUtility::insertProfile(org::maemo::vicar::Profile profile){ + int newId = -1; + bool result = false; + if (profilesDB.isOpen()){ + bool continueInsert = true; + if (!this->tableExists()){ + continueInsert = this->createProfilesTable(); + } + + if (continueInsert) + { + QSqlQuery query; + QString strQuery = QString("insert into profiles values(NULL,'%1','%2','%3','%4','%5')") + .arg(profile.phoneNumberPattern).arg(profile.gatewayNumber) + .arg(profile.dtmfFormat).arg(profile.dtmfPrefix).arg(profile.dtmfSuffix); + qDebug() << "SQL>"<"< +@license: GNU General Public License +*/ + +#ifndef DATABASEUTILITY_H +#define DATABASEUTILITY_H + +#include +#include "vicarprofiletypes.h" +#include +#include + +class DatabaseUtility : public QObject +{ + Q_OBJECT +public: + DatabaseUtility(QObject *parent = 0); + ~DatabaseUtility(); + bool openDatabase(); + bool deleteDatabase(); + void closeDatabase(); + bool tableExists(QString tableName); + bool createProfilesTable(); + int insertProfile(org::maemo::vicar::Profile profile); + bool updateProfile(org::maemo::vicar::Profile profile); + bool selectProfile(int id,org::maemo::vicar::Profile* profile); + bool getAllProfiles(org::maemo::vicar::ProfileList* profileList); + bool findProfileByNumber(QString number,org::maemo::vicar::Profile* profile); + bool deleteProfile(int id); + QSqlError lastError(); + +private: + QSqlDatabase profilesDB; +}; + +#endif // DATABASEUTILITY_H diff --git a/src/vicar-lib/src/dbusutility.cpp b/src/vicar-lib/src/dbusutility.cpp old mode 100644 new mode 100755 index 2e7ea39..0065648 --- a/src/vicar-lib/src/dbusutility.cpp +++ b/src/vicar-lib/src/dbusutility.cpp @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ @@ -9,20 +9,27 @@ #include -//Construction is available in the header file due to a peculiar issue with systemBus() function. - +DbusUtility::DbusUtility(QObject *parent): + QObject(parent), + connection(QDBusConnection::systemBus()){ +} //Destructor for Dbus Utility object. DbusUtility::~DbusUtility(){ - this->connection.disconnectFromBus(this->connection.baseService()); - qDebug() << "Disconnected from system bus"; + //this->connection.disconnectFromBus(this->connection.baseService()); + //qDebug() << "Disconnected from system bus"; } -QDBusConnection DbusUtility::getConnection(){ - if (!this->connection.isConnected()){ - qDebug() << "Not connected to Dbus"; +QDBusConnection DbusUtility::getConnection(bool systemBus){ + if (systemBus){ + if (!this->connection.isConnected()){ + qDebug() << "Not connected to Dbus"; + } + return this->connection; + } + else{ + return QDBusConnection::sessionBus(); } - return this->connection; } void DbusUtility::setConnection(QDBusConnection connection){ diff --git a/src/vicar-lib/src/dbusutility.h b/src/vicar-lib/src/dbusutility.h old mode 100644 new mode 100755 index 3434c53..87a991e --- a/src/vicar-lib/src/dbusutility.h +++ b/src/vicar-lib/src/dbusutility.h @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ @@ -14,15 +14,15 @@ #define NOTIFICATION_PATH "/org/freedesktop/Notifications" #define NOTIFICATION_INTERFACE "org.freedesktop.Notifications" -class DbusUtility +class DbusUtility: public QObject { + Q_OBJECT protected: QDBusConnection connection; public: - DbusUtility():connection(QDBusConnection::systemBus()) - {} + DbusUtility(QObject * parent = 0); ~DbusUtility(); - QDBusConnection getConnection(); + QDBusConnection getConnection(bool systemBus = true); void setConnection(QDBusConnection connection); bool sendSignal(QString strPath,QString strInterface,QString strName); bool sendMethodCall(QString strService,QString strPath, diff --git a/src/vicar-lib/src/gconfutility.cpp b/src/vicar-lib/src/gconfutility.cpp old mode 100644 new mode 100755 index 542f7ee..aa6a296 --- a/src/vicar-lib/src/gconfutility.cpp +++ b/src/vicar-lib/src/gconfutility.cpp @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ diff --git a/src/vicar-lib/src/gconfutility.h b/src/vicar-lib/src/gconfutility.h old mode 100644 new mode 100755 index 9043aed..84879ac --- a/src/vicar-lib/src/gconfutility.h +++ b/src/vicar-lib/src/gconfutility.h @@ -1,6 +1,6 @@ /* -@version: 0.2 -@author: Sudheer K. +@version: 0.5 +@author: Sudheer K. @license: GNU General Public License */ diff --git a/src/vicar-lib/src/telepathyutility.cpp b/src/vicar-lib/src/telepathyutility.cpp new file mode 100644 index 0000000..259ad0c --- /dev/null +++ b/src/vicar-lib/src/telepathyutility.cpp @@ -0,0 +1,208 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ + +#include "telepathyutility.h" +#include "accountmanagerproxy.h" +#include "accountproxy.h" +#include "accountcompatproxy.h" +#include +#include +#include +#include +#include +#include + +using namespace org::freedesktop::Telepathy; + +TelepathyUtility::TelepathyUtility(QObject *parent) : + QObject(parent) +{ +} + +TelepathyUtility::~TelepathyUtility(){ + +} + +//Get a list of all Telepathy accounts +QList TelepathyUtility::getAllAccounts(){ + + QList objPathList; + + QDBusInterface *iface = new QDBusInterface(AM_SERVICE,AM_OBJ_PATH,DBUS_PROPS_IFACE,QDBusConnection::sessionBus(),this); + if (iface->isValid()){ + QDBusReply reply = iface->call(QDBus::AutoDetect,"Get",AM_INTERFACE,"ValidAccounts"); + + if (reply.isValid()){; + QDBusVariant validAccounts = reply.value(); + const QVariant var = validAccounts.variant(); + const QDBusArgument arg = var.value(); + + arg.beginArray(); + while (!arg.atEnd()){ + QDBusObjectPath opath; + arg >> opath; + if (opath.path().contains("tel")){ + qDebug() << opath.path(); + } + objPathList.append(opath); + } + arg.endArray(); + } + else{ + qDebug() << "Error occurred while fetching accounts list "< accountsList = this->getAllAccounts(); + QDBusObjectPath account; + foreach (account,accountsList){ + if (account.path().contains("vicar/tel/vicar")){ + vicarAccountExists = true; + break; + } + } + + return vicarAccountExists; +} + +//Get telepathy account status +QString TelepathyUtility::getAccountStatus(){ + + QString status = "Not Available"; + + QList accountsList = this->getAllAccounts(); + QDBusObjectPath account; + foreach (account,accountsList){ + if (account.path().contains("vicar/tel/vicar")){ + AccountProxy *accountProxy = new AccountProxy(AM_SERVICE,account.path(),QDBusConnection::sessionBus(),this); + if (accountProxy->isValid()){ + uint intStatus = accountProxy->property("ConnectionStatus").toUInt(); + //Based on http://telepathy.freedesktop.org/spec/Connection.html#Connection_Status + switch(intStatus){ + case 0: + status = "Connected"; + break; + case 1: + status = "Connecting"; + break; + case 2: + status = "Disconnected"; + break; + } + } + } + } + + return status; +} + +//Create Vicar telepathy account (used installation) +bool TelepathyUtility::createAccount(){ + + AccountManagerProxy *amProxy = new AccountManagerProxy(AM_SERVICE,AM_OBJ_PATH,QDBusConnection::sessionBus(),this); + + QMap connectionParametersMap; + connectionParametersMap.insert("account","vicar"); + + QList presenceDetails; + uint presenceType(2); //Available = 2 + presenceDetails << presenceType; + presenceDetails << "online"; + presenceDetails << "Available"; + + SimplePresence presence; + presence.type = presenceType; + presence.status = "online"; + presence.statusMessage = "Available"; + + QMap accountPropertiesMap; + accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.AutomaticPresence",QVariant::fromValue(presence)); + accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Enabled",true); + accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.ConnectAutomatically",true); + accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.RequestedPresence",QVariant::fromValue(presence)); + accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.Profile","vicar"); + + QStringList valuesList; + valuesList.append("TEL"); + accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.SecondaryVCardFields",valuesList); + + QDBusPendingReply reply = amProxy->CreateAccount("vicar","tel","Vicar",connectionParametersMap,accountPropertiesMap); + reply.waitForFinished(); + + if (reply.isValid()){ + QDBusObjectPath account = reply.value(); + qDebug() << account.path() <<" created successfully."; + + AccountCompatProxy *accountCompatProxy = new AccountCompatProxy(AM_SERVICE,account.path(),QDBusConnection::sessionBus(),this); + if (accountCompatProxy->isValid()){ + QDBusPendingReply<> dbusReply = accountCompatProxy->SetHasBeenOnline(); + dbusReply.waitForFinished(); + if (dbusReply.isError()){ + qDebug() << "Error occurred while setting HasBeenOnline property "< accountsList = this->getAllAccounts(); + QDBusObjectPath account; + foreach (account,accountsList){ + if (account.path().contains("vicar/tel/vicar")){ + AccountProxy *accountProxy = new AccountProxy(AM_SERVICE,account.path(),QDBusConnection::sessionBus(),this); + if (accountProxy->isValid()){ + QDBusPendingReply<> dbusReply = accountProxy->Remove(); + dbusReply.waitForFinished(); + if (dbusReply.isError()){ + qDebug() << "Error occurred while removing VICaR account "<>(const QDBusArgument &argument, SimplePresence &simplePresence) + { + argument.beginStructure(); + argument >> simplePresence.type >> simplePresence.status >> simplePresence.statusMessage; + argument.endStructure(); + return argument; + } diff --git a/src/vicar-lib/src/telepathyutility.h b/src/vicar-lib/src/telepathyutility.h new file mode 100644 index 0000000..d39f7f3 --- /dev/null +++ b/src/vicar-lib/src/telepathyutility.h @@ -0,0 +1,58 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ + +#ifndef TELEPATHYUTILITY_H +#define TELEPATHYUTILITY_H + +#include +#include +#include + + +#define AM_SERVICE "org.freedesktop.Telepathy.AccountManager" +#define AM_OBJ_PATH "/org/freedesktop/Telepathy/AccountManager" +#define AM_INTERFACE "org.freedesktop.Telepathy.AccountManager" +#define DBUS_SERVICE "org.freedesktop.DBus.Properties" +#define DBUS_OBJ_PATH "/org/freedesktop/DBus/Properties" +#define DBUS_PROPS_IFACE "org.freedesktop.DBus.Properties" + +namespace org { +namespace freedesktop { +namespace Telepathy { +struct SimplePresence +{ + uint type; + QString status; + QString statusMessage; +}; +}//Telepathy +}//freedesktop +}//org + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::SimplePresence); + +bool operator==(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2); +inline bool operator!=(const org::freedesktop::Telepathy::SimplePresence& v1, const org::freedesktop::Telepathy::SimplePresence& v2) +{ + return !operator==(v1, v2); +} +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::SimplePresence& val); +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::SimplePresence& val); + +class TelepathyUtility : public QObject +{ + Q_OBJECT +public: + TelepathyUtility(QObject *parent = 0); + ~TelepathyUtility(); + QList getAllAccounts(); + QString getAccountStatus(); + bool accountExists(); + bool createAccount(); + bool deleteAccount(); +}; + +#endif // TELEPATHYUTILITY_H diff --git a/src/vicar-lib/src/vicarprofiletypes.h b/src/vicar-lib/src/vicarprofiletypes.h new file mode 100644 index 0000000..c43a580 --- /dev/null +++ b/src/vicar-lib/src/vicarprofiletypes.h @@ -0,0 +1,31 @@ +#ifndef VICARPROFILETYPES_H +#define VICARPROFILETYPES_H + +#include +#include +#include + +namespace org { +namespace maemo { +namespace vicar { + +class Profile +{ +public: + uint profileID; + QString phoneNumberPattern; + QString gatewayNumber; + QString dtmfFormat; + QString dtmfPrefix; + QString dtmfSuffix; +}; +typedef QList ProfileList; + +} // namespace vicar +} // namespace maemo +} // namespace org + +Q_DECLARE_METATYPE(org::maemo::vicar::Profile) +Q_DECLARE_METATYPE(org::maemo::vicar::ProfileList) + +#endif // VICARPROFILETYPES_H diff --git a/src/vicar-lib/vicar-lib.pro b/src/vicar-lib/vicar-lib.pro old mode 100644 new mode 100755 index ef26364..25b0bc3 --- a/src/vicar-lib/vicar-lib.pro +++ b/src/vicar-lib/vicar-lib.pro @@ -5,7 +5,7 @@ INCLUDEPATH += /usr/include/gconf/2 \ LIBS += /usr/lib/libgconf-2.so CONFIG += qt debug staticlib CONFIG -= gui -QT += dbus +QT += dbus sql QT -= gui TARGET = vicar TEMPLATE = lib @@ -15,9 +15,20 @@ OBJECTS_DIR = objs DESTDIR = ../lib SOURCES += src/dbusutility.cpp \ - src/gconfutility.cpp + src/gconfutility.cpp \ + src/telepathyutility.cpp \ + src/accountmanagerproxy.cpp \ + src/accountproxy.cpp \ + src/accountcompatproxy.cpp \ + src/databaseutility.cpp HEADERS += src/dbusutility.h \ - src/gconfutility.h + src/gconfutility.h \ + src/telepathyutility.h \ + src/accountmanagerproxy.h \ + src/accountproxy.h \ + src/accountcompatproxy.h \ + src/databaseutility.h \ + src/vicarprofiletypes.h #MAKE INSTALL INSTALLDIR = /../../debian/vicar diff --git a/src/vicar-telepathy/src/basetypes.h b/src/vicar-telepathy/src/basetypes.h new file mode 100644 index 0000000..28ddabd --- /dev/null +++ b/src/vicar-telepathy/src/basetypes.h @@ -0,0 +1,35 @@ +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by Tobias Hunger + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef QTTELEPATHY_BASETYPES_H +#define QTTELEPATHY_BASETYPES_H + +#include +#include +#include +#include +#include + +Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QVariantMap) + +#endif + diff --git a/src/vicar-telepathy/src/connection.cpp b/src/vicar-telepathy/src/connection.cpp new file mode 100644 index 0000000..236ded5 --- /dev/null +++ b/src/vicar-telepathy/src/connection.cpp @@ -0,0 +1,480 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "connection.h" +#include "connectionadaptor.h" +#include "connectioninterfacerequestsadaptor.h" +#include "connectioninterfacerequeststypes.h" +#include "connectioninterfacecapabilitiesadaptor.h" +#include "connectioninterfacecapabilitiestypes.h" +#include "names.h" +#include "vicarcallrouterproxy.h" + +#include +#include +#include +#include +#include + + +namespace +{ +static const QString protocol_vicar("tel"); + +static const QString connection_service_name_prefix("org.freedesktop.Telepathy.Connection.vicar." + protocol_vicar + '.'); +static const QString connection_object_path_prefix("/org/freedesktop/Telepathy/Connection/vicar/" + protocol_vicar + '/'); +static const QString requests_interface("org.freedesktop.Telepathy.Connection.Interface.Requests"); +} + +using namespace org::maemo; + + +class ConnectionPrivate +{ +public: + ConnectionPrivate(Connection * p, + const QString & acc) : + account(acc), + connection_status(Connection::Disconnected), + adaptor(new ConnectionAdaptor(p)), + connIfaceReqsAdaptor(new ConnectionInterfaceRequestsAdaptor(p)), + parent(p) + { + Q_ASSERT(0 != adaptor); + } + + ~ConnectionPrivate() + { + qDebug() << "VICaR: Connection Destructing"; + } + + const QString account; + + Connection::Status connection_status; + ConnectionAdaptor * adaptor; + ConnectionInterfaceRequestsAdaptor * connIfaceReqsAdaptor; + Connection * const parent; +}; + +// --------------------------------------------------------------------------- + +Connection::Connection(const QString & account, + QObject * parent) : + QObject(parent), + d(new ConnectionPrivate(this, account)) +{ + Q_ASSERT(0 != d); + Q_ASSERT(!account.isEmpty()); + + /* -- Set the Dynamic property "Interfaces" --- + + Apparently it is not sufficient to implement an additional interface like Conn.I.Requests. + We have to assign the list of additional interfaces to the DBus Property Interfaces. + + The actual DBus property "Interfaces" is declared in ConnectionAdaptor class, + which is our Connection Interface implementation. + */ + + QStringList interfaces = QStringList(requests_interface); + this->setProperty("Interfaces",interfaces); + + + //Set the property RequestableChannelClasses + org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses; + + uint targetHandleType(1); + + org::freedesktop::Telepathy::RequestableChannelClass requestableChannelClass1; + requestableChannelClass1.fixedProperties.insert("org.freedesktop.Telepathy.Channel.TargetHandleType",targetHandleType); + requestableChannelClass1.fixedProperties.insert("org.freedesktop.Telepathy.Channel.ChannelType","org.freedesktop.Telepathy.Channel.Type.StreamedMedia"); + + requestableChannelClass1.allowedProperties.append("org.freedesktop.Telepathy.Channel.TargetHandle"); + requestableChannelClass1.allowedProperties.append("org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio"); + + requestableChannelClasses.append(requestableChannelClass1); + + org::freedesktop::Telepathy::RequestableChannelClass requestableChannelClass2; + requestableChannelClass2.fixedProperties.insert("org.freedesktop.Telepathy.Channel.TargetHandleType",targetHandleType); + requestableChannelClass2.fixedProperties.insert("org.freedesktop.Telepathy.Channel.ChannelType","org.freedesktop.Telepathy.Channel.Type.StreamedMedia"); + + requestableChannelClass2.allowedProperties.append("com.nokia.Telepathy.Channel.Interface.Conference.InitialMembers"); + requestableChannelClass2.allowedProperties.append("org.freedesktop.Telepathy.Channel.TargetHandleType"); + requestableChannelClass2.allowedProperties.append("org.freedesktop.Telepathy.Channel.Type.StreamedMedia.InitialAudio"); + + requestableChannelClasses.append(requestableChannelClass2); + + + this->setProperty("RequestableChannelClasses",QVariant::fromValue(requestableChannelClasses)); + + + + qDebug() << "VICaR: Connection set up."; +} + +Connection::~Connection() +{ + qDebug() << "VICaR: Connection closed."; + delete(d); +} + +bool Connection::registerObject() +{ + if (!QDBusConnection::sessionBus().registerService(serviceName())) + { + qDebug() << "VICaR: Problem registering connection service:" << serviceName(); + return false; + } + + if (!QDBusConnection::sessionBus().registerObject(objectPath().path(), + this)) + { + qDebug() << "VICaR: Problem registering object path:" << objectPath().path(); + return false; + } + return true; +} + +void Connection::unregisterObject() +{ + qDebug() << "VICaR: Unregistering Connection object from DBus"; + QDBusConnection::sessionBus().unregisterObject(objectPath().path()); + QDBusConnection::sessionBus().unregisterService(serviceName()); +} + +QString Connection::name() const +{ + return QString("vicar"); +} + + +QString Connection::serviceName() const +{ return connection_service_name_prefix + name(); } + +QDBusObjectPath Connection::objectPath() const +{ return QDBusObjectPath(connection_object_path_prefix + name()); } + + +//org.freedesktop.Telepathy.Connection +void Connection::Connect() +{ + /* + Since this is not a "real" Telepathy Connection to a SIP, Chat server, + I am not connecting to anything. + */ + qDebug() << "VICaR: Changing status to Connected..."; + d->connection_status = Connection::Connected; + + //Let all the Telepathy clients know that connection status has changed + qDebug() << "VICaR: Emitting StatusChanged."; + emit StatusChanged(d->connection_status, ReasonRequested); + +} + +void Connection::Disconnect() +{ + qDebug() << "VICaR: Changing status to Disconnected..."; + //We don't have any Handles to release here. So just change the status to Disconnected + d->connection_status = Connection::Disconnected; + + qDebug() << "VICaR: Emitting StatusChanged"; + emit StatusChanged(d->connection_status, ReasonRequested); + + //As per Telepathy specfication, on disconnect we need to unregister from Dbus and destroy the object. + unregisterObject(); + deleteLater(); +} + +QStringList Connection::GetInterfaces() +{ + QStringList result; + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to get Interfaces List. The connection is no longer available."); + return result; + } + result <(d->connection_status); } + +uint Connection::GetSelfHandle() +{ + qDebug() << "VICaR: GetSelfHandle"; + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to get Self Handle. The connection is no longer available."); + qDebug() << "VICaR: NOT CONNECTED when requesting selfhandle!"; + return 0; + } + + //WARNING: Incomplete implemenation + uint handle = 0; + qDebug() << "VICaR: Returning Handle" << handle << "as self handle."; + return handle; +} + +QList Connection::RequestHandles(uint handle_type, + const QStringList & names) +{ + Q_UNUSED(names); + QList result; + + // check input: + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to process handle request. The connection is no longer available."); + return result; + } + if (handle_type != HandleContact) + { + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Supports handles of type Contact only."); + return result; + } + + //WARNING: Incomplete implementation. Create a handle and return the value here. + return result; +} + +void Connection::HoldHandles(const uint handle_type, const QList &handles) +{ + Q_UNUSED(handles); + qDebug() << "VICaR: HoldHandles."; + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to process handle request. The connection is no longer available."); + return; + } + if (handle_type != HandleContact) + { + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Supports handles of type Contact only."); + return; + } + + //WARNING: Incomplete implementation +} + +QStringList Connection::InspectHandles(const uint handle_type, + const QList &handles) +{ + Q_UNUSED(handles); + QStringList result; + + // check input: + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to process handle request. The connection is no longer available."); + return result; + } + if (handle_type != HandleContact) + { + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Supports handles of type Contact only."); + return result; + } + + //WARNING: Incomplete implementation + return result; +} + +void Connection::ReleaseHandles(const uint handle_type, const QList &handles) +{ + Q_UNUSED(handles); + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to release handle. The connection is no longer available."); + qDebug() << "VICaR: Releasing Handle while connection is no longer connected."; + return; + } + if (handle_type != HandleContact) + { + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Supports handles of type Contact only."); + qDebug() << "VICaR: Trying to release a Handle that is not a contact."; + return; + } + + //WARNING: Incomplete implementation +} + +org::freedesktop::Telepathy::ChannelInfoList Connection::ListChannels() +{ + org::freedesktop::Telepathy::ChannelInfoList result; + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR - Unable to list channels. The connection is no longer available."); + return result; + } + + //WARNING: Incomplete implementation + //Btw - We never have any channels :) + + return result; +} + +QDBusObjectPath Connection::RequestChannel(const QString &type, + uint handle_type, uint handle, + bool suppress_handler) +{ + Q_UNUSED(handle); + Q_UNUSED(suppress_handler); + //This method is deprecated and no longer used as per latest Telepathy spec + + if (type != QString("org.freedesktop.Telepathy.Channel.Type.StreamedMedia")) + { + sendErrorReply("org.freedesktop.Telepathy.Error.NotImplemented", + "VICaR: Failed to create channel: Channel type not implemented."); + return QDBusObjectPath(); + } + + if (handle_type != HandleContact ) + { + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidHandle", + "VICaR: Failed to create channel: Handle type not supported."); + return QDBusObjectPath(); + } + + if (d->connection_status != Connected) + { + sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected", + "VICaR: Failed to create channel: Connection is Disconnected."); + return QDBusObjectPath(); + } + + //TODO VICaR Specific code here + + //WARNING: Incomplete implementation, we are not creating any channels here at all. + QDBusObjectPath channel_path; + return channel_path; +} + +//org.freedesktop.Telepathy.Connection.Interface.Requests +QDBusObjectPath Connection::CreateChannel(const QVariantMap &request, + QVariantMap &channel_properties) +{ + Q_UNUSED(channel_properties); + Q_ASSERT(!request.isEmpty()); + qDebug() << "VICaR: CreateChannel"; + qDebug() << " Request details are: "<< request; + + //Ideally we need to emit NewChannels signal here, but since we are not creating any channels we ignore it + + //WARNING: VICaR - Specific implementation + return processChannel(request); + +} + +bool Connection::EnsureChannel(const QVariantMap &request, + QDBusObjectPath &channel_object, + QVariantMap &channel_properties) +{ + Q_UNUSED(channel_object); + Q_UNUSED(channel_properties); + Q_ASSERT(!request.isEmpty()); + qDebug() << "VICaR: EnsureChannel"; + qDebug() << " Request details are: "<< request; + + //WARNING: Incomplete implementation + processChannel(request); + + return true; +} + +QDBusObjectPath Connection::processChannel(const QVariantMap &request){ + + QDBusObjectPath channel_path; + + if (!request.contains("org.freedesktop.Telepathy.Channel.TargetID")){ + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Invalid request. TargetID (Phone Number) not included."); + return channel_path; + } + + QVariant vNumber = request.value("org.freedesktop.Telepathy.Channel.TargetID"); + if (!vNumber.isValid()){ + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Invalid request. Phone Number is not valid."); + return channel_path; + } + QString strNumber = vNumber.toString(); + if (strNumber.isEmpty()){ + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Invalid request. Phone Number is empty."); + return channel_path; + } + + /* + Send an error reply to Tp Client (Mission Control) to force it to close the active channel. + Once it recieves the reply, the client does not bother what we return. + + */ + + sendErrorReply("org.freedesktop.Telepathy.Error.NotAvailable", + "VICaR - Creating a new channel to "+strNumber+" via Ring."); + + + //Initiate a new call to CC/Google Out/Skype-out number by requesting a new channel with Ring CM. + + VicarCallRouterProxy *callRouter = new VicarCallRouterProxy(APPLICATION_DBUS_SERVICE,APPLICATION_DBUS_PATH,QDBusConnection::sessionBus(),this); + + callRouter->callInternationalNumber(strNumber); + + qDebug() << "VICaR: Call is processed."; + + return channel_path; +} + + +//org.freedesktop.Telepathy.Connection.Interface.Capabilities +org::freedesktop::Telepathy::ContactCapabilitiesList Connection::GetCapabilities(const QList &Handles){ + Q_UNUSED(Handles); + org::freedesktop::Telepathy::ContactCapabilitiesList capabilities; + return capabilities; + +} + + +org::freedesktop::Telepathy::CapabilityPairList Connection::AdvertiseCapabilities(org::freedesktop::Telepathy::CapabilityPairList Add, const QStringList &Remove){ + Q_UNUSED(Add); + Q_UNUSED(Remove); + org::freedesktop::Telepathy::CapabilityPairList capabilities; + return capabilities; +} diff --git a/src/vicar-telepathy/src/connection.h b/src/vicar-telepathy/src/connection.h new file mode 100644 index 0000000..ea214f4 --- /dev/null +++ b/src/vicar-telepathy/src/connection.h @@ -0,0 +1,145 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _VICAR_CONNECTION_H_ +#define _VICAR_CONNECTION_H_ + +#include "connectiontypes.h" +#include "connectioninterfacerequeststypes.h" +#include "connectioninterfacecapabilitiestypes.h" + +#include +#include + +class ConnectionPrivate; + +class Connection : public QObject, protected QDBusContext +{ + Q_OBJECT + +public: + explicit Connection(const QString & account, + QObject * parent = 0); + ~Connection(); + + QString name() const; + QString serviceName() const; + QDBusObjectPath objectPath() const; + + bool registerObject(); + void unregisterObject(); + + enum Status + { + Connected = 0, + Connecting = 1, + Disconnected = 2 + }; + + enum Reason + { + ReasonNone = 0, + ReasonRequested = 1, + ReasonNetworkError = 2, + ReasonAuthenticationFailed = 3, + ReasonEncryptionError = 4, + ReasonNameInUse = 5, + ReasonCertNotProvided = 6, + ReasonCertUntrusted = 7, + ReasonCertExpired = 8, + ReasonCertNotActivated = 9, + ReasonCertHostnameMismatch = 10, + ReasonCertFingerprintMismatch = 11, + ReasonCertSelfSigned = 12, + ReasonCertOtherError = 13 + }; + + enum Handle + { + HandleNone = 0, + HandleContact = 1, + HandleRoom = 2, + HandleRoomList = 3, + HandleGroup = 4 + }; + +public slots: + //org.freedesktop.Telepathy.Connection + void Connect(); + void Disconnect(); + + QStringList GetInterfaces(); + QString GetProtocol(); + uint GetStatus(); + + uint GetSelfHandle(); + QList RequestHandles(const uint handle_type, const QStringList &names); + void HoldHandles(const uint handle_type, const QList &handles); + QStringList InspectHandles(const uint handle_type, const QList &handles); + void ReleaseHandles(const uint handle_type, const QList &handles); + + org::freedesktop::Telepathy::ChannelInfoList ListChannels(); + QDBusObjectPath RequestChannel(const QString &type, + uint handle_type, uint handle, + bool suppress_handler); + + //org.freedesktop.Telepathy.Connection.Interface.Requests + QDBusObjectPath CreateChannel(const QVariantMap &request, + QVariantMap &channel_properties); + + bool EnsureChannel(const QVariantMap &request, + QDBusObjectPath &channel_object, + QVariantMap &channel_properties); + //org.freedesktop.Telepathy.Connection.Interface.Capabilities + org::freedesktop::Telepathy::CapabilityPairList AdvertiseCapabilities(org::freedesktop::Telepathy::CapabilityPairList Add, + const QStringList &Remove); + org::freedesktop::Telepathy::ContactCapabilitiesList GetCapabilities(const QList &Handles); + +protected slots: + QDBusObjectPath processChannel(const QVariantMap &request); + +signals: + void NewChannel(const QDBusObjectPath & object_path, + const QString & channel_type, + uint handle_type, uint handle, + bool suppress_handler); + void StatusChanged(uint status, uint reason); + + //org.freedesktop.Telepathy.Connection.Interface.Requests + void ChannelClosed(const QDBusObjectPath &removed_channel_object); + void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels); + + //org.freedesktop.Telepathy.Connection.Interface.Capabilities + void CapabilitiesChanged(org::freedesktop::Telepathy::CapabilityChangeList changes); + +private: + Connection(const Connection &); // no impl. + ConnectionPrivate * const d; +}; + +#endif diff --git a/src/vicar-telepathy/src/connectionadaptor.cpp b/src/vicar-telepathy/src/connectionadaptor.cpp new file mode 100644 index 0000000..09ef293 --- /dev/null +++ b/src/vicar-telepathy/src/connectionadaptor.cpp @@ -0,0 +1,133 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -i QtTelepathy/Core/ConnectionAdaptor -i QtTelepathy/Common/ConnectionTypes -a :src/Core/connectionadaptor.cpp xml/tp-conn.xml + * + * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "connectionadaptor.h" +#include "connectiontypes.h" +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class ConnectionAdaptor + */ + +ConnectionAdaptor::ConnectionAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +ConnectionAdaptor::~ConnectionAdaptor() +{ + // destructor +} + +QStringList ConnectionAdaptor::Interfaces() const +{ + // get the value of property Interfaces + return qvariant_cast< QStringList >(parent()->property("Interfaces")); +} + +void ConnectionAdaptor::Connect() +{ + // handle method call org.freedesktop.Telepathy.Connection.Connect + QMetaObject::invokeMethod(parent(), "Connect"); +} + +void ConnectionAdaptor::Disconnect() +{ + // handle method call org.freedesktop.Telepathy.Connection.Disconnect + QMetaObject::invokeMethod(parent(), "Disconnect"); +} + +QStringList ConnectionAdaptor::GetInterfaces() +{ + // handle method call org.freedesktop.Telepathy.Connection.GetInterfaces + QStringList out0; + QMetaObject::invokeMethod(parent(), "GetInterfaces", Q_RETURN_ARG(QStringList, out0)); + return out0; +} + +QString ConnectionAdaptor::GetProtocol() +{ + // handle method call org.freedesktop.Telepathy.Connection.GetProtocol + QString out0; + QMetaObject::invokeMethod(parent(), "GetProtocol", Q_RETURN_ARG(QString, out0)); + return out0; +} + +uint ConnectionAdaptor::GetSelfHandle() +{ + // handle method call org.freedesktop.Telepathy.Connection.GetSelfHandle + uint out0; + QMetaObject::invokeMethod(parent(), "GetSelfHandle", Q_RETURN_ARG(uint, out0)); + return out0; +} + +uint ConnectionAdaptor::GetStatus() +{ + // handle method call org.freedesktop.Telepathy.Connection.GetStatus + uint out0; + QMetaObject::invokeMethod(parent(), "GetStatus", Q_RETURN_ARG(uint, out0)); + return out0; +} + +void ConnectionAdaptor::HoldHandles(uint handle_type, const QList &handles) +{ + qDebug() << "HoldHandles called from external!" << handles; + // handle method call org.freedesktop.Telepathy.Connection.HoldHandles + QMetaObject::invokeMethod(parent(), "HoldHandles", Q_ARG(uint, handle_type), Q_ARG(QList, handles)); +} + +QStringList ConnectionAdaptor::InspectHandles(uint handle_type, const QList &handles) +{ + // handle method call org.freedesktop.Telepathy.Connection.InspectHandles + QStringList out0; + QMetaObject::invokeMethod(parent(), "InspectHandles", Q_RETURN_ARG(QStringList, out0), Q_ARG(uint, handle_type), Q_ARG(QList, handles)); + return out0; +} + +org::freedesktop::Telepathy::ChannelInfoList ConnectionAdaptor::ListChannels() +{ + // handle method call org.freedesktop.Telepathy.Connection.ListChannels + org::freedesktop::Telepathy::ChannelInfoList out0; + QMetaObject::invokeMethod(parent(), "ListChannels", Q_RETURN_ARG(org::freedesktop::Telepathy::ChannelInfoList, out0)); + return out0; +} + +void ConnectionAdaptor::ReleaseHandles(uint handle_type, const QList &handles) +{ + qDebug() << "ReleaseHandles called from external!" << handles; + // handle method call org.freedesktop.Telepathy.Connection.ReleaseHandles + QMetaObject::invokeMethod(parent(), "ReleaseHandles", Q_ARG(uint, handle_type), Q_ARG(QList, handles)); +} + +QDBusObjectPath ConnectionAdaptor::RequestChannel(const QString &type, uint handle_type, uint handle, bool suppress_handler) +{ + // handle method call org.freedesktop.Telepathy.Connection.RequestChannel + QDBusObjectPath out0; + QMetaObject::invokeMethod(parent(), "RequestChannel", Q_RETURN_ARG(QDBusObjectPath, out0), Q_ARG(QString, type), Q_ARG(uint, handle_type), Q_ARG(uint, handle), Q_ARG(bool, suppress_handler)); + return out0; +} + +QList ConnectionAdaptor::RequestHandles(uint handle_type, const QStringList &names) +{ + // handle method call org.freedesktop.Telepathy.Connection.RequestHandles + QList out0; + QMetaObject::invokeMethod(parent(), "RequestHandles", Q_RETURN_ARG(QList, out0), Q_ARG(uint, handle_type), Q_ARG(QStringList, names)); + return out0; +} + diff --git a/src/vicar-telepathy/src/connectionadaptor.h b/src/vicar-telepathy/src/connectionadaptor.h new file mode 100644 index 0000000..5b9a012 --- /dev/null +++ b/src/vicar-telepathy/src/connectionadaptor.h @@ -0,0 +1,121 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -i QtTelepathy/Common/BaseTypes -i QtTelepathy/Common/ConnectionTypes -a include/QtTelepathy/Core/connectionadaptor.h: xml/tp-conn.xml + * + * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef CONNECTIONADAPTOR_H_1172489892 +#define CONNECTIONADAPTOR_H_1172489892 + +#include +#include +#include "connectiontypes.h" +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface org.freedesktop.Telepathy.Connection + */ +class ConnectionAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Telepathy.Connection") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n" +" \n" +" \n" +" \n" +" \n" +" \" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \" name=\"com.trolltech.QtDBus.QtTypeName.Out0\" />\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + ConnectionAdaptor(QObject *parent); + virtual ~ConnectionAdaptor(); + +public: // PROPERTIES + Q_PROPERTY(QStringList Interfaces READ Interfaces) + QStringList Interfaces() const; + +public Q_SLOTS: // METHODS + void Connect(); + void Disconnect(); + QStringList GetInterfaces(); + QString GetProtocol(); + uint GetSelfHandle(); + uint GetStatus(); + void HoldHandles(uint handle_type, const QList &handles); + QStringList InspectHandles(uint handle_type, const QList &handles); + org::freedesktop::Telepathy::ChannelInfoList ListChannels(); + void ReleaseHandles(uint handle_type, const QList &handles); + QDBusObjectPath RequestChannel(const QString &type, uint handle_type, uint handle, bool suppress_handler); + QList RequestHandles(uint handle_type, const QStringList &names); +Q_SIGNALS: // SIGNALS + void NewChannel(const QDBusObjectPath &object_path, const QString &channel_type, uint handle_type, uint handle, bool suppress_handler); + void StatusChanged(uint status, uint reason); +}; + +#endif diff --git a/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.cpp b/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.cpp new file mode 100644 index 0000000..7cb1780 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.cpp @@ -0,0 +1,51 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i connectioninterfacecapabilitiestypes.h -c ConnectionInterfaceCapabilitiesAdaptor -a connectioninterfacecapabilitiesadaptor.h:connectioninterfacecapabilitiesadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.I.Capabilities.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#include "connectioninterfacecapabilitiesadaptor.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class ConnectionInterfaceCapabilitiesAdaptor + */ + +ConnectionInterfaceCapabilitiesAdaptor::ConnectionInterfaceCapabilitiesAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +ConnectionInterfaceCapabilitiesAdaptor::~ConnectionInterfaceCapabilitiesAdaptor() +{ + // destructor +} + +org::freedesktop::Telepathy::CapabilityPairList ConnectionInterfaceCapabilitiesAdaptor::AdvertiseCapabilities(org::freedesktop::Telepathy::CapabilityPairList Add, const QStringList &Remove) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Capabilities.AdvertiseCapabilities + org::freedesktop::Telepathy::CapabilityPairList Self_Capabilities; + QMetaObject::invokeMethod(parent(), "AdvertiseCapabilities", Q_RETURN_ARG(org::freedesktop::Telepathy::CapabilityPairList, Self_Capabilities), Q_ARG(org::freedesktop::Telepathy::CapabilityPairList, Add), Q_ARG(QStringList, Remove)); + return Self_Capabilities; +} + +org::freedesktop::Telepathy::ContactCapabilitiesList ConnectionInterfaceCapabilitiesAdaptor::GetCapabilities(const QList &Handles) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Capabilities.GetCapabilities + org::freedesktop::Telepathy::ContactCapabilitiesList Contact_Capabilities; + QMetaObject::invokeMethod(parent(), "GetCapabilities", Q_RETURN_ARG(org::freedesktop::Telepathy::ContactCapabilitiesList, Contact_Capabilities), Q_ARG(QList, Handles)); + return Contact_Capabilities; +} + diff --git a/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.h b/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.h new file mode 100644 index 0000000..c891276 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacecapabilitiesadaptor.h @@ -0,0 +1,65 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i connectioninterfacecapabilitiestypes.h -c ConnectionInterfaceCapabilitiesAdaptor -a connectioninterfacecapabilitiesadaptor.h:connectioninterfacecapabilitiesadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.I.Capabilities.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef CONNECTIONINTERFACECAPABILITIESADAPTOR_H_1282518435 +#define CONNECTIONINTERFACECAPABILITIESADAPTOR_H_1282518435 + +#include +#include +#include "connectioninterfacecapabilitiestypes.h" +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface org.freedesktop.Telepathy.Connection.Interface.Capabilities + */ +class ConnectionInterfaceCapabilitiesAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Telepathy.Connection.Interface.Capabilities") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + ConnectionInterfaceCapabilitiesAdaptor(QObject *parent); + virtual ~ConnectionInterfaceCapabilitiesAdaptor(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + org::freedesktop::Telepathy::CapabilityPairList AdvertiseCapabilities(org::freedesktop::Telepathy::CapabilityPairList Add, const QStringList &Remove); + org::freedesktop::Telepathy::ContactCapabilitiesList GetCapabilities(const QList &Handles); +Q_SIGNALS: // SIGNALS + void CapabilitiesChanged(org::freedesktop::Telepathy::CapabilityChangeList in0); +}; + +#endif diff --git a/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.cpp b/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.cpp new file mode 100644 index 0000000..c3a2410 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.cpp @@ -0,0 +1,98 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "connectioninterfacecapabilitiestypes.h" + +using namespace org::freedesktop::Telepathy; + +const QDBusArgument &operator>>(const QDBusArgument &argument, ContactCapabilities &val) +{ + argument.beginStructure(); + argument >> val.handle >> val.channelType >> val.genericCapabilityFlags >> val.typeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const ContactCapabilities &val) +{ + argument.beginStructure(); + argument << val.handle << val.channelType << val.genericCapabilityFlags << val.typeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDebug &operator<<(QDebug arg,const ContactCapabilities &val) +{ + arg.space() << "[" << val.handle << "," << val.channelType << "," << val.genericCapabilityFlags << "," << val.typeSpecificFlags << "]"; + return arg.space(); +} + + +const QDBusArgument &operator>>(const QDBusArgument &argument, CapabilityPair &val) +{ + argument.beginStructure(); + argument >> val.channelType >> val.typeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const CapabilityPair &val) +{ + argument.beginStructure(); + argument << val.channelType << val.typeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDebug &operator<<(QDebug arg,const CapabilityPair &val) +{ + arg.space() << "[" << val.channelType << "," << val.typeSpecificFlags << "]"; + return arg.space(); +} + +const QDBusArgument &operator>>(const QDBusArgument &argument, CapabilityChange &val) +{ + argument.beginStructure(); + argument >> val.handle >> val.channelType >> val.oldGenericFlags >> val.newGenericFlags >> val.oldTypeSpecificFlags >> val.newTypeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const CapabilityChange &val) +{ + argument.beginStructure(); + argument << val.handle << val.channelType << val.oldGenericFlags << val.newGenericFlags << val.oldTypeSpecificFlags << val.newTypeSpecificFlags; + argument.endStructure(); + return argument; +} + +QDebug &operator<<(QDebug arg,const CapabilityChange &val) +{ + arg.space() << "[" << val.handle << "," << val.channelType << "," << val.oldGenericFlags << "," << val.newGenericFlags << "," << val.oldTypeSpecificFlags << "," << val.newTypeSpecificFlags << "]"; + return arg.space(); +} diff --git a/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.h b/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.h new file mode 100644 index 0000000..21243eb --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacecapabilitiestypes.h @@ -0,0 +1,98 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by Tobias Hunger + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef CONNECTIONINTERFACECAPABILITIESTYPES_H +#define CONNECTIONINTERFACECAPABILITIESTYPES_H + +#include +#include +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Telepathy { + +class ContactCapabilities +{ +public: + uint handle; + QString channelType; + uint genericCapabilityFlags; + uint typeSpecificFlags; +}; +typedef QList ContactCapabilitiesList; + +class CapabilityPair +{ +public: + QString channelType; + uint typeSpecificFlags; +}; +typedef QList CapabilityPairList; + +class CapabilityChange +{ +public: + uint handle; + QString channelType; + uint oldGenericFlags; + uint newGenericFlags; + uint oldTypeSpecificFlags; + uint newTypeSpecificFlags; +}; +typedef QList CapabilityChangeList; + +} // namespace Telepathy +} // namespace freedesktop +} // namespace org + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ContactCapabilities) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ContactCapabilitiesList) + +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::ContactCapabilities& val); +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::ContactCapabilities& val); +QDebug& operator<<(QDebug arg, const org::freedesktop::Telepathy::ContactCapabilities& val); + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::CapabilityPair) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::CapabilityPairList) + +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::CapabilityPair& val); +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::CapabilityPair& val); +QDebug& operator<<(QDebug arg, const org::freedesktop::Telepathy::CapabilityPair& val); + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::CapabilityChange) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::CapabilityChangeList) + +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::CapabilityChange& val); +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::CapabilityChange& val); +QDebug& operator<<(QDebug arg, const org::freedesktop::Telepathy::CapabilityChange& val); + +#endif // CONNECTIONINTERFACECAPABILITIESTYPES_H diff --git a/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.cpp b/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.cpp new file mode 100644 index 0000000..6f4459c --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.cpp @@ -0,0 +1,55 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a src/connectioninterfacerequestsadaptor.h:src/connectioninterfacerequestsadaptor.cpp data/Conn.I.Requests.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * Hand Edited! Do not re-generate + */ + +#include "connectioninterfacerequestsadaptor.h" +#include "connectioninterfacerequeststypes.h" +#include "connection.h" +#include +#include +#include +#include +#include +#include +#include + +/* + * Implementation of adaptor class ConnectionInterfaceRequestsAdaptor + */ + +ConnectionInterfaceRequestsAdaptor::ConnectionInterfaceRequestsAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +ConnectionInterfaceRequestsAdaptor::~ConnectionInterfaceRequestsAdaptor() +{ + // destructor +} + +org::freedesktop::Telepathy::RequestableChannelClassList ConnectionInterfaceRequestsAdaptor::requestableChannelClasses() const +{ + // get the value of property RequestableChannelClasses + return qvariant_cast< org::freedesktop::Telepathy::RequestableChannelClassList >(parent()->property("RequestableChannelClasses")); +} + + +QDBusObjectPath ConnectionInterfaceRequestsAdaptor::CreateChannel(const QVariantMap &request, QVariantMap &channel_properties) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.CreateChannel + return static_cast(parent())->CreateChannel(request, channel_properties); +} + +bool ConnectionInterfaceRequestsAdaptor::EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties) +{ + // handle method call org.freedesktop.Telepathy.Connection.Interface.Requests.EnsureChannel + return static_cast(parent())->EnsureChannel(request, channel_object, channel_properties); +} + diff --git a/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.h b/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.h new file mode 100644 index 0000000..527e7f8 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacerequestsadaptor.h @@ -0,0 +1,79 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -i connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a src/connectioninterfacerequestsadaptor.h:src/connectioninterfacerequestsadaptor.cpp data/Conn.I.Requests.xml + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef CONNECTIONINTERFACEREQUESTSADAPTOR_H_1280083803 +#define CONNECTIONINTERFACEREQUESTSADAPTOR_H_1280083803 + +#include +#include +#include "connectioninterfacerequeststypes.h" +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; +//class org::freedesktop::Telepathy::RequestableChannelClass; +//class org::freedesktop::Telepathy::RequestableChannelClassList; + +/* + * Adaptor class for interface org.freedesktop.Telepathy.Connection.Interface.Requests + */ +class ConnectionInterfaceRequestsAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Telepathy.Connection.Interface.Requests") + Q_CLASSINFO("D-Bus Introspection", "" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + " \n" + "") +public: + ConnectionInterfaceRequestsAdaptor(QObject *parent); + virtual ~ConnectionInterfaceRequestsAdaptor(); + +public: // PROPERTIES + Q_PROPERTY(org::freedesktop::Telepathy::RequestableChannelClassList RequestableChannelClasses READ requestableChannelClasses) + org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses() const; + +public Q_SLOTS: // METHODS + QDBusObjectPath CreateChannel(const QVariantMap &request, QVariantMap &channel_properties); + bool EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties); +Q_SIGNALS: // SIGNALS + void ChannelClosed(const QDBusObjectPath &removed_channel_object); + void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels); +}; + +#endif diff --git a/src/vicar-telepathy/src/connectioninterfacerequeststypes.cpp b/src/vicar-telepathy/src/connectioninterfacerequeststypes.cpp new file mode 100644 index 0000000..33ea4a6 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacerequeststypes.cpp @@ -0,0 +1,75 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "connectioninterfacerequeststypes.h" + +using namespace org::freedesktop::Telepathy; + +const QDBusArgument &operator>>(const QDBusArgument &argument, ChannelDetails &val) +{ + argument.beginStructure(); + argument >> val.channel >> val.properties; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const ChannelDetails &val) +{ + argument.beginStructure(); + argument << val.channel << val.properties; + argument.endStructure(); + return argument; +} + +QDebug &operator<<(QDebug arg,const ChannelDetails &val) +{ + arg.space() << "[" << val.channel.path() << "," << val.properties <<"]"; + return arg.space(); +} + +const QDBusArgument &operator>>(const QDBusArgument &argument, RequestableChannelClass &val) +{ + argument.beginStructure(); + argument >> val.fixedProperties >> val.allowedProperties; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const RequestableChannelClass &val) +{ + argument.beginStructure(); + argument << val.fixedProperties << val.allowedProperties; + argument.endStructure(); + return argument; +} + +QDebug &operator<<(QDebug arg,const RequestableChannelClass &val) +{ + arg.space() << "[" << val.fixedProperties << "," << val.allowedProperties <<"]"; + return arg.space(); +} diff --git a/src/vicar-telepathy/src/connectioninterfacerequeststypes.h b/src/vicar-telepathy/src/connectioninterfacerequeststypes.h new file mode 100644 index 0000000..2b6c884 --- /dev/null +++ b/src/vicar-telepathy/src/connectioninterfacerequeststypes.h @@ -0,0 +1,78 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by Tobias Hunger + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef QTTELEPATHY_CONNECTIONINTERFACEREQUESTSTYPES_H +#define QTTELEPATHY_CONNECTIONINTERFACEREQUESTSTYPES_H + +#include +#include +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Telepathy { + +class ChannelDetails +{ +public: + QDBusObjectPath channel; + QVariantMap properties; +}; +typedef QList ChannelDetailsList; + +class RequestableChannelClass +{ +public: + QVariantMap fixedProperties; + QStringList allowedProperties; +}; +typedef QList RequestableChannelClassList; + +} // namespace Telepathy +} // namespace freedesktop +} // namespace org + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelDetails) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelDetailsList) + +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::ChannelDetails& val); +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::ChannelDetails& val); +QDebug& operator<<(QDebug arg, const org::freedesktop::Telepathy::ChannelDetails& val); + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::RequestableChannelClass) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::RequestableChannelClassList) + +const QDBusArgument& operator>>(const QDBusArgument& arg, org::freedesktop::Telepathy::RequestableChannelClass& val); +QDBusArgument& operator<<(QDBusArgument& arg, const org::freedesktop::Telepathy::RequestableChannelClass& val); +QDebug& operator<<(QDebug arg, const org::freedesktop::Telepathy::RequestableChannelClass& val); + +#endif + diff --git a/src/vicar-telepathy/src/connectionmanager.cpp b/src/vicar-telepathy/src/connectionmanager.cpp new file mode 100644 index 0000000..1a89778 --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanager.cpp @@ -0,0 +1,187 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "connectionmanager.h" +#include "connectionmanageradaptor.h" +#include "connection.h" + +#include + +namespace +{ +static const QString protocol_name("tel"); +} + +class ConnectionManagerPrivate +{ +public: + ConnectionManagerPrivate(ConnectionManager * parent) : + adaptor(new ConnectionManagerAdaptor(parent)) + { Q_ASSERT(0 != adaptor); } + + ~ConnectionManagerPrivate() { delete(adaptor);} + + ConnectionManagerAdaptor * const adaptor; +}; + +// --------------------------------------------------------------------------- + +ConnectionManager::ConnectionManager(QObject * parent) : + QObject(parent), + d(new ConnectionManagerPrivate(this)) +{ Q_ASSERT(0 != d); } + +ConnectionManager::~ConnectionManager() +{ delete(d); } + +org::freedesktop::Telepathy::ParameterDefinitionList +ConnectionManager::GetParameters(const QString &proto) +{ + Q_ASSERT(!proto.isEmpty()); + qDebug() << "VICAR: ConnectionManager::GetParameters(const QString &prot)"; + org::freedesktop::Telepathy::ParameterDefinitionList result; + org::freedesktop::Telepathy::ParameterDefinition param; + + // Attention! Default constructed QDBusVariants cause havok on the D-Bus! + param.name = "com.nokia.Telepathy.Connection.Interface.GSM.IMSI"; + param.flags = Register; + param.signature = "s"; + //param.defaultValue = QDBusVariant(QString()); + result.append(param); + + param.name = "com.nokia.Telepathy.Connection.Interface.GSM.Privacy"; + param.flags = Register|hasDefault; + param.signature = "s"; + param.defaultValue = QDBusVariant(QString()); + result.append(param); + + param.name = "com.nokia.Telepathy.Connection.Interface.GSM.SMSServiceCentre"; + param.flags = Register; + param.signature = "s"; + //param.defaultValue = QDBusVariant(QString()); + result.append(param); + + param.name = "com.nokia.Telepathy.Connection.Interface.GSM.SMSValidityPeriod"; + param.flags = Register|hasDefault; + param.signature = "u"; + param.defaultValue = QDBusVariant(0); + result.append(param); + + param.name = "account"; + param.flags = None; + param.signature = "s"; + //param.defaultValue = QDBusVariant(QString()); + result.append(param); + + param.name = "password"; + param.flags = None; + param.signature = "s"; + //param.defaultValue = QDBusVariant(QString()); + result.append(param); + + return result; +} + +QStringList ConnectionManager::ListProtocols() +{ + qDebug() << "VICaR ConnectionManager::ListProtocols()"; + return QStringList(protocol_name); +} + +QString ConnectionManager::RequestConnection(const QString & proto, + QVariantMap parameters, + QDBusObjectPath & object_path) +{ + qDebug() << "VICaR CM: Connection Requested..."; + QString connection_service; + object_path = QDBusObjectPath(); + + if (proto != protocol_name) + { + /* + sendErrorReply("org.freedesktop.Telepathy.Error.NotImplemented", + "VICaR - Unable to create Connection. Requested protocol is not implemented."); + */ + qDebug() << "VICaR CM::RequestConnection: proto mismatch."; + return connection_service; + } + + + QString imsi; + QString privacy; + QString smsServiceCenter; + uint smsValidityPeriod(0); + QString account; + QString password; + + // read parameters: + QString param; + foreach (param, parameters.keys()) + { + if ("com.nokia.Telepathy.Connection.Interface.GSM.IMSI" == param) + { imsi = parameters[param].toString(); } + else if ("com.nokia.Telepathy.Connection.Interface.GSM.Privacy" == param) + { privacy = parameters[param].toString(); } + else if ("com.nokia.Telepathy.Connection.Interface.GSM.SMSServiceCentre" == param) + { smsServiceCenter = parameters[param].toString(); } + else if ("com.nokia.Telepathy.Connection.Interface.GSM.SMSValidityPeriod" == param) + { smsValidityPeriod = parameters[param].toInt(); } + else if ("account" == param) + { account = parameters[param].toString(); } + else if ("password" == param) + { password = parameters[param].toString(); } + else + { + /* + sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument", + "VICaR - Unable to create Connection. Invalid parameters specified."); + */ + qDebug() << "VICaR CM::RequestConnection: invalid parameter" << param << "found."; + return connection_service; + } + } + + Connection * new_connection = new Connection(account, this); + Q_ASSERT(0 != new_connection); + + if (!new_connection->registerObject()) + { + qDebug() << "VICaR CM: Error while registering Connection object with DBus."; + delete new_connection; + return QString(); + } + + qDebug() << "VICaR CM: New Connection Created. Status is "<< new_connection->GetStatus(); + + object_path = new_connection->objectPath(); + connection_service = new_connection->serviceName(); + + emit NewConnection(connection_service, object_path, "tel"); + + return new_connection->serviceName(); +} diff --git a/src/vicar-telepathy/src/connectionmanager.h b/src/vicar-telepathy/src/connectionmanager.h new file mode 100644 index 0000000..bdb5049 --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanager.h @@ -0,0 +1,75 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _VICAR_CONNECTIONMANAGER_H_ +#define _VICAR_CONNECTIONMANAGER_H_ + +#include "connectionmanagertypes.h" +#include +#include + +class ConnectionManagerPrivate; + +class ConnectionManager : public QObject +{ + Q_OBJECT + Q_DECLARE_PRIVATE(ConnectionManager) + +public: + explicit ConnectionManager(QObject * parent = 0); + ~ConnectionManager(); + + enum ParamFlags + { + None = 0, + Required = 1, + Register = 2, + hasDefault = 4 + }; + +public slots: + org::freedesktop::Telepathy::ParameterDefinitionList + GetParameters(const QString &proto); + + QStringList ListProtocols(); + + QString RequestConnection(const QString &proto, QVariantMap parameters, + QDBusObjectPath &object_path); + +signals: + void NewConnection(const QString &bus_name, + const QDBusObjectPath &object_path, + const QString &proto); + +private: + ConnectionManager(const ConnectionManager &); // no impl. + + ConnectionManagerPrivate * const d; +}; + +#endif diff --git a/src/vicar-telepathy/src/connectionmanageradaptor.cpp b/src/vicar-telepathy/src/connectionmanageradaptor.cpp new file mode 100644 index 0000000..d652985 --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanageradaptor.cpp @@ -0,0 +1,62 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -i QtTelepathy/Core/ConnectionManagerAdaptor -i QtTelepathy/Common/ConnectionManagerTypes -a :src/Core/connectionmanageradaptor.cpp xml/tp-connmgr.xml + * + * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +// EDITED FILE, DO NOT UPDATE! + +#include "connectionmanageradaptor.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "connectionmanager.h" + +/* + * Implementation of adaptor class ConnectionManagerAdaptor + */ + +ConnectionManagerAdaptor::ConnectionManagerAdaptor(QObject *parent) + : QDBusAbstractAdaptor(parent) +{ + // constructor + setAutoRelaySignals(true); +} + +ConnectionManagerAdaptor::~ConnectionManagerAdaptor() +{ + // destructor +} + +org::freedesktop::Telepathy::ParameterDefinitionList ConnectionManagerAdaptor::GetParameters(const QString &proto) +{ + // handle method call org.freedesktop.Telepathy.ConnectionManager.GetParameters + org::freedesktop::Telepathy::ParameterDefinitionList out0; + QMetaObject::invokeMethod(parent(), "GetParameters", Q_RETURN_ARG(org::freedesktop::Telepathy::ParameterDefinitionList, out0), Q_ARG(QString, proto)); + return out0; +} + +QStringList ConnectionManagerAdaptor::ListProtocols() +{ + // handle method call org.freedesktop.Telepathy.ConnectionManager.ListProtocols + QStringList out0; + QMetaObject::invokeMethod(parent(), "ListProtocols", Q_RETURN_ARG(QStringList, out0)); + return out0; +} + +QString ConnectionManagerAdaptor::RequestConnection(const QString &proto, QVariantMap parameters, QDBusObjectPath &object_path) +{ + // handle method call org.freedesktop.Telepathy.ConnectionManager.RequestConnection + return static_cast(parent())->RequestConnection(proto, parameters, object_path); +} + diff --git a/src/vicar-telepathy/src/connectionmanageradaptor.h b/src/vicar-telepathy/src/connectionmanageradaptor.h new file mode 100644 index 0000000..9d06b28 --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanageradaptor.h @@ -0,0 +1,69 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -i QtTelepathy/Common/BaseTypes -i QtTelepathy/Common/ConnectionManagerTypes -a include/QtTelepathy/Core/connectionmanageradaptor.h: xml/tp-connmgr.xml + * + * dbusxml2cpp is Copyright (C) 2006 Trolltech ASA. All rights reserved. + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#ifndef CONNECTIONMANAGERADAPTOR_H_1172489892 +#define CONNECTIONMANAGERADAPTOR_H_1172489892 + +#include +#include +#include "connectionmanagertypes.h" +class QByteArray; +template class QList; +template class QMap; +class QString; +class QStringList; +class QVariant; + +/* + * Adaptor class for interface org.freedesktop.Telepathy.ConnectionManager + */ +class ConnectionManagerAdaptor: public QDBusAbstractAdaptor +{ + Q_OBJECT + Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Telepathy.ConnectionManager") + Q_CLASSINFO("D-Bus Introspection", "" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" + "") +public: + ConnectionManagerAdaptor(QObject *parent); + virtual ~ConnectionManagerAdaptor(); + +public: // PROPERTIES +public Q_SLOTS: // METHODS + org::freedesktop::Telepathy::ParameterDefinitionList GetParameters(const QString &proto); + QStringList ListProtocols(); + QString RequestConnection(const QString &proto, QVariantMap parameters, QDBusObjectPath &object_path); +Q_SIGNALS: // SIGNALS + void NewConnection(const QString &bus_name, const QDBusObjectPath &object_path, const QString &proto); +}; + +#endif diff --git a/src/vicar-telepathy/src/connectionmanagertypes.cpp b/src/vicar-telepathy/src/connectionmanagertypes.cpp new file mode 100644 index 0000000..481c7f1 --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanagertypes.cpp @@ -0,0 +1,48 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "connectionmanagertypes.h" + +using namespace org::freedesktop::Telepathy; + +const QDBusArgument &operator>>(const QDBusArgument &argument, ParameterDefinition ¶m) +{ + argument.beginStructure(); + argument >> param.name >> param.flags >> param.signature >> param.defaultValue; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const ParameterDefinition ¶m) +{ + argument.beginStructure(); + argument << param.name << param.flags << param.signature << param.defaultValue; + argument.endStructure(); + return argument; +} + diff --git a/src/vicar-telepathy/src/connectionmanagertypes.h b/src/vicar-telepathy/src/connectionmanagertypes.h new file mode 100644 index 0000000..f1e1b8d --- /dev/null +++ b/src/vicar-telepathy/src/connectionmanagertypes.h @@ -0,0 +1,64 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by Tobias Hunger + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef QTTELEPATHY_CONNECTIONMANAGERTYPES_H +#define QTTELEPATHY_CONNECTIONMANAGERTYPES_H + +#include +#include +#include +#include +#include + +namespace org { +namespace freedesktop { +namespace Telepathy { + +class ParameterDefinition +{ +public: + QString name; + uint flags; + QString signature; + QDBusVariant defaultValue; +}; +typedef QList ParameterDefinitionList; + +} // namespace Telepathy +} // namespace freedesktop +} // namespace org + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ParameterDefinition) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ParameterDefinitionList) + +const QDBusArgument &operator>>(const QDBusArgument &argument, org::freedesktop::Telepathy::ParameterDefinition ¶m); +QDBusArgument &operator<<(QDBusArgument &argument, const org::freedesktop::Telepathy::ParameterDefinition ¶m); + +#endif + diff --git a/src/vicar-telepathy/src/connectiontypes.cpp b/src/vicar-telepathy/src/connectiontypes.cpp new file mode 100644 index 0000000..9632489 --- /dev/null +++ b/src/vicar-telepathy/src/connectiontypes.cpp @@ -0,0 +1,48 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "connectiontypes.h" + +using namespace org::freedesktop::Telepathy; + +const QDBusArgument &operator>>(const QDBusArgument &argument, ChannelInfo &info) +{ + argument.beginStructure(); + argument >> info.objectPath >> info.interfaceName >> info.handleType >> info.handle; + argument.endStructure(); + return argument; +} + +QDBusArgument &operator<<(QDBusArgument &argument, const ChannelInfo &info) +{ + argument.beginStructure(); + argument << info.objectPath << info.interfaceName << info.handleType << info.handle; + argument.endStructure(); + return argument; +} + diff --git a/src/vicar-telepathy/src/connectiontypes.h b/src/vicar-telepathy/src/connectiontypes.h new file mode 100644 index 0000000..9901510 --- /dev/null +++ b/src/vicar-telepathy/src/connectiontypes.h @@ -0,0 +1,93 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on QtTelepathy with copyright notice below. +*/ + +/* + * QtTelepathy, the Tapioca Qt4 Telepathy Client Library + * Copyright (C) 2006 by Tobias Hunger + * Copyright (C) 2006 by INdT + * @author Andre Moreira Magalhaes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef QTTELEPATHY_CONNECTION_H +#define QTTELEPATHY_CONNECTION_H + +#include +#include +#include +#include "basetypes.h" + +namespace org { +namespace freedesktop { +namespace Telepathy { + +enum HandleType { + HANDLE_TYPE_NONE = 0, + HANDLE_TYPE_CONTACT, + HANDLE_TYPE_ROOM, + HANDLE_TYPE_LIST +}; + +enum ConnectionState { + CONNECTION_STATUS_CONNECTED, + CONNECTION_STATUS_CONNECTING, + CONNECTION_STATUS_DISCONNECTED +}; + +enum ConnectionStateReason { + CONNECTION_STATUS_REASON_NONE_SPECIFIED, + CONNECTION_STATUS_REASON_REQUESTED, + CONNECTION_STATUS_REASON_NETWORK_ERROR, + CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED, + CONNECTION_STATUS_REASON_ENCRYPTION_ERROR, + CONNECTION_STATUS_REASON_NAME_IN_USE, + CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED, + CONNECTION_STATUS_REASON_CERT_UNTRUSTED, + CONNECTION_STATUS_REASON_CERT_EXPIRED, + CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED, + CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH, + CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH, + CONNECTION_STATUS_REASON_CERT_SELF_SIGNED, + CONNECTION_STATUS_REASON_CERT_OTHER_ERROR +}; + +class ChannelInfo +{ +public: + QDBusObjectPath objectPath; + QString interfaceName; + uint handleType; + uint handle; +}; +typedef QList ChannelInfoList; + +} // namespace Telepathy +} // namespace freedesktop +} // namespace org + +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelInfo) +Q_DECLARE_METATYPE(org::freedesktop::Telepathy::ChannelInfoList) + +const QDBusArgument &operator>>(const QDBusArgument &argument, org::freedesktop::Telepathy::ChannelInfo &info); +QDBusArgument &operator<<(QDBusArgument &argument, const org::freedesktop::Telepathy::ChannelInfo &info); + +#endif + diff --git a/src/vicar-telepathy/src/main.cpp b/src/vicar-telepathy/src/main.cpp new file mode 100644 index 0000000..7ed93eb --- /dev/null +++ b/src/vicar-telepathy/src/main.cpp @@ -0,0 +1,123 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "names.h" +#include "connectionmanager.h" +#include "basetypes.h" +#include "connectionmanagertypes.h" +#include "connectiontypes.h" +#include "connectioninterfacerequeststypes.h" +#include "connectioninterfacecapabilitiestypes.h" + + +using namespace std; + +ofstream logfile; + +void MyOutputHandler(QtMsgType type, const char *msg) { + switch (type) { + case QtDebugMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Debug: " << msg << "\n"; + break; + case QtCriticalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Critical: " << msg << "\n"; + break; + case QtWarningMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Warning: " << msg << "\n"; + break; + case QtFatalMsg: + logfile << QTime::currentTime().toString().toAscii().data() << " Fatal: " << msg << "\n"; + abort(); + } +} + +int main(int argc, char ** argv) +{ + +// logfile.open("/var/log/logfile.txt", ios::app); +// #ifndef QT_NO_DEBUG_OUTPUT +// qInstallMsgHandler(MyOutputHandler); +// #endif + + + QCoreApplication app(argc, argv); + + // register types: + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + qDBusRegisterMetaType(); + + QDBusConnection connection = QDBusConnection::sessionBus(); + + if (!connection.interface()->isServiceRegistered(cm_service_name)) + { + + // register CM on D-BUS: + if (connection.registerService(cm_service_name)){ + qDebug(qPrintable(QObject::tr("Service %1 registered with session bus."). + arg(cm_service_name))); + } + else{ + qDebug(qPrintable(QObject::tr("Unable to register service %1 with session bus."). + arg(cm_service_name))); + } + + } + + ConnectionManager connection_mgr(&app); + if (!connection.registerObject(cm_object_path,&connection_mgr)){ + qDebug(qPrintable(QObject::tr("Unable to register VICaR connection manager at path %1 with session bus."). + arg(cm_object_path))); + } + + qDebug(qPrintable(QObject::tr("Enternig main loop."))); +// logfile.close(); + return app.exec(); +} diff --git a/src/vicar-telepathy/src/names.h b/src/vicar-telepathy/src/names.h new file mode 100644 index 0000000..6a4f560 --- /dev/null +++ b/src/vicar-telepathy/src/names.h @@ -0,0 +1,48 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License + +Based on Telepathy-SNOM with copyright notice below. +*/ + + +/* + * Telepathy SNOM VoIP phone connection manager + * Copyright (C) 2006 by basyskom GmbH + * @author Tobias Hunger + * + * This library is free software; you can redisQObject::tribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is disQObject::tributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin SQObject::treet, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _VICAR_NAMES_H_ +#define _VICAR_NAMES_H_ + +#define cm_service_name "org.freedesktop.Telepathy.ConnectionManager.vicar" +#define cm_object_path "/org/freedesktop/Telepathy/ConnectionManager/vicar" +#define cm_interface_name "org.freedesktop.Telepathy.ConnectionManager" + +#define ACCOUNT_MGR_NAME "org.freedesktop.Telepathy.AccountManager" +#define ACCOUNT_MGR_PATH "/org/freedesktop/Telepathy/AccountManager" +#define ACCOUNT_MGR_IFACE_QUERY "com.nokia.AccountManager.Interface.Query" +#define ACCOUNT_IFACE_COMPAT "com.nokia.Account.Interface.Compat" +#define ACCOUNT_IFACE_COMPAT_PROFILE "com.nokia.Account.Interface.Compat.Profile" +#define DBUS_PROPERTIES "org.freedesktop.DBus.Properties" + +#define APPLICATION_DBUS_PATH "/org/maemo/vicar" +#define APPLICATION_DBUS_INTERFACE "org.maemo.vicar" +#define APPLICATION_DBUS_SERVICE "org.maemo.vicar" + +#endif diff --git a/src/vicar-telepathy/src/vicarcallrouterproxy.cpp b/src/vicar-telepathy/src/vicarcallrouterproxy.cpp new file mode 100644 index 0000000..7bd1be3 --- /dev/null +++ b/src/vicar-telepathy/src/vicarcallrouterproxy.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c VicarCallRouterProxy -p vicarcallrouterproxy.h:vicarcallrouterproxy.cpp org.maemo.vicar.xml org.maemo.vicar + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "vicarcallrouterproxy.h" + +/* + * Implementation of interface class VicarCallRouterProxy + */ + +VicarCallRouterProxy::VicarCallRouterProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +VicarCallRouterProxy::~VicarCallRouterProxy() +{ +} + diff --git a/src/vicar-telepathy/src/vicarcallrouterproxy.h b/src/vicar-telepathy/src/vicarcallrouterproxy.h new file mode 100644 index 0000000..d0fa3e3 --- /dev/null +++ b/src/vicar-telepathy/src/vicarcallrouterproxy.h @@ -0,0 +1,72 @@ +/* + * This file was generated by qdbusxml2cpp version 0.7 + * Command line was: qdbusxml2cpp -c VicarCallRouterProxy -p vicarcallrouterproxy.h:vicarcallrouterproxy.cpp org.maemo.vicar.xml org.maemo.vicar + * + * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef VICARCALLROUTERPROXY_H_1280455099 +#define VICARCALLROUTERPROXY_H_1280455099 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Proxy class for interface org.maemo.vicar + */ +class VicarCallRouterProxy: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.maemo.vicar"; } + +public: + VicarCallRouterProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~VicarCallRouterProxy(); + +public Q_SLOTS: // METHODS + inline QDBusPendingReply callInternationalNumber(const QString &number) + { + QList argumentList; + argumentList << qVariantFromValue(number); + return asyncCallWithArgumentList(QLatin1String("callInternationalNumber"), argumentList); + } + + inline QDBusPendingReply isRunning() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("isRunning"), argumentList); + } + + inline QDBusPendingReply startOutgoingCallMonitor() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("startOutgoingCallMonitor"), argumentList); + } + + inline QDBusPendingReply stopOutgoingCallMonitor() + { + QList argumentList; + return asyncCallWithArgumentList(QLatin1String("stopOutgoingCallMonitor"), argumentList); + } + +Q_SIGNALS: // SIGNALS +}; + +namespace org { + namespace maemo { + typedef ::VicarCallRouterProxy vicar; + } +} +#endif diff --git a/src/vicar-telepathy/vicar-telepathy.pro b/src/vicar-telepathy/vicar-telepathy.pro new file mode 100644 index 0000000..2522ef7 --- /dev/null +++ b/src/vicar-telepathy/vicar-telepathy.pro @@ -0,0 +1,56 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-06-22T19:17:05 +# +#------------------------------------------------- + +#INCLUDEPATH += /usr/include/telepathy-1.0 +#LIBS += /usr/lib/libtelepathy-qt4.so + +QT += dbus core +QT -= gui + +TARGET = vicar-telepathy +CONFIG += qt debug console +CONFIG -= app_bundle + +TEMPLATE = app +VPATH += src +MOC_DIR = mocs +OBJECTS_DIR = objs +SOURCES += src/main.cpp \ + src/connectiontypes.cpp \ + src/connectionmanagertypes.cpp \ + src/connectionmanageradaptor.cpp \ + src/connectionmanager.cpp \ + src/connectionadaptor.cpp \ + src/connection.cpp \ + src/connectioninterfacerequeststypes.cpp \ + src/connectioninterfacerequestsadaptor.cpp \ + src/vicarcallrouterproxy.cpp \ + src/connectioninterfacecapabilitiestypes.cpp \ + src/connectioninterfacecapabilitiesadaptor.cpp + +# On device application depends on libtelepathy-qt4-0 (Not required now) + +HEADERS += \ + src/names.h \ + src/connectiontypes.h \ + src/connectionmanagertypes.h \ + src/connectionmanageradaptor.h \ + src/connectionmanager.h \ + src/connectionadaptor.h \ + src/connection.h \ + src/basetypes.h \ + src/connectioninterfacerequeststypes.h \ + src/connectioninterfacerequestsadaptor.h \ + src/vicarcallrouterproxy.h \ + src/connectioninterfacecapabilitiestypes.h \ + src/connectioninterfacecapabilitiesadaptor.h + +#MAKE INSTALL +INSTALLDIR = /../../debian/vicar + +INSTALLS += target + +target.path =$$INSTALLDIR/opt/vicar diff --git a/src/vicar-utils/src/main.cpp b/src/vicar-utils/src/main.cpp new file mode 100755 index 0000000..a88b3fb --- /dev/null +++ b/src/vicar-utils/src/main.cpp @@ -0,0 +1,82 @@ +/* +@version: 0.5 +@author: Sudheer K. +@license: GNU General Public License +*/ + +#include "telepathyutility.h" +#include "databaseutility.h" +#include "vicarprofiletypes.h" +#include +#include + +int main(int argc, char *argv[]) +{ + qDBusRegisterMetaType(); + //qDBusRegisterMetaType(); + //qDBusRegisterMetaType(); + + TelepathyUtility *tpUtility = new TelepathyUtility(); + DatabaseUtility *databaseUtility = new DatabaseUtility(); + + if (argc > 1 && argv[1]){ + QString instruction = QString(argv[1]); + if (instruction == "INSTALL"){ + //Check if Account already exists + if (!tpUtility->accountExists()){ + qDebug() << "VICaR account not found. Creating .."; + bool result = tpUtility->createAccount(); + if (!result) exit(1); + } + else{ + qDebug() << "VICaR account found."; + } + } + else if (instruction == "REMOVE"){ + bool result = tpUtility->deleteAccount(); + if (!result) exit(2); + } + + else if (instruction == "CREATEDB"){ + bool result = databaseUtility->openDatabase(); + if (!result){ + qDebug() <<"Error creating profiles database. " + <lastError(); + exit(3); + } + qDebug() << "VICaR profiles database opened."; + + if (!databaseUtility->tableExists("profiles")){ + qDebug() << "Creating VICaR profiles table.."; + result = databaseUtility->createProfilesTable(); + if (!result){ + qDebug() <<"Error creating profiles table. " + <lastError(); + exit(4); + } + } + else{ + qDebug()<<"Profiles table exists"; + } + databaseUtility->closeDatabase(); + } + else if (instruction == "DROPDB"){ + bool result = databaseUtility->deleteDatabase(); + if (!result){ + qDebug() <<"Error deleting profiles database. " + <lastError(); + exit(5); + } + qDebug() << "VICaR profiles database deleted."; + } + else if (instruction == "ACCOUNTSTATUS"){ + QString status = tpUtility->getAccountStatus(); + qDebug() << "Account Status is "<< status; + } + } + + delete (tpUtility); + delete (databaseUtility); + tpUtility = 0; + databaseUtility = 0; +} diff --git a/src/vicar-utils/vicar-utils.pro b/src/vicar-utils/vicar-utils.pro new file mode 100755 index 0000000..0764089 --- /dev/null +++ b/src/vicar-utils/vicar-utils.pro @@ -0,0 +1,24 @@ +CONFIG += qt debug +QT += dbus sql +QT -= gui +TEMPLATE = app +TARGET = vicar-utils +CONFIG += console +CONFIG -= app_bundle + +INCLUDEPATH += ../vicar-lib/src +LIBS += ../lib/libvicar.a + +VPATH += src +MOC_DIR = mocs +OBJECTS_DIR = objs + +SOURCES += src/main.cpp + +#MAKE INSTALL +INSTALLDIR = /../../debian/vicar + +INSTALLS += target + +target.path =$$INSTALLDIR/opt/vicar + diff --git a/vicar.pro b/vicar.pro old mode 100644 new mode 100755 diff --git a/welcome b/welcome old mode 100644 new mode 100755 -- 1.7.9.5