--- /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:
- 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
- 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:
+ 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
+ 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:
+ 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
+ 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:
+ 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
+ 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 D