--- /dev/null
+qtc_packaging/debian_harmattan
\ No newline at end of file
+++ /dev/null
-vicar (0.6-2) unstable; urgency=low
-
- * Calling card number can now have a +.
-
- -- Sudheer K. <scifi1947 at gmail.com> Sun, 12 Dec 2011 16:10:00 -0800
-
+++ /dev/null
-Source: vicar
-Section: user/network
-Priority: extra
-Maintainer: Sudheer K. <scifi1947 at gmail.com>
-Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev
-Standards-Version: 3.7.2
-Homepage: vicar.garage.maemo.org
-XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5673&group_id=1586
-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 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/
- //1y7969GBsbe28Cbr31VkxMTKC7u/t71Wr1qwA+oZT6TXJ//fr1OHToEI4e
- PZqs1EPd3d2jAHQpJRWLRUgpEQQByuUyGGMQQkAp1alEM5kMDMOAYRhIp9Ow
- LAtKKbGwsPCN6enp7wLArl27MD4+/u4E5HI5lMtljIyMfOT1118/GUXRL03T
- /Eyz2Wy9dWBfX98HMpnMZ5vN5hdqtZoVBIGybZuy2Swcx4Hv+2g0GgiCoJO9
- GWMwDKNjqXq9jjiOwTlXruuSpmmCMfaiaZoPTkxMFHbs2NEp399RwMDAAKan
- p5HP5/sty/rdxYsXPc/zPlUul18G0CmJAWDPnj0HlFLPtEtl5fs+wjAkx3Fg
- WRYAIAxD1Ov1zuyvyOwdIUophGEIIkoSntI0jdoruH9ycvKX17UL3XvvvTh2
- 7BgGBwc3uq7703K5vD6dTn+tWCy+vCKhwbbtmxhjH/c870uZTAZRFCmlFCU2
- ieO4E5qmwTAMCCEghEAURdech2HYaXwSIVJKIiIFgGzb/jaA6xNw7NgxPP74
- 45mnn376d0S0oVqt/qJSqfw+nU73Mcb2CiFSUsqDtm07cRxvsG2bmaapLMsi
- pVSHvK7rHYIrS4JEUBzHHRFhGHZIJKvbbnpISok4jnve1Y+4v7//00T0c6WU
- WlxcJKUUWq1Wp6xuv6DlOE7jtttuM1KplJe0jwmphOzK2U78vzISkcnYJKck
- 55xzMMbKr7322prrTmQbN278/1Kp9DKAD65Zs4bbtl2fnp6uaZqm6br+h2q1
- Khhjv9m6devpdevWfbFarR5eSSAhlhxXilppw6Sl5Jxf82xCXCkFKSU0TRPv
- JhPrp06d6rZt+7tEtCOO4ywR6QBkHMdRtVr9i1JqXggxNT4+XhgeHqbEJkKI
- DjkAkFJ2SHPOO9eS3ji5l/ifiMA5hxBCSSkJAOI47gi9XgESQMv3/UsAFIA0
- AAeACUBTSjEAvQDWAOAzMzPb0ul055+GOI7h+75oNptNIoKUktozeQ2LZHbb
- IhQAJYRQhmGYnucZRNRZDd/3o3aNFLSrgEb7XP6zPEDtFlNrl9kWgBSAbgDZ
- Nvm1AHp0XV971113bUmn0ykhhDE7O6tNTEyEURSFK8bTW1rW5MViRUQAIsdx
- 1D333OMZhhEFQeDruu6PjY39X7FYvASgBKAMYAlAvT3uupt6tiI0AHo7jLcc
- 9fb9hDxfQZ4ls90O2SYRr4ioHeGKSK4nYpPxq1jFKlaxilX85+Cv1id6eRL3
- 1HwAAAAASUVORK5CYII=
+++ /dev/null
-This package was debianized by Sudheer K. <scifi1947 at gmail.com> on
-Sat, 8 May 2010 13:57:08 -0700.
-
-It was downloaded from https://garage.maemo.org/projects/vicar
-
-Upstream Author: Sudheer K. <scifi1947 at gmail.com>
-
-Copyright: 2010, Sudheer K.
-
-License:
-
- This package is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This package 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 General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-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. <scifi1947 at gmail.com> and
-is licensed under the GPL, see above.
-
-
-# Please also look if there are files or directories which have a
-# different copyright/license attached and list them here.
+++ /dev/null
-vicar_0.6-2_armel.deb user/network extra
+++ /dev/null
-#!/bin/sh
-# postinst script for vicar
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postinst> `configure' <most-recently-configured-version>
-# * <old-postinst> `abort-upgrade' <new version>
-# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-# <new-version>
-# * <postinst> `abort-remove'
-# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-# <failed-install-package> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- configure)
-
- eval $(dbus-launch --sh-syntax)
- export DBUS_SESSION_BUS_ADDRESS
- export DBUS_SESSION_BUS_PID
-
- # 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"
-
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
-
- *)
- echo "postinst 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
-
-
+++ /dev/null
-#!/bin/sh
-# postrm script for vicar
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <postrm> `remove'
-# * <postrm> `purge'
-# * <old-postrm> `upgrade' <new-version>
-# * <new-postrm> `failed-upgrade' <old-version>
-# * <new-postrm> `abort-install'
-# * <new-postrm> `abort-install' <old-version>
-# * <new-postrm> `abort-upgrade' <old-version>
-# * <disappearer's-postrm> `disappear' <overwriter>
-# <overwriter-version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- purge)
- echo "Deleting configuration from GConf ..."
- gconftool-2 --recursive-unset /apps/Maemo/vicar
- echo "Removing logs ..."
- [[ -x /var/log/vicar.log ]] && rm -f /var/log/vicar.log
- ;;
-
- remove|abort-install)
- echo "Removing unused scripts ..."
- ;;
-
- upgrade|failed-upgrade|abort-upgrade|disappear)
- ;;
-
- *)
- echo "postrm 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
-
-
+++ /dev/null
-#!/bin/sh
-# prerm script for vicar
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * <prerm> `remove'
-# * <old-prerm> `upgrade' <new-version>
-# * <new-prerm> `failed-upgrade' <old-version>
-# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-# * <deconfigured's-prerm> `deconfigure' `in-favour'
-# <package-being-installed> <version> `removing'
-# <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
- remove|deconfigure)
-
- eval $(dbus-launch --sh-syntax)
- export DBUS_SESSION_BUS_ADDRESS
- export DBUS_SESSION_BUS_PID
-
- 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
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-APPNAME := vicar
-builddir:
- mkdir -p builddir
-
-builddir/Makefile: builddir
- cd builddir && qmake ../$(APPNAME).pro
-
-build: build-stamp
-
-build-stamp: builddir/Makefile
- dh_testdir
-
- # Add here commands to compile the package.
- cd builddir && $(MAKE)
- #docbook-to-man debian/$(APPNAME).sgml > $(APPNAME).1
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- # Add here commands to clean up after the build process.
- rm -rf builddir
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/arora.
- cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+++ /dev/null
-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.7.0~git20100909), libqt4-dbus (>= 4.7.0~git20100909), libqt4-gui (>= 4.7.0~git20100909), libqt4-sql (>= 4.7.0~git20100909), libqt4-xml (>= 4.7.0~git20100909), libstdc++6 (>= 4.2.1)
-misc:Depends=
--- /dev/null
+vicar (0.7-0maemo5) unstable; urgency=low
+
+ * Added Harmattan support
+ -- Sudheer K. <scifi1947 at gmail.com> Mon, 22 Aug 2011 16:10:00 -0800
+
--- /dev/null
+Source: vicar
+Section: user/network
+Priority: extra
+Maintainer: Sudheer K. <scifi1947 at gmail.com>
+Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev
+Standards-Version: 3.7.2
+Homepage: https://garage.maemo.org/projects/vicar
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5673&group_id=1586
+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 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/
+ //1y7969GBsbe28Cbr31VkxMTKC7u/t71Wr1qwA+oZT6TXJ//fr1OHToEI4e
+ PZqs1EPd3d2jAHQpJRWLRUgpEQQByuUyGGMQQkAp1alEM5kMDMOAYRhIp9Ow
+ LAtKKbGwsPCN6enp7wLArl27MD4+/u4E5HI5lMtljIyMfOT1118/GUXRL03T
+ /Eyz2Wy9dWBfX98HMpnMZ5vN5hdqtZoVBIGybZuy2Swcx4Hv+2g0GgiCoJO9
+ GWMwDKNjqXq9jjiOwTlXruuSpmmCMfaiaZoPTkxMFHbs2NEp399RwMDAAKan
+ p5HP5/sty/rdxYsXPc/zPlUul18G0CmJAWDPnj0HlFLPtEtl5fs+wjAkx3Fg
+ WRYAIAxD1Ov1zuyvyOwdIUophGEIIkoSntI0jdoruH9ycvKX17UL3XvvvTh2
+ 7BgGBwc3uq7703K5vD6dTn+tWCy+vCKhwbbtmxhjH/c870uZTAZRFCmlFCU2
+ ieO4E5qmwTAMCCEghEAURdech2HYaXwSIVJKIiIFgGzb/jaA6xNw7NgxPP74
+ 45mnn376d0S0oVqt/qJSqfw+nU73Mcb2CiFSUsqDtm07cRxvsG2bmaapLMsi
+ pVSHvK7rHYIrS4JEUBzHHRFhGHZIJKvbbnpISok4jnve1Y+4v7//00T0c6WU
+ WlxcJKUUWq1Wp6xuv6DlOE7jtttuM1KplJe0jwmphOzK2U78vzISkcnYJKck
+ 55xzMMbKr7322prrTmQbN278/1Kp9DKAD65Zs4bbtl2fnp6uaZqm6br+h2q1
+ Khhjv9m6devpdevWfbFarR5eSSAhlhxXilppw6Sl5Jxf82xCXCkFKSU0TRPv
+ JhPrp06d6rZt+7tEtCOO4ywR6QBkHMdRtVr9i1JqXggxNT4+XhgeHqbEJkKI
+ DjkAkFJ2SHPOO9eS3ji5l/ifiMA5hxBCSSkJAOI47gi9XgESQMv3/UsAFIA0
+ AAeACUBTSjEAvQDWAOAzMzPb0ul055+GOI7h+75oNptNIoKUktozeQ2LZHbb
+ IhQAJYRQhmGYnucZRNRZDd/3o3aNFLSrgEb7XP6zPEDtFlNrl9kWgBSAbgDZ
+ Nvm1AHp0XV971113bUmn0ykhhDE7O6tNTEyEURSFK8bTW1rW5MViRUQAIsdx
+ 1D333OMZhhEFQeDruu6PjY39X7FYvASgBKAMYAlAvT3uupt6tiI0AHo7jLcc
+ 9fb9hDxfQZ4ls90O2SYRr4ioHeGKSK4nYpPxq1jFKlaxilX85+Cv1id6eRL3
+ 1HwAAAAASUVORK5CYII=
--- /dev/null
+This package was debianized by Sudheer K. <scifi1947 at gmail.com> on
+Sat, 8 May 2010 13:57:08 -0700.
+
+It was downloaded from https://garage.maemo.org/projects/vicar
+
+Upstream Author: Sudheer K. <scifi1947 at gmail.com>
+
+Copyright: 2010, Sudheer K.
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+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. <scifi1947 at gmail.com> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
--- /dev/null
+vicar_0.7-0maemo5_armel.deb user/network extra
--- /dev/null
+#!/bin/sh
+# postinst script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+
+ eval $(dbus-launch --sh-syntax)
+ export DBUS_SESSION_BUS_ADDRESS
+ export DBUS_SESSION_BUS_PID
+
+ # Kill any running instances of the daemon (only used on Linux based systems)
+ killall -q vicar-daemon || true
+ killall -q vicar-telepathy || true
+
+ echo "Checking for log folder ..."
+ [[ ! -d /var/log/vicar ]] && mkdir /var/log/vicar
+
+ echo "Checking for log file ..."
+ [[ ! -e /var/log/vicar/vicar.log ]] && touch /var/log/vicar/vicar.log && chown -R user:users /var/log/vicar
+
+ echo "Starting Vicar daemon ..."
+ [[ -x /opt/vicar/bin/vicar-daemon ]] && su - user -c "exec /opt/vicar/bin/vicar-daemon& >/dev/null"
+
+ echo "Starting Vicar-Telepathy ..."
+ [[ -x /opt/vicar/bin/vicar-telepathy ]] && su - user -c "exec /opt/vicar/bin/vicar-telepathy& >/dev/null"
+
+ echo "Creating Vicar Telepathy account ..."
+ [[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/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/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils CREATEDB"
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst 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
+
+
--- /dev/null
+#!/bin/sh
+# postrm script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge)
+ echo "Removing logs ..."
+ [[ -d /var/log/vicar ]] && rm -rf /var/log/vicar
+ ;;
+
+ remove|abort-install)
+ ;;
+
+ upgrade|failed-upgrade|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm 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
+
+
--- /dev/null
+#!/bin/sh
+# prerm script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|deconfigure)
+
+ eval $(dbus-launch --sh-syntax)
+ export DBUS_SESSION_BUS_ADDRESS
+ export DBUS_SESSION_BUS_PID
+
+ echo "Deleting Vicar Telepathy account ..."
+ [[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils REMOVE"
+
+ echo "Deleting Vicar Profiles database ..."
+ [[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/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
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ # $(MAKE) # Uncomment this line for use without Qt Creator
+ #docbook-to-man debian/vicar.sgml > vicar.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/vicar.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/vicar install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps # Uncomment this line for use without Qt Creator
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+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.7.0~git20100909), libqt4-dbus (>= 4.7.0~git20100909), libqt4-gui (>= 4.7.0~git20100909), libqt4-sql (>= 4.7.0~git20100909), libqt4-xml (>= 4.7.0~git20100909), libstdc++6 (>= 4.2.1)
--- /dev/null
+vicar (0.7-0maemo6) unstable; urgency=low
+
+ * Added Harmattan support
+ -- Sudheer K. <scifi1947 at gmail.com> Mon, 22 Aug 2011 16:10:00 -0800
+
--- /dev/null
+Source: vicar
+Section: user/network
+Priority: extra
+Maintainer: Sudheer K. <scifi1947 at gmail.com>
+Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev, applauncherd-dev, libaccounts-qt-dev
+Standards-Version: 3.7.3
+Homepage: https://garage.maemo.org/projects/vicar
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5673&group_id=1586
+XB-Maemo-Display-Name: VICaR - Value International Call Router
+
+Package: vicar
+Architecture: any
+Depends: ${shlibs:Depends}, applauncherd, libaccounts-qt1
+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/
+ //1y7969GBsbe28Cbr31VkxMTKC7u/t71Wr1qwA+oZT6TXJ//fr1OHToEI4e
+ PZqs1EPd3d2jAHQpJRWLRUgpEQQByuUyGGMQQkAp1alEM5kMDMOAYRhIp9Ow
+ LAtKKbGwsPCN6enp7wLArl27MD4+/u4E5HI5lMtljIyMfOT1118/GUXRL03T
+ /Eyz2Wy9dWBfX98HMpnMZ5vN5hdqtZoVBIGybZuy2Swcx4Hv+2g0GgiCoJO9
+ GWMwDKNjqXq9jjiOwTlXruuSpmmCMfaiaZoPTkxMFHbs2NEp399RwMDAAKan
+ p5HP5/sty/rdxYsXPc/zPlUul18G0CmJAWDPnj0HlFLPtEtl5fs+wjAkx3Fg
+ WRYAIAxD1Ov1zuyvyOwdIUophGEIIkoSntI0jdoruH9ycvKX17UL3XvvvTh2
+ 7BgGBwc3uq7703K5vD6dTn+tWCy+vCKhwbbtmxhjH/c870uZTAZRFCmlFCU2
+ ieO4E5qmwTAMCCEghEAURdech2HYaXwSIVJKIiIFgGzb/jaA6xNw7NgxPP74
+ 45mnn376d0S0oVqt/qJSqfw+nU73Mcb2CiFSUsqDtm07cRxvsG2bmaapLMsi
+ pVSHvK7rHYIrS4JEUBzHHRFhGHZIJKvbbnpISok4jnve1Y+4v7//00T0c6WU
+ WlxcJKUUWq1Wp6xuv6DlOE7jtttuM1KplJe0jwmphOzK2U78vzISkcnYJKck
+ 55xzMMbKr7322prrTmQbN278/1Kp9DKAD65Zs4bbtl2fnp6uaZqm6br+h2q1
+ Khhjv9m6devpdevWfbFarR5eSSAhlhxXilppw6Sl5Jxf82xCXCkFKSU0TRPv
+ JhPrp06d6rZt+7tEtCOO4ywR6QBkHMdRtVr9i1JqXggxNT4+XhgeHqbEJkKI
+ DjkAkFJ2SHPOO9eS3ji5l/ifiMA5hxBCSSkJAOI47gi9XgESQMv3/UsAFIA0
+ AAeACUBTSjEAvQDWAOAzMzPb0ul055+GOI7h+75oNptNIoKUktozeQ2LZHbb
+ IhQAJYRQhmGYnucZRNRZDd/3o3aNFLSrgEb7XP6zPEDtFlNrl9kWgBSAbgDZ
+ Nvm1AHp0XV971113bUmn0ykhhDE7O6tNTEyEURSFK8bTW1rW5MViRUQAIsdx
+ 1D333OMZhhEFQeDruu6PjY39X7FYvASgBKAMYAlAvT3uupt6tiI0AHo7jLcc
+ 9fb9hDxfQZ4ls90O2SYRr4ioHeGKSK4nYpPxq1jFKlaxilX85+Cv1id6eRL3
+ 1HwAAAAASUVORK5CYII=
--- /dev/null
+Source: vicar
+Section: user/network
+Priority: extra
+Maintainer: Sudheer K. <scifi1947 at gmail.com>
+Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev
+Standards-Version: 3.7.3
+Homepage: https://garage.maemo.org/projects/vicar
+XSBC-Bugtracker: https://garage.maemo.org/tracker/?atid=5673&group_id=1586
+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 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/
+ //1y7969GBsbe28Cbr31VkxMTKC7u/t71Wr1qwA+oZT6TXJ//fr1OHToEI4e
+ PZqs1EPd3d2jAHQpJRWLRUgpEQQByuUyGGMQQkAp1alEM5kMDMOAYRhIp9Ow
+ LAtKKbGwsPCN6enp7wLArl27MD4+/u4E5HI5lMtljIyMfOT1118/GUXRL03T
+ /Eyz2Wy9dWBfX98HMpnMZ5vN5hdqtZoVBIGybZuy2Swcx4Hv+2g0GgiCoJO9
+ GWMwDKNjqXq9jjiOwTlXruuSpmmCMfaiaZoPTkxMFHbs2NEp399RwMDAAKan
+ p5HP5/sty/rdxYsXPc/zPlUul18G0CmJAWDPnj0HlFLPtEtl5fs+wjAkx3Fg
+ WRYAIAxD1Ov1zuyvyOwdIUophGEIIkoSntI0jdoruH9ycvKX17UL3XvvvTh2
+ 7BgGBwc3uq7703K5vD6dTn+tWCy+vCKhwbbtmxhjH/c870uZTAZRFCmlFCU2
+ ieO4E5qmwTAMCCEghEAURdech2HYaXwSIVJKIiIFgGzb/jaA6xNw7NgxPP74
+ 45mnn376d0S0oVqt/qJSqfw+nU73Mcb2CiFSUsqDtm07cRxvsG2bmaapLMsi
+ pVSHvK7rHYIrS4JEUBzHHRFhGHZIJKvbbnpISok4jnve1Y+4v7//00T0c6WU
+ WlxcJKUUWq1Wp6xuv6DlOE7jtttuM1KplJe0jwmphOzK2U78vzISkcnYJKck
+ 55xzMMbKr7322prrTmQbN278/1Kp9DKAD65Zs4bbtl2fnp6uaZqm6br+h2q1
+ Khhjv9m6devpdevWfbFarR5eSSAhlhxXilppw6Sl5Jxf82xCXCkFKSU0TRPv
+ JhPrp06d6rZt+7tEtCOO4ywR6QBkHMdRtVr9i1JqXggxNT4+XhgeHqbEJkKI
+ DjkAkFJ2SHPOO9eS3ji5l/ifiMA5hxBCSSkJAOI47gi9XgESQMv3/UsAFIA0
+ AAeACUBTSjEAvQDWAOAzMzPb0ul055+GOI7h+75oNptNIoKUktozeQ2LZHbb
+ IhQAJYRQhmGYnucZRNRZDd/3o3aNFLSrgEb7XP6zPEDtFlNrl9kWgBSAbgDZ
+ Nvm1AHp0XV971113bUmn0ykhhDE7O6tNTEyEURSFK8bTW1rW5MViRUQAIsdx
+ 1D333OMZhhEFQeDruu6PjY39X7FYvASgBKAMYAlAvT3uupt6tiI0AHo7jLcc
+ 9fb9hDxfQZ4ls90O2SYRr4ioHeGKSK4nYpPxq1jFKlaxilX85+Cv1id6eRL3
+ 1HwAAAAASUVORK5CYII=
+
+
+Package: vicar-dbg
+Architecture: any
+Section: devel
+Depends: vicar (= ${binary:Version})
+Description: Automatically routes international GSM calls through a calling card or skype-out number.
+ This packages contains the debugging symbols for VICaR.
--- /dev/null
+This package was debianized by Sudheer K. <scifi1947 at gmail.com> on
+Sat, 8 May 2010 13:57:08 -0700.
+
+It was downloaded from https://garage.maemo.org/projects/vicar
+
+Upstream Author: Sudheer K. <scifi1947 at gmail.com>
+
+Copyright: 2010, Sudheer K.
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+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. <scifi1947 at gmail.com> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
--- /dev/null
+vicar_0.7-0maemo6_armel.deb user/network extra
--- /dev/null
+#!/bin/sh
+# postinst script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+
+ eval $(dbus-launch --sh-syntax)
+ export DBUS_SESSION_BUS_ADDRESS
+ export DBUS_SESSION_BUS_PID
+
+ # Kill any running instances of the daemon (only used on Linux based systems)
+ #killall -q vicar-daemon || true
+ #killall -q vicar-telepathy || true
+
+ echo "Checking for log folder ..."
+ [[ ! -d /var/log/vicar ]] && mkdir /var/log/vicar
+
+ echo "Checking for log file ..."
+ [[ ! -e /var/log/vicar/vicar.log ]] && touch /var/log/vicar/vicar.log && chown -R user:users /var/log/vicar
+
+ echo "Starting Vicar daemon ..."
+ #[[ -x /opt/vicar/bin/vicar-daemon ]] && su - user -c "exec /opt/vicar/bin/vicar-daemon& >/dev/null"
+
+ echo "Starting Vicar-Telepathy ..."
+ #[[ -x /opt/vicar/bin/vicar-telepathy ]] && su - user -c "exec /opt/vicar/bin/vicar-telepathy& >/dev/null"
+
+ echo "Creating Vicar Telepathy account ..."
+ #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/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/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils CREATEDB"
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst 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
+
+
--- /dev/null
+#!/bin/sh
+# postrm script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge)
+ echo "Removing logs ..."
+ #[[ -d /var/log/vicar ]] && rm -rf /var/log/vicar
+ ;;
+
+ remove|abort-install)
+ ;;
+
+ upgrade|failed-upgrade|abort-upgrade|disappear)
+ ;;
+
+ *)
+ echo "postrm 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
+
+
--- /dev/null
+#!/bin/sh
+# prerm script for vicar
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|deconfigure)
+
+ eval $(dbus-launch --sh-syntax)
+ export DBUS_SESSION_BUS_ADDRESS
+ export DBUS_SESSION_BUS_PID
+
+ echo "Deleting Vicar Telepathy account ..."
+ #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/vicar-utils REMOVE"
+
+ echo "Deleting Vicar Profiles database ..."
+ #[[ -x /opt/vicar/bin/vicar-utils ]] && su - user -c "exec /opt/vicar/bin/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
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+
+ # Add here commands to compile the package.
+ # $(MAKE) # Uncomment this line for use without Qt Creator
+ #docbook-to-man debian/vicar.sgml > vicar.1
+
+ touch $@
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ $(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/vicar.
+ $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/vicar install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+# dh_install
+# dh_installmenu
+# dh_installdebconf
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_python
+# dh_installinit
+# dh_installcron
+# dh_installinfo
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+# dh_perl
+# dh_makeshlibs
+ dh_installdeb
+ # dh_shlibdeps # Uncomment this line for use without Qt Creator
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+misc:Depends=
--- /dev/null
+Package: vicar-dbg
+Source: vicar
+Version: 0.7-0maemo6
+Architecture: armel
+Maintainer: Sudheer K. <scifi1947 at gmail.com>
+Installed-Size: 7084
+Depends: vicar (= 0.7-0maemo6)
+Section: devel
+Priority: extra
+Homepage: https://garage.maemo.org/projects/vicar
+Description: Automatically routes international GSM calls through a calling card or skype-out number.
+ This packages contains the debugging symbols for VICaR.
+Aegis-Manifest: empty
+Bugtracker: https://garage.maemo.org/tracker/?atid=5673&group_id=1586
+Maemo-Display-Name: VICaR - Value International Call Router
--- /dev/null
+S 15 com.nokia.maemo H 40 168db240cfaa1d7354fc9cd7349ebad45837d6e0 R 36 usr/lib/debug/opt/vicar/vicar-daemon
+S 15 com.nokia.maemo H 40 0c59af9c01dc22013a5d547223968e2048ebf1d6 R 39 usr/lib/debug/opt/vicar/vicar-telepathy
+S 15 com.nokia.maemo H 40 fbd25d17608299a04787929b7943ac02e70e7403 R 35 usr/lib/debug/opt/vicar/vicar-utils
--- /dev/null
+94c5118afac985166dad92d570b92bde usr/lib/debug/opt/vicar/vicar-daemon
+a6b5e63b8efc6694831c0149a2b2190a usr/lib/debug/opt/vicar/vicar-telepathy
+8cf9c300f128a5aed4d1e8aea2240ca3 usr/lib/debug/opt/vicar/vicar-utils
+2fa624231f0d198505e7ca08d461b494 usr/share/doc/vicar-dbg/copyright
--- /dev/null
+This package was debianized by Sudheer K. <scifi1947 at gmail.com> on
+Sat, 8 May 2010 13:57:08 -0700.
+
+It was downloaded from https://garage.maemo.org/projects/vicar
+
+Upstream Author: Sudheer K. <scifi1947 at gmail.com>
+
+Copyright: 2010, Sudheer K.
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This package 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+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. <scifi1947 at gmail.com> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
--- /dev/null
+<!-- Generated by aegis-manifest 0.20110517-1+harmattan on 2011-09-15. -->
+<!-- To disable non-interactive creation of and updates to this file,
+ and adding of the resulting Aegis manifest into a Debian package,
+ replace this file with an empty (zero-length) file. -->
+<!-- The checksum is used for detecting any manual changes of the <aegis>
+ section. If the checksum is found and matches this section, file
+ contents will be updated without user interaction.
+ Modify the file or remove the checksum to disable this functionality. -->
+<aegis>
+
+ <!-- provide>
+ <dbus name="org.freedesktop.Telepathy.Connection.vicar.tel.vicar" own="Cellular" bus="session">
+ <node name="/">
+ <interface name="org.freedesktop.Telepathy.Connection">
+ <annotation name="org.maemo.vicar" value="Cellular"/>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Requests">
+ <annotation name="org.maemo.vicar" value="Cellular"/>
+ </interface>
+ </node>
+ </dbus>
+
+ <dbus name="org.freedesktop.Telepathy.ConnectionManager.vicar" own="Cellular" bus="session">
+ <node name="/">
+ <interface name="org.freedesktop.Telepathy.ConnectionManager">
+ <annotation name="org.maemo.vicar" value="Cellular"/>
+ </interface>
+ </node>
+ </dbus>
+
+ </provide -->
+
+ <request policy="add">
+ <!-- Application accesses DBus libraries directly.
+ Entries for these calls may need to be added manually. -->
+
+ <!-- rodata: com.nokia.csd.Call,com.nokia.csd.Call.Instance -->
+ <credential name="Cellular" />
+ <!-- credential name="TrackerReadAccess" / -->
+ <!-- credential name="TrackerWriteAccess" / -->
+ <credential name="UID::user" />
+ <credential name="GID::users" />
+ <for path="/opt/vicar/bin/vicar-telepathy" />
+ <for path="/opt/vicar/bin/vicar-daemon" />
+ <for path="/opt/vicar/bin/vicar-utils" />
+ <!-- These entries to be used only when debug package is included
+ <for path="/usr/lib/debug/opt/vicar/bin/vicar-telepathy" />
+ <for path="/usr/lib/debug/opt/vicar/bin/vicar-daemon" />
+ <for path="/usr/lib/debug/opt/vicar/bin/vicar-utils" /> -->
+ </request>
+
+ <request context="INSTALL">
+ <credential name="CAP::kill" />
+ <credential name="CAP::chown" />
+ </request>
+
+ <request context="REMOVE">
+ <credential name="CAP::kill" />
+ </request>
+</aegis>
--- /dev/null
+misc:Depends=
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE provider>
+<provider version="1.0" id="vicar">
+ <name>Vicar</name>
+ <icon>icon-m-service-vicar</icon>
+ <short-description>Route calls via VICaR</short-description>
+ <description>Use Vicar to route calls via your calling card. Please use Vicar application to update routing preferences.</description>
+</provider>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<service id="vicar">
+ <type>IM</type>
+ <name>VICaR Service Name</name>
+ <provider>vicar</provider>
+ <icon>icon-m-service-vicar</icon>
+
+ <!-- default settings (account settings have precedence over these) -->
+ <template>
+ <setting name="manager">vicar</setting>
+ <setting name="protocol">tel</setting>
+ </template>
+
+ <!-- type-specific data -->
+ <!--type_data>
+ <capabilities>chat-p2p, voice-p2p, video-p2p, chat-room, chat-room-list, avatars, alias, roster</capabilities>
+ <vcard_field>TEL</vcard_field>
+ <actions>
+ <action name="call">
+ <name>addr_bd_cont_starter_im_service_call</name>
+ <icon>general_call</icon>
+ <vcard_field>TEL</vcard_field>
+ <properties>
+ <prop name="org.freedesktop.Telepathy.Channel.ChannelType" type="s">org.freedesktop.Telepathy.Channel.Type.StreamedMedia</prop>
+ </properties>
+ </action>
+ </actions>
+
+ <service-presences-list>
+ <i18n-domain>rtcom-libpresence</i18n-domain>
+ <presence id="available" type="Available" >
+ <presence-icon size="small">icon-s-common-presence-online</presence-icon
+ <presence-icon size="medium">icon-m-common-presence-online</presence-ico
+ <i18n-name>qtn_comm_presence_online</i18n-name>
+ </presence>
+
+ <presence id="online" type="Online" >
+ <presence-icon size="small">icon-s-common-presence-online</presence-icon
+ <presence-icon size="medium">icon-m-common-presence-online</presence-ico
+ <i18n-name>qtn_comm_presence_online</i18n-name>
+ </presence>
+
+ <presence id="offline" type="Offline">
+ <presence-icon size="small">icon-s-common-presence-offline</presence-ico
+ <presence-icon size="medium">icon-m-common-presence-offline</presence-ic
+ <i18n-name>qtn_comm_presence_offline</i18n-name>
+ </presence>
+
+ </service-presences-list>
+ </type_data -->
+</service>
--- /dev/null
+[D-BUS Service]
+Name=org.freedesktop.Telepathy.ConnectionManager.vicar
+Exec=/opt/vicar/bin/vicar-telepathy
--- /dev/null
+[D-BUS Service]
+Name=org.maemo.vicar
+Exec=/opt/vicar/bin/vicar-daemon
+User=user
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=Vicar
+Exec=/usr/bin/invoker --type=d -s /opt/vicar-config-qml/bin/vicar-config-qml
+Icon=/usr/share/icons/hicolor/80x80/apps/vicar_harmattan.png
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
--- /dev/null
+# Author: Sudheer K.
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Name=Vicar
+Exec=/opt/vicar/bin/vicar-config
+Icon=vicar_harmattan
+++ /dev/null
-[D-BUS Service]
-Name=org.freedesktop.Telepathy.ConnectionManager.vicar
-Exec=/opt/vicar/vicar-telepathy
+++ /dev/null
-[D-BUS Service]
-Name=org.maemo.vicar
-Exec=/opt/vicar/vicar-daemon
-User=user
--- /dev/null
+[ConnectionManager]
+BusName=org.freedesktop.Telepathy.ConnectionManager.vicar
+ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/vicar
+
+[Protocol tel]
+param-org.freedesktop.Telepathy.Connection.Interface.Cellular.IMSI=s dbus-property
+param-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageServiceCentre=s dbus-property
+
+# SMS validity period in seconds
+# Range from 300 ... 38102400 (5 minutes to 63 weeks)
+param-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageValidityPeriod=u dbus-property
+default-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageValidityPeriod=0
+
+param-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageReducedCharacterSet=b dbus-property
+default-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageReducedCharacterSet=false
+
+param-org.freedesktop.Telepathy.Connection.Interface.Cellular.MessageNationalCharacterSet=s dbus-property
+
+param-org.freedesktop.Telepathy.Connection.Interface.Anonymity.AnonymityModes=u dbus-property
+default-org.freedesktop.Telepathy.Connection.Interface.Anonymity.AnonymityModes=0
+
+# Deprecated
+param-account=s
+param-password=s
--- /dev/null
+[ConnectionManager]
+BusName=org.freedesktop.Telepathy.ConnectionManager.vicar
+ObjectPath=/org/freedesktop/Telepathy/ConnectionManager/vicar
+
+[Protocol tel]
+AddressableVCardFields=tel;
+AddressableURISchemes=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
--- /dev/null
+[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
+++ /dev/null
-# Author: Sudheer K.
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Name=Vicar
-Exec=/opt/vicar/vicar-config
-Icon=vicar_scalable_icon
+++ /dev/null
-[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
+++ /dev/null
-[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
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Capabilities">
+ <method name="GetCapabilities">
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In0" />
+ <annotation value="org::freedesktop::Telepathy::ContactCapabilitiesList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <arg name="Handles" type="au" direction="in"/>
+ <arg name="Contact_Capabilities" type="a(usuu)" direction="out"/>
+ </method>
+
+ <method name="AdvertiseCapabilities">
+ <annotation value="org::freedesktop::Telepathy::CapabilityPairList" name="com.trolltech.QtDBus.QtTypeName.In0" />
+ <annotation value="org::freedesktop::Telepathy::CapabilityPairList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <arg name="Add" type="a(su)" direction="in"/>
+ <arg name="Remove" type="as" direction="in"/>
+ <arg name="Self_Capabilities" type="a(su)" direction="out"/>
+ </method>
+
+ <signal name="CapabilitiesChanged">
+ <annotation value="org::freedesktop::Telepathy::CapabilityChangeList" name="com.trolltech.QtDBus.QtTypeName.In0" />
+ <arg type="a(usuuuu)"/>
+ </signal>
+ </interface>
+</node>
<property access="read" type="(a{sv}as)" name="RequestableChannelClasses">
<annotation name="com.trolltech.QtDBus.QtTypeName" value="org::freedesktop::Telepathy::RequestableChannelClassList"/>
</property>
+ <property access="read" type="a(oa{sv})" name="Channels">
+ <annotation name="com.trolltech.QtDBus.QtTypeName" value="org::freedesktop::Telepathy::ChannelDetailsList"/>
+ </property>
+
<method name="CreateChannel">
<annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In0"/>
<annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.Out1"/>
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="data" direction="out" type="s"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="out" type="v"/>
+ </method>
+ <method name="Set">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="in" type="v"/>
+ </method>
+ <method name="GetAll">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="props" direction="out" type="a{sv}"/>
+ </method>
+ </interface>
+ <interface name="com.nokia.Telepathy.Connection.Interface.StoredMessages">
+ <method name="SetStorageState">
+ <arg name="OutOfStorage" type="b" direction="in"/>
+ </method>
+ <method name="ExpungeMessages">
+ <arg name="StoredMessageTokens" type="as" direction="in"/>
+ </method>
+ <method name="DeliverStoredMessages">
+ <arg name="StoredMessageTokens" type="as" direction="in"/>
+ </method>
+ <signal name="MessagesExpunged">
+ <arg type="as"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Anonymity">
+ <signal name="AnonymityModesChanged">
+ <arg type="u"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Cellular">
+ <signal name="IMSIChanged">
+ <arg type="s"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.ServicePoint">
+ <signal name="ServicePointsChanged">
+ <arg type="a((us)as)"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Capabilities">
+ <method name="GetCapabilities">
+ <arg name="Handles" type="au" direction="in"/>
+ <arg name="Contact_Capabilities" type="a(usuu)" direction="out"/>
+ </method>
+ <method name="AdvertiseCapabilities">
+ <arg name="Add" type="a(su)" direction="in"/>
+ <arg name="Remove" type="as" direction="in"/>
+ <arg name="Self_Capabilities" type="a(su)" direction="out"/>
+ </method>
+ <signal name="CapabilitiesChanged">
+ <arg type="a(usuuuu)"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Contacts">
+ <method name="GetContactAttributes">
+ <arg name="Handles" type="au" direction="in"/>
+ <arg name="Interfaces" type="as" direction="in"/>
+ <arg name="Hold" type="b" direction="in"/>
+ <arg name="Attributes" type="a{ua{sv}}" direction="out"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Requests">
+ <method name="EnsureChannel">
+ <arg name="Request" type="a{sv}" direction="in"/>
+ <arg name="Yours" type="b" direction="out"/>
+ <arg name="Channel" type="o" direction="out"/>
+ <arg name="Properties" type="a{sv}" direction="out"/>
+ </method>
+ <method name="CreateChannel">
+ <arg name="Request" type="a{sv}" direction="in"/>
+ <arg name="Channel" type="o" direction="out"/>
+ <arg name="Properties" type="a{sv}" direction="out"/>
+ </method>
+ <signal name="ChannelClosed">
+ <arg type="o"/>
+ </signal>
+ <signal name="NewChannels">
+ <arg type="a(oa{sv})"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="GetAll">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Properties" type="a{sv}" direction="out"/>
+ </method>
+ <method name="Set">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Property_Name" type="s" direction="in"/>
+ <arg name="Value" type="v" direction="in"/>
+ </method>
+ <method name="Get">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Property_Name" type="s" direction="in"/>
+ <arg name="Value" type="v" direction="out"/>
+ </method>
+ <signal name="PropertiesChanged">
+ <arg type="s"/>
+ <arg type="a{sv}"/>
+ <arg type="as"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection">
+ <method name="RemoveClientInterest">
+ <arg name="Tokens" type="as" direction="in"/>
+ </method>
+ <method name="AddClientInterest">
+ <arg name="Tokens" type="as" direction="in"/>
+ </method>
+ <method name="RequestHandles">
+ <arg name="Handle_Type" type="u" direction="in"/>
+ <arg name="Identifiers" type="as" direction="in"/>
+ <arg name="Handles" type="au" direction="out"/>
+ </method>
+ <method name="RequestChannel">
+ <arg name="Type" type="s" direction="in"/>
+ <arg name="Handle_Type" type="u" direction="in"/>
+ <arg name="Handle" type="u" direction="in"/>
+ <arg name="Suppress_Handler" type="b" direction="in"/>
+ <arg name="Object_Path" type="o" direction="out"/>
+ </method>
+ <method name="ReleaseHandles">
+ <arg name="Handle_Type" type="u" direction="in"/>
+ <arg name="Handles" type="au" direction="in"/>
+ </method>
+ <method name="ListChannels">
+ <arg name="Channel_Info" type="a(osuu)" direction="out"/>
+ </method>
+ <method name="InspectHandles">
+ <arg name="Handle_Type" type="u" direction="in"/>
+ <arg name="Handles" type="au" direction="in"/>
+ <arg name="Identifiers" type="as" direction="out"/>
+ </method>
+ <method name="HoldHandles">
+ <arg name="Handle_Type" type="u" direction="in"/>
+ <arg name="Handles" type="au" direction="in"/>
+ </method>
+ <method name="GetStatus">
+ <arg name="Status" type="u" direction="out"/>
+ </method>
+ <method name="GetSelfHandle">
+ <arg name="Self_Handle" type="u" direction="out"/>
+ </method>
+ <method name="GetProtocol">
+ <arg name="Protocol" type="s" direction="out"/>
+ </method>
+ <method name="GetInterfaces">
+ <arg name="Interfaces" type="as" direction="out"/>
+ </method>
+ <method name="Disconnect">
+ </method>
+ <method name="Connect">
+ </method>
+ <signal name="StatusChanged">
+ <arg type="u"/>
+ <arg type="u"/>
+ </signal>
+ <signal name="ConnectionError">
+ <arg type="s"/>
+ <arg type="a{sv}"/>
+ </signal>
+ <signal name="NewChannel">
+ <arg type="o"/>
+ <arg type="s"/>
+ <arg type="u"/>
+ <arg type="u"/>
+ <arg type="b"/>
+ </signal>
+ <signal name="SelfHandleChanged">
+ <arg type="u"/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.Telepathy.Connection" >
+ <property access="read" type="as" name="Interfaces"/>
+ <method name="Connect" />
+ <method name="Disconnect" />
+ <method name="GetInterfaces" >
+ <arg direction="out" type="as" />
+ </method>
+ <method name="GetProtocol" >
+ <arg direction="out" type="s" />
+ </method>
+ <method name="GetSelfHandle" >
+ <arg direction="out" type="u" />
+ </method>
+ <method name="GetStatus" >
+ <arg direction="out" type="u" />
+ </method>
+ <method name="HoldHandles" >
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <arg direction="in" type="u" name="handle_type" />
+ <arg direction="in" type="au" name="handles" />
+ </method>
+ <method name="InspectHandles" >
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <arg direction="in" type="u" name="handle_type" />
+ <arg direction="in" type="au" name="handles" />
+ <arg direction="out" type="as" />
+ </method>
+ <method name="ListChannels" >
+ <annotation value="org::freedesktop::Telepathy::ChannelInfoList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <arg direction="out" type="a(osuu)" />
+ </method>
+ <method name="ReleaseHandles" >
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <arg direction="in" type="u" name="handle_type" />
+ <arg direction="in" type="au" name="handles" />
+ </method>
+ <method name="RequestChannel" >
+ <arg direction="in" type="s" name="type" />
+ <arg direction="in" type="u" name="handle_type" />
+ <arg direction="in" type="u" name="handle" />
+ <arg direction="in" type="b" name="suppress_handler" />
+ <arg direction="out" type="o" />
+ </method>
+ <method name="RequestHandles" >
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <arg direction="in" type="u" name="handle_type" />
+ <arg direction="in" type="as" name="names" />
+ <arg direction="out" type="au" />
+ </method>
+ <signal name="NewChannel" >
+ <arg type="o" name="object_path" />
+ <arg type="s" name="channel_type" />
+ <arg type="u" name="handle_type" />
+ <arg type="u" name="handle" />
+ <arg type="b" name="suppress_handler" />
+ </signal>
+ <signal name="StatusChanged" >
+ <arg type="u" name="status" />
+ <arg type="u" name="reason" />
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.Connection.Interface.Requests">
+ <property access="read" type="(a{sv}as)" name="RequestableChannelClasses">
+ <annotation value="org::freedesktop::Telepathy::RequestableChannelClassList" name="com.trolltech.QtDBus.QtTypeName"/>
+ </property>
+ <method name="CreateChannel">
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In0"/>
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.Out1"/>
+ <arg direction="in" type="a{sv}" name="request"/>
+ <arg direction="out" type="o" name="channel_object"/>
+ <arg direction="out" type="a{sv}" name="channel_properties"/>
+ </method>
+ <method name="EnsureChannel">
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In0"/>
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.Out2"/>
+ <arg direction="in" type="a{sv}" name="request"/>
+ <arg direction="out" type="b" name="yours"/>
+ <arg direction="out" type="o" name="channel_object"/>
+ <arg direction="out" type="a{sv}" name="channel_properties"/>
+ </method>
+ <signal name="NewChannels">
+ <annotation value="org::freedesktop::Telepathy::ChannelDetailsList" name="com.trolltech.QtDBus.QtTypeName.In0"/>
+ <arg type="a(oa{sv})" name="new_channels"/>
+ </signal>
+ <signal name="ChannelClosed">
+ <arg type="o" name="removed_channel_object"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="property_name" type="s" direction="in"/>
+ <arg name="value" type="v" direction="out"/>
+ </method>
+ <method name="Set">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="property_name" type="s" direction="in"/>
+ <arg name="value" type="v" direction="in"/>
+ </method>
+ <method name="GetAll">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="values" type="a{sv}" direction="out"/>
+ <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="xml_data" type="s" direction="out"/>
+ </method>
+ </interface>
+</node>
<node>
<interface name="org.freedesktop.Telepathy.Connection" >
<property name="Interfaces" type="as" access="read" />
+ <property name="HasImmortalHandles" type="b" access="read" />
+ <property name="Status" type="u" access="read" />
+ <property name="SelfHandle" type="u" access="read" />
+
<method name="Connect" />
<method name="Disconnect" />
<method name="GetInterfaces" >
<arg direction="out" type="u" />
</method>
<method name="HoldHandles" >
- <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
<arg direction="in" type="u" name="handle_type" />
<arg direction="in" type="au" name="handles" />
</method>
<method name="InspectHandles" >
- <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
<arg direction="in" type="u" name="handle_type" />
<arg direction="in" type="au" name="handles" />
<arg direction="out" type="as" />
<arg direction="out" type="a(osuu)" />
</method>
<method name="ReleaseHandles" >
- <annotation value="QList<uint>" name="com.trollteh.QtDBus.QtTypeName.In1" />
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In1" />
<arg direction="in" type="u" name="handle_type" />
<arg direction="in" type="au" name="handles" />
</method>
<arg direction="out" type="o" />
</method>
<method name="RequestHandles" >
- <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.Out0" />
<arg direction="in" type="u" name="handle_type" />
<arg direction="in" type="as" name="names" />
<arg direction="out" type="au" />
</method>
+ <method name="AddClientInterest">
+ <arg name="tokens" type="as" direction="in"/>
+ </method>
+ <method name="RemoveClientInterest">
+ <arg name="tokens" type="as" direction="in"/>
+ </method>
+
<signal name="NewChannel" >
<arg type="o" name="object_path" />
<arg type="s" name="channel_type" />
<arg type="u" name="status" />
<arg type="u" name="reason" />
</signal>
- </interface>
- <interface name="org.freedesktop.Telepathy.Connection.Interface.Requests">
- <property access="read" type="(a{sv}as)" name="RequestableChannelClasses">
- <annotation name="com.trolltech.QtDBus.QtTypeName" value="org::freedesktop::Telepathy::RequestableChannelClassList"/>
- </property>
- <method name="CreateChannel">
- <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In0"/>
- <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.Out1"/>
- <arg direction="in" type="a{sv}" name="request"/>
- <arg direction="out" type="o" name="channel_object"/>
- <arg direction="out" type="a{sv}" name="channel_properties"/>
- </method>
- <method name="EnsureChannel">
- <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In0"/>
- <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.Out2"/>
- <arg direction="in" type="a{sv}" name="request"/>
- <arg direction="out" type="b" name="yours"/>
- <arg direction="out" type="o" name="channel_object"/>
- <arg direction="out" type="a{sv}" name="channel_properties"/>
- </method>
- <signal name="NewChannels">
- <annotation value="org::freedesktop::Telepathy::ChannelDetailsList" name="com.trolltech.QtDBus.QtTypeName.In0"/>
- <arg type="a(oa{sv})" name="new_channels"/>
+ <signal name="ConnectionError">
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In1"/>
+ <arg type="s" name="error" />
+ <arg type="a{sv}" name="error_details" />
</signal>
- <signal name="ChannelClosed">
- <arg type="o" name="removed_channel_object"/>
- </signal>
- </interface>
- <interface name="org.freedesktop.Telepathy.Connection.Interface.Capabilities">
- <method name="GetCapabilities">
- <annotation value="QList<uint>" name="com.trolltech.QtDBus.QtTypeName.In0" />
- <annotation value="org::freedesktop::Telepathy::ContactCapabilitiesList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
- <arg name="Handles" type="au" direction="in"/>
- <arg name="Contact_Capabilities" type="a(usuu)" direction="out"/>
- </method>
-
- <method name="AdvertiseCapabilities">
- <annotation value="org::freedesktop::Telepathy::CapabilityPairList" name="com.trolltech.QtDBus.QtTypeName.In0" />
- <annotation value="org::freedesktop::Telepathy::CapabilityPairList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
- <arg name="Add" type="a(su)" direction="in"/>
- <arg name="Remove" type="as" direction="in"/>
- <arg name="Self_Capabilities" type="a(su)" direction="out"/>
- </method>
-
- <signal name="CapabilitiesChanged">
- <annotation value="org::freedesktop::Telepathy::CapabilityChangeList" name="com.trolltech.QtDBus.QtTypeName.In0" />
- <arg type="a(usuuuu)"/>
+ <signal name="SelfHandleChanged">
+ <arg type="u"/>
</signal>
</interface>
</node>
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="data" direction="out" type="s"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="out" type="v"/>
+ </method>
+ <method name="Set">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="propname" direction="in" type="s"/>
+ <arg name="value" direction="in" type="v"/>
+ </method>
+ <method name="GetAll">
+ <arg name="interface" direction="in" type="s"/>
+ <arg name="props" direction="out" type="a{sv}"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.Telepathy.ConnectionManager">
+ <method name="RequestConnection">
+ <arg name="Protocol" type="s" direction="in"/>
+ <arg name="Parameters" type="a{sv}" direction="in"/>
+ <arg name="Bus_Name" type="s" direction="out"/>
+ <arg name="Object_Path" type="o" direction="out"/>
+ </method>
+ <method name="ListProtocols">
+ <arg name="Protocols" type="as" direction="out"/>
+ </method>
+ <method name="GetParameters">
+ <arg name="Protocol" type="s" direction="in"/>
+ <arg name="Parameters" type="a(susv)" direction="out"/>
+ </method>
+ <signal name="NewConnection">
+ <arg type="s"/>
+ <arg type="o"/>
+ <arg type="s"/>
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="GetAll">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Properties" type="a{sv}" direction="out"/>
+ </method>
+ <method name="Set">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Property_Name" type="s" direction="in"/>
+ <arg name="Value" type="v" direction="in"/>
+ </method>
+ <method name="Get">
+ <arg name="Interface_Name" type="s" direction="in"/>
+ <arg name="Property_Name" type="s" direction="in"/>
+ <arg name="Value" type="v" direction="out"/>
+ </method>
+ <signal name="PropertiesChanged">
+ <arg type="s"/>
+ <arg type="a{sv}"/>
+ <arg type="as"/>
+ </signal>
+ </interface>
+</node>
--- /dev/null
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node>
+ <interface name="org.freedesktop.Telepathy.ConnectionManager" >
+ <method name="GetParameters" >
+ <annotation value="org::freedesktop::Telepathy::ParameterDefinitionList" name="com.trolltech.QtDBus.QtTypeName.Out0" />
+ <arg direction="in" type="s" name="proto" />
+ <arg direction="out" type="a(susv)" />
+ </method>
+ <method name="ListProtocols" >
+ <arg direction="out" type="as" />
+ </method>
+ <method name="RequestConnection" >
+ <annotation value="QVariantMap" name="com.trolltech.QtDBus.QtTypeName.In1" />
+ <arg direction="in" type="s" name="proto" />
+ <arg direction="in" type="a{sv}" name="parameters" />
+ <arg direction="out" type="s" name="bus_name" />
+ <arg direction="out" type="o" name="object_path" />
+ </method>
+ <signal name="NewConnection" >
+ <arg type="s" name="bus_name" />
+ <arg type="o" name="object_path" />
+ <arg type="s" name="proto" />
+ </signal>
+ </interface>
+ <interface name="org.freedesktop.DBus.Properties">
+ <method name="Get">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="property_name" type="s" direction="in"/>
+ <arg name="value" type="v" direction="out"/>
+ </method>
+ <method name="Set">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="property_name" type="s" direction="in"/>
+ <arg name="value" type="v" direction="in"/>
+ </method>
+ <method name="GetAll">
+ <arg name="interface_name" type="s" direction="in"/>
+ <arg name="values" type="a{sv}" direction="out"/>
+ <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg name="xml_data" type="s" direction="out"/>
+ </method>
+ </interface>
+</node>
--- /dev/null
+ array [
+ dict entry(
+ string "HasImmortalHandles"
+ variant boolean true
+ )
+ dict entry(
+ string "Status"
+ variant uint32 0
+ )
+ dict entry(
+ string "SelfHandle"
+ variant uint32 1
+ )
+ dict entry(
+ string "Interfaces"
+ variant array [
+ string "org.freedesktop.Telepathy.Connection.Interface.Requests"
+ string "org.freedesktop.Telepathy.Connection.Interface.Contacts"
+ string "org.freedesktop.Telepathy.Connection.Interface.Aliasing"
+ ]
+ )
+ ]
+
+type=MethodReturn, service=":1.16", signature="a{sv}", contents=([Argument: a{sv} {"HasImmortalHandles" = [Variant(bool): true], "Status" = [Variant(uint): 0], "SelfHandle" = [Variant(uint): 1], "Interfaces" = [Variant(QStringList): {"org.freedesktop.Telepathy.Connection.Interface.Requests", "org.freedesktop.Telepathy.Connection.Interface.Contacts", "org.freedesktop.Telepathy.Connection.Interface.Capabilities", "org.freedesktop.Telepathy.Connection.Interface.ServicePoint", "org.freedesktop.Telepathy.Connection.Interface.Cellular", "org.freedesktop.Telepathy.Connection.Interface.Anonymity", "com.nokia.Telepathy.Connection.Interface.StoredMessages"}]}])
CONFIG += ordered\r
SUBDIRS += vicar-lib\r
SUBDIRS += vicar-daemon\r
-SUBDIRS += vicar-config\r
+\r
+contains(MEEGO_EDITION,harmattan){\r
+ SUBDIRS += vicar-config-qml\r
+}\r
+else{\r
+ SUBDIRS += vicar-config\r
+}\r
+\r
SUBDIRS += vicar-telepathy\r
SUBDIRS += vicar-utils\r
\r
#MAKE INSTALL\r
\r
-INSTALLS += desktop service manager profile icon26 icon32 icon48 icon64 scalable\r
+INSTALLS += desktop dbus_service tp_connmanager rtcom_profile icon26 icon32 icon48 icon64 appicon\r
+\r
+dbus_service.path = /usr/share/dbus-1/services\r
+dbus_service.files = data/dbus/org.maemo.vicar.service\r
+dbus_service.files += data/dbus/org.freedesktop.Telepathy.ConnectionManager.vicar.service\r
+\r
+tp_connmanager.path = /usr/share/telepathy/managers\r
+tp_connmanager.files = data/telepathy/vicar.manager\r
+\r
+rtcom_profile.path = /usr/share/osso-rtcom\r
+rtcom_profile.files = data/telepathy/vicar.profile\r
+\r
+icon26.path = /usr/share/icons/hicolor/26x26/apps\r
+icon26.files += data/icons/26x26/vicar_harmattan.png\r
+\r
+icon32.path = /usr/share/icons/hicolor/32x32/apps\r
+icon32.files += data/icons/32x32/vicar_harmattan.png\r
\r
-desktop.path = /usr/share/applications/hildon\r
-desktop.files += data/vicar-config.desktop\r
+icon48.path = /usr/share/icons/hicolor/48x48/apps\r
+icon48.files += data/icons/48x48/vicar_harmattan.png\r
\r
-service.path = /usr/share/dbus-1/services\r
-service.files = data/org.maemo.vicar.service\r
-service.files += data/org.freedesktop.Telepathy.ConnectionManager.vicar.service\r
+icon64.path = /usr/share/icons/hicolor/64x64/apps\r
+icon64.files += data/icons/64x64/vicar_harmattan.png\r
\r
-manager.path = /usr/share/telepathy/managers\r
-manager.files = data/vicar.manager\r
+appicon.path = /usr/share/icons/hicolor/80x80/apps\r
+appicon.files += data/icons/vicar_harmattan.png\r
\r
-profile.path = /usr/share/osso-rtcom\r
-profile.files = data/vicar.profile\r
+contains(MEEGO_EDITION,harmattan){\r
+#Install files required for Harmattan Accounts framework\r
+ INSTALLS += account_provider account_service account_icon\r
\r
-icon26.path = /opt/usr/share/icons/hicolor/26x26/apps\r
-icon26.files += data/icons/26x26/vicar_phone.png\r
+ account_provider.path = /usr/share/accounts/providers\r
+ account_provider.files += data/accounts/vicar.provider\r
\r
-icon32.path = /opt/usr/share/icons/hicolor/32x32/apps\r
-icon32.files += data/icons/32x32/vicar_phone.png\r
+ account_service.path = /usr/share/accounts/services\r
+ account_service.files += data/accounts/vicar.service\r
\r
-icon48.path = /opt/usr/share/icons/hicolor/48x48/apps\r
-icon48.files += data/icons/48x48/vicar_phone.png\r
+ account_icon.path = /usr/share/themes/blanco/meegotouch/icons\r
+ account_icon.files += data/icons/icon-m-service-vicar.png\r
\r
-icon64.path = /opt/usr/share/icons/hicolor/64x64/apps\r
-icon64.files += data/icons/64x64/vicar_phone.png\r
+ desktop.path = /usr/share/applications\r
+ desktop.files += data/desktop/vicar-config-qml.desktop\r
+}\r
\r
-scalable.path = /opt/usr/share/icons/hicolor/scalable/apps\r
-scalable.files += data/icons/vicar_scalable_icon.png\r
+maemo5 | exists(/usr/bin/hildon-home) {\r
+ desktop.path = /usr/share/applications/hildon\r
+ desktop.files += data/desktop/vicar-config.desktop\r
+}\r
--- /dev/null
+#include <QtGui/QApplication>
+#include <QDeclarativeEngine>
+#include <QDebug>
+#include "qmlapplicationviewer.h"
+#include <QDir>
+
+Q_DECL_EXPORT int main(int argc, char *argv[])
+{
+ QScopedPointer<QApplication> app(createApplication(argc, argv));
+ QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
+
+#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+ //For maemo fremantle or harmattan use a common path
+ qDebug() << "Maemo";
+ QString strPath = QDir().homePath() + "/.vicar/OfflineStorage";
+ viewer->engine()->setOfflineStoragePath(strPath);
+#else
+ qDebug() << "Not Maemo";
+#endif
+
+ qDebug() << viewer->engine()->offlineStoragePath();
+ viewer->setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+ viewer->setMainQmlFile(QLatin1String("qml/vicarconfigqml/main.qml"));
+ viewer->showExpanded();
+
+ return app->exec();
+}
--- /dev/null
+/*
+@version: 0.2
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+
+var dynComponent;
+var addRuleSheet;
+var action;
+
+function loadRules(){
+ rulesModel.clear();
+ var rulesArray = DBUtility.getAllRules();
+ if (rulesArray && rulesArray.length > 0){
+ var i;
+ for (i = 0; i < rulesArray.length; i++){
+ var ruleObj = rulesArray[i];
+ rulesModel.append({"id":ruleObj.id,"numberpattern":ruleObj.numberpattern,"gatewaynumber":ruleObj.gatewaynumber,"dtmfformat":ruleObj.dtmfformat,"dtmfprefix":ruleObj.dtmfprefix,"dtmfsuffix":ruleObj.dtmfsuffix});
+ }
+ uiLoader.sourceComponent = rulesComponent;
+ }
+ else{
+ uiLoader.sourceComponent = blankComponent;
+ }
+}
+
+function editRule(ruleID){
+ action = "EDIT";
+ dynComponent = Qt.createComponent("addrulesheet.qml");
+ if (dynComponent.status == Component.Error) {
+ console.log("Error loading component:", dynComponent.errorString());
+ }
+
+ addRuleSheet = dynComponent.createObject(pageStack.currentPage,{"ruleID": ruleID});
+ if (addRuleSheet === null){
+ console.log("Error creating object");
+ }
+ else{
+ addRuleSheet.statusChanged.connect(onSheetStatusChanged);
+ addRuleSheet.open();
+ }
+}
+
+function addRule(){
+ action = "ADD";
+ dynComponent = Qt.createComponent("addrulesheet.qml");
+ if (dynComponent.status == Component.Error) {
+ console.log("Error loading component:", dynComponent.errorString());
+ }
+
+ addRuleSheet = dynComponent.createObject(pageStack.currentPage);
+ if (addRuleSheet === null){
+ console.log("Error creating object");
+ }
+ else{
+ addRuleSheet.statusChanged.connect(onSheetStatusChanged);
+ addRuleSheet.open();
+ }
+}
+
+function onSheetStatusChanged(){
+ if (addRuleSheet.status == DialogStatus.Closed){
+ if (action == "EDIT")
+ loadRules();
+ else
+ mainPage.reload();
+ }
+}
--- /dev/null
+/*
+@version: 0.2
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+function getDatabase() {
+ logMessage("Opening VICaR database..");
+ return openDatabaseSync("VICaR", "1.0", "StorageDatabase", 100);
+}
+
+function logMessage(strMessage){
+ if (typeof(logUtility)!== 'undefined'){
+ logUtility.logMessage(strMessage);
+ }
+ else{
+ console.log(strMessage);
+ }
+}
+
+// Initialize tables
+function initialize() {
+ var db = getDatabase();
+ db.transaction(
+ function(tx) {
+ // Create the settings table if it doesn't already exist
+ // If the table exists, this is skipped
+ tx.executeSql('CREATE TABLE IF NOT EXISTS settings(setting TEXT PRIMARY KEY, value TEXT)');
+ tx.executeSql('CREATE TABLE IF NOT EXISTS rules(id INTEGER PRIMARY KEY, numberpattern TEXT, gatewaynumber TEXT, dtmfformat TEXT, dtmfprefix TEXT, dtmfsuffix TEXT)');
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ });
+}
+
+function getSetting(setting) {
+ var db = getDatabase();
+ var res="";
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('SELECT value FROM settings WHERE setting=?;', [setting]);
+ if (rs.rows.length > 0) {
+ res = rs.rows.item(0).value;
+ logMessage(setting+" is "+res);
+ } else {
+ res = "Unknown";
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return res;
+}
+
+
+function setSetting(setting, value) {
+ var db = getDatabase();
+ var res = "";
+ db.transaction(
+ function(tx) {
+ var rs = tx.executeSql('INSERT OR REPLACE INTO settings VALUES (?,?);', [setting,value]);
+ if (rs.rowsAffected > 0) {
+ res = "OK";
+ logMessage("Updated "+setting+" to "+value);
+ } else {
+ res = "Error";
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return res;
+}
+
+function addRule(ruleObj){
+ logMessage('SQL> INSERT INTO rules(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, '+[ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]+')');
+ var db = getDatabase();
+ var res = "";
+ logMessage("Opened VICaR database..");
+
+ db.transaction(function(tx) {
+ var rs = tx.executeSql('INSERT INTO rules(id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix) VALUES (NULL, ?, ?, ?, ?, ?);', [ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix]);
+ logMessage("Inserted "+rs.rowsAffected+" rows");
+ if (rs.rowsAffected > 0) {
+ res = "OK";
+ } else {
+ res = "Error";
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return res;
+}
+
+function updateRule(id,ruleObj){
+ logMessage('SQL> UPDATE rules set numberpattern = '+[ruleObj.numberpattern]+
+ ', gatewaynumber = '+[ruleObj.gatewaynumber]+
+ ', dtmfformat = '+[ruleObj.dtmfformat]+
+ ', dtmfprefix = '+[ruleObj.dtmfprefix]+
+ ', dtmfsuffix = '+[ruleObj.dtmfsuffix]+
+ ' WHERE id = ?'+[id]);
+ var db = getDatabase();
+ var res = "";
+ db.transaction(function(tx) {
+ var rs = tx.executeSql('UPDATE rules set numberpattern = ?, gatewaynumber = ?, dtmfformat = ?, dtmfprefix = ?, dtmfsuffix = ? WHERE id = ?;',
+ [ruleObj.numberpattern, ruleObj.gatewaynumber, ruleObj.dtmfformat, ruleObj.dtmfprefix, ruleObj.dtmfsuffix, id]);
+ logMessage("Updated "+rs.rowsAffected+" rows");
+ if (rs.rowsAffected > 0) {
+ res = "OK";
+ } else {
+ res = "Error";
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return res;
+}
+
+function removeRule(id){
+ logMessage('SQL> DELETE FROM rules WHERE id = '+[id]);
+ var db = getDatabase();
+ var res = "";
+ db.transaction(function(tx) {
+ var rs = tx.executeSql('DELETE FROM rules WHERE id = ?;', [id]);
+ logMessage("Deleted "+rs.rowsAffected+" rows");
+ if (rs.rowsAffected > 0) {
+ res = "OK";
+ } else {
+ res = "Error";
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return res;
+}
+
+function getAllRules(){
+ var db = getDatabase();
+ var rulesArray = new Array();
+ var ruleObj;
+ db.transaction(function(tx) {
+ var rs = tx.executeSql('SELECT * FROM rules');
+ logMessage("Fetched "+rs.rows.length+" rows");
+ var i = 0;
+ for (i = 0; i < rs.rows.length; i++){
+ ruleObj = new Object();
+ ruleObj.id = rs.rows.item(i).id;
+ ruleObj.numberpattern = rs.rows.item(i).numberpattern;
+ ruleObj.gatewaynumber = rs.rows.item(i).gatewaynumber;
+ ruleObj.dtmfformat = rs.rows.item(i).dtmfformat;
+ ruleObj.dtmfprefix = rs.rows.item(i).dtmfprefix;
+ ruleObj.dtmfsuffix = rs.rows.item(i).dtmfsuffix;
+ rulesArray[i] = ruleObj;
+ logMessage("id = "+ruleObj.id
+ +", numberpattern = "+ruleObj.numberpattern
+ +", gatewaynumber = "+ruleObj.gatewaynumber
+ +", dtmfformat = "+ruleObj.dtmfformat
+ +", dtmfprefix = "+ruleObj.dtmfprefix
+ +", dtmfsuffix = "+ruleObj.dtmfsuffix);
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return rulesArray;
+}
+
+
+function getRuleByID(id){
+ var db = getDatabase();
+ var ruleObj;
+ db.transaction(function(tx) {
+ logMessage('SQL> SELECT * FROM rules WHERE id = '+[id]);
+ var rs = tx.executeSql('SELECT * FROM rules WHERE id = '+[id]);
+ logMessage("Fetched "+rs.rows.length+" rows");
+ if (rs.rows.length > 0){
+ ruleObj = new Object();
+ ruleObj.id = rs.rows.item(0).id;
+ ruleObj.numberpattern = rs.rows.item(0).numberpattern;
+ ruleObj.gatewaynumber = rs.rows.item(0).gatewaynumber;
+ ruleObj.dtmfformat = rs.rows.item(0).dtmfformat;
+ ruleObj.dtmfprefix = rs.rows.item(0).dtmfprefix;
+ ruleObj.dtmfsuffix = rs.rows.item(0).dtmfsuffix;
+ logMessage("id = "+ruleObj.id
+ +", numberpattern = "+ruleObj.numberpattern
+ +", gatewaynumber = "+ruleObj.gatewaynumber
+ +", dtmfformat = "+ruleObj.dtmfformat
+ +", dtmfprefix = "+ruleObj.dtmfprefix
+ +", dtmfsuffix = "+ruleObj.dtmfsuffix);
+ }
+ },
+ function(error) {
+ logMessage("Error ["+error.code +"] - " + error.DOMString+" occurred.");
+ }
+ );
+ return ruleObj;
+}
--- /dev/null
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import "Library/js/DBUtility.js" as DBUtility
+import "Library/js/CoreLogic.js" as Core
+
+Page {
+ tools: commonTools
+ id: mainPage
+
+ Component.onCompleted: {
+ DBUtility.initialize();
+ Core.loadRules();
+ }
+
+ function reload(){
+ Core.loadRules();
+ }
+
+ Rectangle{
+ id: headerRect
+ anchors.top:parent.top
+ width: parent.width ; height: parent.height/10
+ color: "grey"
+ opacity: 0.6
+
+ Text {
+ id: titleText
+ anchors.centerIn: parent //#cccccc
+ font.pointSize: 16; horizontalAlignment: Text.AlignLeft; elide: Text.ElideLeft; color: "black"; style: Text.Raised; styleColor: "black"
+ font.bold: true
+ text: qsTr("VICaR - Rules")
+ }
+ }
+
+ Loader
+ {
+ id: uiLoader
+ anchors {top: headerRect.bottom; bottom: parent.bottom}
+ width: parent.width
+ }
+
+ ListModel{
+ id: rulesModel
+ }
+
+
+ Component {
+ id: rulesComponent
+ Item {
+ ListView {
+ id: rulesView
+ model: rulesModel
+ anchors.fill: parent
+ delegate:ruleDelegate
+ }
+ }
+ }
+
+ Component {
+ id: ruleDelegate
+ Item{
+ width: uiLoader.width
+ height: 40
+ Text {
+ width: parent.width
+ font.pointSize: 16; horizontalAlignment: Text.AlignLeft; elide: Text.ElideLeft; color: "black"; style: Text.Raised; styleColor: "black"
+ text: "For #s starting with "+numberpattern+ ", use "+gatewaynumber;
+ }
+ MouseArea{
+ anchors.fill: parent
+ onPressAndHold: {
+ ruleContextMenu.ruleID = id;
+ console.log("Setting Rule ID as "+id);
+ ruleContextMenu.open();
+ }
+ }
+ }
+ }
+
+ ContextMenu{
+ id: ruleContextMenu
+ property int ruleID:0
+
+ MenuLayout{
+ MenuItem {
+ text: qsTr("Edit");
+ onClicked: {
+ Core.editRule(ruleContextMenu.ruleID);
+ }
+ }
+ MenuItem {
+ text: qsTr("Delete");
+ onClicked: {
+ DBUtility.removeRule(ruleContextMenu.ruleID);
+ Core.loadRules();
+ }
+ }
+ }
+ }
+
+ Component{
+ id: blankComponent
+ Item {
+ Label {
+ id: label
+ anchors.centerIn: parent
+ text: qsTr("Add rules for call routing.")
+ visible: true
+ }
+ }
+ }
+}
--- /dev/null
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import "Library/js/DBUtility.js" as DBUtility
+
+Sheet{
+ id: screen
+ acceptButtonText: qsTr("Done")
+ rejectButtonText: qsTr("Cancel")
+
+ signal sheetDestroyed()
+
+ property int ruleID:0
+ property string numberpattern:""
+ property string gatewaynumber:""
+ property string dtmfformat:""
+ property int numberFormatIndex:0
+ property string dtmfprefix: ""
+ property string dtmfsuffix: ""
+
+ Component.onCompleted: {
+ if (ruleID != 0){
+ var ruleObj = DBUtility.getRuleByID(ruleID);
+ if (ruleObj !== null){
+ numberpattern = ruleObj.numberpattern;
+ gatewaynumber = ruleObj.gatewaynumber;
+ dtmfformat = ruleObj.dtmfformat;
+ var i;
+ for (i = 0; i < numberFormatModel.count; i++){
+ if (numberFormatModel.get(i).name == dtmfformat) {
+ numberFormatIndex = i;
+ break;
+ }
+ }
+ dtmfprefix = ruleObj.dtmfprefix;
+ dtmfsuffix = ruleObj.dtmfsuffix;
+ }
+ }
+ }
+
+ Component.onDestruction: {
+ console.log("OnDestruction");
+ sheetDestroyed();
+ }
+
+ ListModel {
+ id: numberFormatModel
+ ListElement { name: "<Country Code><Area Code><Phone Number>" }
+ ListElement { name: "+<Country Code><Area Code><Phone Number>" }
+ ListElement { name: "00<Country Code><Area Code><Phone Number>" }
+ ListElement { name: "011<Country Code><Area Code><Phone Number>" }
+ }
+
+ SelectionDialog {
+ id: numberFormatDialog
+ titleText: "Number Format"
+ width: container.width
+ selectedIndex: numberFormatIndex
+ model: numberFormatModel
+ }
+
+ content: Flickable {
+ id: container
+ anchors.fill: parent
+ anchors.leftMargin: 10
+ anchors.topMargin: 10
+ flickableDirection: Flickable.VerticalFlick
+
+ Column {
+ id: col
+ width: parent.width
+ spacing: 10
+ Label { text: (ruleID != 0)? qsTr("Edit Rule"):qsTr("Add Rule"); font.bold: true; }
+ Label { text: qsTr("For numbers starting with:") }
+ TextField {
+ id: numberStartingWith
+ anchors { left: parent.left; right: parent.right; }
+ //height: implicitHeight
+ inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText
+ text: screen.numberpattern
+ }
+ Label { text: qsTr("Route call via:") }
+ TextField {
+ id: gatewayNumber
+ anchors { left: parent.left; right: parent.right; }
+ //height: implicitHeight
+ inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText
+ text: screen.gatewaynumber
+ }
+
+ Label { text: qsTr("Dial number in this format:") }
+
+ Button {
+ anchors { horizontalCenter: parent.horizontalCenter }
+ //height: implicitHeight
+ text: "Change Format"
+ onClicked: {
+ numberFormatDialog.open();
+ }
+ }
+
+ Rectangle {
+ width: parent.width
+ height: 30
+ color: "lightgray"
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: numberFormatDialog.selectedIndex >= 0 ? numberFormatDialog.model.get(numberFormatDialog.selectedIndex).name : "None"
+ font.pixelSize: 16
+ //font.bold: true
+ }
+ }
+
+ Label { text: qsTr("Include this tone before dialing:") }
+ TextField {
+ id: dtmfPrefix
+ anchors { left: parent.left; right: parent.right; }
+ height: implicitHeight
+ inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText
+ }
+
+ Label { text: qsTr("Include this tone after dialing:") }
+ TextField {
+ id: dtmfSuffix
+ anchors { left: parent.left; right: parent.right; }
+ height: implicitHeight
+ inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText
+ }
+ }
+ }
+ onAccepted: {
+ //id, numberpattern, gatewaynumber, dtmfformat, dtmfprefix, dtmfsuffix
+ var ruleObj = new Object();
+ ruleObj.id = ruleID;
+ ruleObj.numberpattern = numberStartingWith.text;
+ ruleObj.gatewaynumber = gatewayNumber.text;
+ ruleObj.dtmfformat = numberFormatDialog.model.get(numberFormatDialog.selectedIndex).name;
+ ruleObj.dtmfprefix = dtmfPrefix.text;
+ ruleObj.dtmfsuffix = dtmfSuffix.text;
+ if (ruleID != 0)
+ DBUtility.updateRule(ruleID,ruleObj);
+ else
+ DBUtility.addRule(ruleObj);
+ destroy();
+ }
+ onRejected: destroy();
+}
--- /dev/null
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import "Library/js/CoreLogic.js" as Core
+
+PageStackWindow {
+ id: appWindow
+
+ initialPage: mainPage
+
+ MainPage {
+ id: mainPage
+ }
+
+ ToolBarLayout {
+ id: commonTools
+ visible: true
+
+ ToolIcon {
+ platformIconId: "toolbar-add"
+ anchors.left: (parent === undefined) ? undefined : parent.left
+ onClicked: {
+ Core.addRule();
+ }
+ }
+
+ ToolIcon {
+ platformIconId: "toolbar-view-menu"
+ anchors.right: (parent === undefined) ? undefined : parent.right
+ onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
+ }
+ }
+
+ Menu {
+ id: myMenu
+ visualParent: pageStack
+ MenuLayout {
+ MenuItem { text: qsTr("About") }
+ }
+ }
+}
--- /dev/null
+// checksum 0x78c version 0x60010
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtGui/QApplication>
+
+#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
+
+#ifdef HARMATTAN_BOOSTER
+#include <MDeclarativeCache>
+#endif
+
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+
+#include <qt_private/qdeclarativedebughelper_p.h>
+
+#if !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+ QmlJsDebuggingEnabler()
+ {
+ QDeclarativeDebugHelper::enableDebugging();
+ }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+ QmlApplicationViewerPrivate(QDeclarativeView *view_) : view(view_) {}
+
+ QString mainQmlFile;
+ QDeclarativeView *view;
+ friend class QmlApplicationViewer;
+ QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+ if (!QDir::isAbsolutePath(path))
+ return QCoreApplication::applicationDirPath()
+ + QLatin1String("/../Resources/") + path;
+#else
+ QString pathInInstallDir;
+ const QString applicationDirPath = QCoreApplication::applicationDirPath();
+ pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path);
+
+ if (QFileInfo(pathInInstallDir).exists())
+ return pathInInstallDir;
+#endif
+#endif
+ return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(this))
+{
+ connect(engine(), SIGNAL(quit()), SLOT(close()));
+ setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QDeclarativeView *view, QWidget *parent)
+ : QDeclarativeView(parent)
+ , d(new QmlApplicationViewerPrivate(view))
+{
+ connect(view->engine(), SIGNAL(quit()), view, SLOT(close()));
+ view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
+ // Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
+#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
+#if !defined(NO_JSDEBUGGER)
+ new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
+#endif
+#if !defined(NO_QMLOBSERVER)
+ new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
+#endif
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+ delete d;
+}
+
+QmlApplicationViewer *QmlApplicationViewer::create()
+{
+#ifdef HARMATTAN_BOOSTER
+ return new QmlApplicationViewer(MDeclarativeCache::qDeclarativeView(), 0);
+#else
+ return new QmlApplicationViewer();
+#endif
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+ d->mainQmlFile = d->adjustPath(file);
+ d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+ d->view->engine()->addImportPath(d->adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#if defined(Q_OS_SYMBIAN)
+ // If the version of Qt on the device is < 4.7.2, that attribute won't work
+ if (orientation != ScreenOrientationAuto) {
+ const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+ if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+ qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+ return;
+ }
+ }
+#endif // Q_OS_SYMBIAN
+
+ Qt::WidgetAttribute attribute;
+ switch (orientation) {
+#if QT_VERSION < 0x040702
+ // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+ case ScreenOrientationLockPortrait:
+ attribute = static_cast<Qt::WidgetAttribute>(128);
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = static_cast<Qt::WidgetAttribute>(129);
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = static_cast<Qt::WidgetAttribute>(130);
+ break;
+#else // QT_VERSION < 0x040702
+ case ScreenOrientationLockPortrait:
+ attribute = Qt::WA_LockPortraitOrientation;
+ break;
+ case ScreenOrientationLockLandscape:
+ attribute = Qt::WA_LockLandscapeOrientation;
+ break;
+ default:
+ case ScreenOrientationAuto:
+ attribute = Qt::WA_AutoOrientation;
+ break;
+#endif // QT_VERSION < 0x040702
+ };
+ setAttribute(attribute, true);
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
+ d->view->showFullScreen();
+#elif defined(Q_WS_MAEMO_5)
+ d->view->showMaximized();
+#else
+ d->view->show();
+#endif
+}
+
+QApplication *createApplication(int &argc, char **argv)
+{
+#ifdef HARMATTAN_BOOSTER
+ return MDeclarativeCache::qApplication(argc, argv);
+#else
+ return new QApplication(argc, argv);
+#endif
+}
--- /dev/null
+// checksum 0x82ed version 0x60010
+/*
+ This file was generated by the Qt Quick Application wizard of Qt Creator.
+ QmlApplicationViewer is a convenience class containing mobile device specific
+ code such as screen orientation handling. Also QML paths and debugging are
+ handled here.
+ It is recommended not to modify this file, since newer versions of Qt Creator
+ may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+ Q_OBJECT
+
+public:
+ enum ScreenOrientation {
+ ScreenOrientationLockPortrait,
+ ScreenOrientationLockLandscape,
+ ScreenOrientationAuto
+ };
+
+ explicit QmlApplicationViewer(QWidget *parent = 0);
+ virtual ~QmlApplicationViewer();
+
+ static QmlApplicationViewer *create();
+
+ void setMainQmlFile(const QString &file);
+ void addImportPath(const QString &path);
+
+ // Note that this will only have an effect on Symbian and Fremantle.
+ void setOrientation(ScreenOrientation orientation);
+
+ void showExpanded();
+
+private:
+ explicit QmlApplicationViewer(QDeclarativeView *view, QWidget *parent);
+ class QmlApplicationViewerPrivate *d;
+};
+
+QApplication *createApplication(int &argc, char **argv);
+
+#endif // QMLAPPLICATIONVIEWER_H
--- /dev/null
+# checksum 0x368d version 0x60010
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+# Include JS debugger library if QMLJSDEBUGGER_PATH is set
+!isEmpty(QMLJSDEBUGGER_PATH) {
+ include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+} else {
+ DEFINES -= QMLJSDEBUGGER
+}
+
+contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
+ DEFINES += HARMATTAN_BOOSTER
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemsources = $${item}.sources
+ $$itemsources = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath= $$eval($${deploymentfolder}.target)
+ export($$itemsources)
+ export($$itempath)
+ DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+ isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+ isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, /, \\)
+ sourcePathSegments = $$split(source, \\)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+ target = $$replace(target, /, \\)
+ !isEqual(source,$$target) {
+ !isEmpty(copyCommand):copyCommand += &&
+ isEqual(QMAKE_DIR_SEP, \\) {
+ copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+ } else {
+ source = $$replace(source, \\\\, /)
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ target = $$replace(target, \\\\, /)
+ copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
+ }
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+} else:unix {
+ maemo5 {
+ desktopfile.files = $${TARGET}.desktop
+ desktopfile.path = /usr/share/applications/hildon
+ icon.files = $${TARGET}64.png
+ icon.path = /usr/share/icons/hicolor/64x64/apps
+ } else:!isEmpty(MEEGO_VERSION_MAJOR) {
+ desktopfile.files = $${TARGET}_harmattan.desktop
+ desktopfile.path = /usr/share/applications
+ icon.files = $${TARGET}80.png
+ icon.path = /usr/share/icons/hicolor/80x80/apps
+ } else { # Assumed to be a Desktop Unix
+ copyCommand =
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+ source = $$replace(source, \\\\, /)
+ macx {
+ target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+ } else {
+ target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+ }
+ target = $$replace(target, \\\\, /)
+ sourcePathSegments = $$split(source, /)
+ targetFullPath = $$target/$$last(sourcePathSegments)
+ !isEqual(source,$$targetFullPath) {
+ !isEmpty(copyCommand):copyCommand += &&
+ copyCommand += $(MKDIR) \"$$target\"
+ copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+ }
+ }
+ !isEmpty(copyCommand) {
+ copyCommand = @echo Copying application data... && $$copyCommand
+ copydeploymentfolders.commands = $$copyCommand
+ first.depends = $(first) copydeploymentfolders
+ export(first.depends)
+ export(copydeploymentfolders.commands)
+ QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+ }
+ }
+ installPrefix = /opt/$${TARGET}
+ for(deploymentfolder, DEPLOYMENTFOLDERS) {
+ item = item$${deploymentfolder}
+ itemfiles = $${item}.files
+ $$itemfiles = $$eval($${deploymentfolder}.source)
+ itempath = $${item}.path
+ $$itempath = $${installPrefix}/$$eval($${deploymentfolder}.target)
+ export($$itemfiles)
+ export($$itempath)
+ INSTALLS += $$item
+ }
+
+ !isEmpty(desktopfile.path) {
+ export(icon.files)
+ export(icon.path)
+ export(desktopfile.files)
+ export(desktopfile.path)
+ INSTALLS += icon desktopfile
+ }
+
+ target.path = $${installPrefix}/bin
+ export(target.path)
+ INSTALLS += target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
--- /dev/null
+contains(MEEGO_EDITION,harmattan){
+ DEFINES += Q_WS_MAEMO_6
+}
+
+# Add more folders to ship with the application, here
+folder_01.source = qml/vicarconfigqml
+folder_01.target = qml
+DEPLOYMENTFOLDERS = folder_01
+
+INCLUDEPATH += /usr/include/applauncherd
+
+# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
+CONFIG += qt-boostable qdeclarative-boostable
+LIBS += -lmdeclarativecache
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += cpp/main.cpp
+
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+
+#include <QtGui/QApplication>
+#include "profileswindow.h"
+#include "vicarprofiletypes.h"
+
+int main(int argc, char *argv[])
+{
+ //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
+ //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
+
+ QApplication a(argc, argv);
+ ProfilesWindow w;
+ w.show();
+ return a.exec();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "profilesettingsdialog.h"
+#include "ui_profilesettingsdialog.h"
+#include "vicarprofiletypes.h"
+#include <QMessageBox>
+#include <QDebug>
+
+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
+
+ if (profile->phoneNumberPattern == "%"){
+ ui->labelNumberStartsWith->setText("-- Default Profile --");
+ ui->lineEditNumberStartsWith->setVisible(false);
+ }
+
+ 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->lineEditCallingCardNumber->setValidator(new QRegExpValidator(QRegExp( "^[0-9\\+]*$"), 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();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+#ifndef PROFILESETTINGSDIALOG_H
+#define PROFILESETTINGSDIALOG_H
+
+#include <QDialog>
+#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
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <QDebug>
+#include <QDBusMetaType>
+
+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{
+ org::maemo::vicar::Profile currentProfile;
+ QString strProfileDetails;
+ QListWidgetItem *item;
+ foreach (currentProfile,profileList){
+ if (currentProfile.phoneNumberPattern != "%"){
+ strProfileDetails = QString("Number starts with %1, then call via %2")
+ .arg(currentProfile.phoneNumberPattern)
+ .arg(currentProfile.gatewayNumber);
+ }
+ else{
+ strProfileDetails = QString("No profile found, then call via %1")
+ .arg(currentProfile.gatewayNumber);
+ }
+ 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;
+ if (profile.phoneNumberPattern != "%"){
+ strProfileDetails = QString("Number starts with %1, then call via %2")
+ .arg(profile.phoneNumberPattern)
+ .arg(profile.gatewayNumber);
+ }
+ else{
+ strProfileDetails = QString("No profile found, then call via %1")
+ .arg(profile.gatewayNumber);
+ }
+ item->setText(strProfileDetails);
+ item->setData(Qt::UserRole,profile.profileID);
+ }
+ }
+ }
+ }
+ else{
+ d->dbusUtility->displayNotification("Select a profile to edit.");
+ }
+}
+
+void ProfilesWindow::on_removeButton_clicked(){
+ QListWidgetItem *item = ui->profilesListWidget->currentItem();
+ if (item != 0){
+ qDebug() << "Selected item data is " << item->data(Qt::UserRole).toInt();
+ 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<org::freedesktop::Telepathy::SimplePresence>();
+
+ 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);
+}
+
+void ProfilesWindow::on_actionEditDefaultProfile_triggered(){
+ org::maemo::vicar::Profile profile;
+ bool result = d->databaseUtility->getDefaultProfile(&profile);
+ qDebug() << "Default profile exits? " <<result;
+ if (result){
+ //Default profile does not exist - edit it
+ ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+ int response = dialog->exec();
+ if (response == QDialog::Accepted){
+ qDebug() << "Updating default profile record";
+ bool result = d->databaseUtility->updateProfile(profile);
+ if (!result){
+ d->dbusUtility->displayNotification("Unable to update default profile.");
+ qDebug() << "Error updating default profile."<< d->databaseUtility->lastError();
+ }
+ else{
+ ui->profilesListWidget->clear();
+ this->loadProfilesList();
+ }
+ }
+ }
+ else{
+ //Create new default profile
+ profile.phoneNumberPattern = "%";
+ ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
+ int result = dialog->exec();
+ if (result == QDialog::Accepted){
+ qDebug() << "Inserting new default profile record";
+ int result = d->databaseUtility->insertProfile(profile);
+ if (result == -1){
+ d->dbusUtility->displayNotification("Unable to create default profile.");
+ qDebug() << "Error inserting new default profile record. "<< d->databaseUtility->lastError();
+ }
+ else{
+ QString strProfileDetails = QString("No profile found, then call via %1")
+ .arg(profile.gatewayNumber);
+ QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
+ item->setData(Qt::UserRole,result);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+#ifndef PROFILESWINDOW_H
+#define PROFILESWINDOW_H
+
+#include <QMainWindow>
+
+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);
+ void on_actionEditDefaultProfile_triggered();
+};
+
+#endif // PROFILESWINDOW_H
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-
-#include <QtGui/QApplication>
-#include "profileswindow.h"
-#include "vicarprofiletypes.h"
-
-int main(int argc, char *argv[])
-{
- //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
- //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
-
- QApplication a(argc, argv);
- ProfilesWindow w;
- w.show();
- return a.exec();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "profilesettingsdialog.h"
-#include "ui_profilesettingsdialog.h"
-#include "vicarprofiletypes.h"
-#include <QMessageBox>
-#include <QDebug>
-
-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
-
- if (profile->phoneNumberPattern == "%"){
- ui->labelNumberStartsWith->setText("-- Default Profile --");
- ui->lineEditNumberStartsWith->setVisible(false);
- }
-
- 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->lineEditCallingCardNumber->setValidator(new QRegExpValidator(QRegExp( "^[0-9\\+]*$"), 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();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-#ifndef PROFILESETTINGSDIALOG_H
-#define PROFILESETTINGSDIALOG_H
-
-#include <QDialog>
-#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
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <QDebug>
-#include <QDBusMetaType>
-
-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{
- org::maemo::vicar::Profile currentProfile;
- QString strProfileDetails;
- QListWidgetItem *item;
- foreach (currentProfile,profileList){
- if (currentProfile.phoneNumberPattern != "%"){
- strProfileDetails = QString("Number starts with %1, then call via %2")
- .arg(currentProfile.phoneNumberPattern)
- .arg(currentProfile.gatewayNumber);
- }
- else{
- strProfileDetails = QString("No profile found, then call via %1")
- .arg(currentProfile.gatewayNumber);
- }
- 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;
- if (profile.phoneNumberPattern != "%"){
- strProfileDetails = QString("Number starts with %1, then call via %2")
- .arg(profile.phoneNumberPattern)
- .arg(profile.gatewayNumber);
- }
- else{
- strProfileDetails = QString("No profile found, then call via %1")
- .arg(profile.gatewayNumber);
- }
- item->setText(strProfileDetails);
- item->setData(Qt::UserRole,profile.profileID);
- }
- }
- }
- }
- else{
- d->dbusUtility->displayNotification("Select a profile to edit.");
- }
-}
-
-void ProfilesWindow::on_removeButton_clicked(){
- QListWidgetItem *item = ui->profilesListWidget->currentItem();
- if (item != 0){
- qDebug() << "Selected item data is " << item->data(Qt::UserRole).toInt();
- 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<org::freedesktop::Telepathy::SimplePresence>();
-
- 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);
-}
-
-void ProfilesWindow::on_actionEditDefaultProfile_triggered(){
- org::maemo::vicar::Profile profile;
- bool result = d->databaseUtility->getDefaultProfile(&profile);
- qDebug() << "Default profile exits? " <<result;
- if (result){
- //Default profile does not exist - edit it
- ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
- int response = dialog->exec();
- if (response == QDialog::Accepted){
- qDebug() << "Updating default profile record";
- bool result = d->databaseUtility->updateProfile(profile);
- if (!result){
- d->dbusUtility->displayNotification("Unable to update default profile.");
- qDebug() << "Error updating default profile."<< d->databaseUtility->lastError();
- }
- else{
- ui->profilesListWidget->clear();
- this->loadProfilesList();
- }
- }
- }
- else{
- //Create new default profile
- profile.phoneNumberPattern = "%";
- ProfileSettingsDialog *dialog = new ProfileSettingsDialog(this,&profile);
- int result = dialog->exec();
- if (result == QDialog::Accepted){
- qDebug() << "Inserting new default profile record";
- int result = d->databaseUtility->insertProfile(profile);
- if (result == -1){
- d->dbusUtility->displayNotification("Unable to create default profile.");
- qDebug() << "Error inserting new default profile record. "<< d->databaseUtility->lastError();
- }
- else{
- QString strProfileDetails = QString("No profile found, then call via %1")
- .arg(profile.gatewayNumber);
- QListWidgetItem *item = new QListWidgetItem(strProfileDetails,ui->profilesListWidget);
- item->setData(Qt::UserRole,result);
- }
- }
- }
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-#ifndef PROFILESWINDOW_H
-#define PROFILESWINDOW_H
-
-#include <QMainWindow>
-
-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);
- void on_actionEditDefaultProfile_triggered();
-};
-
-#endif // PROFILESWINDOW_H
<rect>
<x>0</x>
<y>0</y>
- <width>677</width>
- <height>367</height>
+ <width>679</width>
+ <height>369</height>
</rect>
</property>
<widget class="QWidget" name="formLayoutWidget">
</size>
</property>
<property name="inputMethodHints">
- <set>Qt::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers</set>
+ <set>Qt::ImhDialableCharactersOnly|Qt::ImhNoPredictiveText</set>
</property>
</widget>
</item>
--- /dev/null
+/********************************************************************************
+** Form generated from reading UI file 'profilesettingsdialog.ui'
+**
+** Created: Mon Jan 2 23:41:01 2012
+** by: Qt User Interface Compiler version 4.7.4
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_PROFILESETTINGSDIALOG_H
+#define UI_PROFILESETTINGSDIALOG_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QComboBox>
+#include <QtGui/QDialog>
+#include <QtGui/QFormLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QLabel>
+#include <QtGui/QLineEdit>
+#include <QtGui/QPushButton>
+#include <QtGui/QScrollArea>
+#include <QtGui/QSpacerItem>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+
+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::ImhDialableCharactersOnly|Qt::ImhLowercaseOnly|Qt::ImhNoPredictiveText|Qt::ImhPreferNumbers);
+
+ 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::ImhDialableCharactersOnly|Qt::ImhNoPredictiveText);
+
+ 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::ImhNoPredictiveText|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::ImhNoPredictiveText|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", "<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("ProfileSettingsDialog", "+<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("ProfileSettingsDialog", "00<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
+ << QApplication::translate("ProfileSettingsDialog", "011<Country Code><Area Code><Phone Number>", 0, QApplication::UnicodeUTF8)
+ );
+ labelDTMFPrefix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone prefix: ", 0, QApplication::UnicodeUTF8));
+ labelDTMFSuffix->setText(QApplication::translate("ProfileSettingsDialog", "DTMF tone suffix:", 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
--- /dev/null
+/********************************************************************************
+** Form generated from reading UI file 'profileswindow.ui'
+**
+** Created: Mon Jan 2 23:41:00 2012
+** by: Qt User Interface Compiler version 4.7.4
+**
+** WARNING! All changes made in this file will be lost when recompiling UI file!
+********************************************************************************/
+
+#ifndef UI_PROFILESWINDOW_H
+#define UI_PROFILESWINDOW_H
+
+#include <QtCore/QVariant>
+#include <QtGui/QAction>
+#include <QtGui/QApplication>
+#include <QtGui/QButtonGroup>
+#include <QtGui/QHBoxLayout>
+#include <QtGui/QHeaderView>
+#include <QtGui/QListWidget>
+#include <QtGui/QMainWindow>
+#include <QtGui/QMenu>
+#include <QtGui/QMenuBar>
+#include <QtGui/QPushButton>
+#include <QtGui/QSpacerItem>
+#include <QtGui/QVBoxLayout>
+#include <QtGui/QWidget>
+
+QT_BEGIN_NAMESPACE
+
+class Ui_ProfilesWindow
+{
+public:
+ QAction *actionRoutingEnabled;
+ QAction *actionRouteOnDefault;
+ QAction *actionEditDefaultProfile;
+ QWidget *centralwidget;
+ QWidget *layoutWidget;
+ QVBoxLayout *verticalLayout;
+ QHBoxLayout *horizontalLayout;
+ QPushButton *addButton;
+ QPushButton *editButton;
+ 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);
+ actionEditDefaultProfile = new QAction(ProfilesWindow);
+ actionEditDefaultProfile->setObjectName(QString::fromUtf8("actionEditDefaultProfile"));
+ 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);
+
+ editButton = new QPushButton(layoutWidget);
+ editButton->setObjectName(QString::fromUtf8("editButton"));
+
+ horizontalLayout->addWidget(editButton);
+
+ 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, 27));
+ menuVicarProfiles = new QMenu(menubar);
+ menuVicarProfiles->setObjectName(QString::fromUtf8("menuVicarProfiles"));
+ ProfilesWindow->setMenuBar(menubar);
+
+ menubar->addAction(menuVicarProfiles->menuAction());
+ menuVicarProfiles->addAction(actionRoutingEnabled);
+ menuVicarProfiles->addAction(actionRouteOnDefault);
+ menuVicarProfiles->addAction(actionEditDefaultProfile);
+
+ 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
+ actionEditDefaultProfile->setText(QApplication::translate("ProfilesWindow", "Edit Default Profile", 0, QApplication::UnicodeUTF8));
+#ifndef QT_NO_TOOLTIP
+ actionEditDefaultProfile->setToolTip(QApplication::translate("ProfilesWindow", "Create/Edit profile to be used when no other profile is found for a number", 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
-INCLUDEPATH += .
-INCLUDEPATH += /usr/include/gconf/2 \
- /usr/include/glib-2.0 \
- /usr/lib/glib-2.0/include
-INCLUDEPATH += ../vicar-lib/src
-LIBS += /usr/lib/libgconf-2.so
+#INCLUDEPATH += .
+INCLUDEPATH += ../vicar-lib/cpp
+
+CONFIG += link_pkgconfig
+PKGCONFIG += glib-2.0 gconf-2.0
+
LIBS += ../lib/libvicar.a
-CONFIG += qt \
- debug
+CONFIG += qt
QT += dbus sql
TEMPLATE = app
TARGET = vicar-config
-VPATH += src \
+VPATH += cpp \
uis
UI_DIR = uis
-MOC_DIR = mocs
-OBJECTS_DIR = objs
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
# Input
-HEADERS += profileswindow.h \
- profilesettingsdialog.h
-FORMS += profileswindow.ui \
- profilesettingsdialog.ui
-SOURCES += main.cpp \
- profileswindow.cpp \
- profilesettingsdialog.cpp
+HEADERS += cpp/profileswindow.h \
+ cpp/profilesettingsdialog.h
+FORMS += uis/profileswindow.ui \
+ uis/profilesettingsdialog.ui
+SOURCES += cpp/main.cpp \
+ cpp/profileswindow.cpp \
+ cpp/profilesettingsdialog.cpp
-# MAKE INSTALL
-INSTALLDIR = /../../debian/vicar
INSTALLS += target
-target.path = $$INSTALLDIR/opt/vicar
+target.path = /opt/vicar/bin
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "callrouter.h"
+#include "vicardbusadaptor.h"
+#include <dbusutility.h>
+#include <gconfutility.h>
+#include <databaseutility.h>
+#include <telepathyutility.h>
+#include <QDebug>
+#include <QRegExp>
+#include <QDBusConnection>
+#include <QDBusMessage>
+#include <QStringListIterator>
+
+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;
+ QString strLastDTMFCode;
+ org::maemo::vicar::Profile *currentProfile;
+ CallRouter * const parent;
+};
+
+// ---------------------------------------------------------------------------
+
+CallRouter::CallRouter(QObject *parent) :
+ QObject(parent),
+ d(new CallRouterPrivate(this))
+{
+ Q_ASSERT(0 != d);
+ this->registerDBusService();
+ qDebug() << "Vicar-Daemon: Registered DBus Service " << APPLICATION_DBUS_SERVICE;
+}
+
+CallRouter::~CallRouter(){
+}
+
+void CallRouter::registerDBusService(){
+ //Connect to Session Bus
+ QDBusConnection connection = d->dbusUtility->getConnection(false);
+
+ if (!connection.interface()->isServiceRegistered(APPLICATION_DBUS_SERVICE)){
+
+ if (!connection.registerService(APPLICATION_DBUS_SERVICE)) {
+ qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
+ exit(1);
+ }
+ }
+
+ if (!connection.registerObject(APPLICATION_DBUS_PATH, this, QDBusConnection::ExportAdaptors)) {
+ qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
+ exit(2);
+ }
+
+}
+
+
+void CallRouter::unregisterDBusService(){
+
+ //Disconnect from Session bus
+ QDBusConnection connection = d->dbusUtility->getConnection(false);
+
+ connection.unregisterObject(APPLICATION_DBUS_PATH,QDBusConnection::UnregisterTree);
+
+ if (!connection.unregisterService(APPLICATION_DBUS_SERVICE)) {
+ qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
+ exit(3);
+ }
+
+}
+
+QString CallRouter::callViaCallingCard(QString strDestinationNumber){
+
+ d->currentProfile = new org::maemo::vicar::Profile();
+ d->currentProfile->profileID = 0;
+
+ d->databaseUtility->openDatabase();
+ bool result = d->databaseUtility->findProfileByNumber(strDestinationNumber,d->currentProfile);
+
+ QString strErrorMessage;
+ if (!result){
+ strErrorMessage = QString("Vicar-Daemon: Error finding VICaR profile. %1").arg(d->databaseUtility->lastError().text());
+ }
+ else if (d->currentProfile->profileID == 0){
+ bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default");
+ if (routeOnDefault){
+ qDebug() << "Vicar-Daemon: Routing directly as per configuration";
+ this->placeCall(strDestinationNumber);
+ }
+ else{
+ qDebug() << "Vicar-Daemon: 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() << "Vicar-Daemon: Initiating call to "<< strCallingCardNumber;
+ bool status = this->placeCall(strCallingCardNumber);
+ d->strLastDialedNumber = strDestinationNumber;
+
+ QString strUserMessage;
+
+ if (status){
+ qDebug() << "Vicar-Daemon: 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() << "Vicar-Daemon: " << strErrorMessage;
+ d->strLastDialedNumber.clear();
+ delete d->currentProfile;
+ d->currentProfile = 0;
+ }
+ d->dbusUtility->displayNotification(strUserMessage);
+ }
+
+ d->databaseUtility->closeDatabase();
+ return strErrorMessage;
+}
+
+bool CallRouter::placeCall(QString number){
+
+ QList<QVariant> argsToSend;
+ argsToSend.append(number);
+ argsToSend.append(0);
+
+ bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
+ CSD_CALL_PATH,
+ CSD_CALL_INTERFACE,
+ QString("CreateWith"),argsToSend);
+ return status;
+
+}
+
+void CallRouter::startCallStatusMonitors(){
+ /* Declare the slot to be executed when a call is picked up by other party (Audio connection established).
+ We need this to confirm whether a call went though successfully.
+ */
+
+ QDBusConnection connection = d->dbusUtility->getConnection();
+
+ bool success = connection.connect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("AudioConnect"),this,
+ SLOT(sendNumberAsDTMFCode(const QDBusMessage&)));
+
+ if (success){
+ qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+
+ /* Declare the slot to be executed when the DTMF code is sent.
+ */
+
+ success = connection.connect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("StoppedDTMF"),this,
+ SLOT(displayDTMFConfirmation()));
+
+ if (success){
+ qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+
+ /* Declare the slot to be executed when the call is terminated (due to connection errors etc).
+ We need this to avoid sending DTMF code on wrong calls.
+ */
+
+ success = connection.connect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("Terminated"),this,
+ SLOT(stopCallStatusMonitors()));
+
+ if (success){
+ qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+ /* Declare the slot to be executed when a call is received
+ (before we can place the call to calling card number).
+ It is extremely rare that somebody should get a call within these few seconds.
+ In any case, we need this to avoid sending DTMF code on the received call.
+
+ Btw - I don't care for the incoming number here. If anyone is calling the user before we can send DTMF code,
+ then we stop sending the DTMF code even if user does not respond to the call.
+ */
+
+ success = connection.connect(QString(""),
+ CSD_CALL_PATH,
+ CSD_CALL_INTERFACE,
+ QString("Coming"),this,
+ SLOT(stopCallStatusMonitors()));
+
+ if (success){
+ qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+}
+
+void CallRouter::stopCallStatusMonitors(){
+
+ d->strLastDTMFCode.clear();
+ d->strLastDialedNumber.clear();
+ delete d->currentProfile;
+ d->currentProfile = 0;
+
+ QDBusConnection connection = d->dbusUtility->getConnection();
+
+ // Disconnect the slot for audio connection status
+ bool status = connection.disconnect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("AudioConnect"),this,
+ SLOT(sendNumberAsDTMFCode(const QDBusMessage&)));
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+ // Disconnect the slot for monitoring DTMF completion
+ status = connection.disconnect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("StoppedDTMF"),this,
+ SLOT(displayDTMFConfirmation()));
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+
+ // Disconnect the slot for monitoring terminated calls
+ status = connection.disconnect(QString(""),
+ CSD_CALL_INSTANCE_PATH,
+ CSD_CALL_INSTANCE_INTERFACE,
+ QString("Terminated"),this,
+ SLOT(stopCallStatusMonitors()));
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+
+ // Disconnect the slot for monitoring incoming calls
+ status = connection.disconnect(QString(""),
+ CSD_CALL_PATH,
+ CSD_CALL_INTERFACE,
+ QString("Coming"),this,
+ SLOT(stopCallStatusMonitors()));
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
+ qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
+ }
+}
+
+void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){
+
+ if (!d->strLastDialedNumber.isEmpty() && d->currentProfile != 0){
+ //Verify whether we have the last dialed number available
+
+ QList<QVariant> listArguments = dbusMessage.arguments();
+ bool audioConnected = listArguments.first().toBool();
+
+ if (audioConnected){
+ // Now that the call to Calling card number is successful. We can send the original number as DTMF tones
+ QString strDTMFCode = convertToDTMFCode(d->strLastDialedNumber);
+
+ qDebug() << "Vicar-Daemon: Audio connection established. Sending DTMF code "<< strDTMFCode;
+
+
+ QList<QVariant> argsToSend;
+ argsToSend.append(strDTMFCode);
+ bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
+ CSD_CALL_PATH,
+ CSD_CALL_INTERFACE,
+ QString("SendDTMF"),argsToSend);
+
+ if (status){
+ qDebug() << "Vicar-Daemon: Sending " << strDTMFCode << " as DTMF code.";
+ d->strLastDTMFCode = strDTMFCode;
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Unable to send DTMF code.";
+ }
+ }
+ else{
+ qDebug() << "Vicar-Daemon: Audio not yet connected.";
+ }
+ }
+ else
+ {
+ qDebug() << "Vicar-Daemon: Last dialed number is empty.";
+ }
+}
+
+void CallRouter::displayDTMFConfirmation(){
+ //This slot is called when the all the DTMF tones are sent (i.e StoppedDTMF signal is emitted)
+ //Just display confirmation message and cleanup
+
+
+ if (!d->strLastDTMFCode.isEmpty()){
+ QString strMessage = d->strLastDTMFCode.append(" sent as DTMF code");
+ d->dbusUtility->displayNotification(strMessage);
+ qDebug() << "Vicar-Daemon: "<< d->strLastDTMFCode << " sent as DTMF code.";
+ }
+
+ /*
+ Connecting and Disconnecting from/to DBus signal for each international call
+ may not be the most efficient way of handling this. But we need to make sure
+ that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
+ */
+
+ qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
+ stopCallStatusMonitors();
+}
+
+QString CallRouter::convertToDTMFCode(QString strNumber){
+ QString strDTMFCode;
+
+ if (!strNumber.isEmpty()){
+ //int intDTMFDelay = 1;
+
+ //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);
+ strDTMFCode = "";
+
+ //Now check whether we need a prefix
+ QString strDTMFPrefix = d->currentProfile->dtmfPrefix;
+
+ 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 = "<Country Code><Area Code><Phone Number>";
+
+ /* Replace 00 (international dialing code) at the beginning
+ and also replace any character other than the numbers 0-9 and p.
+ */
+ QRegExp regexp = QRegExp("(^0{2})|[^0-9p]");
+ strNumber = strNumber.replace(regexp,"");
+
+ /* Now we have a clean number with only country code, area code and phone number,
+ lets convert it to the calling card friendly format
+ */
+ if (qstrDTMFFormat.startsWith("+")){
+ strDTMFCode = strDTMFCode.append("+");
+ }
+ else if (qstrDTMFFormat.startsWith("00")){
+ strDTMFCode = strDTMFCode.append("00");
+ }
+ else if (qstrDTMFFormat.startsWith("011")){
+ strDTMFCode = strDTMFCode.append("011");
+ }
+
+ strDTMFCode = strDTMFCode.append(strNumber);
+
+ //Now check whether we need a suffix
+ QString strDTMFSuffix = d->currentProfile->dtmfSuffix;
+ if (!strDTMFSuffix.isEmpty()){
+ strDTMFCode = strDTMFCode.append(strDTMFSuffix);
+ }
+ }
+
+ return strDTMFCode;
+}
+
+//DBus Method used by external applications to check whether VICaR is enabled and running
+bool CallRouter::isRunning(){
+
+ return true;
+
+ //Verify Whether VICaR telepathy account is online
+ /*
+ if (d->tpUtility->getAccountStatus() == "Connected"){
+ return true;
+ }
+ else{
+ return false;
+ }
+ */
+}
+
+//DBus Method used by external applications to call via VICaR
+QString CallRouter::callInternationalNumber(const QString& strDestinationNumber){
+
+ QString strErrorMessage;
+
+ qDebug() << "Vicar-Daemon: New call requested by external application. Destination number is " << strDestinationNumber;
+
+ if (isValidPhoneNumber(strDestinationNumber)){
+
+ //Remove spaces in the phone number before using
+ QString numberWithoutSpaces = QString(strDestinationNumber).remove(" ");
+
+ strErrorMessage = this->callViaCallingCard(numberWithoutSpaces);
+ }
+ else{
+ strErrorMessage = QString("Vicar-Daemon: %1 is not a valid number").arg(strDestinationNumber);
+ if (strDestinationNumber != "publish" && strDestinationNumber != "subscribe"){
+ d->dbusUtility->displayNotification(QString("Vicar: %1 is not a valid number").arg(strDestinationNumber));
+ }
+ }
+
+ qDebug() << strErrorMessage;
+
+ if (strErrorMessage.isEmpty()){
+ return QString("Success");
+ }
+ else{
+ return strErrorMessage;
+ }
+ }
+
+//Check whether a string is valid phone number
+bool CallRouter::isValidPhoneNumber(QString strPhoneNumber){
+
+/* Remove all dialble characters and space. The resulting string should be a valid number */
+ QRegExp regexp = QRegExp("[p+*# ]");
+
+ strPhoneNumber = strPhoneNumber.replace(regexp,"");
+
+ qDebug() << "Vicar Daemon: Cleaned up phone number is " << strPhoneNumber;
+
+/* Now remove all digits, the resulting string should be empty, then it is a valid number */
+ regexp = QRegExp("[0-9]");
+
+ strPhoneNumber = strPhoneNumber.replace(regexp,"");
+
+ bool isNumber = strPhoneNumber.isEmpty();
+ return isNumber;
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef CALLROUTER_H
+#define CALLROUTER_H
+
+#include <QObject>
+#include <QDBusMessage>
+#include <dbusutility.h>
+#include <gconfutility.h>
+#include "vicardbusadaptor.h"
+
+#define APPLICATION_DBUS_PATH "/org/maemo/vicar"
+#define APPLICATION_DBUS_INTERFACE "org.maemo.vicar"
+#define APPLICATION_DBUS_SERVICE "org.maemo.vicar"
+#define APPLICATION_FRIENDLY_NAME "VICaR"
+
+/* CSD CALL plugin D-Bus definitions */
+#define CSD_CALL_BUS_NAME "com.nokia.csd.Call"
+#define CSD_CALL_INTERFACE "com.nokia.csd.Call"
+#define CSD_CALL_INSTANCE_INTERFACE "com.nokia.csd.Call.Instance"
+#define CSD_CALL_CONFERENCE "com.nokia.csd.Call.Conference"
+#define CSD_CALL_PATH "/com/nokia/csd/call"
+#define CSD_CALL_INSTANCE_PATH "/com/nokia/csd/call/1"
+#define CSD_CALL_SERVICE "com.nokia.csd.Call"
+#define CSD_SERVICE "com.nokia.csd"
+
+class CallRouterPrivate;
+
+class CallRouter : public QObject
+{
+Q_OBJECT
+Q_CLASSINFO("D-Bus Interface", "org.maemo.vicar")
+
+public:
+ CallRouter(QObject *parent = 0);
+ ~CallRouter();
+ void registerDBusService();
+ void unregisterDBusService();
+ bool isValidPhoneNumber(QString);
+
+protected:
+ void startCallStatusMonitors();
+ QString convertToDTMFCode(QString);
+ bool isExcludedNumber(QString);
+ bool placeCall(QString);
+
+protected slots:
+ QString callViaCallingCard(QString);
+ void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
+ void displayDTMFConfirmation();
+ void stopCallStatusMonitors();
+
+ //D-Bus Interface Methods
+public slots:
+ bool isRunning();
+ QString callInternationalNumber(const QString& internationalNumber);
+
+private:
+ CallRouterPrivate * const d;
+};
+
+#endif // CALLROUTER_H
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include <QtCore/QCoreApplication>
+#include <QDBusConnection>
+#include <QDebug>
+#include "callrouter.h"
+//#include "vicarprofiletypes.h"
+
+int main(int argc, char *argv[])
+{
+ //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
+ //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
+
+ QCoreApplication a(argc, argv);
+ CallRouter callRouter(&a);
+ return a.exec();
+}
--- /dev/null
+/*
+ * 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 <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * 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;
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtDBus/QtDBus>
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> 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", ""
+" <interface name=\"org.maemo.vicar\">\n"
+" <method name=\"startOutgoingCallMonitor\">\n"
+" <arg direction=\"out\" type=\"b\"/>\n"
+" </method>\n"
+" <method name=\"stopOutgoingCallMonitor\">\n"
+" <arg direction=\"out\" type=\"b\"/>\n"
+" </method>\n"
+" <method name=\"isRunning\">\n"
+" <arg direction=\"out\" type=\"b\"/>\n"
+" </method>\n"
+" <method name=\"callInternationalNumber\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"number\"/>\n"
+" <arg direction=\"out\" type=\"s\"/>\n"
+" </method>\n"
+" </interface>\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
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "callrouter.h"
-#include "vicardbusadaptor.h"
-#include <dbusutility.h>
-#include <gconfutility.h>
-#include <databaseutility.h>
-#include <telepathyutility.h>
-#include <QDebug>
-#include <QRegExp>
-#include <QDBusConnection>
-#include <QDBusMessage>
-#include <QStringListIterator>
-
-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;
- QString strLastDTMFCode;
- org::maemo::vicar::Profile *currentProfile;
- CallRouter * const parent;
-};
-
-// ---------------------------------------------------------------------------
-
-CallRouter::CallRouter(QObject *parent) :
- QObject(parent),
- d(new CallRouterPrivate(this))
-{
- Q_ASSERT(0 != d);
- this->registerDBusService();
- qDebug() << "Vicar-Daemon: Registered DBus Service " << APPLICATION_DBUS_SERVICE;
-}
-
-CallRouter::~CallRouter(){
-}
-
-void CallRouter::registerDBusService(){
- //Connect to Session Bus
- QDBusConnection connection = d->dbusUtility->getConnection(false);
-
- if (!connection.interface()->isServiceRegistered(APPLICATION_DBUS_SERVICE)){
-
- if (!connection.registerService(APPLICATION_DBUS_SERVICE)) {
- qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
- exit(1);
- }
- }
-
- if (!connection.registerObject(APPLICATION_DBUS_PATH, this, QDBusConnection::ExportAdaptors)) {
- qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
- exit(2);
- }
-
-}
-
-
-void CallRouter::unregisterDBusService(){
-
- //Disconnect from Session bus
- QDBusConnection connection = d->dbusUtility->getConnection(false);
-
- connection.unregisterObject(APPLICATION_DBUS_PATH,QDBusConnection::UnregisterTree);
-
- if (!connection.unregisterService(APPLICATION_DBUS_SERVICE)) {
- qDebug() << "Vicar-Daemon: " << d->dbusUtility->getErrorMessage();
- exit(3);
- }
-
-}
-
-QString CallRouter::callViaCallingCard(QString strDestinationNumber){
-
- d->currentProfile = new org::maemo::vicar::Profile();
- d->currentProfile->profileID = 0;
-
- d->databaseUtility->openDatabase();
- bool result = d->databaseUtility->findProfileByNumber(strDestinationNumber,d->currentProfile);
-
- QString strErrorMessage;
- if (!result){
- strErrorMessage = QString("Vicar-Daemon: Error finding VICaR profile. %1").arg(d->databaseUtility->lastError().text());
- }
- else if (d->currentProfile->profileID == 0){
- bool routeOnDefault = d->gconfUtility->getGconfValueBoolean("route_on_default");
- if (routeOnDefault){
- qDebug() << "Vicar-Daemon: Routing directly as per configuration";
- this->placeCall(strDestinationNumber);
- }
- else{
- qDebug() << "Vicar-Daemon: 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() << "Vicar-Daemon: Initiating call to "<< strCallingCardNumber;
- bool status = this->placeCall(strCallingCardNumber);
- d->strLastDialedNumber = strDestinationNumber;
-
- QString strUserMessage;
-
- if (status){
- qDebug() << "Vicar-Daemon: 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() << "Vicar-Daemon: " << strErrorMessage;
- d->strLastDialedNumber.clear();
- delete d->currentProfile;
- d->currentProfile = 0;
- }
- d->dbusUtility->displayNotification(strUserMessage);
- }
-
- d->databaseUtility->closeDatabase();
- return strErrorMessage;
-}
-
-bool CallRouter::placeCall(QString number){
-
- QList<QVariant> argsToSend;
- argsToSend.append(number);
- argsToSend.append(0);
-
- bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
- CSD_CALL_PATH,
- CSD_CALL_INTERFACE,
- QString("CreateWith"),argsToSend);
- return status;
-
-}
-
-void CallRouter::startCallStatusMonitors(){
- /* Declare the slot to be executed when a call is picked up by other party (Audio connection established).
- We need this to confirm whether a call went though successfully.
- */
-
- QDBusConnection connection = d->dbusUtility->getConnection();
-
- bool success = connection.connect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("AudioConnect"),this,
- SLOT(sendNumberAsDTMFCode(const QDBusMessage&)));
-
- if (success){
- qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
-
- /* Declare the slot to be executed when the DTMF code is sent.
- */
-
- success = connection.connect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("StoppedDTMF"),this,
- SLOT(displayDTMFConfirmation()));
-
- if (success){
- qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
-
- /* Declare the slot to be executed when the call is terminated (due to connection errors etc).
- We need this to avoid sending DTMF code on wrong calls.
- */
-
- success = connection.connect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("Terminated"),this,
- SLOT(stopCallStatusMonitors()));
-
- if (success){
- qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
- /* Declare the slot to be executed when a call is received
- (before we can place the call to calling card number).
- It is extremely rare that somebody should get a call within these few seconds.
- In any case, we need this to avoid sending DTMF code on the received call.
-
- Btw - I don't care for the incoming number here. If anyone is calling the user before we can send DTMF code,
- then we stop sending the DTMF code even if user does not respond to the call.
- */
-
- success = connection.connect(QString(""),
- CSD_CALL_PATH,
- CSD_CALL_INTERFACE,
- QString("Coming"),this,
- SLOT(stopCallStatusMonitors()));
-
- if (success){
- qDebug() << "Vicar-Daemon: Successfully connected to Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to connect to Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-}
-
-void CallRouter::stopCallStatusMonitors(){
-
- d->strLastDTMFCode.clear();
- d->strLastDialedNumber.clear();
- delete d->currentProfile;
- d->currentProfile = 0;
-
- QDBusConnection connection = d->dbusUtility->getConnection();
-
- // Disconnect the slot for audio connection status
- bool status = connection.disconnect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("AudioConnect"),this,
- SLOT(sendNumberAsDTMFCode(const QDBusMessage&)));
-
- if (status){
- qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal AudioConnect in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
- // Disconnect the slot for monitoring DTMF completion
- status = connection.disconnect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("StoppedDTMF"),this,
- SLOT(displayDTMFConfirmation()));
-
- if (status){
- qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal StoppedDTMF in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
-
- // Disconnect the slot for monitoring terminated calls
- status = connection.disconnect(QString(""),
- CSD_CALL_INSTANCE_PATH,
- CSD_CALL_INSTANCE_INTERFACE,
- QString("Terminated"),this,
- SLOT(stopCallStatusMonitors()));
-
- if (status){
- qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal Terminated in interface "<< CSD_CALL_INSTANCE_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-
- // Disconnect the slot for monitoring incoming calls
- status = connection.disconnect(QString(""),
- CSD_CALL_PATH,
- CSD_CALL_INTERFACE,
- QString("Coming"),this,
- SLOT(stopCallStatusMonitors()));
-
- if (status){
- qDebug() << "Vicar-Daemon: Successfully disconnected from Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
- }
- else{
- qDebug() << "Vicar-Daemon: Failed to disconnect from Dbus signal Coming in interface" << CSD_CALL_INTERFACE;
- qDebug() <<"Vicar-Daemon: DBus Error: "<< d->dbusUtility->getErrorMessage();
- }
-}
-
-void CallRouter::sendNumberAsDTMFCode(const QDBusMessage& dbusMessage){
-
- if (!d->strLastDialedNumber.isEmpty() && d->currentProfile != 0){
- //Verify whether we have the last dialed number available
-
- QList<QVariant> listArguments = dbusMessage.arguments();
- bool audioConnected = listArguments.first().toBool();
-
- if (audioConnected){
- // Now that the call to Calling card number is successful. We can send the original number as DTMF tones
- QString strDTMFCode = convertToDTMFCode(d->strLastDialedNumber);
-
- qDebug() << "Vicar-Daemon: Audio connection established. Sending DTMF code "<< strDTMFCode;
-
-
- QList<QVariant> argsToSend;
- argsToSend.append(strDTMFCode);
- bool status = d->dbusUtility->sendMethodCall(CSD_SERVICE,
- CSD_CALL_PATH,
- CSD_CALL_INTERFACE,
- QString("SendDTMF"),argsToSend);
-
- if (status){
- qDebug() << "Vicar-Daemon: Sending " << strDTMFCode << " as DTMF code.";
- d->strLastDTMFCode = strDTMFCode;
- }
- else{
- qDebug() << "Vicar-Daemon: Unable to send DTMF code.";
- }
- }
- else{
- qDebug() << "Vicar-Daemon: Audio not yet connected.";
- }
- }
- else
- {
- qDebug() << "Vicar-Daemon: Last dialed number is empty.";
- }
-}
-
-void CallRouter::displayDTMFConfirmation(){
- //This slot is called when the all the DTMF tones are sent (i.e StoppedDTMF signal is emitted)
- //Just display confirmation message and cleanup
-
-
- if (!d->strLastDTMFCode.isEmpty()){
- QString strMessage = d->strLastDTMFCode.append(" sent as DTMF code");
- d->dbusUtility->displayNotification(strMessage);
- qDebug() << "Vicar-Daemon: "<< d->strLastDTMFCode << " sent as DTMF code.";
- }
-
- /*
- Connecting and Disconnecting from/to DBus signal for each international call
- may not be the most efficient way of handling this. But we need to make sure
- that the DTMF codes are sent only for the calls placed by this app (i.e calls to Calling card number).
- */
-
- qDebug() << "Vicar-Daemon: Now disconnecting from call status monitors..";
- stopCallStatusMonitors();
-}
-
-QString CallRouter::convertToDTMFCode(QString strNumber){
- QString strDTMFCode;
-
- if (!strNumber.isEmpty()){
- //int intDTMFDelay = 1;
-
- //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);
- strDTMFCode = "";
-
- //Now check whether we need a prefix
- QString strDTMFPrefix = d->currentProfile->dtmfPrefix;
-
- 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 = "<Country Code><Area Code><Phone Number>";
-
- /* Replace 00 (international dialing code) at the beginning
- and also replace any character other than the numbers 0-9 and p.
- */
- QRegExp regexp = QRegExp("(^0{2})|[^0-9p]");
- strNumber = strNumber.replace(regexp,"");
-
- /* Now we have a clean number with only country code, area code and phone number,
- lets convert it to the calling card friendly format
- */
- if (qstrDTMFFormat.startsWith("+")){
- strDTMFCode = strDTMFCode.append("+");
- }
- else if (qstrDTMFFormat.startsWith("00")){
- strDTMFCode = strDTMFCode.append("00");
- }
- else if (qstrDTMFFormat.startsWith("011")){
- strDTMFCode = strDTMFCode.append("011");
- }
-
- strDTMFCode = strDTMFCode.append(strNumber);
-
- //Now check whether we need a suffix
- QString strDTMFSuffix = d->currentProfile->dtmfSuffix;
- if (!strDTMFSuffix.isEmpty()){
- strDTMFCode = strDTMFCode.append(strDTMFSuffix);
- }
- }
-
- return strDTMFCode;
-}
-
-//DBus Method used by external applications to check whether VICaR is enabled and running
-bool CallRouter::isRunning(){
-
- return true;
-
- //Verify Whether VICaR telepathy account is online
- /*
- if (d->tpUtility->getAccountStatus() == "Connected"){
- return true;
- }
- else{
- return false;
- }
- */
-}
-
-//DBus Method used by external applications to call via VICaR
-QString CallRouter::callInternationalNumber(const QString& strDestinationNumber){
-
- QString strErrorMessage;
-
- qDebug() << "Vicar-Daemon: New call requested by external application. Destination number is " << strDestinationNumber;
-
- if (isValidPhoneNumber(strDestinationNumber)){
-
- //Remove spaces in the phone number before using
- QString numberWithoutSpaces = QString(strDestinationNumber).remove(" ");
-
- strErrorMessage = this->callViaCallingCard(numberWithoutSpaces);
- }
- else{
- strErrorMessage = QString("Vicar-Daemon: %1 is not a valid number").arg(strDestinationNumber);
- if (strDestinationNumber != "publish" && strDestinationNumber != "subscribe"){
- d->dbusUtility->displayNotification(QString("Vicar: %1 is not a valid number").arg(strDestinationNumber));
- }
- }
-
- qDebug() << strErrorMessage;
-
- if (strErrorMessage.isEmpty()){
- return QString("Success");
- }
- else{
- return strErrorMessage;
- }
- }
-
-//Check whether a string is valid phone number
-bool CallRouter::isValidPhoneNumber(QString strPhoneNumber){
-
-/* Remove all dialble characters and space. The resulting string should be a valid number */
- QRegExp regexp = QRegExp("[p+*# ]");
-
- strPhoneNumber = strPhoneNumber.replace(regexp,"");
-
- qDebug() << "Vicar Daemon: Cleaned up phone number is " << strPhoneNumber;
-
-/* Now remove all digits, the resulting string should be empty, then it is a valid number */
- regexp = QRegExp("[0-9]");
-
- strPhoneNumber = strPhoneNumber.replace(regexp,"");
-
- bool isNumber = strPhoneNumber.isEmpty();
- return isNumber;
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#ifndef CALLROUTER_H
-#define CALLROUTER_H
-
-#include <QObject>
-#include <QDBusMessage>
-#include <dbusutility.h>
-#include <gconfutility.h>
-#include "vicardbusadaptor.h"
-
-#define APPLICATION_DBUS_PATH "/org/maemo/vicar"
-#define APPLICATION_DBUS_INTERFACE "org.maemo.vicar"
-#define APPLICATION_DBUS_SERVICE "org.maemo.vicar"
-#define APPLICATION_FRIENDLY_NAME "VICaR"
-
-/* CSD CALL plugin D-Bus definitions */
-#define CSD_CALL_BUS_NAME "com.nokia.csd.Call"
-#define CSD_CALL_INTERFACE "com.nokia.csd.Call"
-#define CSD_CALL_INSTANCE_INTERFACE "com.nokia.csd.Call.Instance"
-#define CSD_CALL_CONFERENCE "com.nokia.csd.Call.Conference"
-#define CSD_CALL_PATH "/com/nokia/csd/call"
-#define CSD_CALL_INSTANCE_PATH "/com/nokia/csd/call/1"
-#define CSD_CALL_SERVICE "com.nokia.csd.Call"
-#define CSD_SERVICE "com.nokia.csd"
-
-class CallRouterPrivate;
-
-class CallRouter : public QObject
-{
-Q_OBJECT
-Q_CLASSINFO("D-Bus Interface", "org.maemo.vicar")
-
-public:
- CallRouter(QObject *parent = 0);
- ~CallRouter();
- void registerDBusService();
- void unregisterDBusService();
- bool isValidPhoneNumber(QString);
-
-protected:
- void startCallStatusMonitors();
- QString convertToDTMFCode(QString);
- bool isExcludedNumber(QString);
- bool placeCall(QString);
-
-protected slots:
- QString callViaCallingCard(QString);
- void sendNumberAsDTMFCode(const QDBusMessage& dbusMessage);
- void displayDTMFConfirmation();
- void stopCallStatusMonitors();
-
- //D-Bus Interface Methods
-public slots:
- bool isRunning();
- QString callInternationalNumber(const QString& internationalNumber);
-
-private:
- CallRouterPrivate * const d;
-};
-
-#endif // CALLROUTER_H
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include <QtCore/QCoreApplication>
-#include <QDBusConnection>
-#include <QDebug>
-#include "callrouter.h"
-//#include "vicarprofiletypes.h"
-
-int main(int argc, char *argv[])
-{
- //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
- //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
-
- QCoreApplication a(argc, argv);
- CallRouter callRouter(&a);
- return a.exec();
-}
+++ /dev/null
-/*
- * 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 <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * 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;
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtDBus/QtDBus>
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> 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", ""
-" <interface name=\"org.maemo.vicar\">\n"
-" <method name=\"startOutgoingCallMonitor\">\n"
-" <arg direction=\"out\" type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"stopOutgoingCallMonitor\">\n"
-" <arg direction=\"out\" type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"isRunning\">\n"
-" <arg direction=\"out\" type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"callInternationalNumber\">\n"
-" <arg direction=\"in\" type=\"s\" name=\"number\"/>\n"
-" <arg direction=\"out\" type=\"s\"/>\n"
-" </method>\n"
-" </interface>\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
-INCLUDEPATH += /usr/include/gconf/2 \
- /usr/include/glib-2.0 \
- /usr/lib/glib-2.0/include
-INCLUDEPATH += ../vicar-lib/src
+contains(MEEGO_EDITION,harmattan){
+ DEFINES += Q_WS_MAEMO_6
+}
+
+INCLUDEPATH += ../vicar-lib/cpp
+
+CONFIG += link_pkgconfig
+PKGCONFIG += glib-2.0 gconf-2.0
-LIBS += /usr/lib/libgconf-2.so
LIBS += ../lib/libvicar.a
CONFIG += qt debug
CONFIG += console
CONFIG -= app_bundle
-VPATH += src
-MOC_DIR = mocs
-OBJECTS_DIR = objs
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
-SOURCES += src/main.cpp \
- src/callrouter.cpp \
- src/vicardbusadaptor.cpp
-HEADERS += src/callrouter.h \
- src/vicardbusadaptor.h
-
-#MAKE INSTALL
-INSTALLDIR = /../../debian/vicar
+SOURCES += cpp/main.cpp \
+ cpp/callrouter.cpp \
+ cpp/vicardbusadaptor.cpp
+HEADERS += cpp/callrouter.h \
+ cpp/vicardbusadaptor.h
INSTALLS += target
-
-target.path =$$INSTALLDIR/opt/vicar
+target.path =/opt/vicar/bin
--- /dev/null
+/*
+ * 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()
+{
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+
+/*
+ * 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<QVariant> 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
--- /dev/null
+/*
+ * 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()
+{
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+
+/*
+ * 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<QDBusObjectPath> CreateAccount(const QString &Connection_Manager, const QString &Protocol, const QString &Display_Name, const QVariantMap &Parameters, const QVariantMap &Properties)
+ {
+ QList<QVariant> 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
--- /dev/null
+/*
+ * 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()
+{
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+
+/*
+ * 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<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("Reconnect"), argumentList);
+ }
+
+ inline QDBusPendingReply<> Remove()
+ {
+ QList<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("Remove"), argumentList);
+ }
+
+ inline QDBusPendingReply<QStringList> UpdateParameters(const QVariantMap &Set, const QStringList &Unset)
+ {
+ QList<QVariant> 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
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <andre.magalhaes@indt.org>
+ *
+ * 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();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QList>
+#include <QtCore/QDebug>
+#include <QtCore/QVariantMap>
+#include <QtDBus/QDBusArgument>
+#include <QtDBus/QDBusObjectPath>
+
+namespace org {
+namespace freedesktop {
+namespace Telepathy {
+
+class ChannelDetails
+{
+public:
+ QDBusObjectPath channel;
+ QVariantMap properties;
+};
+typedef QList<ChannelDetails> ChannelDetailsList;
+
+class RequestableChannelClass
+{
+public:
+ QVariantMap fixedProperties;
+ QStringList allowedProperties;
+};
+typedef QList<RequestableChannelClass> 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
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -c ConnectionInterfaceRequestsProxy -p connifacereqproxy.h:connifacereqproxy.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml org.freedesktop.Telepathy.Connection.Interface.Requests
+ *
+ * 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 "connifacereqproxy.h"
+
+/*
+ * Implementation of interface class ConnectionInterfaceRequestsProxy
+ */
+
+ConnectionInterfaceRequestsProxy::ConnectionInterfaceRequestsProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
+ : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
+{
+}
+
+ConnectionInterfaceRequestsProxy::~ConnectionInterfaceRequestsProxy()
+{
+}
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -c ConnectionInterfaceRequestsProxy -p connifacereqproxy.h:connifacereqproxy.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml org.freedesktop.Telepathy.Connection.Interface.Requests
+ *
+ * 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 CONNIFACEREQPROXY_H_1284203341
+#define CONNIFACEREQPROXY_H_1284203341
+
+#include <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+#include "connectioninterfacerequeststypes.h"
+
+/*
+ * Proxy class for interface org.freedesktop.Telepathy.Connection.Interface.Requests
+ */
+class ConnectionInterfaceRequestsProxy: public QDBusAbstractInterface
+{
+ Q_OBJECT
+public:
+ static inline const char *staticInterfaceName()
+ { return "org.freedesktop.Telepathy.Connection.Interface.Requests"; }
+
+public:
+ ConnectionInterfaceRequestsProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
+
+ ~ConnectionInterfaceRequestsProxy();
+
+ Q_PROPERTY(org::freedesktop::Telepathy::RequestableChannelClassList RequestableChannelClasses READ requestableChannelClasses)
+ inline org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses() const
+ { return qvariant_cast< org::freedesktop::Telepathy::RequestableChannelClassList >(property("RequestableChannelClasses")); }
+
+public Q_SLOTS: // METHODS
+ inline QDBusPendingReply<QDBusObjectPath, QVariantMap> CreateChannel(const QVariantMap &request)
+ {
+ QList<QVariant> argumentList;
+ argumentList << qVariantFromValue(request);
+ return asyncCallWithArgumentList(QLatin1String("CreateChannel"), argumentList);
+ }
+ inline QDBusReply<QDBusObjectPath> CreateChannel(const QVariantMap &request, QVariantMap &channel_properties)
+ {
+ QList<QVariant> argumentList;
+ argumentList << qVariantFromValue(request);
+ QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("CreateChannel"), argumentList);
+ if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
+ channel_properties = qdbus_cast<QVariantMap>(reply.arguments().at(1));
+ }
+ return reply;
+ }
+
+ inline QDBusPendingReply<bool, QDBusObjectPath, QVariantMap> EnsureChannel(const QVariantMap &request)
+ {
+ QList<QVariant> argumentList;
+ argumentList << qVariantFromValue(request);
+ return asyncCallWithArgumentList(QLatin1String("EnsureChannel"), argumentList);
+ }
+ inline QDBusReply<bool> EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties)
+ {
+ QList<QVariant> argumentList;
+ argumentList << qVariantFromValue(request);
+ QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("EnsureChannel"), argumentList);
+ if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) {
+ channel_object = qdbus_cast<QDBusObjectPath>(reply.arguments().at(1));
+ channel_properties = qdbus_cast<QVariantMap>(reply.arguments().at(2));
+ }
+ return reply;
+ }
+
+Q_SIGNALS: // SIGNALS
+ void ChannelClosed(const QDBusObjectPath &removed_channel_object);
+ void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels);
+};
+
+namespace org {
+ namespace freedesktop {
+ namespace Telepathy {
+ namespace Connection {
+ namespace Interface {
+ typedef ::ConnectionInterfaceRequestsProxy Requests;
+ }
+ }
+ }
+ }
+}
+#endif
--- /dev/null
+#include "databaseutility.h"
+#include <QSqlDatabase>
+#include <QSqlError>
+#include <QSqlQuery>
+#include <QFile>
+#include <QDir>
+#include <QVariant>
+#include <QDebug>
+
+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 "<<path;
+ profilesDB.setDatabaseName(path);
+ return profilesDB.open();
+}
+
+bool DatabaseUtility::deleteDatabase(){
+ closeDatabase();
+ //QString path(QDir::home().path());
+ //path.append(QDir::separator()).append("vicar.db.sqlite");
+ QString path("/home/user/vicar.db.sqlite");
+ path = QDir::toNativeSeparators(path);
+ return QFile::remove(path);
+}
+
+void DatabaseUtility::closeDatabase(){
+ if (profilesDB.isOpen()){
+ profilesDB.close();
+ }
+}
+
+bool DatabaseUtility::tableExists(QString tableName){
+ bool exists = false;
+ if (profilesDB.isOpen()){
+ QStringList tablesList = profilesDB.tables();
+ exists = tablesList.contains(tableName,Qt::CaseInsensitive);
+ }
+ return exists;
+}
+
+bool DatabaseUtility::createProfilesTable(){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QSqlQuery query;
+ QString strQuery = "create table profiles"
+ "(id integer primary key,"
+ "numberpattern varchar(20),"
+ "gatewaynumber varchar(30),"
+ "dtmfformat varchar(100),"
+ "dtmfprefix varchar(20),"
+ "dtmfsuffix varchar(20)"
+ ")";
+ result = query.exec(strQuery);
+ }
+ return result;
+}
+
+bool DatabaseUtility::selectProfile(int id,org::maemo::vicar::Profile* profile){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QString strQuery = QString("select * from profiles where id = %1").arg(id);
+ qDebug() << "SQL>"<<strQuery;
+ QSqlQuery query(strQuery);
+ if (query.next()){
+ profile->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>"<<strQuery;
+ QSqlQuery query(strQuery);
+ while (query.next()){
+ org::maemo::vicar::Profile profile;
+ profile.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();
+ profileList->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>"<<strQuery;
+ QSqlQuery query(strQuery);
+ if (query.next()){
+ profile->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::getDefaultProfile(org::maemo::vicar::Profile *profile){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QString strQuery = QString("select * from profiles where numberpattern = '%' order by id");
+ qDebug() << "SQL>"<<strQuery;
+ QSqlQuery query(strQuery);
+ if (query.next()){
+ profile->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("profiles")){
+ 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>"<<strQuery;
+ result = query.exec(strQuery);
+ if (result){
+ newId = query.lastInsertId().toInt();
+ }
+ }
+ }
+ return newId;
+}
+
+bool DatabaseUtility::updateProfile(org::maemo::vicar::Profile profile){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QSqlQuery query;
+ QString strQuery = QString("update profiles set numberpattern = '%1', "
+ "gatewaynumber = '%2', dtmfformat = '%3', "
+ "dtmfprefix = '%4', dtmfsuffix = '%5' where id = %6")
+ .arg(profile.phoneNumberPattern).arg(profile.gatewayNumber)
+ .arg(profile.dtmfFormat).arg(profile.dtmfPrefix)
+ .arg(profile.dtmfSuffix).arg(profile.profileID);
+ qDebug() << "SQL>"<<strQuery;
+ result = query.exec(strQuery);
+ }
+ return result;
+}
+
+bool DatabaseUtility::deleteProfile(int id){
+ bool result = false;
+ if (profilesDB.isOpen()){
+ QSqlQuery query;
+ QString strQuery = QString("delete from profiles where id=%1").arg(id);
+ qDebug() << "SQL>"<<strQuery;
+ result = query.exec(strQuery);
+ }
+ return result;
+}
+
+QSqlError DatabaseUtility::lastError(){
+ return profilesDB.lastError();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef DATABASEUTILITY_H
+#define DATABASEUTILITY_H
+
+#include <QObject>
+#include "vicarprofiletypes.h"
+#include <QSqlError>
+#include <QSqlDatabase>
+
+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 getDefaultProfile(org::maemo::vicar::Profile* profile);
+ bool deleteProfile(int id);
+ QSqlError lastError();
+
+private:
+ QSqlDatabase profilesDB;
+};
+
+#endif // DATABASEUTILITY_H
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "dbusutility.h"
+#include <QDBusMessage>
+#include <QDebug>
+
+
+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";
+}
+
+QDBusConnection DbusUtility::getConnection(bool systemBus){
+ if (systemBus){
+ if (!this->connection.isConnected()){
+ qDebug() << "Not connected to Dbus";
+ }
+ return this->connection;
+ }
+ else{
+ return QDBusConnection::sessionBus();
+ }
+}
+
+void DbusUtility::setConnection(QDBusConnection connection){
+ this->connection = connection;
+}
+
+//Utility method to send a dbus signal.
+bool DbusUtility::sendSignal(QString strPath,QString strInterface,QString strName,bool systemBus){
+ QDBusMessage dbusSignal = QDBusMessage::createSignal(strPath,strInterface,strName);
+ QDBusConnection dbusConnection = getConnection(systemBus);
+ bool status = dbusConnection.send(dbusSignal);
+ return status;
+}
+
+//Utility method to call a dbus method with parameters
+bool DbusUtility::sendMethodCall(QString strService,QString strPath,
+ QString strInterface,QString strMethodName,
+ QList<QVariant> & arguments,
+ bool systemBus){
+ QDBusMessage dbusMethodCall = QDBusMessage::createMethodCall(strService,strPath,strInterface,strMethodName);
+ dbusMethodCall.setArguments(arguments);
+ QDBusConnection dbusConnection = getConnection(systemBus);
+ bool status = dbusConnection.send(dbusMethodCall);
+ return status;
+}
+
+//Utility method to display a notification (Orange sliding banner in Maemo) with custom message
+bool DbusUtility::displayNotification(QString strMessage){
+ QList <QVariant> arguments;
+ arguments.append(strMessage);
+
+ bool status = this->sendMethodCall(NOTIFICATION_SERVICE,
+ NOTIFICATION_PATH,
+ NOTIFICATION_INTERFACE,
+ QString("SystemNoteInfoprint"),
+ arguments);
+ return status;
+}
+
+
+//Utility method to retrieve the last dbus error
+QString DbusUtility::getErrorMessage(){
+ QString strErrorMessage;
+ QDBusError dbusError = this->connection.lastError();
+ if (dbusError.isValid()){
+ strErrorMessage = qPrintable(dbusError.message());
+ }
+ return strErrorMessage;
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef DBUSUTILITY_H
+#define DBUSUTILITY_H
+
+#include <QDBusMessage>
+#include <QDBusConnection>
+
+#define NOTIFICATION_SERVICE "org.freedesktop.Notifications"
+#define NOTIFICATION_PATH "/org/freedesktop/Notifications"
+#define NOTIFICATION_INTERFACE "org.freedesktop.Notifications"
+
+class DbusUtility: public QObject
+{
+ Q_OBJECT
+protected:
+ QDBusConnection connection;
+public:
+ DbusUtility(QObject * parent = 0);
+ ~DbusUtility();
+ QDBusConnection getConnection(bool systemBus = true);
+ void setConnection(QDBusConnection connection);
+ bool sendSignal(QString strPath,QString strInterface,QString strName,bool systemBus = true);
+ bool sendMethodCall(QString strService,QString strPath,
+ QString strInterface,QString strMethodName,
+ QList<QVariant> & arguments,bool systemBus = true);
+ bool displayNotification(QString strMessage);
+ QString getErrorMessage();
+};
+
+#endif // DBUSUTILITY_H
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "gconfutility.h"
+#include <gconf/gconf-client.h>
+#include <QDebug>
+
+GConfUtility::GConfUtility(QObject *parent) :
+ QObject(parent)
+{
+ /* Get a GConf client */
+ gconfClient = gconf_client_get_default();
+ g_assert(GCONF_IS_CLIENT(gconfClient));
+}
+
+GConfUtility::~GConfUtility(){
+ /* release GConf client */
+ g_object_unref(gconfClient);
+ gconfClient = 0;
+}
+
+QString GConfUtility::getGconfValueString(QString strKey){
+
+ char* strValue = NULL;
+
+ if (!strKey.isEmpty()) {
+ strKey.prepend(GCONF_DIR);
+
+ strValue = gconf_client_get_string(gconfClient, strKey.toAscii().constData(), NULL);
+ qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<strValue;
+ }
+
+ return QString(strValue);
+}
+
+void GConfUtility::setGconfValueString(QString strKey,QString strValue){
+
+ if (!strKey.isEmpty()){
+
+ strKey.prepend(GCONF_DIR);
+
+ if (!strValue.isEmpty()){
+ gconf_client_set_string(gconfClient, strKey.toAscii().constData(), strValue.toAscii().constData(),NULL);
+ qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<strValue.toAscii().constData();
+ }
+ else{
+ gconf_client_unset(gconfClient, strKey.toAscii().constData(),NULL);
+ qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to NULL";
+ }
+
+ }
+}
+
+bool GConfUtility::getGconfValueBoolean(QString strKey){
+
+ bool boolValue = false;
+
+ if (!strKey.isEmpty()) {
+ strKey.prepend(GCONF_DIR);
+
+ boolValue = gconf_client_get_bool(gconfClient, strKey.toAscii().constData(), NULL);
+ qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<boolValue;
+ }
+
+ return boolValue;
+}
+
+void GConfUtility::setGconfValueBoolean(QString strKey,bool boolValue){
+
+ if (!strKey.isEmpty()){
+
+ strKey.prepend(GCONF_DIR);
+
+ gconf_client_set_bool(gconfClient, strKey.toAscii().constData(),boolValue,NULL);
+ qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<boolValue;
+ }
+}
+
+int GConfUtility::getGconfValueInteger(QString strKey){
+
+ int intValue = 0;
+
+ if (!strKey.isEmpty()) {
+ strKey.prepend(GCONF_DIR);
+
+ intValue = gconf_client_get_int(gconfClient, strKey.toAscii().constData(), NULL);
+ qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<intValue;
+ }
+
+ return intValue;
+}
+
+void GConfUtility::setGconfValueInteger(QString strKey,int intValue){
+
+ if (!strKey.isEmpty()){
+
+ strKey.prepend(GCONF_DIR);
+
+ gconf_client_set_int(gconfClient, strKey.toAscii().constData(),intValue,NULL);
+ qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<intValue;
+ }
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef GCONFUTILITY_H
+#define GCONFUTILITY_H
+
+#include <QObject>
+#include <gconf/gconf-client.h>
+
+#define APPLICATION_NAME "vicar"
+#define GCONF_DIR "/apps/Maemo/" APPLICATION_NAME "/"
+
+class GConfUtility : public QObject
+ {
+Q_OBJECT
+public:
+ GConfUtility(QObject *parent = 0);
+ ~GConfUtility();
+ void setGconfValueString(QString strKey,QString strValue);
+ QString getGconfValueString(QString strKey);
+
+ void setGconfValueBoolean(QString strKey,bool boolValue);
+ bool getGconfValueBoolean(QString strKey);
+
+ void setGconfValueInteger(QString strKey,int intValue);
+ int getGconfValueInteger(QString strKey);
+
+private:
+ GConfClient *gconfClient;
+};
+
+#endif // GCONFUTILITY_H
--- /dev/null
+#if defined(Q_WS_MAEMO_6)
+
+#include "harmattanaccountutility.h"
+#include <Accounts/Manager>
+#include <Accounts/Provider>
+#include <Accounts/Service>
+#include <QDebug>
+
+#define SERVICE_NAME "vicar"
+#define SERVICE_TYPE "IM"
+#define PROVIDER_NAME "vicar"
+
+
+using namespace Accounts;
+
+HarmattanAccountUtility::HarmattanAccountUtility()
+{
+ manager = new Manager(this);
+}
+
+Account* HarmattanAccountUtility::getAccount(){
+ Account *vicarAccount = NULL;
+ //AccountIdList accountsList = manager->accountList(SERVICE_TYPE);
+ AccountIdList accountsList = manager->accountList();
+
+ for (int i = 0; i < accountsList.size(); i++) {
+ Account *tempAccount = manager->account(accountsList.at(i));
+ if (tempAccount->providerName() == PROVIDER_NAME){
+ qDebug() << "Account exists";
+ return tempAccount;
+ }
+ else {
+ qDebug () << tempAccount->valueAsString("username") << "with provider " << tempAccount->providerName() <<" ignored";
+ }
+ }
+
+ qDebug() << "Account does not exist";
+ return vicarAccount;
+}
+
+Account* HarmattanAccountUtility::addAccount(){
+ Account *vicarAccount;
+ vicarAccount = getAccount();
+ if (vicarAccount == NULL){
+ qDebug() << "Creating new account";
+ vicarAccount = manager->createAccount(PROVIDER_NAME);
+ if (vicarAccount != NULL) {
+ qDebug() << "Account object created";
+ connect(vicarAccount,SIGNAL(error(Accounts::Error)),SLOT(errorOccurred(Accounts::Error)));
+ vicarAccount->setDisplayName("VicarAccount");
+ vicarAccount->setValue("username","vicar");
+ vicarAccount->setValue("name","Call via Vicar");
+ vicarAccount->setEnabled(true); //Set account as enabled globally
+ Service *vicarService = manager->service(SERVICE_NAME);
+ vicarAccount->selectService(vicarService);
+ vicarAccount->setEnabled(true); //Set account as enabled at service level
+ vicarAccount->setValue("ConnectAutomatically","true");
+ vicarAccount->setValue("HasBeenOnline","true");
+ vicarAccount->setValue("NormalizedName","Vicar");
+ vicarAccount->setValue("org.freedesktop.Telepathy.Account.Interface.Addressing.DRAFT.URISchemes","tel;");
+ vicarAccount->setValue("tmc-uid","vicar/tel/vicar0");
+ vicarAccount->sync();
+ qDebug() << "Account created with ID " << vicarAccount->id();
+ }
+ else{
+ qDebug() << "Account not created due to error "<< manager->lastError().message();
+ }
+ }
+ else{
+ qDebug() << "Account already exists. No need to create again";
+ }
+ return vicarAccount;
+}
+
+void HarmattanAccountUtility::removeAccount(){
+ Account *vicarAccount = getAccount();
+ if (vicarAccount != NULL && vicarAccount != 0){
+ vicarAccount->remove();
+ vicarAccount->sync();
+ qDebug() << "Account deleted";
+ delete vicarAccount;
+ }
+}
+
+void HarmattanAccountUtility::verifyAccount(){
+ Account *vicarAccount = getAccount();
+ if (vicarAccount != NULL && vicarAccount != 0){
+ Service *vicarService = manager->service(SERVICE_NAME);
+ vicarAccount->selectService(vicarService);
+ QStringList keysList = vicarAccount->allKeys();
+ qDebug() << keysList;
+ delete vicarAccount;
+ }
+}
+
+void HarmattanAccountUtility::errorOccurred(Accounts::Error error){
+ qDebug() << "Error is "<< error.message();
+}
+
+#endif //defined(Q_WS_MAEMO_6)
--- /dev/null
+#ifndef HARMATTANACCOUNTUTILITY_H
+#define HARMATTANACCOUNTUTILITY_H
+
+#if defined(Q_WS_MAEMO_6)
+
+#include <QObject>
+
+#include <Accounts/Account>
+#include <Accounts/Error>
+#include <Accounts/Manager>
+
+using namespace Accounts;
+
+class HarmattanAccountUtility : public QObject
+{
+ Q_OBJECT
+
+public:
+ HarmattanAccountUtility();
+ Account* getAccount();
+ Account* addAccount();
+ void removeAccount();
+ void verifyAccount();
+
+public slots:
+ void errorOccurred(Accounts::Error);
+
+private:
+ Manager *manager;
+
+};
+
+#endif //defined (Q_WS_MAEMO_6)
+
+#endif // HARMATTANACCOUNTUTILITY_H
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef LOGUTILITY_H
+#define LOGUTILITY_H
+#include <QFile>
+#include <QIODevice>
+#include <QTextStream>
+#include <QDateTime>
+#include <QDebug>
+
+class LogUtility : public QObject
+{
+ Q_OBJECT
+
+public:
+ LogUtility(QString logPath,QObject *parent = 0) :
+ QObject(parent){
+ logFilePath = logPath;
+ }
+
+ ~LogUtility(){
+ }
+
+public slots:
+ void logMessage(QString strMessage, bool appendMode = true) {
+
+ QFile logFile(logFilePath);
+
+ bool success = false;
+
+ if (appendMode){
+ success = logFile.open(QIODevice::Append | QIODevice::WriteOnly | QIODevice::Text);
+ }
+ else{
+ success = logFile.open(QIODevice::Truncate | QIODevice::WriteOnly | QIODevice::Text);
+ }
+
+ QString strTimeNow = QDateTime::currentDateTime().toString("dd-MMM-yyyy HH:mm:ss");
+ if (success) {
+ QTextStream logStream(&logFile);
+ logStream << strTimeNow << " - " << strMessage << endl;
+ }
+ else{
+ qDebug() << "ERROROPENINGLOGFILE" << " - " << strMessage;
+ }
+ }
+
+private:
+ QString logFilePath;
+};
+
+#endif // LOGUTILITY_H
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "telepathyutility.h"
+#include "accountmanagerproxy.h"
+#include "accountproxy.h"
+#include "accountcompatproxy.h"
+#include "connifacereqproxy.h"
+#include <QDBusInterface>
+#include <QDBusConnection>
+#include <QStringList>
+#include <QDBusPendingReply>
+#include <QDBusObjectPath>
+#include <QDebug>
+
+using namespace org::freedesktop::Telepathy;
+
+TelepathyUtility::TelepathyUtility(QObject *parent) :
+ QObject(parent)
+{
+}
+
+TelepathyUtility::~TelepathyUtility(){
+
+}
+
+//Get a list of all Telepathy accounts
+QList<QDBusObjectPath> TelepathyUtility::getAllAccounts(){
+
+ QList<QDBusObjectPath> objPathList;
+
+ QDBusInterface *iface = new QDBusInterface(AM_SERVICE,AM_OBJ_PATH,DBUS_PROPS_IFACE,QDBusConnection::sessionBus(),this);
+ if (iface->isValid()){
+ QDBusReply<QDBusVariant> 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<QDBusArgument>();
+
+ 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 "<<reply.error();
+ }
+ }
+ else{
+ qDebug() << "Error occurred while connecting to DBus interface";
+ }
+
+ return objPathList;
+
+}
+
+//Check if Vicar telepathy account exists
+bool TelepathyUtility::accountExists(){
+ bool vicarAccountExists = false;
+ QList<QDBusObjectPath> 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<QDBusObjectPath> 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 during installation)
+bool TelepathyUtility::createAccount(){
+
+ AccountManagerProxy *amProxy = new AccountManagerProxy(AM_SERVICE,AM_OBJ_PATH,QDBusConnection::sessionBus(),this);
+
+ QMap<QString,QVariant> connectionParametersMap;
+ connectionParametersMap.insert("account","vicar");
+
+ QList<QVariant> presenceDetails;
+ uint presenceType(2); //Available = 2
+ presenceDetails << presenceType;
+ presenceDetails << "available";
+ presenceDetails << "Available";
+
+ SimplePresence presence;
+ presence.type = presenceType;
+ presence.status = "available";
+ presence.statusMessage = "Available";
+
+ QMap<QString,QVariant> 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("org.freedesktop.Telepathy.Account.Service","vicar"); //Required when service can't be determined by the protocol name
+ accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.Profile","vicar");
+
+ QStringList valuesList;
+ valuesList.append("TEL");
+ accountPropertiesMap.insert("com.nokia.Account.Interface.Compat.SecondaryVCardFields",valuesList);
+
+ //QStringList uriSchemeList;
+ //uriSchemeList.append("tel");
+ //accountPropertiesMap.insert("org.freedesktop.Telepathy.Account.Interface.Addressing.DRAFT.URISchemes",uriSchemeList);
+
+ QDBusPendingReply<QDBusObjectPath> 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 "<<dbusReply.error();
+ return false;
+ }
+ }
+ }
+ else{
+ qDebug() << "Error creating VICaR telepathy account "<<reply.error();
+ return false;
+ }
+
+ return true;
+}
+
+//Delete Vicar telepathy account (used during uninstallation)
+bool TelepathyUtility::deleteAccount(){
+
+ QList<QDBusObjectPath> 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 "<<dbusReply.error();
+ return false;
+ }
+ else{
+ qDebug() <<"VICaR account deleted";
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+bool TelepathyUtility::callNumberWithRing(QString number){
+
+ bool result = false;
+
+ ConnectionInterfaceRequestsProxy *requestsProxy = new ConnectionInterfaceRequestsProxy(RING_CONN_SERVICE,RING_CONN_PATH,QDBusConnection::sessionBus(),this);
+ if (requestsProxy->isValid()){
+ QVariantMap channelRequestDetails;
+ uint targetHandleType(1);
+ channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.TargetHandleType",targetHandleType);
+ channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.TargetID",number);
+ channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.ChannelType","org.freedesktop.Telepathy.Channel.Type.StreamedMedia");
+ QDBusPendingReply<QDBusObjectPath,QVariantMap> dbusReply = requestsProxy->CreateChannel(channelRequestDetails);
+ dbusReply.waitForFinished();
+ if (!dbusReply.isError()){
+ QDBusObjectPath objPath = dbusReply.argumentAt<0>();
+ QVariantMap channelProperties = dbusReply.argumentAt<1>();
+ result = true;
+ }
+ else{
+ qDebug() << "Error occurred calling "<<number<< ". Error is "<< dbusReply.error();
+ result = false;
+ }
+ }
+
+ return result;
+}
+
+bool TelepathyUtility::sendDTMFTone(QString tone){
+ bool result = false;
+
+ return result;
+}
+
+// Marshall the Presence data into a D-Bus argument
+ QDBusArgument &operator<<(QDBusArgument &argument, const SimplePresence &simplePresence)
+ {
+ argument.beginStructure();
+ argument << simplePresence.type << simplePresence.status << simplePresence.statusMessage;
+ argument.endStructure();
+ return argument;
+ }
+
+ // Retrieve the Presence data from the D-Bus argument
+ const QDBusArgument &operator>>(const QDBusArgument &argument, SimplePresence &simplePresence)
+ {
+ argument.beginStructure();
+ argument >> simplePresence.type >> simplePresence.status >> simplePresence.statusMessage;
+ argument.endStructure();
+ return argument;
+ }
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#ifndef TELEPATHYUTILITY_H
+#define TELEPATHYUTILITY_H
+
+#include <QObject>
+#include <QDBusObjectPath>
+#include <QDBusArgument>
+
+
+#define AM_SERVICE "org.freedesktop.Telepathy.AccountManager"
+#define AM_OBJ_PATH "/org/freedesktop/Telepathy/AccountManager"
+#define AM_INTERFACE "org.freedesktop.Telepathy.AccountManager"
+#define RING_CONN_SERVICE "org.freedesktop.Telepathy.Connection.ring.tel.ring"
+#define RING_CONN_PATH "/org/freedesktop/Telepathy/Connection/ring/tel/ring"
+#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<QDBusObjectPath> getAllAccounts();
+ QString getAccountStatus();
+ bool accountExists();
+ bool createAccount();
+ bool deleteAccount();
+ bool callNumberWithRing(QString number);
+ bool sendDTMFTone(QString tone);
+};
+
+#endif // TELEPATHYUTILITY_H
--- /dev/null
+#ifndef VICARPROFILETYPES_H
+#define VICARPROFILETYPES_H
+
+#include <QString>
+#include <QList>
+#include <QMetaType>
+
+namespace org {
+namespace maemo {
+namespace vicar {
+
+class Profile
+{
+public:
+ uint profileID;
+ QString phoneNumberPattern;
+ QString gatewayNumber;
+ QString dtmfFormat;
+ QString dtmfPrefix;
+ QString dtmfSuffix;
+};
+typedef QList<Profile> ProfileList;
+
+} // namespace vicar
+} // namespace maemo
+} // namespace org
+
+Q_DECLARE_METATYPE(org::maemo::vicar::Profile)
+Q_DECLARE_METATYPE(org::maemo::vicar::ProfileList)
+
+#endif // VICARPROFILETYPES_H
+++ /dev/null
-/*
- * 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()
-{
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * 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<QVariant> 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
+++ /dev/null
-/*
- * 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()
-{
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * 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<QDBusObjectPath> CreateAccount(const QString &Connection_Manager, const QString &Protocol, const QString &Display_Name, const QVariantMap &Parameters, const QVariantMap &Properties)
- {
- QList<QVariant> 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
+++ /dev/null
-/*
- * 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()
-{
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * 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<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Reconnect"), argumentList);
- }
-
- inline QDBusPendingReply<> Remove()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Remove"), argumentList);
- }
-
- inline QDBusPendingReply<QStringList> UpdateParameters(const QVariantMap &Set, const QStringList &Unset)
- {
- QList<QVariant> 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
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <andre.magalhaes@indt.org>
- *
- * 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();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QList>
-#include <QtCore/QDebug>
-#include <QtCore/QVariantMap>
-#include <QtDBus/QDBusArgument>
-#include <QtDBus/QDBusObjectPath>
-
-namespace org {
-namespace freedesktop {
-namespace Telepathy {
-
-class ChannelDetails
-{
-public:
- QDBusObjectPath channel;
- QVariantMap properties;
-};
-typedef QList<ChannelDetails> ChannelDetailsList;
-
-class RequestableChannelClass
-{
-public:
- QVariantMap fixedProperties;
- QStringList allowedProperties;
-};
-typedef QList<RequestableChannelClass> 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
-
+++ /dev/null
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -c ConnectionInterfaceRequestsProxy -p connifacereqproxy.h:connifacereqproxy.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml org.freedesktop.Telepathy.Connection.Interface.Requests
- *
- * 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 "connifacereqproxy.h"
-
-/*
- * Implementation of interface class ConnectionInterfaceRequestsProxy
- */
-
-ConnectionInterfaceRequestsProxy::ConnectionInterfaceRequestsProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ConnectionInterfaceRequestsProxy::~ConnectionInterfaceRequestsProxy()
-{
-}
-
+++ /dev/null
-/*
- * This file was generated by qdbusxml2cpp version 0.7
- * Command line was: qdbusxml2cpp -c ConnectionInterfaceRequestsProxy -p connifacereqproxy.h:connifacereqproxy.cpp org.freedesktop.Telepathy.Connection.I.Requests.xml org.freedesktop.Telepathy.Connection.Interface.Requests
- *
- * 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 CONNIFACEREQPROXY_H_1284203341
-#define CONNIFACEREQPROXY_H_1284203341
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-#include "connectioninterfacerequeststypes.h"
-
-/*
- * Proxy class for interface org.freedesktop.Telepathy.Connection.Interface.Requests
- */
-class ConnectionInterfaceRequestsProxy: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.freedesktop.Telepathy.Connection.Interface.Requests"; }
-
-public:
- ConnectionInterfaceRequestsProxy(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~ConnectionInterfaceRequestsProxy();
-
- Q_PROPERTY(org::freedesktop::Telepathy::RequestableChannelClassList RequestableChannelClasses READ requestableChannelClasses)
- inline org::freedesktop::Telepathy::RequestableChannelClassList requestableChannelClasses() const
- { return qvariant_cast< org::freedesktop::Telepathy::RequestableChannelClassList >(property("RequestableChannelClasses")); }
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<QDBusObjectPath, QVariantMap> CreateChannel(const QVariantMap &request)
- {
- QList<QVariant> argumentList;
- argumentList << qVariantFromValue(request);
- return asyncCallWithArgumentList(QLatin1String("CreateChannel"), argumentList);
- }
- inline QDBusReply<QDBusObjectPath> CreateChannel(const QVariantMap &request, QVariantMap &channel_properties)
- {
- QList<QVariant> argumentList;
- argumentList << qVariantFromValue(request);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("CreateChannel"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
- channel_properties = qdbus_cast<QVariantMap>(reply.arguments().at(1));
- }
- return reply;
- }
-
- inline QDBusPendingReply<bool, QDBusObjectPath, QVariantMap> EnsureChannel(const QVariantMap &request)
- {
- QList<QVariant> argumentList;
- argumentList << qVariantFromValue(request);
- return asyncCallWithArgumentList(QLatin1String("EnsureChannel"), argumentList);
- }
- inline QDBusReply<bool> EnsureChannel(const QVariantMap &request, QDBusObjectPath &channel_object, QVariantMap &channel_properties)
- {
- QList<QVariant> argumentList;
- argumentList << qVariantFromValue(request);
- QDBusMessage reply = callWithArgumentList(QDBus::Block, QLatin1String("EnsureChannel"), argumentList);
- if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 3) {
- channel_object = qdbus_cast<QDBusObjectPath>(reply.arguments().at(1));
- channel_properties = qdbus_cast<QVariantMap>(reply.arguments().at(2));
- }
- return reply;
- }
-
-Q_SIGNALS: // SIGNALS
- void ChannelClosed(const QDBusObjectPath &removed_channel_object);
- void NewChannels(org::freedesktop::Telepathy::ChannelDetailsList new_channels);
-};
-
-namespace org {
- namespace freedesktop {
- namespace Telepathy {
- namespace Connection {
- namespace Interface {
- typedef ::ConnectionInterfaceRequestsProxy Requests;
- }
- }
- }
- }
-}
-#endif
+++ /dev/null
-#include "databaseutility.h"
-#include <QSqlDatabase>
-#include <QSqlError>
-#include <QSqlQuery>
-#include <QFile>
-#include <QDir>
-#include <QVariant>
-#include <QDebug>
-
-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 "<<path;
- profilesDB.setDatabaseName(path);
- return profilesDB.open();
-}
-
-bool DatabaseUtility::deleteDatabase(){
- closeDatabase();
- //QString path(QDir::home().path());
- //path.append(QDir::separator()).append("vicar.db.sqlite");
- QString path("/home/user/vicar.db.sqlite");
- path = QDir::toNativeSeparators(path);
- return QFile::remove(path);
-}
-
-void DatabaseUtility::closeDatabase(){
- if (profilesDB.isOpen()){
- profilesDB.close();
- }
-}
-
-bool DatabaseUtility::tableExists(QString tableName){
- bool exists = false;
- if (profilesDB.isOpen()){
- QStringList tablesList = profilesDB.tables();
- exists = tablesList.contains(tableName,Qt::CaseInsensitive);
- }
- return exists;
-}
-
-bool DatabaseUtility::createProfilesTable(){
- bool result = false;
- if (profilesDB.isOpen()){
- QSqlQuery query;
- QString strQuery = "create table profiles"
- "(id integer primary key,"
- "numberpattern varchar(20),"
- "gatewaynumber varchar(30),"
- "dtmfformat varchar(100),"
- "dtmfprefix varchar(20),"
- "dtmfsuffix varchar(20)"
- ")";
- result = query.exec(strQuery);
- }
- return result;
-}
-
-bool DatabaseUtility::selectProfile(int id,org::maemo::vicar::Profile* profile){
- bool result = false;
- if (profilesDB.isOpen()){
- QString strQuery = QString("select * from profiles where id = %1").arg(id);
- qDebug() << "SQL>"<<strQuery;
- QSqlQuery query(strQuery);
- if (query.next()){
- profile->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>"<<strQuery;
- QSqlQuery query(strQuery);
- while (query.next()){
- org::maemo::vicar::Profile profile;
- profile.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();
- profileList->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>"<<strQuery;
- QSqlQuery query(strQuery);
- if (query.next()){
- profile->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::getDefaultProfile(org::maemo::vicar::Profile *profile){
- bool result = false;
- if (profilesDB.isOpen()){
- QString strQuery = QString("select * from profiles where numberpattern = '%' order by id");
- qDebug() << "SQL>"<<strQuery;
- QSqlQuery query(strQuery);
- if (query.next()){
- profile->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("profiles")){
- 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>"<<strQuery;
- result = query.exec(strQuery);
- if (result){
- newId = query.lastInsertId().toInt();
- }
- }
- }
- return newId;
-}
-
-bool DatabaseUtility::updateProfile(org::maemo::vicar::Profile profile){
- bool result = false;
- if (profilesDB.isOpen()){
- QSqlQuery query;
- QString strQuery = QString("update profiles set numberpattern = '%1', "
- "gatewaynumber = '%2', dtmfformat = '%3', "
- "dtmfprefix = '%4', dtmfsuffix = '%5' where id = %6")
- .arg(profile.phoneNumberPattern).arg(profile.gatewayNumber)
- .arg(profile.dtmfFormat).arg(profile.dtmfPrefix)
- .arg(profile.dtmfSuffix).arg(profile.profileID);
- qDebug() << "SQL>"<<strQuery;
- result = query.exec(strQuery);
- }
- return result;
-}
-
-bool DatabaseUtility::deleteProfile(int id){
- bool result = false;
- if (profilesDB.isOpen()){
- QSqlQuery query;
- QString strQuery = QString("delete from profiles where id=%1").arg(id);
- qDebug() << "SQL>"<<strQuery;
- result = query.exec(strQuery);
- }
- return result;
-}
-
-QSqlError DatabaseUtility::lastError(){
- return profilesDB.lastError();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#ifndef DATABASEUTILITY_H
-#define DATABASEUTILITY_H
-
-#include <QObject>
-#include "vicarprofiletypes.h"
-#include <QSqlError>
-#include <QSqlDatabase>
-
-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 getDefaultProfile(org::maemo::vicar::Profile* profile);
- bool deleteProfile(int id);
- QSqlError lastError();
-
-private:
- QSqlDatabase profilesDB;
-};
-
-#endif // DATABASEUTILITY_H
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "dbusutility.h"
-#include <QDBusMessage>
-#include <QDebug>
-
-
-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";
-}
-
-QDBusConnection DbusUtility::getConnection(bool systemBus){
- if (systemBus){
- if (!this->connection.isConnected()){
- qDebug() << "Not connected to Dbus";
- }
- return this->connection;
- }
- else{
- return QDBusConnection::sessionBus();
- }
-}
-
-void DbusUtility::setConnection(QDBusConnection connection){
- this->connection = connection;
-}
-
-//Utility method to send a dbus signal.
-bool DbusUtility::sendSignal(QString strPath,QString strInterface,QString strName){
- QDBusMessage dbusSignal = QDBusMessage::createSignal(strPath,strInterface,strName);
- bool status = DbusUtility::connection.send(dbusSignal);
- return status;
-}
-
-//Utility method to call a dbus method with parameters
-bool DbusUtility::sendMethodCall(QString strService,QString strPath,
- QString strInterface,QString strMethodName,
- QList<QVariant> & arguments){
- QDBusMessage dbusMethodCall = QDBusMessage::createMethodCall(strService,strPath,strInterface,strMethodName);
- dbusMethodCall.setArguments(arguments);
- bool status = DbusUtility::connection.send(dbusMethodCall);
- return status;
-}
-
-//Utility method to display a notification (Orange sliding banner in Maemo) with custom message
-bool DbusUtility::displayNotification(QString strMessage){
- QList <QVariant> arguments;
- arguments.append(strMessage);
-
- bool status = this->sendMethodCall(NOTIFICATION_SERVICE,
- NOTIFICATION_PATH,
- NOTIFICATION_INTERFACE,
- QString("SystemNoteInfoprint"),
- arguments);
- return status;
-}
-
-
-//Utility method to retrieve the last dbus error
-QString DbusUtility::getErrorMessage(){
- QString strErrorMessage;
- QDBusError dbusError = this->connection.lastError();
- if (dbusError.isValid()){
- strErrorMessage = qPrintable(dbusError.message());
- }
- return strErrorMessage;
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#ifndef DBUSUTILITY_H
-#define DBUSUTILITY_H
-
-#include <QDBusMessage>
-#include <QDBusConnection>
-
-#define NOTIFICATION_SERVICE "org.freedesktop.Notifications"
-#define NOTIFICATION_PATH "/org/freedesktop/Notifications"
-#define NOTIFICATION_INTERFACE "org.freedesktop.Notifications"
-
-class DbusUtility: public QObject
-{
- Q_OBJECT
-protected:
- QDBusConnection connection;
-public:
- DbusUtility(QObject * parent = 0);
- ~DbusUtility();
- QDBusConnection getConnection(bool systemBus = true);
- void setConnection(QDBusConnection connection);
- bool sendSignal(QString strPath,QString strInterface,QString strName);
- bool sendMethodCall(QString strService,QString strPath,
- QString strInterface,QString strMethodName,
- QList<QVariant> & arguments);
- bool displayNotification(QString strMessage);
- QString getErrorMessage();
-};
-
-#endif // DBUSUTILITY_H
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "gconfutility.h"
-#include <gconf/gconf-client.h>
-#include <QDebug>
-
-GConfUtility::GConfUtility(QObject *parent) :
- QObject(parent)
-{
- /* Get a GConf client */
- gconfClient = gconf_client_get_default();
- g_assert(GCONF_IS_CLIENT(gconfClient));
-}
-
-GConfUtility::~GConfUtility(){
- /* release GConf client */
- g_object_unref(gconfClient);
- gconfClient = 0;
-}
-
-QString GConfUtility::getGconfValueString(QString strKey){
-
- char* strValue = NULL;
-
- if (!strKey.isEmpty()) {
- strKey.prepend(GCONF_DIR);
-
- strValue = gconf_client_get_string(gconfClient, strKey.toAscii().constData(), NULL);
- qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<strValue;
- }
-
- return QString(strValue);
-}
-
-void GConfUtility::setGconfValueString(QString strKey,QString strValue){
-
- if (!strKey.isEmpty()){
-
- strKey.prepend(GCONF_DIR);
-
- if (!strValue.isEmpty()){
- gconf_client_set_string(gconfClient, strKey.toAscii().constData(), strValue.toAscii().constData(),NULL);
- qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<strValue.toAscii().constData();
- }
- else{
- gconf_client_unset(gconfClient, strKey.toAscii().constData(),NULL);
- qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to NULL";
- }
-
- }
-}
-
-bool GConfUtility::getGconfValueBoolean(QString strKey){
-
- bool boolValue = false;
-
- if (!strKey.isEmpty()) {
- strKey.prepend(GCONF_DIR);
-
- boolValue = gconf_client_get_bool(gconfClient, strKey.toAscii().constData(), NULL);
- qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<boolValue;
- }
-
- return boolValue;
-}
-
-void GConfUtility::setGconfValueBoolean(QString strKey,bool boolValue){
-
- if (!strKey.isEmpty()){
-
- strKey.prepend(GCONF_DIR);
-
- gconf_client_set_bool(gconfClient, strKey.toAscii().constData(),boolValue,NULL);
- qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<boolValue;
- }
-}
-
-int GConfUtility::getGconfValueInteger(QString strKey){
-
- int intValue = 0;
-
- if (!strKey.isEmpty()) {
- strKey.prepend(GCONF_DIR);
-
- intValue = gconf_client_get_int(gconfClient, strKey.toAscii().constData(), NULL);
- qDebug() << "Gconf: "<<strKey.toAscii().constData()<< " is "<<intValue;
- }
-
- return intValue;
-}
-
-void GConfUtility::setGconfValueInteger(QString strKey,int intValue){
-
- if (!strKey.isEmpty()){
-
- strKey.prepend(GCONF_DIR);
-
- gconf_client_set_int(gconfClient, strKey.toAscii().constData(),intValue,NULL);
- qDebug() << "Assigned "<<strKey.toAscii().constData()<< " to "<<intValue;
- }
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#ifndef GCONFUTILITY_H
-#define GCONFUTILITY_H
-
-#include <QObject>
-#include <gconf/gconf-client.h>
-
-#define APPLICATION_NAME "vicar"
-#define GCONF_DIR "/apps/Maemo/" APPLICATION_NAME "/"
-
-class GConfUtility : public QObject
- {
-Q_OBJECT
-public:
- GConfUtility(QObject *parent = 0);
- ~GConfUtility();
- void setGconfValueString(QString strKey,QString strValue);
- QString getGconfValueString(QString strKey);
-
- void setGconfValueBoolean(QString strKey,bool boolValue);
- bool getGconfValueBoolean(QString strKey);
-
- void setGconfValueInteger(QString strKey,int intValue);
- int getGconfValueInteger(QString strKey);
-
-private:
- GConfClient *gconfClient;
-};
-
-#endif // GCONFUTILITY_H
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "telepathyutility.h"
-#include "accountmanagerproxy.h"
-#include "accountproxy.h"
-#include "accountcompatproxy.h"
-#include "connifacereqproxy.h"
-#include <QDBusInterface>
-#include <QDBusConnection>
-#include <QStringList>
-#include <QDBusPendingReply>
-#include <QDBusObjectPath>
-#include <QDebug>
-
-using namespace org::freedesktop::Telepathy;
-
-TelepathyUtility::TelepathyUtility(QObject *parent) :
- QObject(parent)
-{
-}
-
-TelepathyUtility::~TelepathyUtility(){
-
-}
-
-//Get a list of all Telepathy accounts
-QList<QDBusObjectPath> TelepathyUtility::getAllAccounts(){
-
- QList<QDBusObjectPath> objPathList;
-
- QDBusInterface *iface = new QDBusInterface(AM_SERVICE,AM_OBJ_PATH,DBUS_PROPS_IFACE,QDBusConnection::sessionBus(),this);
- if (iface->isValid()){
- QDBusReply<QDBusVariant> 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<QDBusArgument>();
-
- 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 "<<reply.error();
- }
- }
- else{
- qDebug() << "Error occurred while connecting to DBus interface";
- }
-
- return objPathList;
-
-}
-
-//Check if Vicar telepathy account exists
-bool TelepathyUtility::accountExists(){
- bool vicarAccountExists = false;
- QList<QDBusObjectPath> 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<QDBusObjectPath> 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 during installation)
-bool TelepathyUtility::createAccount(){
-
- AccountManagerProxy *amProxy = new AccountManagerProxy(AM_SERVICE,AM_OBJ_PATH,QDBusConnection::sessionBus(),this);
-
- QMap<QString,QVariant> connectionParametersMap;
- connectionParametersMap.insert("account","vicar");
-
- QList<QVariant> presenceDetails;
- uint presenceType(2); //Available = 2
- presenceDetails << presenceType;
- presenceDetails << "online";
- presenceDetails << "Available";
-
- SimplePresence presence;
- presence.type = presenceType;
- presence.status = "online";
- presence.statusMessage = "Available";
-
- QMap<QString,QVariant> 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<QDBusObjectPath> 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 "<<dbusReply.error();
- return false;
- }
- }
- }
- else{
- qDebug() << "Error creating VICaR telepathy account "<<reply.error();
- return false;
- }
-
- return true;
-}
-
-//Delete Vicar telepathy account (used during uninstallation)
-bool TelepathyUtility::deleteAccount(){
-
- QList<QDBusObjectPath> 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 "<<dbusReply.error();
- return false;
- }
- else{
- qDebug() <<"VICaR account deleted";
- }
- }
- }
- }
-
- return true;
-}
-
-bool TelepathyUtility::callNumberWithRing(QString number){
-
- bool result = false;
-
- ConnectionInterfaceRequestsProxy *requestsProxy = new ConnectionInterfaceRequestsProxy(RING_CONN_SERVICE,RING_CONN_PATH,QDBusConnection::sessionBus(),this);
- if (requestsProxy->isValid()){
- QVariantMap channelRequestDetails;
- uint targetHandleType(1);
- channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.TargetHandleType",targetHandleType);
- channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.TargetID",number);
- channelRequestDetails.insert("org.freedesktop.Telepathy.Channel.ChannelType","org.freedesktop.Telepathy.Channel.Type.StreamedMedia");
- QDBusPendingReply<QDBusObjectPath,QVariantMap> dbusReply = requestsProxy->CreateChannel(channelRequestDetails);
- dbusReply.waitForFinished();
- if (!dbusReply.isError()){
- QDBusObjectPath objPath = dbusReply.argumentAt<0>();
- QVariantMap channelProperties = dbusReply.argumentAt<1>();
- result = true;
- }
- else{
- qDebug() << "Error occurred calling "<<number<< ". Error is "<< dbusReply.error();
- result = false;
- }
- }
-
- return result;
-}
-
-bool TelepathyUtility::sendDTMFTone(QString tone){
- bool result = false;
-
- return result;
-}
-
-// Marshall the Presence data into a D-Bus argument
- QDBusArgument &operator<<(QDBusArgument &argument, const SimplePresence &simplePresence)
- {
- argument.beginStructure();
- argument << simplePresence.type << simplePresence.status << simplePresence.statusMessage;
- argument.endStructure();
- return argument;
- }
-
- // Retrieve the Presence data from the D-Bus argument
- const QDBusArgument &operator>>(const QDBusArgument &argument, SimplePresence &simplePresence)
- {
- argument.beginStructure();
- argument >> simplePresence.type >> simplePresence.status >> simplePresence.statusMessage;
- argument.endStructure();
- return argument;
- }
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#ifndef TELEPATHYUTILITY_H
-#define TELEPATHYUTILITY_H
-
-#include <QObject>
-#include <QDBusObjectPath>
-#include <QDBusArgument>
-
-
-#define AM_SERVICE "org.freedesktop.Telepathy.AccountManager"
-#define AM_OBJ_PATH "/org/freedesktop/Telepathy/AccountManager"
-#define AM_INTERFACE "org.freedesktop.Telepathy.AccountManager"
-#define RING_CONN_SERVICE "org.freedesktop.Telepathy.Connection.ring.tel.ring"
-#define RING_CONN_PATH "/org/freedesktop/Telepathy/Connection/ring/tel/ring"
-#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<QDBusObjectPath> getAllAccounts();
- QString getAccountStatus();
- bool accountExists();
- bool createAccount();
- bool deleteAccount();
- bool callNumberWithRing(QString number);
- bool sendDTMFTone(QString tone);
-};
-
-#endif // TELEPATHYUTILITY_H
+++ /dev/null
-#ifndef VICARPROFILETYPES_H
-#define VICARPROFILETYPES_H
-
-#include <QString>
-#include <QList>
-#include <QMetaType>
-
-namespace org {
-namespace maemo {
-namespace vicar {
-
-class Profile
-{
-public:
- uint profileID;
- QString phoneNumberPattern;
- QString gatewayNumber;
- QString dtmfFormat;
- QString dtmfPrefix;
- QString dtmfSuffix;
-};
-typedef QList<Profile> ProfileList;
-
-} // namespace vicar
-} // namespace maemo
-} // namespace org
-
-Q_DECLARE_METATYPE(org::maemo::vicar::Profile)
-Q_DECLARE_METATYPE(org::maemo::vicar::ProfileList)
-
-#endif // VICARPROFILETYPES_H
-INCLUDEPATH += /usr/include/gconf/2 \
- /usr/include/glib-2.0 \
- /usr/lib/glib-2.0/include
-#QMAKE_LIBDIR=./
-LIBS += /usr/lib/libgconf-2.so
-CONFIG += qt debug staticlib
+CONFIG += link_pkgconfig
+PKGCONFIG += glib-2.0 gconf-2.0
+
+contains(MEEGO_EDITION,harmattan){
+ DEFINES += Q_WS_MAEMO_6
+ PKGCONFIG += accounts-qt
+}
+
+CONFIG += qt debug staticlib core xml
CONFIG -= gui
QT += dbus sql
QT -= gui
+
TARGET = vicar
TEMPLATE = lib
-VPATH += src
-MOC_DIR = mocs
-OBJECTS_DIR = objs
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
DESTDIR = ../lib
-SOURCES += src/dbusutility.cpp \
- src/gconfutility.cpp \
- src/telepathyutility.cpp \
- src/accountmanagerproxy.cpp \
- src/accountproxy.cpp \
- src/accountcompatproxy.cpp \
- src/connifacereqproxy.cpp \
- src/connectioninterfacerequeststypes.cpp \
- src/databaseutility.cpp
-HEADERS += src/dbusutility.h \
- src/gconfutility.h \
- src/telepathyutility.h \
- src/accountmanagerproxy.h \
- src/accountproxy.h \
- src/accountcompatproxy.h \
- src/connifacereqproxy.h \
- src/connectioninterfacerequeststypes.h \
- src/databaseutility.h \
- src/vicarprofiletypes.h
-
-#MAKE INSTALL
-INSTALLDIR = /../../debian/vicar
+SOURCES += cpp/dbusutility.cpp \
+ cpp/gconfutility.cpp \
+ cpp/telepathyutility.cpp \
+ cpp/accountmanagerproxy.cpp \
+ cpp/accountproxy.cpp \
+ cpp/accountcompatproxy.cpp \
+ cpp/connifacereqproxy.cpp \
+ cpp/connectioninterfacerequeststypes.cpp \
+ cpp/databaseutility.cpp \
+ cpp/harmattanaccountutility.cpp
+HEADERS += cpp/dbusutility.h \
+ cpp/gconfutility.h \
+ cpp/telepathyutility.h \
+ cpp/accountmanagerproxy.h \
+ cpp/accountproxy.h \
+ cpp/accountcompatproxy.h \
+ cpp/connifacereqproxy.h \
+ cpp/connectioninterfacerequeststypes.h \
+ cpp/databaseutility.h \
+ cpp/vicarprofiletypes.h \
+ cpp/logutility.h \
+ cpp/harmattanaccountutility.h
INSTALLS += target
+target.path =/opt/vicar/lib
-target.path =$$INSTALLDIR/opt/lib
--- /dev/null
+/*
+ * QtTelepathy, the Tapioca Qt4 Telepathy Client Library
+ * Copyright (C) 2006 by Tobias Hunger <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QVariant>
+#include <QtCore/QVariantMap>
+
+Q_DECLARE_METATYPE(QList<uint>)
+Q_DECLARE_METATYPE(QVariantMap)
+
+#endif
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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 Street, 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 <logutility.h>
+
+#include <QtCore/QDebug>
+#include <QtCore/QCoreApplication>
+#include <QtCore/QVariantMap>
+#include <QDBusMessage>
+#include <QDBusReply>
+
+
+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)),
+ logUtility(new LogUtility("/var/log/vicar/vicar.log",p)),
+ parent(p)
+ {
+ Q_ASSERT(0 != adaptor);
+ }
+
+ ~ConnectionPrivate()
+ {
+ qDebug() << "VICaR Connection: Connection Destructing";
+ }
+
+ const QString account;
+
+ Connection::Status connection_status;
+ ConnectionAdaptor * adaptor;
+ ConnectionInterfaceRequestsAdaptor * connIfaceReqsAdaptor;
+ LogUtility * const logUtility;
+ Connection * const parent;
+};
+
+// ---------------------------------------------------------------------------
+
+Connection::Connection(const QString & account,
+ QObject * parent) :
+ QObject(parent),
+ d(new ConnectionPrivate(this, account))
+{
+
+ QString strMessage;
+ strMessage = "DEBUG: In Connection Constructor";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ 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 Dynamic property "HasImmortalHandles" to true as per telepathy Connection spec 0.21.6
+ //The handles for vicar connection are expected to last throughout the lifetime of the connection
+ this->setProperty("HasImmortalHandles",true);
+
+ this->setProperty("Status",org::freedesktop::Telepathy::CONNECTION_STATUS_CONNECTED);
+ this->setProperty("SelfHandle",org::freedesktop::Telepathy::HANDLE_TYPE_CONTACT);
+
+ //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));
+
+ //Set the property Channels
+ org::freedesktop::Telepathy::ChannelDetailsList channelDetails;
+ this->setProperty("Channels",QVariant::fromValue(channelDetails));
+
+ //Set the connection status to Connected (default for Vicar)
+ d->connection_status = Connection::Connected;
+
+
+ strMessage = "VICaR Connection: Connection set up.";
+
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+}
+
+Connection::~Connection()
+{
+ qDebug() << "VICaR Connection: Connection closed.";
+ delete(d);
+}
+
+bool Connection::registerObject()
+{
+ QString strMessage;
+
+ if (!QDBusConnection::sessionBus().interface()->isServiceRegistered(serviceName())){
+ if (!QDBusConnection::sessionBus().registerService(serviceName()))
+ {
+ strMessage = "VICaR Connection: Problem registering connection service:" + serviceName();
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return false;
+ }
+
+ if (!QDBusConnection::sessionBus().registerObject(objectPath().path(),
+ this))
+ {
+ strMessage = "VICaR Connection: Problem registering object path:" + objectPath().path();
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return false;
+ }
+ }
+ else{
+ strMessage = "VICaR Connection: " + serviceName()+" is already registered on DBus";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ }
+ return true;
+}
+
+void Connection::unregisterObject()
+{
+ QString strMessage = "VICaR Connection: Unregistering Connection object from DBus";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ 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.
+ */
+ QString strMessage = "VICaR Connection: Changing status to Connected...";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ d->connection_status = Connection::Connected;
+
+ //Let all the Telepathy clients know that connection status has changed
+ strMessage = "VICaR Connection: Emitting StatusChanged.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ emit StatusChanged(d->connection_status, ReasonRequested);
+}
+
+void Connection::Disconnect()
+{
+ QString strMessage = "VICaR Connection: Changing status to Disconnected...";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ //We don't have any Handles to release here. So just change the status to Disconnected
+ d->connection_status = Connection::Disconnected;
+
+ strMessage = "VICaR Connection: Emitting StatusChanged";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ 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 <<requests_interface;
+ return result;
+}
+
+QString Connection::GetProtocol()
+{ return protocol_vicar; }
+
+uint Connection::GetStatus()
+{ return static_cast<uint>(d->connection_status); }
+
+uint Connection::GetSelfHandle()
+{
+ QString strMessage = "VICaR Connection: GetSelfHandle";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ if (d->connection_status != Connected)
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
+ "VICaR - Unable to get Self Handle. The connection is no longer available.");
+ strMessage = "VICaR Connection: NOT CONNECTED when requesting selfhandle!";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return 0;
+ }
+
+ //WARNING: Incomplete implemenation
+ uint handle = 0;
+ strMessage = "VICaR Connection: Returning Handle " + QString(handle) + "as self handle.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return handle;
+}
+
+QList<uint> Connection::RequestHandles(uint handle_type,
+ const QStringList & names)
+{
+ Q_UNUSED(names);
+ QList<uint> 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<uint> &handles)
+{
+ Q_UNUSED(handles);
+ QString strMessage = "VICaR Connection: HoldHandles.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ if (d->connection_status != Connected)
+ {
+
+ strMessage = "VICaR Connection: HoldHandles - Not Connected.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
+ "VICaR - Unable to process handle request. The connection is no longer available.");
+ return;
+ }
+ if (handle_type != HandleContact)
+ {
+
+ strMessage = "VICaR Connection: HoldHandles - Invalid Handle Type.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ 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<uint> &handles)
+{
+ Q_UNUSED(handles);
+ QStringList handlesList;
+
+ QString strMessage = "VICaR Connection: InspectHandles.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ // 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 handlesList;
+ }
+ if (handle_type != HandleContact)
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+ "VICaR - Supports handles of type Contact only.");
+ return handlesList;
+ }
+
+ uint handle = 0;
+ for (int i = 0 ; i < handles.length(); i++) {
+ handle = handles.at(i);
+ strMessage = "VICaR Connection: Inspecting handle "+QString(handle);
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ handlesList.append(QString(handle));
+ }
+
+ //WARNING: Incomplete implementation
+ return handlesList;
+}
+
+void Connection::ReleaseHandles(const uint handle_type, const QList<uint> &handles)
+{
+ Q_UNUSED(handles);
+ QString strMessage;
+ if (d->connection_status != Connected)
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
+ "VICaR - Unable to release handle. The connection is no longer available.");
+ strMessage = "VICaR Connection: Releasing Handle while connection is no longer connected.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return;
+ }
+ if (handle_type != HandleContact)
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+ "VICaR - Supports handles of type Contact only.");
+ strMessage = "VICaR Connection: Trying to release a Handle that is not a contact.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ 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 Connection: Failed to create channel: Channel type not implemented.");
+ return QDBusObjectPath();
+ }
+
+ if (handle_type != HandleContact )
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidHandle",
+ "VICaR Connection: Failed to create channel: Handle type not supported.");
+ return QDBusObjectPath();
+ }
+
+ if (d->connection_status != Connected)
+ {
+ sendErrorReply("org.freedesktop.Telepathy.Error.Disconnected",
+ "VICaR Connection: Failed to create channel: Connection is Disconnected.");
+ return QDBusObjectPath();
+ }
+
+ //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());
+ QString strMessage;
+ strMessage = "VICaR Connection: CreateChannel";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ 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());
+ QString strMessage = "VICaR Connection: EnsureChannel";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ qDebug() << " Request details are: "<< request;
+
+ //WARNING: Incomplete implementation
+ processChannel(request);
+
+ return true;
+}
+
+QDBusObjectPath Connection::processChannel(const QVariantMap &request){
+
+ QString strMessage = "VICaR Connection: ProcessChannel";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ 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;
+ }
+ else if (strNumber == "publish" || strNumber == "subscribe"){
+ //Deny the persistent Mission control requests to publish and subscribe
+ QString strError = "VICaR - Invalid request. " + strNumber + " is not supported.";
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+ strError);
+ return channel_path;
+
+ }
+
+ //Only allow requests with handle type as contact
+ QVariant vTargetHandleType = request.value("org.freedesktop.Telepathy.Channel.TargetHandleType");
+ uint intTargetHandleType = vTargetHandleType.toUInt();
+ if (intTargetHandleType != HandleContact)
+ {
+ strMessage = "VICaR - Supports handles of type Contact only. Recieved handle type ";
+ strMessage.append(vTargetHandleType.toString());
+
+ sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
+ strMessage);
+ 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);
+
+ strMessage = "VICaR Connection: Call is processed.";
+
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ return channel_path;
+}
+
+
+void Connection::AddClientInterest(const QStringList &tokens){
+ //WARNING: Incomplete implementation
+ Q_UNUSED(tokens);
+ QString strMessage;
+
+ strMessage = "VICaR Connection: AddClientInterest";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+}
+
+void Connection::RemoveClientInterest(const QStringList &tokens){
+ //WARNING: Incomplete implementation
+ Q_UNUSED(tokens);
+ QString strMessage;
+
+ strMessage = "VICaR Connection: RemoveClientInterest";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+}
+
+//org.freedesktop.Telepathy.Connection.Interface.Capabilities
+org::freedesktop::Telepathy::ContactCapabilitiesList Connection::GetCapabilities(const QList<uint> &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;
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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 <QtDBus/QDBusContext>
+#include <QtDBus/QtDBus>
+
+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<uint> RequestHandles(const uint handle_type, const QStringList &names);
+ void HoldHandles(const uint handle_type, const QList<uint> &handles);
+ QStringList InspectHandles(const uint handle_type, const QList<uint> &handles);
+ void ReleaseHandles(const uint handle_type, const QList<uint> &handles);
+
+ org::freedesktop::Telepathy::ChannelInfoList ListChannels();
+ QDBusObjectPath RequestChannel(const QString &type,
+ uint handle_type, uint handle,
+ bool suppress_handler);
+
+ //New methods added in Telepathy specification 0.21.3
+ void AddClientInterest(const QStringList &tokens);
+ void RemoveClientInterest(const QStringList &tokens);
+
+
+ //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<uint> &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);
+ //New signals added in Telepathy specification 0.17.10
+ void SelfHandleChanged(uint handle);
+ void ConnectionError(const QString & error, QVariantMap errorDetails);
+
+
+ //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
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -i vicar-telepathy/cpp/connectiontypes.h -c ConnectionAdaptor -a connectionadaptor.h:connectionadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2011 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 "connectionadaptor.h"
+#include <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class ConnectionAdaptor
+ */
+
+ConnectionAdaptor::ConnectionAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+ConnectionAdaptor::~ConnectionAdaptor()
+{
+ // destructor
+}
+
+bool ConnectionAdaptor::hasImmortalHandles() const
+{
+ // get the value of property HasImmortalHandles
+ return qvariant_cast< bool >(parent()->property("HasImmortalHandles"));
+}
+
+QStringList ConnectionAdaptor::interfaces() const
+{
+ // get the value of property Interfaces
+ return qvariant_cast< QStringList >(parent()->property("Interfaces"));
+}
+
+uint ConnectionAdaptor::selfHandle() const
+{
+ // get the value of property SelfHandle
+ return qvariant_cast< uint >(parent()->property("SelfHandle"));
+}
+
+uint ConnectionAdaptor::status() const
+{
+ // get the value of property Status
+ return qvariant_cast< uint >(parent()->property("Status"));
+}
+
+void ConnectionAdaptor::AddClientInterest(const QStringList &tokens)
+{
+ // handle method call org.freedesktop.Telepathy.Connection.AddClientInterest
+ QMetaObject::invokeMethod(parent(), "AddClientInterest", Q_ARG(QStringList, tokens));
+}
+
+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<uint> &handles)
+{
+ // handle method call org.freedesktop.Telepathy.Connection.HoldHandles
+ QMetaObject::invokeMethod(parent(), "HoldHandles", Q_ARG(uint, handle_type), Q_ARG(QList<uint>, handles));
+}
+
+QStringList ConnectionAdaptor::InspectHandles(uint handle_type, const QList<uint> &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<uint>, 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<uint> &handles)
+{
+ // handle method call org.freedesktop.Telepathy.Connection.ReleaseHandles
+ QMetaObject::invokeMethod(parent(), "ReleaseHandles", Q_ARG(uint, handle_type), Q_ARG(QList<uint>, handles));
+}
+
+void ConnectionAdaptor::RemoveClientInterest(const QStringList &tokens)
+{
+ // handle method call org.freedesktop.Telepathy.Connection.RemoveClientInterest
+ QMetaObject::invokeMethod(parent(), "RemoveClientInterest", Q_ARG(QStringList, tokens));
+}
+
+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<uint> ConnectionAdaptor::RequestHandles(uint handle_type, const QStringList &names)
+{
+ // handle method call org.freedesktop.Telepathy.Connection.RequestHandles
+ QList<uint> out0;
+ QMetaObject::invokeMethod(parent(), "RequestHandles", Q_RETURN_ARG(QList<uint>, out0), Q_ARG(uint, handle_type), Q_ARG(QStringList, names));
+ return out0;
+}
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -i vicar-telepathy/cpp/connectiontypes.h -c ConnectionAdaptor -a connectionadaptor.h:connectionadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2011 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 CONNECTIONADAPTOR_H_1318911911
+#define CONNECTIONADAPTOR_H_1318911911
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "connectiontypes.h"
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> 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", ""
+" <interface name=\"org.freedesktop.Telepathy.Connection\">\n"
+" <property access=\"read\" type=\"as\" name=\"Interfaces\"/>\n"
+" <property access=\"read\" type=\"b\" name=\"HasImmortalHandles\"/>\n"
+" <property access=\"read\" type=\"u\" name=\"Status\"/>\n"
+" <property access=\"read\" type=\"u\" name=\"SelfHandle\"/>\n"
+" <method name=\"Connect\"/>\n"
+" <method name=\"Disconnect\"/>\n"
+" <method name=\"GetInterfaces\">\n"
+" <arg direction=\"out\" type=\"as\"/>\n"
+" </method>\n"
+" <method name=\"GetProtocol\">\n"
+" <arg direction=\"out\" type=\"s\"/>\n"
+" </method>\n"
+" <method name=\"GetSelfHandle\">\n"
+" <arg direction=\"out\" type=\"u\"/>\n"
+" </method>\n"
+" <method name=\"GetStatus\">\n"
+" <arg direction=\"out\" type=\"u\"/>\n"
+" </method>\n"
+" <method name=\"HoldHandles\">\n"
+" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle_type\"/>\n"
+" <arg direction=\"in\" type=\"au\" name=\"handles\"/>\n"
+" </method>\n"
+" <method name=\"InspectHandles\">\n"
+" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle_type\"/>\n"
+" <arg direction=\"in\" type=\"au\" name=\"handles\"/>\n"
+" <arg direction=\"out\" type=\"as\"/>\n"
+" </method>\n"
+" <method name=\"ListChannels\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::ChannelInfoList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
+" <arg direction=\"out\" type=\"a(osuu)\"/>\n"
+" </method>\n"
+" <method name=\"ReleaseHandles\">\n"
+" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle_type\"/>\n"
+" <arg direction=\"in\" type=\"au\" name=\"handles\"/>\n"
+" </method>\n"
+" <method name=\"RequestChannel\">\n"
+" <arg direction=\"in\" type=\"s\" name=\"type\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle_type\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle\"/>\n"
+" <arg direction=\"in\" type=\"b\" name=\"suppress_handler\"/>\n"
+" <arg direction=\"out\" type=\"o\"/>\n"
+" </method>\n"
+" <method name=\"RequestHandles\">\n"
+" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
+" <arg direction=\"in\" type=\"u\" name=\"handle_type\"/>\n"
+" <arg direction=\"in\" type=\"as\" name=\"names\"/>\n"
+" <arg direction=\"out\" type=\"au\"/>\n"
+" </method>\n"
+" <method name=\"AddClientInterest\">\n"
+" <arg direction=\"in\" type=\"as\" name=\"tokens\"/>\n"
+" </method>\n"
+" <method name=\"RemoveClientInterest\">\n"
+" <arg direction=\"in\" type=\"as\" name=\"tokens\"/>\n"
+" </method>\n"
+" <signal name=\"NewChannel\">\n"
+" <arg type=\"o\" name=\"object_path\"/>\n"
+" <arg type=\"s\" name=\"channel_type\"/>\n"
+" <arg type=\"u\" name=\"handle_type\"/>\n"
+" <arg type=\"u\" name=\"handle\"/>\n"
+" <arg type=\"b\" name=\"suppress_handler\"/>\n"
+" </signal>\n"
+" <signal name=\"StatusChanged\">\n"
+" <arg type=\"u\" name=\"status\"/>\n"
+" <arg type=\"u\" name=\"reason\"/>\n"
+" </signal>\n"
+" <signal name=\"ConnectionError\">\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In1\"/>\n"
+" <arg type=\"s\" name=\"error\"/>\n"
+" <arg type=\"a{sv}\" name=\"error_details\"/>\n"
+" </signal>\n"
+" <signal name=\"SelfHandleChanged\">\n"
+" <arg type=\"u\"/>\n"
+" </signal>\n"
+" </interface>\n"
+ "")
+public:
+ ConnectionAdaptor(QObject *parent);
+ virtual ~ConnectionAdaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(bool HasImmortalHandles READ hasImmortalHandles)
+ bool hasImmortalHandles() const;
+
+ Q_PROPERTY(QStringList Interfaces READ interfaces)
+ QStringList interfaces() const;
+
+ Q_PROPERTY(uint SelfHandle READ selfHandle)
+ uint selfHandle() const;
+
+ Q_PROPERTY(uint Status READ status)
+ uint status() const;
+
+public Q_SLOTS: // METHODS
+ void AddClientInterest(const QStringList &tokens);
+ void Connect();
+ void Disconnect();
+ QStringList GetInterfaces();
+ QString GetProtocol();
+ uint GetSelfHandle();
+ uint GetStatus();
+ void HoldHandles(uint handle_type, const QList<uint> &handles);
+ QStringList InspectHandles(uint handle_type, const QList<uint> &handles);
+ org::freedesktop::Telepathy::ChannelInfoList ListChannels();
+ void ReleaseHandles(uint handle_type, const QList<uint> &handles);
+ void RemoveClientInterest(const QStringList &tokens);
+ QDBusObjectPath RequestChannel(const QString &type, uint handle_type, uint handle, bool suppress_handler);
+ QList<uint> RequestHandles(uint handle_type, const QStringList &names);
+Q_SIGNALS: // SIGNALS
+ void ConnectionError(const QString &error, const QVariantMap &error_details);
+ void NewChannel(const QDBusObjectPath &object_path, const QString &channel_type, uint handle_type, uint handle, bool suppress_handler);
+ void SelfHandleChanged(uint in0);
+ void StatusChanged(uint status, uint reason);
+};
+
+#endif
--- /dev/null
+/*
+ * 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 <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * 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<uint> &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<uint>, Handles));
+ return Contact_Capabilities;
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "connectioninterfacecapabilitiestypes.h"
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> 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", ""
+" <interface name=\"org.freedesktop.Telepathy.Connection.Interface.Capabilities\">\n"
+" <method name=\"GetCapabilities\">\n"
+" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <annotation value=\"org::freedesktop::Telepathy::ContactCapabilitiesList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
+" <arg direction=\"in\" type=\"au\" name=\"Handles\"/>\n"
+" <arg direction=\"out\" type=\"a(usuu)\" name=\"Contact_Capabilities\"/>\n"
+" </method>\n"
+" <method name=\"AdvertiseCapabilities\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::CapabilityPairList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <annotation value=\"org::freedesktop::Telepathy::CapabilityPairList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
+" <arg direction=\"in\" type=\"a(su)\" name=\"Add\"/>\n"
+" <arg direction=\"in\" type=\"as\" name=\"Remove\"/>\n"
+" <arg direction=\"out\" type=\"a(su)\" name=\"Self_Capabilities\"/>\n"
+" </method>\n"
+" <signal name=\"CapabilitiesChanged\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::CapabilityChangeList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <arg type=\"a(usuuuu)\"/>\n"
+" </signal>\n"
+" </interface>\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<uint> &Handles);
+Q_SIGNALS: // SIGNALS
+ void CapabilitiesChanged(org::freedesktop::Telepathy::CapabilityChangeList in0);
+};
+
+#endif
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <andre.magalhaes@indt.org>
+ *
+ * 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();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QList>
+#include <QtCore/QDebug>
+#include <QtCore/QVariantMap>
+#include <QtDBus/QDBusArgument>
+#include <QtDBus/QDBusObjectPath>
+
+namespace org {
+namespace freedesktop {
+namespace Telepathy {
+
+class ContactCapabilities
+{
+public:
+ uint handle;
+ QString channelType;
+ uint genericCapabilityFlags;
+ uint typeSpecificFlags;
+};
+typedef QList<ContactCapabilities> ContactCapabilitiesList;
+
+class CapabilityPair
+{
+public:
+ QString channelType;
+ uint typeSpecificFlags;
+};
+typedef QList<CapabilityPair> CapabilityPairList;
+
+class CapabilityChange
+{
+public:
+ uint handle;
+ QString channelType;
+ uint oldGenericFlags;
+ uint newGenericFlags;
+ uint oldTypeSpecificFlags;
+ uint newTypeSpecificFlags;
+};
+typedef QList<CapabilityChange> 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
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -i vicar-telepathy/cpp/connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a connectioninterfacerequestsadaptor.h:connectioninterfacerequestsadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2011 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 <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+
+/*
+ * Implementation of adaptor class ConnectionInterfaceRequestsAdaptor
+ */
+
+ConnectionInterfaceRequestsAdaptor::ConnectionInterfaceRequestsAdaptor(QObject *parent)
+ : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+ConnectionInterfaceRequestsAdaptor::~ConnectionInterfaceRequestsAdaptor()
+{
+ // destructor
+}
+
+org::freedesktop::Telepathy::ChannelDetailsList ConnectionInterfaceRequestsAdaptor::channels() const
+{
+ // get the value of property Channels
+ return qvariant_cast< org::freedesktop::Telepathy::ChannelDetailsList >(parent()->property("Channels"));
+}
+
+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<YourObjectType *>(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<YourObjectType *>(parent())->EnsureChannel(request, channel_object, channel_properties);
+}
+
--- /dev/null
+/*
+ * This file was generated by qdbusxml2cpp version 0.7
+ * Command line was: qdbusxml2cpp -i vicar-telepathy/cpp/connectioninterfacerequeststypes.h -c ConnectionInterfaceRequestsAdaptor -a connectioninterfacerequestsadaptor.h:connectioninterfacerequestsadaptor.cpp data/xml/org.freedesktop.Telepathy.Connection.I.Requests.xml
+ *
+ * qdbusxml2cpp is Copyright (C) 2011 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_1318919889
+#define CONNECTIONINTERFACEREQUESTSADAPTOR_H_1318919889
+
+#include <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "connectioninterfacerequeststypes.h"
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> 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", ""
+" <interface name=\"org.freedesktop.Telepathy.Connection.Interface.Requests\">\n"
+" <property access=\"read\" type=\"(a{sv}as)\" name=\"RequestableChannelClasses\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::RequestableChannelClassList\" name=\"com.trolltech.QtDBus.QtTypeName\"/>\n"
+" </property>\n"
+" <property access=\"read\" type=\"a(oa{sv})\" name=\"Channels\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::ChannelDetailsList\" name=\"com.trolltech.QtDBus.QtTypeName\"/>\n"
+" </property>\n"
+" <method name=\"CreateChannel\">\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out1\"/>\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"request\"/>\n"
+" <arg direction=\"out\" type=\"o\" name=\"channel_object\"/>\n"
+" <arg direction=\"out\" type=\"a{sv}\" name=\"channel_properties\"/>\n"
+" </method>\n"
+" <method name=\"EnsureChannel\">\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out2\"/>\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"request\"/>\n"
+" <arg direction=\"out\" type=\"b\" name=\"yours\"/>\n"
+" <arg direction=\"out\" type=\"o\" name=\"channel_object\"/>\n"
+" <arg direction=\"out\" type=\"a{sv}\" name=\"channel_properties\"/>\n"
+" </method>\n"
+" <signal name=\"NewChannels\">\n"
+" <annotation value=\"org::freedesktop::Telepathy::ChannelDetailsList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
+" <arg type=\"a(oa{sv})\" name=\"new_channels\"/>\n"
+" </signal>\n"
+" <signal name=\"ChannelClosed\">\n"
+" <arg type=\"o\" name=\"removed_channel_object\"/>\n"
+" </signal>\n"
+" </interface>\n"
+ "")
+public:
+ ConnectionInterfaceRequestsAdaptor(QObject *parent);
+ virtual ~ConnectionInterfaceRequestsAdaptor();
+
+public: // PROPERTIES
+ Q_PROPERTY(org::freedesktop::Telepathy::ChannelDetailsList Channels READ channels)
+ org::freedesktop::Telepathy::ChannelDetailsList channels() const;
+
+ 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
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <andre.magalhaes@indt.org>
+ *
+ * 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();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QList>
+#include <QtCore/QDebug>
+#include <QtCore/QVariantMap>
+#include <QtDBus/QDBusArgument>
+#include <QtDBus/QDBusObjectPath>
+
+namespace org {
+namespace freedesktop {
+namespace Telepathy {
+
+class ChannelDetails
+{
+public:
+ QDBusObjectPath channel;
+ QVariantMap properties;
+};
+typedef QList<ChannelDetails> ChannelDetailsList;
+
+class RequestableChannelClass
+{
+public:
+ QVariantMap fixedProperties;
+ QStringList allowedProperties;
+};
+typedef QList<RequestableChannelClass> 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
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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 <logutility.h>
+
+#include <QtCore/QDebug>
+
+namespace
+{
+static const QString protocol_name("tel");
+}
+
+class ConnectionManagerPrivate
+{
+public:
+ ConnectionManagerPrivate(ConnectionManager * parent) :
+ adaptor(new ConnectionManagerAdaptor(parent)),
+ logUtility(new LogUtility("/var/log/vicar/vicar.log",parent))
+ {
+ Q_ASSERT(0 != adaptor);
+ activeConnection = 0;
+ }
+
+ ~ConnectionManagerPrivate() { delete(adaptor);}
+ ConnectionManagerAdaptor * const adaptor;
+ LogUtility * const logUtility;
+ Connection * activeConnection;
+};
+
+// ---------------------------------------------------------------------------
+
+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)
+{
+
+ QString strMessage;
+ Q_ASSERT(!proto.isEmpty());
+ Q_UNUSED(proto);
+ strMessage = "VICAR: ConnectionManager::GetParameters(const QString &prot)";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ org::freedesktop::Telepathy::ParameterDefinitionList result;
+ org::freedesktop::Telepathy::ParameterDefinition param;
+
+ //TODO - Match the parameters with telepathy-ring?
+
+ // 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()
+{
+ QString strMessage = "VICaR ConnectionManager::ListProtocols()";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return QStringList(protocol_name);
+}
+
+QString ConnectionManager::RequestConnection(const QString & proto,
+ QVariantMap parameters,
+ QDBusObjectPath & object_path)
+{
+ QString strMessage = "VICaR CM: Connection Requested for protocol "+proto;
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ 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.");
+ */
+ strMessage = "VICaR CM::RequestConnection: proto mismatch.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return connection_service;
+ }
+ if (d->activeConnection != 0){
+ strMessage = "VICaR CM::RequestConnection: An active connection already exists at "+d->activeConnection->serviceName();
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ object_path = d->activeConnection->objectPath();
+ connection_service = d->activeConnection->serviceName();
+ //emit NewConnection(connection_service, object_path, "tel"); //Just in case, emit the NewConnection again
+ 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.");
+ */
+ strMessage = "VICaR CM::RequestConnection: invalid parameter" + param + "found.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ return connection_service;
+ }
+ }
+
+ strMessage = "DEBUG CM: Trying to create new connection with account "+account;
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ Connection * new_connection = new Connection(account, this);
+ Q_ASSERT(0 != new_connection);
+
+ strMessage = "DEBUG CM: Trying to register new connection";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ if (!new_connection->registerObject())
+ {
+ strMessage = "VICaR CM: Error while registering Connection object with DBus.";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+ new_connection->deleteLater();
+ return QString();
+ }
+
+ strMessage = "VICaR CM: New Connection Created. Status is " + QString(new_connection->GetStatus());
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+
+ object_path = new_connection->objectPath();
+ connection_service = new_connection->serviceName();
+
+ strMessage = "VICaR CM: Emitting New Connection Signal";
+ qDebug() << strMessage;
+ d->logUtility->logMessage(strMessage);
+
+ emit NewConnection(connection_service, object_path, "tel");
+
+ //Set ActiveConnection - We only need one active connection at a time
+ d->activeConnection = new_connection;
+ return new_connection->serviceName();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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 <QtDBus/QDBusContext>
+#include <QtDBus/QtDBus>
+
+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
--- /dev/null
+/*
+ * 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 <QtCore/QMetaObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtCore/QDebug>
+
+#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<ConnectionManager *>(parent())->RequestConnection(proto, parameters, object_path);
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtDBus/QtDBus>
+#include "connectionmanagertypes.h"
+class QByteArray;
+template<class T> class QList;
+template<class Key, class Value> 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", ""
+" <interface name=\"org.freedesktop.Telepathy.ConnectionManager\" >\n"
+" <method name=\"GetParameters\" >\n"
+" <annotation value=\"org::freedesktop::Telepathy::ParameterDefinitionList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\" />\n"
+" <arg direction=\"in\" type=\"s\" name=\"proto\" />\n"
+" <arg direction=\"out\" type=\"a(susv)\" />\n"
+" </method>\n"
+" <method name=\"ListProtocols\" >\n"
+" <arg direction=\"out\" type=\"as\" />\n"
+" </method>\n"
+" <method name=\"RequestConnection\" >\n"
+" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n"
+" <arg direction=\"in\" type=\"s\" name=\"proto\" />\n"
+" <arg direction=\"in\" type=\"a{sv}\" name=\"parameters\" />\n"
+" <arg direction=\"out\" type=\"s\" name=\"bus_name\" />\n"
+" <arg direction=\"out\" type=\"o\" name=\"object_path\" />\n"
+" </method>\n"
+" <signal name=\"NewConnection\" >\n"
+" <arg type=\"s\" name=\"bus_name\" />\n"
+" <arg type=\"o\" name=\"object_path\" />\n"
+" <arg type=\"s\" name=\"proto\" />\n"
+" </signal>\n"
+" </interface>\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
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <andre.magalhaes@indt.org>
+ *
+ * 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;
+}
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QFlag>
+#include <QtCore/QList>
+#include <QtCore/QString>
+#include <QtDBus/QDBusArgument>
+#include <QtDBus/QDBusVariant>
+
+namespace org {
+namespace freedesktop {
+namespace Telepathy {
+
+class ParameterDefinition
+{
+public:
+ QString name;
+ uint flags;
+ QString signature;
+ QDBusVariant defaultValue;
+};
+typedef QList<ParameterDefinition> 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
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <andre.magalhaes@indt.org>
+ *
+ * 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;
+}
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <tobias.hunger@basyskom.de>
+ * Copyright (C) 2006 by INdT
+ * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
+ *
+ * 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 <QtCore/QList>
+#include <QtCore/QString>
+#include <QtDBus/QDBusArgument>
+#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<ChannelInfo> 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
+
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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 <iostream>
+#include <fstream>
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDebug>
+
+#include <QtDBus/QDBusConnection>
+#include <QtDBus/QDBusMetaType>
+#include <QtDBus/QDBusInterface>
+#include <QDBusError>
+#include <QDateTime>
+
+#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<org::freedesktop::Telepathy::ParameterDefinition>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinitionList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfo>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfoList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilities>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilitiesList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPair>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPairList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChange>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChangeList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
+
+ QDBusConnection connection = QDBusConnection::sessionBus();
+
+ if (!connection.interface()->isServiceRegistered(cm_service_name))
+ {
+
+ // register CM on D-BUS:
+ bool success = connection.registerService(cm_service_name);
+ if (success){
+ qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Service %1 registered with session bus.").
+ arg(cm_service_name)));
+ }
+ else{
+
+ QDBusError error = connection.interface()->lastError();
+
+ qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register service %1 with session bus due to error %2.").
+ arg(cm_service_name,error.message())));
+ }
+
+ }
+
+ ConnectionManager connection_mgr(&app);
+ if (!connection.registerObject(cm_object_path,&connection_mgr)){
+ qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Unable to register VICaR connection manager at path %1 with session bus.").
+ arg(cm_object_path)));
+ }
+
+ qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Enternig main loop.")));
+ return app.exec();
+}
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@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 <info@basyskom.de>
+ *
+ * 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
--- /dev/null
+/*
+ * 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()
+{
+}
+
--- /dev/null
+/*
+ * 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 <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+
+/*
+ * 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<QString> callInternationalNumber(const QString &number)
+ {
+ QList<QVariant> argumentList;
+ argumentList << qVariantFromValue(number);
+ return asyncCallWithArgumentList(QLatin1String("callInternationalNumber"), argumentList);
+ }
+
+ inline QDBusPendingReply<bool> isRunning()
+ {
+ QList<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("isRunning"), argumentList);
+ }
+
+ inline QDBusPendingReply<bool> startOutgoingCallMonitor()
+ {
+ QList<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("startOutgoingCallMonitor"), argumentList);
+ }
+
+ inline QDBusPendingReply<bool> stopOutgoingCallMonitor()
+ {
+ QList<QVariant> argumentList;
+ return asyncCallWithArgumentList(QLatin1String("stopOutgoingCallMonitor"), argumentList);
+ }
+
+Q_SIGNALS: // SIGNALS
+};
+
+namespace org {
+ namespace maemo {
+ typedef ::VicarCallRouterProxy vicar;
+ }
+}
+#endif
+++ /dev/null
-/*
- * QtTelepathy, the Tapioca Qt4 Telepathy Client Library
- * Copyright (C) 2006 by Tobias Hunger <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QVariant>
-#include <QtCore/QVariantMap>
-
-Q_DECLARE_METATYPE(QList<uint>)
-Q_DECLARE_METATYPE(QVariantMap)
-
-#endif
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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 <QtCore/QDebug>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QVariantMap>
-#include <QDBusMessage>
-#include <QDBusReply>
-
-
-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 <<requests_interface;
- return result;
-}
-
-QString Connection::GetProtocol()
-{ return protocol_vicar; }
-
-uint Connection::GetStatus()
-{ return static_cast<uint>(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<uint> Connection::RequestHandles(uint handle_type,
- const QStringList & names)
-{
- Q_UNUSED(names);
- QList<uint> 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<uint> &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<uint> &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<uint> &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;
- }
- else if (strNumber == "publish" || strNumber == "subscribe"){
- //Deny the persistent Mission control requests to publish and subscribe
- QString strError = "VICaR - Invalid request. " + strNumber + " is not supported.";
- sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
- strError);
- return channel_path;
-
- }
-
- //Only allow requests with handle type as contact
- QVariant vTargetHandleType = request.value("org.freedesktop.Telepathy.Channel.TargetHandleType");
- uint intTargetHandleType = vTargetHandleType.toUInt();
- if (intTargetHandleType != HandleContact)
- {
- QString strMessage = "VICaR - Supports handles of type Contact only. Recieved handle type ";
- strMessage.append(vTargetHandleType.toString());
-
- sendErrorReply("org.freedesktop.Telepathy.Error.InvalidArgument",
- strMessage);
- 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<uint> &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;
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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 <QtDBus/QDBusContext>
-#include <QtDBus/QtDBus>
-
-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<uint> RequestHandles(const uint handle_type, const QStringList &names);
- void HoldHandles(const uint handle_type, const QList<uint> &handles);
- QStringList InspectHandles(const uint handle_type, const QList<uint> &handles);
- void ReleaseHandles(const uint handle_type, const QList<uint> &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<uint> &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
+++ /dev/null
-/*
- * 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 <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtCore/QDebug>
-
-/*
- * 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<uint> &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<uint>, handles));
-}
-
-QStringList ConnectionAdaptor::InspectHandles(uint handle_type, const QList<uint> &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<uint>, 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<uint> &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<uint>, 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<uint> ConnectionAdaptor::RequestHandles(uint handle_type, const QStringList &names)
-{
- // handle method call org.freedesktop.Telepathy.Connection.RequestHandles
- QList<uint> out0;
- QMetaObject::invokeMethod(parent(), "RequestHandles", Q_RETURN_ARG(QList<uint>, out0), Q_ARG(uint, handle_type), Q_ARG(QStringList, names));
- return out0;
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "connectiontypes.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> 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", ""
-" <interface name=\"org.freedesktop.Telepathy.Connection\" >\n"
-" <property access=\"read\" type=\"as\" name=\"Interfaces\"/>\n"
-" <method name=\"Connect\" />\n"
-" <method name=\"Disconnect\" />\n"
-" <method name=\"GetInterfaces\" >\n"
-" <arg direction=\"out\" type=\"as\" />\n"
-" </method>\n"
-" <method name=\"GetProtocol\" >\n"
-" <arg direction=\"out\" type=\"s\" />\n"
-" </method>\n"
-" <method name=\"GetSelfHandle\" >\n"
-" <arg direction=\"out\" type=\"u\" />\n"
-" </method>\n"
-" <method name=\"GetStatus\" >\n"
-" <arg direction=\"out\" type=\"u\" />\n"
-" </method>\n"
-" <method name=\"HoldHandles\" >\n"
-" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle_type\" />\n"
-" <arg direction=\"in\" type=\"au\" name=\"handles\" />\n"
-" </method>\n"
-" <method name=\"InspectHandles\" >\n"
-" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle_type\" />\n"
-" <arg direction=\"in\" type=\"au\" name=\"handles\" />\n"
-" <arg direction=\"out\" type=\"as\" />\n"
-" </method>\n"
-" <method name=\"ListChannels\" >\n"
-" <annotation value=\"org::freedesktop::Telepathy::ChannelInfoList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\" />\n"
-" <arg direction=\"out\" type=\"a(osuu)\" />\n"
-" </method>\n"
-" <method name=\"ReleaseHandles\" >\n"
-" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle_type\" />\n"
-" <arg direction=\"in\" type=\"au\" name=\"handles\" />\n"
-" </method>\n"
-" <method name=\"RequestChannel\" >\n"
-" <arg direction=\"in\" type=\"s\" name=\"type\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle_type\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle\" />\n"
-" <arg direction=\"in\" type=\"b\" name=\"suppress_handler\" />\n"
-" <arg direction=\"out\" type=\"o\" />\n"
-" </method>\n"
-" <method name=\"RequestHandles\" >\n"
-" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\" />\n"
-" <arg direction=\"in\" type=\"u\" name=\"handle_type\" />\n"
-" <arg direction=\"in\" type=\"as\" name=\"names\" />\n"
-" <arg direction=\"out\" type=\"au\" />\n"
-" </method>\n"
-" <signal name=\"NewChannel\" >\n"
-" <arg type=\"o\" name=\"object_path\" />\n"
-" <arg type=\"s\" name=\"channel_type\" />\n"
-" <arg type=\"u\" name=\"handle_type\" />\n"
-" <arg type=\"u\" name=\"handle\" />\n"
-" <arg type=\"b\" name=\"suppress_handler\" />\n"
-" </signal>\n"
-" <signal name=\"StatusChanged\" >\n"
-" <arg type=\"u\" name=\"status\" />\n"
-" <arg type=\"u\" name=\"reason\" />\n"
-" </signal>\n"
-" </interface>\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<uint> &handles);
- QStringList InspectHandles(uint handle_type, const QList<uint> &handles);
- org::freedesktop::Telepathy::ChannelInfoList ListChannels();
- void ReleaseHandles(uint handle_type, const QList<uint> &handles);
- QDBusObjectPath RequestChannel(const QString &type, uint handle_type, uint handle, bool suppress_handler);
- QList<uint> 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
+++ /dev/null
-/*
- * 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 <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * 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<uint> &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<uint>, Handles));
- return Contact_Capabilities;
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "connectioninterfacecapabilitiestypes.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> 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", ""
-" <interface name=\"org.freedesktop.Telepathy.Connection.Interface.Capabilities\">\n"
-" <method name=\"GetCapabilities\">\n"
-" <annotation value=\"QList<uint>\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <annotation value=\"org::freedesktop::Telepathy::ContactCapabilitiesList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"in\" type=\"au\" name=\"Handles\"/>\n"
-" <arg direction=\"out\" type=\"a(usuu)\" name=\"Contact_Capabilities\"/>\n"
-" </method>\n"
-" <method name=\"AdvertiseCapabilities\">\n"
-" <annotation value=\"org::freedesktop::Telepathy::CapabilityPairList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <annotation value=\"org::freedesktop::Telepathy::CapabilityPairList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\"/>\n"
-" <arg direction=\"in\" type=\"a(su)\" name=\"Add\"/>\n"
-" <arg direction=\"in\" type=\"as\" name=\"Remove\"/>\n"
-" <arg direction=\"out\" type=\"a(su)\" name=\"Self_Capabilities\"/>\n"
-" </method>\n"
-" <signal name=\"CapabilitiesChanged\">\n"
-" <annotation value=\"org::freedesktop::Telepathy::CapabilityChangeList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
-" <arg type=\"a(usuuuu)\"/>\n"
-" </signal>\n"
-" </interface>\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<uint> &Handles);
-Q_SIGNALS: // SIGNALS
- void CapabilitiesChanged(org::freedesktop::Telepathy::CapabilityChangeList in0);
-};
-
-#endif
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <andre.magalhaes@indt.org>
- *
- * 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();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QList>
-#include <QtCore/QDebug>
-#include <QtCore/QVariantMap>
-#include <QtDBus/QDBusArgument>
-#include <QtDBus/QDBusObjectPath>
-
-namespace org {
-namespace freedesktop {
-namespace Telepathy {
-
-class ContactCapabilities
-{
-public:
- uint handle;
- QString channelType;
- uint genericCapabilityFlags;
- uint typeSpecificFlags;
-};
-typedef QList<ContactCapabilities> ContactCapabilitiesList;
-
-class CapabilityPair
-{
-public:
- QString channelType;
- uint typeSpecificFlags;
-};
-typedef QList<CapabilityPair> CapabilityPairList;
-
-class CapabilityChange
-{
-public:
- uint handle;
- QString channelType;
- uint oldGenericFlags;
- uint newGenericFlags;
- uint oldTypeSpecificFlags;
- uint newTypeSpecificFlags;
-};
-typedef QList<CapabilityChange> 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
+++ /dev/null
-/*
- * 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 <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-/*
- * 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<Connection *>(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<Connection *>(parent())->EnsureChannel(request, channel_object, channel_properties);
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "connectioninterfacerequeststypes.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> 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", ""
- " <interface name=\"org.freedesktop.Telepathy.Connection.Interface.Requests\">\n"
- " <property access=\"read\" type=\"(a{sv}as)\" name=\"RequestableChannelClasses\">\n"
- " <annotation value=\"org::freedesktop::Telepathy::RequestableChannelClassList\" name=\"com.trolltech.QtDBus.QtTypeName\"/>\n"
- " </property>\n"
- " <method name=\"CreateChannel\">\n"
- " <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
- " <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out1\"/>\n"
- " <arg direction=\"in\" type=\"a{sv}\" name=\"request\"/>\n"
- " <arg direction=\"out\" type=\"o\" name=\"channel_object\"/>\n"
- " <arg direction=\"out\" type=\"a{sv}\" name=\"channel_properties\"/>\n"
- " </method>\n"
- " <method name=\"EnsureChannel\">\n"
- " <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
- " <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.Out2\"/>\n"
- " <arg direction=\"in\" type=\"a{sv}\" name=\"request\"/>\n"
- " <arg direction=\"out\" type=\"b\" name=\"yours\"/>\n"
- " <arg direction=\"out\" type=\"o\" name=\"channel_object\"/>\n"
- " <arg direction=\"out\" type=\"a{sv}\" name=\"channel_properties\"/>\n"
- " </method>\n"
- " <signal name=\"NewChannels\">\n"
- " <annotation value=\"org::freedesktop::Telepathy::ChannelDetailsList\" name=\"com.trolltech.QtDBus.QtTypeName.In0\"/>\n"
- " <arg type=\"a(oa{sv})\" name=\"new_channels\"/>\n"
- " </signal>\n"
- " <signal name=\"ChannelClosed\">\n"
- " <arg type=\"o\" name=\"removed_channel_object\"/>\n"
- " </signal>\n"
- " </interface>\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
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <andre.magalhaes@indt.org>
- *
- * 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();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QList>
-#include <QtCore/QDebug>
-#include <QtCore/QVariantMap>
-#include <QtDBus/QDBusArgument>
-#include <QtDBus/QDBusObjectPath>
-
-namespace org {
-namespace freedesktop {
-namespace Telepathy {
-
-class ChannelDetails
-{
-public:
- QDBusObjectPath channel;
- QVariantMap properties;
-};
-typedef QList<ChannelDetails> ChannelDetailsList;
-
-class RequestableChannelClass
-{
-public:
- QVariantMap fixedProperties;
- QStringList allowedProperties;
-};
-typedef QList<RequestableChannelClass> 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
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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 <QtCore/QDebug>
-
-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();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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 <QtDBus/QDBusContext>
-#include <QtDBus/QtDBus>
-
-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
+++ /dev/null
-/*
- * 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 <QtCore/QMetaObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtCore/QDebug>
-
-#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<ConnectionManager *>(parent())->RequestConnection(proto, parameters, object_path);
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtDBus/QtDBus>
-#include "connectionmanagertypes.h"
-class QByteArray;
-template<class T> class QList;
-template<class Key, class Value> 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", ""
-" <interface name=\"org.freedesktop.Telepathy.ConnectionManager\" >\n"
-" <method name=\"GetParameters\" >\n"
-" <annotation value=\"org::freedesktop::Telepathy::ParameterDefinitionList\" name=\"com.trolltech.QtDBus.QtTypeName.Out0\" />\n"
-" <arg direction=\"in\" type=\"s\" name=\"proto\" />\n"
-" <arg direction=\"out\" type=\"a(susv)\" />\n"
-" </method>\n"
-" <method name=\"ListProtocols\" >\n"
-" <arg direction=\"out\" type=\"as\" />\n"
-" </method>\n"
-" <method name=\"RequestConnection\" >\n"
-" <annotation value=\"QVariantMap\" name=\"com.trolltech.QtDBus.QtTypeName.In1\" />\n"
-" <arg direction=\"in\" type=\"s\" name=\"proto\" />\n"
-" <arg direction=\"in\" type=\"a{sv}\" name=\"parameters\" />\n"
-" <arg direction=\"out\" type=\"s\" name=\"bus_name\" />\n"
-" <arg direction=\"out\" type=\"o\" name=\"object_path\" />\n"
-" </method>\n"
-" <signal name=\"NewConnection\" >\n"
-" <arg type=\"s\" name=\"bus_name\" />\n"
-" <arg type=\"o\" name=\"object_path\" />\n"
-" <arg type=\"s\" name=\"proto\" />\n"
-" </signal>\n"
-" </interface>\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
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <andre.magalhaes@indt.org>
- *
- * 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;
-}
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QFlag>
-#include <QtCore/QList>
-#include <QtCore/QString>
-#include <QtDBus/QDBusArgument>
-#include <QtDBus/QDBusVariant>
-
-namespace org {
-namespace freedesktop {
-namespace Telepathy {
-
-class ParameterDefinition
-{
-public:
- QString name;
- uint flags;
- QString signature;
- QDBusVariant defaultValue;
-};
-typedef QList<ParameterDefinition> 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
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <andre.magalhaes@indt.org>
- *
- * 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;
-}
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <tobias.hunger@basyskom.de>
- * Copyright (C) 2006 by INdT
- * @author Andre Moreira Magalhaes <andre.magalhaes@indt.org>
- *
- * 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 <QtCore/QList>
-#include <QtCore/QString>
-#include <QtDBus/QDBusArgument>
-#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<ChannelInfo> 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
-
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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 <iostream>
-#include <fstream>
-
-#include <QtCore/QCoreApplication>
-#include <QtCore/QDebug>
-
-#include <QtDBus/QDBusConnection>
-#include <QtDBus/QDBusMetaType>
-#include <QtDBus/QDBusInterface>
-#include <QDateTime>
-
-#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<org::freedesktop::Telepathy::ParameterDefinition>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ParameterDefinitionList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfo>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelInfoList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilities>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ContactCapabilitiesList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPair>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityPairList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChange>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::CapabilityChangeList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
-
- 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("Vicar-Telepathy: Service %1 registered with session bus.").
- arg(cm_service_name)));
- }
- else{
- qDebug(qPrintable(QObject::tr("Vicar-Telepathy: 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("Vicar-Telepathy: Unable to register VICaR connection manager at path %1 with session bus.").
- arg(cm_object_path)));
- }
-
- qDebug(qPrintable(QObject::tr("Vicar-Telepathy: Enternig main loop.")));
-// logfile.close();
- return app.exec();
-}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@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 <info@basyskom.de>
- *
- * 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
+++ /dev/null
-/*
- * 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()
-{
-}
-
+++ /dev/null
-/*
- * 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 <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * 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<QString> callInternationalNumber(const QString &number)
- {
- QList<QVariant> argumentList;
- argumentList << qVariantFromValue(number);
- return asyncCallWithArgumentList(QLatin1String("callInternationalNumber"), argumentList);
- }
-
- inline QDBusPendingReply<bool> isRunning()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("isRunning"), argumentList);
- }
-
- inline QDBusPendingReply<bool> startOutgoingCallMonitor()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("startOutgoingCallMonitor"), argumentList);
- }
-
- inline QDBusPendingReply<bool> stopOutgoingCallMonitor()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("stopOutgoingCallMonitor"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace maemo {
- typedef ::VicarCallRouterProxy vicar;
- }
-}
-#endif
-#-------------------------------------------------
-#
-# Project created by QtCreator 2010-06-22T19:17:05
-#
-#-------------------------------------------------
-
#INCLUDEPATH += /usr/include/telepathy-1.0
#LIBS += /usr/lib/libtelepathy-qt4.so
+exists($$QMAKE_INCDIR_QT"/../qmsystem2/qmkeys.h"){
+ DEFINES += Q_WS_MAEMO_6
+}
+
QT += dbus core
QT -= gui
TARGET = vicar-telepathy
-CONFIG += qt debug console
+CONFIG += qt console
CONFIG -= app_bundle
+INCLUDEPATH += ../vicar-lib/cpp
+LIBS += ../lib/libvicar.a
+
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
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
+SOURCES += cpp/main.cpp \
+ cpp/connectiontypes.cpp \
+ cpp/connectionmanagertypes.cpp \
+ cpp/connectionmanageradaptor.cpp \
+ cpp/connectionmanager.cpp \
+ cpp/connectionadaptor.cpp \
+ cpp/connection.cpp \
+ cpp/connectioninterfacerequeststypes.cpp \
+ cpp/connectioninterfacerequestsadaptor.cpp \
+ cpp/vicarcallrouterproxy.cpp \
+ cpp/connectioninterfacecapabilitiestypes.cpp \
+ cpp/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
+ cpp/names.h \
+ cpp/connectiontypes.h \
+ cpp/connectionmanagertypes.h \
+ cpp/connectionmanageradaptor.h \
+ cpp/connectionmanager.h \
+ cpp/connectionadaptor.h \
+ cpp/connection.h \
+ cpp/basetypes.h \
+ cpp/connectioninterfacerequeststypes.h \
+ cpp/connectioninterfacerequestsadaptor.h \
+ cpp/vicarcallrouterproxy.h \
+ cpp/connectioninterfacecapabilitiestypes.h \
+ cpp/connectioninterfacecapabilitiesadaptor.h
INSTALLS += target
-
-target.path =$$INSTALLDIR/opt/vicar
+target.path =/opt/vicar/bin
--- /dev/null
+/*
+@version: 0.6
+@author: Sudheer K. <scifi1947 at gmail.com>
+@license: GNU General Public License
+*/
+
+#include "telepathyutility.h"
+#include "databaseutility.h"
+#include "vicarprofiletypes.h"
+#include "connectioninterfacerequeststypes.h"
+#include "harmattanaccountutility.h"
+#include <QDebug>
+#include <QCoreApplication> //DEBUG - Delete this
+#include "dbusutility.h"
+#include <QDBusMetaType>
+#include <QDBusConnection>
+
+int main(int argc, char *argv[])
+{
+
+ QCoreApplication app(argc,argv);
+
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::SimplePresence>();
+ //From Connection Interface Requests
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
+ qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
+ //From Vicar Profile Types
+ //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
+ //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
+
+ TelepathyUtility *tpUtility = new TelepathyUtility();
+ DatabaseUtility *databaseUtility = new DatabaseUtility();
+ HarmattanAccountUtility *accountUtility = new HarmattanAccountUtility();
+
+ 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. "
+ <<databaseUtility->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. "
+ <<databaseUtility->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. "
+ <<databaseUtility->lastError();
+ exit(5);
+ }
+ qDebug() << "VICaR profiles database deleted.";
+ }
+ else if (instruction == "TPACCOUNTSTATUS"){
+ QString status = tpUtility->getAccountStatus();
+ qDebug() << "Account Status is "<< status;
+ }
+ else if (instruction == "--create-account"){
+#if defined(Q_WS_MAEMO_6)
+ qDebug() << "Creating account";
+ accountUtility->addAccount();
+#else
+ qDebug() << "This command is applicable only in harmattan";
+#endif
+ }
+ else if (instruction == "--delete-account"){
+#if defined(Q_WS_MAEMO_6)
+ qDebug() << "Deleting account";
+ accountUtility->removeAccount();
+#else
+ qDebug() << "This command is applicable only in harmattan";
+#endif
+ }
+ else if (instruction == "TESTING"){
+ tpUtility->callNumberWithRing(argv[2]);
+ }
+ }
+ else{
+
+ qDebug() << "Sending Introspect method call";
+
+ DbusUtility dbusUtility(&app);
+ QList<QVariant> argsToSend;
+
+
+ bool success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.Connection.ring.tel.ring",
+ "/org/freedesktop/Telepathy/Connection/ring/tel/ring",
+ "org.freedesktop.DBus.Introspectable",
+ "Introspect",argsToSend,false);
+
+ success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.ConnectionManager.ring",
+ "/org/freedesktop/Telepathy/ConnectionManager/ring",
+ "org.freedesktop.DBus.Introspectable",
+ "Introspect",argsToSend,false);
+
+ /*
+
+ bool success = dbusUtility.sendMethodCall("org.freedesktop.Telepathy.AccountManager",
+ "/org/freedesktop/Telepathy/Account/ring/tel/ring",
+ "org.freedesktop.Telepathy.Account",
+ "Reconnect",argsToSend,false);
+ */
+
+ if (!success){
+ qDebug() << dbusUtility.getErrorMessage();
+ }
+ else{
+ qDebug() << "Method call executed successfully";
+ }
+ app.exec();
+ }
+
+ delete (tpUtility);
+ delete (databaseUtility);
+ delete (accountUtility);
+ tpUtility = 0;
+ databaseUtility = 0;
+ accountUtility = 0;
+}
+++ /dev/null
-/*
-@version: 0.6
-@author: Sudheer K. <scifi1947 at gmail.com>
-@license: GNU General Public License
-*/
-
-#include "telepathyutility.h"
-#include "databaseutility.h"
-#include "vicarprofiletypes.h"
-#include "connectioninterfacerequeststypes.h"
-#include <QDebug>
-#include <QDBusMetaType>
-
-int main(int argc, char *argv[])
-{
- qDBusRegisterMetaType<org::freedesktop::Telepathy::SimplePresence>();
- //From Connection Interface Requests
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetails>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::ChannelDetailsList>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClass>();
- qDBusRegisterMetaType<org::freedesktop::Telepathy::RequestableChannelClassList>();
- //From Vicar Profile Types
- //qDBusRegisterMetaType<org::maemo::vicar::Profile>();
- //qDBusRegisterMetaType<org::maemo::vicar::ProfileList>();
-
- 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. "
- <<databaseUtility->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. "
- <<databaseUtility->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. "
- <<databaseUtility->lastError();
- exit(5);
- }
- qDebug() << "VICaR profiles database deleted.";
- }
- else if (instruction == "ACCOUNTSTATUS"){
- QString status = tpUtility->getAccountStatus();
- qDebug() << "Account Status is "<< status;
- }
- else if (instruction == "TESTING"){
- tpUtility->callNumberWithRing(argv[2]);
- }
- }
-
- delete (tpUtility);
- delete (databaseUtility);
- tpUtility = 0;
- databaseUtility = 0;
-}
-CONFIG += qt debug
+contains(MEEGO_EDITION,harmattan){
+ DEFINES += Q_WS_MAEMO_6
+
+ CONFIG += link_pkgconfig
+ PKGCONFIG += accounts-qt
+}
+
+CONFIG += core qt debug xml
QT += dbus sql
QT -= gui
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
-INCLUDEPATH += ../vicar-lib/src
+INCLUDEPATH += ../vicar-lib/cpp
LIBS += ../lib/libvicar.a
-VPATH += src
-MOC_DIR = mocs
-OBJECTS_DIR = objs
-
-SOURCES += src/main.cpp
+VPATH += cpp
+MOC_DIR = cpp/.mocs
+OBJECTS_DIR = cpp/.objs
-#MAKE INSTALL
-INSTALLDIR = /../../debian/vicar
+SOURCES += cpp/main.cpp
INSTALLS += target
-
-target.path =$$INSTALLDIR/opt/vicar
-
+target.path =/opt/vicar/bin