From 2cfa4c13eb07d90bd63117d956d7a7ce9cd6102c Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 2 Sep 2009 18:06:43 +0200 Subject: [PATCH] Converted libmodest-dbus-client into a new library package. Modest will depend on it (fix 1/2 for NB#132625). --- libmodest-dbus-client/AUTHORS | 1 + libmodest-dbus-client/COPYING | 27 + libmodest-dbus-client/ChangeLog | 2 + libmodest-dbus-client/HACKING | 75 + libmodest-dbus-client/INSTALL | 229 +++ libmodest-dbus-client/Makefile.am | 45 +- libmodest-dbus-client/NEWS | 132 ++ libmodest-dbus-client/README | 17 +- libmodest-dbus-client/autogen.sh | 20 + libmodest-dbus-client/config.sub | 1569 ++++++++++++++++++++ libmodest-dbus-client/configure.ac | 125 ++ libmodest-dbus-client/debian/changelog | 5 + libmodest-dbus-client/debian/compat | 1 + libmodest-dbus-client/debian/control | 28 + libmodest-dbus-client/debian/control.maemo-bora | 41 + libmodest-dbus-client/debian/control.maemo-chinook | 77 + libmodest-dbus-client/debian/control.maemo-diablo | 52 + .../debian/control.maemo-fremantle | 29 + libmodest-dbus-client/debian/copyright | 27 + libmodest-dbus-client/debian/dirs | 1 + libmodest-dbus-client/debian/docs | 2 + .../debian/libmodest-dbus-client-dev.install | 5 + .../debian/libmodest-dbus-client.install | 2 + .../debian/modest.postinst-chinook | 4 + libmodest-dbus-client/debian/rules | 126 ++ .../debian/scripts/renew_control_file.sh | 6 + .../libmodest-dbus-client-1.0.pc.in | 11 - libmodest-dbus-client/libmodest-dbus-client.c | 984 ------------ libmodest-dbus-client/libmodest-dbus-client.h | 177 --- .../moving-to-libmodest-dbus-client.txt | 64 - libmodest-dbus-client/src/Makefile.am | 44 + libmodest-dbus-client/src/README | 2 + libmodest-dbus-client/src/libmodest-dbus-api.h | 110 ++ .../src/libmodest-dbus-client-1.0.pc.in | 11 + libmodest-dbus-client/src/libmodest-dbus-client.c | 984 ++++++++++++ libmodest-dbus-client/src/libmodest-dbus-client.h | 177 +++ .../src/moving-to-libmodest-dbus-client.txt | 64 + src/dbus_api/modest-dbus-api.h | 110 -- 38 files changed, 4017 insertions(+), 1369 deletions(-) create mode 100644 libmodest-dbus-client/AUTHORS create mode 100644 libmodest-dbus-client/COPYING create mode 100644 libmodest-dbus-client/ChangeLog create mode 100644 libmodest-dbus-client/HACKING create mode 100644 libmodest-dbus-client/INSTALL create mode 100644 libmodest-dbus-client/NEWS create mode 100755 libmodest-dbus-client/autogen.sh create mode 100755 libmodest-dbus-client/config.sub create mode 100644 libmodest-dbus-client/configure.ac create mode 100644 libmodest-dbus-client/debian/changelog create mode 100644 libmodest-dbus-client/debian/compat create mode 100644 libmodest-dbus-client/debian/control create mode 100644 libmodest-dbus-client/debian/control.maemo-bora create mode 100644 libmodest-dbus-client/debian/control.maemo-chinook create mode 100644 libmodest-dbus-client/debian/control.maemo-diablo create mode 100644 libmodest-dbus-client/debian/control.maemo-fremantle create mode 100644 libmodest-dbus-client/debian/copyright create mode 100644 libmodest-dbus-client/debian/dirs create mode 100644 libmodest-dbus-client/debian/docs create mode 100644 libmodest-dbus-client/debian/libmodest-dbus-client-dev.install create mode 100644 libmodest-dbus-client/debian/libmodest-dbus-client.install create mode 100644 libmodest-dbus-client/debian/modest.postinst-chinook create mode 100755 libmodest-dbus-client/debian/rules create mode 100644 libmodest-dbus-client/debian/scripts/renew_control_file.sh delete mode 100644 libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in delete mode 100644 libmodest-dbus-client/libmodest-dbus-client.c delete mode 100644 libmodest-dbus-client/libmodest-dbus-client.h delete mode 100644 libmodest-dbus-client/moving-to-libmodest-dbus-client.txt create mode 100644 libmodest-dbus-client/src/Makefile.am create mode 100644 libmodest-dbus-client/src/README create mode 100644 libmodest-dbus-client/src/libmodest-dbus-api.h create mode 100644 libmodest-dbus-client/src/libmodest-dbus-client-1.0.pc.in create mode 100644 libmodest-dbus-client/src/libmodest-dbus-client.c create mode 100644 libmodest-dbus-client/src/libmodest-dbus-client.h create mode 100644 libmodest-dbus-client/src/moving-to-libmodest-dbus-client.txt delete mode 100644 src/dbus_api/modest-dbus-api.h diff --git a/libmodest-dbus-client/AUTHORS b/libmodest-dbus-client/AUTHORS new file mode 100644 index 0000000..997a6ec --- /dev/null +++ b/libmodest-dbus-client/AUTHORS @@ -0,0 +1 @@ +Dirk-Jan C. Binnema diff --git a/libmodest-dbus-client/COPYING b/libmodest-dbus-client/COPYING new file mode 100644 index 0000000..f567522 --- /dev/null +++ b/libmodest-dbus-client/COPYING @@ -0,0 +1,27 @@ +Copyright (c) 2006,2007 Nokia Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the Nokia Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/libmodest-dbus-client/ChangeLog b/libmodest-dbus-client/ChangeLog new file mode 100644 index 0000000..b10402b --- /dev/null +++ b/libmodest-dbus-client/ChangeLog @@ -0,0 +1,2 @@ +* please check the git log instead. A dump of log in this ChangeLog may happen + soon. diff --git a/libmodest-dbus-client/HACKING b/libmodest-dbus-client/HACKING new file mode 100644 index 0000000..f61fa36 --- /dev/null +++ b/libmodest-dbus-client/HACKING @@ -0,0 +1,75 @@ +HACKING +======= + +[ Unfortunately, modest is not following these rules everywhere; +however, it *should* ] + +When hacking on modest, please honour these time-tested coding guidelines. +First, please follow the Linux CodingStyle guidelines +(/usr/src/linux/Documentation/CodingStyle); for naming, follow the +Gtk/GObject guidelines. + +Here are some additional notes. + +Your editor may help you with this, for example for emacs: + + (c-set-style "K&R") + (setq tab-width 8) + (setq indent-tabs-mode t) + (setq c-basic-offset 8) + +Or the equivalent for your favourite editor. + +Lines must not exceed 100 characters. + +Functions should do one thing, and do it well. In general, functions +should not be much longer than 20-30 lines (except for, say, handling +many different cases in a 'switch'-statement). Files should not get to +big either; if there are more than, say,1000 lines, it's a sign that +some refactoring should take place. + +Code should compile cleanly with gcc's -Wall compile option. Of course this +might not always be possible due to problems in dependent libraries and/or +compiler version. Therefore, do not include -Werror in the standard compile +options; but do use it when building / testing things yourself. + +Code should also run cleanly. GTK+/GLib warnings and errors must be +taken very seriously. + +Global functions (the ones in .h-files) must be commented using the gtk-doc +system. This way, we generate nice documentation. After installing +(under /usr/local), we can browse the results with DevHelp. Just +add /usr/local/share/gtk-doc/html to the DEVHELP_SEARCH_PATH-environment variable. + +g_signal callback function start with 'on_', ie. for a signal "foo-actived", +the corresponding callback function will be called on_foo activated. (if +needed, an namespace prefixes) + +global (non-static) functions check their arguments with g_return_if_fail/ +g_return_val if_fail. This will give runtime warnings, and point to bugs in +the code. Non-bug problems however, should be reported with g_printerr. + g_printerr ("modest: cannot find icon\n") + +Furthermore, please follow 'conventional wisdom' for programming with +GLib/GTK+/GObject. Some things to remember: + +* g_new, g_malloc and friends never return NULL. They terminate + the application if it happens (normally). Therefore, no need to check + for NULL returns; +* g_return_if_fail, g_return_if_reached and friends may be 'turned off', + ie. they are to be used for error checking, but not for your programming logic + + +DEBUGGING +========= +There are some DBUS methods available for debugging. + +run-standalone.sh dbus-send --print-reply --dest=com.nokia.modest /com/nokia/modest com.nokia.modest.DumpOperationQueue + +(instead of DumpOperationQueue, you can also use DumpSendQueues or +DumpAccounts) + +These methods will print a list of the current mail operation queue, +send queues or the accounts. If you don't know what that means, then +this problably not for you :) + diff --git a/libmodest-dbus-client/INSTALL b/libmodest-dbus-client/INSTALL new file mode 100644 index 0000000..54caf7c --- /dev/null +++ b/libmodest-dbus-client/INSTALL @@ -0,0 +1,229 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the `--target=TYPE' option to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/libmodest-dbus-client/Makefile.am b/libmodest-dbus-client/Makefile.am index 141bfc4..da10ab8 100644 --- a/libmodest-dbus-client/Makefile.am +++ b/libmodest-dbus-client/Makefile.am @@ -26,27 +26,30 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -INCLUDES=\ - $(MODEST_GSTUFF_CFLAGS)\ - $(MODEST_LIBTINYMAIL_GNOME_DESKTOP_CFLAGS) \ - $(MODEST_LIBTINYMAIL_MAEMO_CFLAGS) \ - $(MODEST_PLATFORM_CFLAGS) \ - -I$(MODEST_TOOLKIT_DIR) \ - -I$(top_srcdir)/src \ - -DPREFIX=\"@prefix@\" \ - -DMODEST_LOCALEDIR=\"$(MODEST_LOCALEDIR)\" \ - -DMODEST_PLATFORM=\"$(MODEST_PLATFORM)\" \ - -DMODEST_PLATFORM_ID=$(MODEST_PLATFORM_ID) \ - -DPIXMAP_PREFIX=\"${datadir}/pixmaps/modest/\" \ - -DMODEST_UIDIR=\"$(datadir)/modest/ui/\" +SUBDIRS= src -lib_LTLIBRARIES = libmodest-dbus-client-1.0.la -libmodest_dbus_client_1_0_la_SOURCES = libmodest-dbus-client.h libmodest-dbus-client.c +EXTRA_DIST= \ + mkinstalldirs \ + autogen.sh \ + NEWS \ + ChangeLog \ + COPYING \ + HACKING \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + debian/changelog \ + debian/copyright \ + debian/rules -library_includedir=$(includedir)/libmodest-dbus-client-1.0/libmodest-dbus-client -library_include_HEADERS = libmodest-dbus-client.h +DISTCLEANFILES = \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libmodest-dbus-client-1.0.pc - -DISTCLEANFILES = $(pkgconfig_DATA) +# we install the NEWS file, so we can give +# a nice release note dialog when updating +# (using the postinst thingie in debian/ +NEWS_FILE=NEWS +newsdir=$(datadir)/modest/data +news_DATA = $(NEWS_FILE) diff --git a/libmodest-dbus-client/NEWS b/libmodest-dbus-client/NEWS new file mode 100644 index 0000000..45e9e03 --- /dev/null +++ b/libmodest-dbus-client/NEWS @@ -0,0 +1,132 @@ +*2008-w24: +- Fixes in search, settings and localisation + +* 2008-W22: +- Many stability and performance related issues fixed +- fixes for some rare crashes +- SMTP server related fixes + +* 2008-W20: +- a couple of send and receive related issues fixed + +* 2008-W19: +- a couple of rare hangs / crashes fixed + +* 2008-W18: +- some more low-memory fixes +- many small UI issues were fixed +- a couple of rare hangs / crashes fixed + +* 2008-W17: +- fixes access to Gmail and some other TLS/SSL sites +- improved low-memory handling +- stability fixes +- fixes for dealing with unreliable networks +- many tiny UI issues fixes + +* 2008-W16: +- stability fixes +- logical-id fixes +- fixed some glitches +- better support for some UPnP servers (attachments) + +* 2008-W15: +- many fixes related to specific hangs +- fix for the background-update coredumps +- improved some error notes +- improved attachment detection (tinymail) +- symbol reduction, should help startup a bit +- added WiMAX support + +* 2008-W14: + + +* 2008-W13: + +* 2008-W12: +- fixes for instability in POP3 handling +- improved error notes for a couple of situations +- fixed a couple of crashes +- better handling of memory-full situations +- better handling of some non-Latin mails + +* 2008-W11: +- many minor UI fixes +- handful of crasher fixes +- better handling of non-latin mails +- better error messages in some cases +- code improvements and some mem leak fixes + +* 2008-W10: +- many small UI fixes +- non-empty body no longer required when sending mail +- fixes related to handling of non-Latin mails (e.g. Chinese) +- more specific error notes when connection fails +- fix a bunch of crashers in various places, and some modality problems +- fixes related to attachments (when forewarding/replying/opening from drafts) +- fix some reference leaks +- localization/truncation fixes +- optimizations in showing of viewer/editor windows +- fixes related to address book handling +- make more actions cancellable + +* 2008-W09: +- no release due to the FOSDEM conference + +* 2008-W08: +- improved support for dealing Chinese / non-ascii languages +- fix some server-specific imap/namespace crashes (Maemo bug: #2715) +- fix crash due to failed error handling +- fix vertical panning +- don't get called by alarmd when offline (improves battery life) +- better out-of-mem handling +- improved attachment detection (tinymail) +- small ui tweaks all over +- made NEWS org-mode compliant + +* 2008-W07: +- added maemo-launcher support, which should improve startup speed, memory usage +- fixed some (increasing rare) crashes +- fixed attachment detection +- fixed a number of focus issues +- many small UI issues (focusing, icons etc.) + +* 2008-W06: +- fixed another bunch of crashers +- fixed the focus issue that caused addressbook not to work (editor) +- fix saving of multiple attachments +- various fixes related to dimming / focussing + - performance improvements +- fixed maemo bug #2790 (wrong section in debian control) +- improved the working of the cancel-button + +* 2008-W05: +- fixed crasher in tinymail when message retrieval failed (r3284) +- tinymail: fix syncing of imap folders with offline changes (r3279) +- tinymail: fix some memory issues (r3287) +- fix background download crash +- many UI issues fixed +- disable signature when it's not enabled +- don't send message after cancelling it +- don't keep 'updating' when going offline +- read/unread fixes + +* 2008-W04: +- many stability fixes in tinymail (see there) and modest, due to extensive valgrinding +- fixes for parsing namespaces +- fix attachment handling in the UI +- fix attachment forwarding (tinymail) +- fix misbehaving keyboard shortcuts +- fix for separator position (Maemo bug #2682) +- lots of focus/dimming issues resolved + +* 2008-W03: +- now with release notes (also seen in the NEWS) +- added some dbus-debug methods +- fixed some memory corruption (incorrect frees) in modest, tinymail-maemo and tinymail-camel +- fixed bugs in tny tree model (see there) +- fixed support for message with multiple text/plain parts (#2720) +- fixed URL support (#2683) +- fixed many dimming rules, focus issues +- fixed backspace-usage in find-toolbar +- code cleanups diff --git a/libmodest-dbus-client/README b/libmodest-dbus-client/README index cd4379e..ddf944c 100644 --- a/libmodest-dbus-client/README +++ b/libmodest-dbus-client/README @@ -1,2 +1,15 @@ -This is a C convenience API for using the modest D-Bus API, without needing to use the generic D-Bus -client library directly. \ No newline at end of file +modest +------ + +"modest" is a modest e-mail program, based on Philip van Hoof's *tinymail*. +tinymail is an effort to ease the writing of email programs, in particular +for small devices. + +And while tinymail can support just about anything, we are using it's +*libcamel* backend for mail protocol implementation. + +More about camel: http://go-evolution.org/Camel +More about tinymail: https://svn.cronos.be/svn/tinymail/trunk/ + + + diff --git a/libmodest-dbus-client/autogen.sh b/libmodest-dbus-client/autogen.sh new file mode 100755 index 0000000..c29b69a --- /dev/null +++ b/libmodest-dbus-client/autogen.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. +REQUIRED_AUTOMAKE_VERSION=1.8 +PKG_NAME=modest + +(test -f $srcdir/configure.ac) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level $PKG_NAME directory" + exit 1 +} + +#USE_GNOME2_MACROS=1 . gnome-autogen.sh $@ +libtoolize --copy --force +aclocal &&\ +autoheader &&\ +autoconf &&\ +automake --add-missing --copy diff --git a/libmodest-dbus-client/config.sub b/libmodest-dbus-client/config.sub new file mode 100755 index 0000000..87a1ee4 --- /dev/null +++ b/libmodest-dbus-client/config.sub @@ -0,0 +1,1569 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-04-22' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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 program 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 program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/libmodest-dbus-client/configure.ac b/libmodest-dbus-client/configure.ac new file mode 100644 index 0000000..db54332 --- /dev/null +++ b/libmodest-dbus-client/configure.ac @@ -0,0 +1,125 @@ +# Copyright (c) 2006,2007 Nokia Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the Nokia Corporation nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +AC_INIT([modest],[3.0],[http://maemo.org]) +AC_CONFIG_HEADERS([config.h]) + +m4_define([modest_api_major_version], [1]) +m4_define([modest_api_minor_version], [99]) +m4_define([modest_api_micro_version], [0]) +m4_define([modest_api_version], [modest_api_major_version.modest_api_minor_version.modest_api_micro_version]) + + +AM_INIT_AUTOMAKE([dist-bzip2]) + +MODEST_API_MAJOR_VERSION=modest_api_major_version +MODEST_API_MINOR_VERSION=modest_api_minor_version +MODEST_API_MICRO_VERSION=modest_api_micro_version +MODEST_API_VERSION=modest_api_version +AC_SUBST(MODEST_API_MAJOR_VERSION) +AC_SUBST(MODEST_API_MINOR_VERSION) +AC_SUBST(MODEST_API_MICRO_VERSION) +AC_SUBST(MODEST_API_VERSION) + +if test x$prefix = xNONE; then + prefix=/usr/local +fi +AC_SUBST(prefix) + +AC_PROG_CC +AC_PROG_CXX +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_PROG_LIBTOOL + + +# Option to enable debugging +AC_ARG_ENABLE(debug, + [AC_HELP_STRING([--enable-debug],[Debugging (default=no)])], + [with_debug=yes], [with_debug=no]) + +if test "x$with_debug" == "xyes" ; then + CFLAGS="$CFLAGS -ggdb -O0 -DDEBUG -Wall" +else + CFLAGS="$CFLAGS -O2 -Wall" +fi + +# Option to enable debugging +AC_ARG_ENABLE(gcov, + [AC_HELP_STRING([--enable-gcov],[Coverage reporting (default=no)])], + [with_gcov=yes], [with_gcov=no]) + +if test "x$with_gcov" == "xyes" ; then + CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" + LDFLAGS="$LDFLAGS -lgcov" +fi + + +PKG_CHECK_MODULES(MODEST_GSTUFF,glib-2.0 >= 2.6 libosso dbus-1 dbus-glib-1) +AC_SUBST(MODEST_GSTUFF_CFLAGS) +AC_SUBST(MODEST_GSTUFF_LIBS) + + +# +# check for MCE +# +if test "x$have_mce" == "xtrue"; then + mce="mce" + AC_DEFINE_UNQUOTED(MODEST_HAVE_MCE, 1, ["Whether mce is used."]) + AC_SUBST(MODEST_MCE_CFLAGS) + AC_SUBST(MODEST_MCE_LIBS) +fi + + +# warnings are errors, but don't check format errors, because +# it breaks with logical ids +CFLAGS="$CFLAGS -Wno-format-extra-args -Werror" + +serviceentrydir=`$PKG_CONFIG dbus-glib-1 --variable=prefix`/share/dbus-1/services + +dbus_api="dbus_api" +AC_SUBST(dbus_api) + +# Define as variables in Makefiles +AC_SUBST(serviceentrydir) + + +AC_OUTPUT([ +Makefile +src/Makefile +src/libmodest-dbus-client-1.0.pc +]) + + +echo +echo "modest configure results" +echo "-----------------------------------" +echo "Prefix : ${prefix}" +echo "MCE : $have_mce" +echo "CFLAGS : $CFLAGS" +echo "Debug version : $with_debug" diff --git a/libmodest-dbus-client/debian/changelog b/libmodest-dbus-client/debian/changelog new file mode 100644 index 0000000..f0ac5b3 --- /dev/null +++ b/libmodest-dbus-client/debian/changelog @@ -0,0 +1,5 @@ +libmodest-dbus-client (3.0.17-rc33) unstable; urgency=low + + * Initial import + + -- Anonymous Mon, 17 Aug 2009 00:00:00 +0000 diff --git a/libmodest-dbus-client/debian/compat b/libmodest-dbus-client/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/libmodest-dbus-client/debian/compat @@ -0,0 +1 @@ +4 diff --git a/libmodest-dbus-client/debian/control b/libmodest-dbus-client/debian/control new file mode 100644 index 0000000..8770d91 --- /dev/null +++ b/libmodest-dbus-client/debian/control @@ -0,0 +1,28 @@ +Source: libmodest-dbus-client +Section: mail +Priority: optional +Maintainer: Moises Martinez +Build-Depends: debhelper (>= 4.0.0), cdbs, libdbus-1-dev, libdbus-glib-1-dev, libosso-dev, libglib2.0-dev +Standards-Version: 3.8.0 + +Package: libmodest-dbus-client +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: library wrapping modest's dbus interface + This packages provides the library wrapping for modest's + dbus interface + +Package: libmodest-dbus-client-dev +Section: devel +Architecture: any +Depends: libmodest-dbus-client +Description: library wrapping modest's dbus interface (dev package) + Development packages for libmodest-dbus-client + +Package: libmodest-dbus-client-dbg +Section: devel +Architecture: any +Depends: libmodest-dbus-client (=${Source-Version}) +Description: debug package for modest dbus client + This package contains the debug symbols for modest dbus client diff --git a/libmodest-dbus-client/debian/control.maemo-bora b/libmodest-dbus-client/debian/control.maemo-bora new file mode 100644 index 0000000..567f585 --- /dev/null +++ b/libmodest-dbus-client/debian/control.maemo-bora @@ -0,0 +1,41 @@ +Source: modest +Section: user/extra +Priority: optional +Maintainer: Moises Martinez +Build-Depends: debhelper (>= 4.0.0), cdbs, gtkhtml-dev, libconic0-dev, hildon-libs-dev, libdbus-1-dev, libdbus-glib-1-dev, libalarm-dev, gtk-doc-tools, libebook-dev, libedataserver-dev, libgconf2-dev, libglib2.0-dev, libosso-abook-dev, libosso-gnomevfs2-dev, libossomime-dev,libtinymail-1.0-0-dev, libtinymail-gnomevfs-1.0-0-dev, libtinymail-camel-1.0-0-dev, libtinymail-maemo-1.0-0-dev,libtinymailui-1.0-0-dev,libtinymailui-gtk-1.0-0-dev,libwpeditor-plus-dev,libosso-help-dev +Standards-Version: 3.6.0 + +Package: modest +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends},${launcher:Depends},maemo-providers-data +Description: an e-mail client for platforms with modest resources + +Package: modest-plugin-dev +Architecture: any +Depends: modest +Description: Plugin development packages for modest mail client. + Plugin development packages for modest, the e-mail client for osso. + +Package: modest-dbg +Section: devel +Architecture: all +Depends: modest (=${Source-Version}) +Description: debug package for modest + +Package: libmodest-dbus-client +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: library wrapping modest's dbus interface + +Package: libmodest-dbus-client-dev +Section: devel +Architecture: any +Depends: libmodest-dbus-client +Description: library wrapping modest's dbus interface (dev package) + +Package: libmodest-dbus-client-dbg +Section: devel +Architecture: all +Depends: libmodest-dbus-client (=${Source-Version}) +Description: debug package for modest diff --git a/libmodest-dbus-client/debian/control.maemo-chinook b/libmodest-dbus-client/debian/control.maemo-chinook new file mode 100644 index 0000000..c0dcda4 --- /dev/null +++ b/libmodest-dbus-client/debian/control.maemo-chinook @@ -0,0 +1,77 @@ +Source: modest +Section: mail +Priority: optional +Maintainer: Moises Martinez +Build-Depends: debhelper (>= 4.0.0), cdbs, gnome-common, gtkhtml-dev, libconic0-dev, libhildon1-dev, libdbus-1-dev, libdbus-glib-1-dev, libebook-dev, osso-af-settings, libedataserver-dev, libhildonnotify-dev, libgconf2-dev, libglib2.0-dev, libosso-abook-dev, libosso-gnomevfs2-dev, libhildonmime-dev,libtinymail-1.0-0-dev, libtinymail-camel-1.0-0-dev, libtinymail-maemo-1.0-0-dev,libtinymailui-1.0-0-dev,libtinymail-gnomevfs-1.0-0-dev,libtinymailui-gtk-1.0-0-dev,wpeditor0,wpeditor-dev,libhildonhelp-dev, libalarm-dev, gtk-doc-tools, libhildonnotify-dev, libnotify-dev, libogs1.2-dev, microb-engine-dev, mce-dev +Standards-Version: 3.6.0 + +Package: modest +Architecture: any +Section: user/Communication +Depends: ${shlibs:Depends}, ${misc:Depends}, ${launcher:Depends},osso-icons-theme,operator-wizard-settings,osso-countries-l10n-mr0 +Replaces: modest-l10n-engb +XB-Maemo-Icon-26: + iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/ + AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1wEKDQgQTIRG + 3AAABDJJREFUSMftlkuMVEUUhr+6j+7b02+YHnpmLvRAwEQhuvCxIG4EFiZo + jCFxA4mLWbBU40KNCxbGxMSdiUvdkJAYopGVsBANIhANOIJhhCiMA/Ie6cf0 + dN963HLRM31nMsMjMW6MJzmpyjl16q+/6tSpgv+aiP3799s4jonjGGvtsgHW + 2iW6MG6hv5IaY5aMA/CiKGJ8fPyhVtWb3KKNResYY2K0jtH3auf7Bw98hNdu + t+l0OmQymQeCmHkA/ZAAWscoGdFqtXCklBw9evQBLGKUipHK3F9lr1WL9MrU + BN1uF8d1XbrdLocOHbonC3kfEKUMSi6dfMF3duIYrtM7Ny+TyRCGIWfPnmPi + +EGGp/cuA0xt/RwTO5gLH2DrZ8AJoPIiqrYPI5sE0x9SqB9GmDna+e1cH9zH + 5akpMHOE4UYcx8FJpVKEYUhtbIyvf7hO9OwEmS1vLcpLF92+hjm1C1s/jbAK + YVr4Nw5gZ46Rm9xN8NcXOKaJQJNrHcG79glXpyep1cYIwxAAB6BYLDJcHaZY + KvHZwS+JIpMA+SXML2+jH3mfaPOnS5jmpt5Bpjfxx8bvmM1u69vbN0+zevUq + qsNVisUixhgcYwxBEDBYqVCrjQEu13/9KplNzqDX7qVbeYW4Pb0ESKY2cmPo + PSIT4EWX+/auqLBu3RiDgxWCIEAphWeMwXVd8vkcoyMhrWaLVe2L/aA4u5lu + dS9aGTL1k0mi4HCz8i5Sgdu9SKATIAa3MToSks/ncV0XKSWO1hohBL7vUyqX + WV+ewXdUP6YTvo7UIKXCb37ft89mt9NmBKUNxfbhvr0ZVymMbqVULuH7PkKI + BAjAcRx836eoJ5IgWaDuPYlUBts8h2vqfd9MZidax9jYUmof6dtv+8+Ryxfw + 4waO4/S2eDHQgqRbJ/r9WzzBT2dOoJQh1UjYGDFAM/U0ABl1nnR8LWGa30km + Ogcnt2FlIwFSSiUVYO4GXic5n+zaHRB3uPT7eYL2om1LP4MVqXkKSeLo7Gb8 + VEDh0hvYDW+CX+gtzBg8rfV8BYjRt77B698fj8qm59ngXOXi5M8ExQkQPdel + xhou3/kR1/NYH9dhoGf35i7waPdVZosv4Q/txpjkRfCkVBjTKzH2zrfJ9Rl8 + itzqEUa7Fr9xHGcu7vvuyCrC1vFIoau7UKKF3ziFkw3JPvYaUfoFIqmRShMY + bx5IyV5tihTO4x+zZri0qM4ZhoaG8P093G6/jDEGay1bACEEruuSzWbJlXeQ + y+VwXRchBDXgyp93kZFGpnsxnowkWhtiC8XCAJ2uWlJUXS9NqTxIvlBe9jAu + gLmeh1QxQif+cilLa7aD1gYLeEpJrIXmrKLRUitW8PuLBiKEEMufbwEDmRQC + eskw+dsMnY76V/4KM3c7gECMj49brTXGGBbalVRrQxwbHkhwBVb/yz+SvwGz + ut/ZrkydigAAAABJRU5ErkJggg== +Description: an e-mail client for platforms with modest resources + e-mail client for osso + +Package: modest-plugin-dev +Architecture: any +Depends: modest +Description: Plugin development packages for modest mail client. + Plugin development packages for modest, the e-mail client for osso. + +Package: modest-dbg +Section: devel +Architecture: any +Depends: modest (=${Source-Version}) +Description: debug package for modest + Contains the debug symbols for modest app + +Package: libmodest-dbus-client +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: library wrapping modest's dbus interface + This packages provides the library wrapping for modest's + dbus interface + +Package: libmodest-dbus-client-dev +Section: devel +Architecture: any +Depends: libmodest-dbus-client +Description: library wrapping modest's dbus interface (dev package) + Development packages for libmodest-dbus-client + +Package: libmodest-dbus-client-dbg +Section: devel +Architecture: any +Depends: libmodest-dbus-client (=${Source-Version}) +Description: debug package for modest dbus client + This package contains the debug symbols for modest dbus client diff --git a/libmodest-dbus-client/debian/control.maemo-diablo b/libmodest-dbus-client/debian/control.maemo-diablo new file mode 100644 index 0000000..9c1d323 --- /dev/null +++ b/libmodest-dbus-client/debian/control.maemo-diablo @@ -0,0 +1,52 @@ +Source: modest +Section: mail +Priority: optional +Maintainer: Moises Martinez +Build-Depends: debhelper (>= 4.0.0), cdbs, gnome-common, gtkhtml-dev, libconic0-dev, libhildon1-dev, libdbus-1-dev, libdbus-glib-1-dev, + libebook-dev, osso-af-settings, libedataserver-dev, libhildonnotify-dev, libgconf2-dev, libglib2.0-dev, libosso-abook-dev, + libosso-gnomevfs2-dev, libhildonmime-dev,libtinymail-1.0-0-dev, libtinymail-camel-1.0-0-dev, libtinymail-maemo-1.0-0-dev, libtinymailui-1.0-0-dev, + libtinymail-gnomevfs-1.0-0-dev, libtinymailui-gtk-1.0-0-dev, wpeditor0, wpeditor-dev, libhildonhelp-dev, modest-providers-data, + libalarm-dev, gtk-doc-tools, libhildonnotify-dev, libnotify-dev, libogs1.2-dev, microb-engine-dev, mce-dev, maemo-launcher-dev +Standards-Version: 3.6.0 + +Package: modest +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${launcher:Depends}, modest-providers-data, modest-l10n-mr0, + osso-icons-theme, operator-wizard-settings, osso-countries-l10n-mr0, microb-engine +Description: an e-mail client for platforms with modest resources + e-mail client for osso + +Package: modest-plugin-dev +Architecture: any +Depends: modest +Description: Plugin development packages for modest mail client. + Plugin development packages for modest, the e-mail client for osso. + +Package: modest-dbg +Section: devel +Architecture: any +Depends: modest (=${Source-Version}) +Description: debug package for modest + Contains the debug symbols for modest app + +Package: libmodest-dbus-client +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: library wrapping modest's dbus interface + This packages provides the library wrapping for modest's + dbus interface + +Package: libmodest-dbus-client-dev +Section: devel +Architecture: any +Depends: libmodest-dbus-client +Description: library wrapping modest's dbus interface (dev package) + Development packages for libmodest-dbus-client + +Package: libmodest-dbus-client-dbg +Section: devel +Architecture: any +Depends: libmodest-dbus-client (=${Source-Version}) +Description: debug package for modest dbus client + This package contains the debug symbols for modest dbus client diff --git a/libmodest-dbus-client/debian/control.maemo-fremantle b/libmodest-dbus-client/debian/control.maemo-fremantle new file mode 100644 index 0000000..208ff3a --- /dev/null +++ b/libmodest-dbus-client/debian/control.maemo-fremantle @@ -0,0 +1,29 @@ +Source: libmodest-dbus-client +Section: mail +Priority: optional +Maintainer: Moises Martinez +Build-Depends: debhelper (>= 4.0.0), cdbs, libdbus-1-dev, libdbus-glib-1-dev, + libosso-dev, libglib2.0-dev +Standards-Version: 3.8.0 + +Package: libmodest-dbus-client +Section: devel +Architecture: any +Depends: ${shlibs:Depends} +Description: library wrapping modest's dbus interface + This packages provides the library wrapping for modest's + dbus interface + +Package: libmodest-dbus-client-dev +Section: devel +Architecture: any +Depends: libmodest-dbus-client +Description: library wrapping modest's dbus interface (dev package) + Development packages for libmodest-dbus-client + +Package: libmodest-dbus-client-dbg +Section: devel +Architecture: any +Depends: libmodest-dbus-client (=${Source-Version}) +Description: debug package for modest dbus client + This package contains the debug symbols for modest dbus client diff --git a/libmodest-dbus-client/debian/copyright b/libmodest-dbus-client/debian/copyright new file mode 100644 index 0000000..f567522 --- /dev/null +++ b/libmodest-dbus-client/debian/copyright @@ -0,0 +1,27 @@ +Copyright (c) 2006,2007 Nokia Corporation +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the Nokia Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/libmodest-dbus-client/debian/dirs b/libmodest-dbus-client/debian/dirs new file mode 100644 index 0000000..e772481 --- /dev/null +++ b/libmodest-dbus-client/debian/dirs @@ -0,0 +1 @@ +usr/bin diff --git a/libmodest-dbus-client/debian/docs b/libmodest-dbus-client/debian/docs new file mode 100644 index 0000000..50bd824 --- /dev/null +++ b/libmodest-dbus-client/debian/docs @@ -0,0 +1,2 @@ +NEWS +README diff --git a/libmodest-dbus-client/debian/libmodest-dbus-client-dev.install b/libmodest-dbus-client/debian/libmodest-dbus-client-dev.install new file mode 100644 index 0000000..e62c08c --- /dev/null +++ b/libmodest-dbus-client/debian/libmodest-dbus-client-dev.install @@ -0,0 +1,5 @@ +usr/lib/pkgconfig/libmodest-dbus-client* +usr/include/libmodest-dbus-client-1.0/libmodest-dbus-client/libmodest-dbus-client.h +usr/include/libmodest-dbus-client-1.0/libmodest-dbus-client/libmodest-dbus-api.h +usr/lib/libmodest-dbus-client-1.0.la + diff --git a/libmodest-dbus-client/debian/libmodest-dbus-client.install b/libmodest-dbus-client/debian/libmodest-dbus-client.install new file mode 100644 index 0000000..3fd2d3b --- /dev/null +++ b/libmodest-dbus-client/debian/libmodest-dbus-client.install @@ -0,0 +1,2 @@ +usr/lib/libmodest-dbus-client-1.0.so* + diff --git a/libmodest-dbus-client/debian/modest.postinst-chinook b/libmodest-dbus-client/debian/modest.postinst-chinook new file mode 100644 index 0000000..bc85bb5 --- /dev/null +++ b/libmodest-dbus-client/debian/modest.postinst-chinook @@ -0,0 +1,4 @@ +#!/bin/sh + +maemo-select-menu-location modest.desktop tana_fi_extras +maemo-confirm-text "Modest release-notes" /usr/share/modest/data/NEWS diff --git a/libmodest-dbus-client/debian/rules b/libmodest-dbus-client/debian/rules new file mode 100755 index 0000000..dad7556 --- /dev/null +++ b/libmodest-dbus-client/debian/rules @@ -0,0 +1,126 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g +PACKAGENAME = modest + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +ifneq (,$(findstring thumb,$(DEB_BUILD_OPTIONS))) + CFLAGS += -mthumb +endif + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + conf_opt += --enable-debug +endif + +config.status: configure + dh_testdir + # commands to configure the package. + if [ ! -x configure ]; then ./autogen.sh; fi + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(conf_opt) + +configure: configure-stamp +configure-stamp: + dh_testdir + ./autogen.sh + touch configure-stamp + +build: build-stamp + +build-stamp: config.status + dh_testdir + + # commands to compile the package. + $(MAKE) + touch build-stamp + + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + +# commands to clean up after the build process. +# -$(MAKE) distclean + [ ! -f Makefile ] || $(MAKE) distclean + +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config.guess +endif + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + +# install the package into debian/tmp/ + $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + +# ACHTUNG: hack +# we remove the modest.mo english localization, if the current control file contains a reference +# to modest-l10n-mr0; thus, the modest package will not conflict with that one. +# if modest-l10n-mr0 is not there, we'll install our own (en_GB) .mo file. + if grep -q modest-l10n-mr0 $(CURDIR)/debian/control ; then rm $(CURDIR)/debian/tmp/usr/share/locale/en_GB/LC_MESSAGES/modest.mo ; else echo "modest.mo not removed."; fi + + +# 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 --sourcedir=debian/tmp -v +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo +# dh_installman + dh_link + dh_strip --keep-debug --dbg-package=modest --dbg-package=libmodest-dbus-client + dh_compress + dh_fixperms +# dh_perl +# dh_python + dh_makeshlibs + dh_installdeb + dh_shlibdeps + # Not a requirement by now, so don't fail if it's not installed +# which dh_maemolauncher && dh_maemolauncher usr/bin/modest || true + dh_gencontrol +# sh debian/scripts/renew_control_file.sh + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff --git a/libmodest-dbus-client/debian/scripts/renew_control_file.sh b/libmodest-dbus-client/debian/scripts/renew_control_file.sh new file mode 100644 index 0000000..b7135fc --- /dev/null +++ b/libmodest-dbus-client/debian/scripts/renew_control_file.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +TMP=`dpkg -s libtinymail-1.0-0 | grep Version: | awk '{print $2}'` +echo $TMP +sed -i "s/-1.0-0/-1.0-0 (>= $TMP )/g" debian/modest/DEBIAN/control + diff --git a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in b/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in deleted file mode 100644 index 930b644..0000000 --- a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: libmodest-dbus-client-1.0 -Description: Some library. -Requires: glib-2.0 dbus-1 -Version: @VERSION@ -Libs: -L${libdir} -lmodest-dbus-client-1.0 -Cflags: -I${includedir}/libmodest-dbus-client-1.0 diff --git a/libmodest-dbus-client/libmodest-dbus-client.c b/libmodest-dbus-client/libmodest-dbus-client.c deleted file mode 100644 index b483dc7..0000000 --- a/libmodest-dbus-client/libmodest-dbus-client.c +++ /dev/null @@ -1,984 +0,0 @@ -/* Copyright (c) 2007, Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Nokia Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "libmodest-dbus-client.h" -#include /* For the API strings. */ - -//#define DBUS_API_SUBJECT_TO_CHANGE 1 -#include -#include -#include - - - -/** Get a comma-separated list of attachement URI strings, - * from a list of strings. - */ -static gchar* get_attachments_string (GSList *attachments) -{ - if (!attachments) - return NULL; - - gchar *attachments_str = g_strdup(""); - - GSList *iter = attachments; - while (iter) - { - if (iter->data) { - gchar *escaped; - gchar *tmp; - escaped = g_uri_escape_string ((const gchar *) (iter->data), NULL, TRUE); - tmp = g_strconcat(attachments_str, ",", escaped, NULL); - g_free(escaped); - g_free(attachments_str); - attachments_str = tmp; - } - iter = g_slist_next(iter); - } - return attachments_str; -} - -/** - * libmodest_dbus_client_mail_to: - * @osso_context: a valid #osso_context_t object. - * @mailto_uri: A mailto URI. - * - * This function will try to do a remote procedure call (rpc) - * into modest (or start it if necessary) and open a composer - * window with the supplied parameters prefilled. - * - * Return value: Whether or not the rpc call to modest - * was successfull - **/ -gboolean -libmodest_dbus_client_mail_to (osso_context_t *osso_context, const gchar *mailto_uri) -{ - osso_rpc_t retval = { 0 }; - const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_MAIL_TO, &retval, - DBUS_TYPE_STRING, mailto_uri, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - return TRUE; -} - -/** - * libmodest_dbus_client_compose_mail: - * @osso_context: a valid #osso_context_t object. - * @to: The Recipients (From: line) - * @cc: Recipients for carbon copies - * @bcc: Recipients for blind carbon copies - * @subject: Subject line - * @body: The actual body of the mail to compose. - * @attachments: Additional list of attachments. A list of URI strings. - * - * This function will try to do a remote procedure call (rpc) - * into modest (or start it if necessary) and open a composer - * window with the supplied parameters prefilled. - * - * Return value: Whether or not the rpc call to modest - * was successfull - **/ -gboolean -libmodest_dbus_client_compose_mail (osso_context_t *osso_context, const gchar *to, const gchar *cc, - const gchar *bcc, const gchar* subject, const gchar* body, GSList *attachments) -{ - osso_rpc_t retval = { 0 }; - - gchar *attachments_str = get_attachments_string(attachments); - - const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_COMPOSE_MAIL, &retval, - DBUS_TYPE_STRING, to, - DBUS_TYPE_STRING, cc, - DBUS_TYPE_STRING, bcc, - DBUS_TYPE_STRING, subject, - DBUS_TYPE_STRING, body, - DBUS_TYPE_STRING, attachments_str, - DBUS_TYPE_INVALID); - - g_free (attachments_str); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - - return TRUE; -} - -/** - * libmodest_dbus_client_open_message: - * @osso_context: a valid #osso_context_t object. - * @msg_uri: A valid url to a mail - * - * This method will try to find the message supplied - * by @msg_uri and open it for display if found. - * It will use remote procedure calls (rpc) over - * dbus to do so. - * - * Return value: TRUE on successs, FALSE on error - **/ -gboolean -libmodest_dbus_client_open_message (osso_context_t *osso_context, const gchar *mail_uri) -{ - osso_rpc_t retval = { 0 }; - const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_OPEN_MESSAGE, &retval, - DBUS_TYPE_STRING, mail_uri, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - return TRUE; -} - -gboolean -libmodest_dbus_client_send_and_receive (osso_context_t *osso_context) -{ - osso_rpc_t retval = { 0 }; - const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_SEND_RECEIVE, &retval, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - return TRUE; -} - -gboolean -libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context) -{ - osso_rpc_t retval = { 0 }; - const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_OPEN_DEFAULT_INBOX, &retval, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - return TRUE; -} - -gboolean -libmodest_dbus_client_open_account (osso_context_t *osso_context, - const gchar *account_id) -{ - osso_rpc_t retval = { 0 }; - const osso_return_t ret = - osso_rpc_run_with_defaults(osso_context, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_OPEN_ACCOUNT, &retval, - DBUS_TYPE_STRING, account_id, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); - return FALSE; - } else { - printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); - } - - osso_rpc_free_val(&retval); - - return TRUE; -} - -/** - * libmodest_dbus_client_delete_message: - * @osso_context: a valid #osso_context_t object. - * @msg_uri: A valid url to a mail - * - * This method will try to find the message supplied - * by @msg_uri and if found delete it. It will use - * remote procedure calls (rpc) over dbus to do so. - * - * Return value: TRUE on successs, FALSE on error - **/ -gboolean -libmodest_dbus_client_delete_message (osso_context_t *osso_ctx, - const char *msg_uri) -{ - osso_rpc_t retval = { 0 }; - osso_return_t ret; - - ret = osso_rpc_run_with_defaults (osso_ctx, - MODEST_DBUS_NAME, - MODEST_DBUS_METHOD_DELETE_MESSAGE, &retval, - DBUS_TYPE_STRING, msg_uri, - DBUS_TYPE_INVALID); - - if (ret != OSSO_OK) { - g_debug ("debug: osso_rpc_run() failed.\n"); - } else { - g_debug ("debug: osso_rpc_run() succeeded.\n"); - } - - osso_rpc_free_val (&retval); - - return ret == OSSO_OK; -} - -static void -modest_search_hit_free (ModestSearchHit *hit) -{ - g_free (hit->msgid); - g_slice_free (ModestSearchHit, hit); -} - -void -modest_search_hit_list_free (GList *hits) -{ - GList *iter; - - if (hits == NULL) { - return; - } - - for (iter = hits; iter; iter = iter->next) { - modest_search_hit_free ((ModestSearchHit *) iter->data); - } - - g_list_free (hits); -} - -static char * -_dbus_iter_get_string_or_null (DBusMessageIter *iter) -{ - const char *string = NULL; - char *ret = NULL; - - dbus_message_iter_get_basic (iter, &string); - - if (string && strlen (string)) { - ret = g_strdup (string); - } - - return ret; -} - -static guint64 -_dbus_iter_get_uint64 (DBusMessageIter *iter) -{ - dbus_uint64_t ui64v; - guint64 ret; - - ui64v = 0; - dbus_message_iter_get_basic (iter, &ui64v); - - ret = (guint64) ui64v; - - return ret; -} - - -static gint64 -_dbus_iter_get_int64 (DBusMessageIter *iter) -{ - dbus_int64_t i64v; - gint64 ret; - - i64v = 0; - dbus_message_iter_get_basic (iter, &i64v); - - ret = (gint64) i64v; - - return ret; -} - -static gboolean -_dbus_iter_get_boolean (DBusMessageIter *iter) - -{ - dbus_bool_t val; - gboolean ret; - - val = FALSE; - dbus_message_iter_get_basic (iter, &val); - - ret = (gboolean) val; - - return ret; -} - -/** Get the values from the complex type (SEARCH_HIT_DBUS_TYPE) - * in the D-Bus return message. */ -static ModestSearchHit * -modest_dbus_message_iter_get_search_hit (DBusMessageIter *parent) -{ - ModestSearchHit *hit; - DBusMessageIter child; - dbus_bool_t res; - int arg_type; - gboolean error; - - error = FALSE; - hit = g_slice_new0 (ModestSearchHit); - - arg_type = dbus_message_iter_get_arg_type (parent); - - if (arg_type != 'r') { - return NULL; - } - - dbus_message_iter_recurse (parent, &child); - - /* msgid */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - hit->msgid = _dbus_iter_get_string_or_null (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* subject */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - hit->subject = _dbus_iter_get_string_or_null (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* folder */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - hit->folder = _dbus_iter_get_string_or_null (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* sender */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - hit->sender = _dbus_iter_get_string_or_null (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* msize */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_UINT64) { - error = TRUE; - goto out; - } - - hit->msize = _dbus_iter_get_uint64 (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* has_attachment */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_BOOLEAN) { - error = TRUE; - goto out; - } - - hit->has_attachment = _dbus_iter_get_boolean (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* is_unread */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_BOOLEAN) { - error = TRUE; - goto out; - } - - hit->is_unread = _dbus_iter_get_boolean (&child); - - res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* timestamp */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_INT64) { - error = TRUE; - goto out; - } - - hit->timestamp = _dbus_iter_get_int64 (&child); - - res = dbus_message_iter_next (&child); - if (res == TRUE) { - error = TRUE; - goto out; - } - -out: - if (error) { - g_warning ("%s: Error during unmarshalling", __FUNCTION__); - modest_search_hit_free (hit); - hit = NULL; - } - - return hit; -} - -/** - * libmodest_dbus_client_search: - * @osso_ctx: A valid #osso_context_t object. - * @query: The term to search for. - * @folder: An url to specific folder or %NULL to search everywhere. - * @start_date: Search hits before this date will be ignored. - * @end_date: Search hits after this date will be ignored. - * @min_size: Messagers smaller then this size will be ingored. - * @flags: A list of flags where to search so the documentation - * of %ModestDBusSearchFlags for details. - * @hits: A pointer to a valid GList pointer that will contain the search - * hits (ModestSearchHit). The list and the items must be freed by the caller - * with modest_search_hit_list_free(). - * - * This method will search the folder specified by a valid url in @folder or all - * known accounts (local and remote) if %NULL for matches of the search term(s) - * specified in @query. It is legal to specify 0 in @start_date, @end_date and - * @min_size to ignore these parameters during the search otherwise those message - * that do not meet the specifed dates or size will be ignored. - * Where to search, be it subject, sender or the whole body can be specified by - * the @flags parameter. - * - * Upon success TRUE is returned and @hits will include the search hits or the list - * migh be empty if none of the messages matched the search criteria. The returned - * list must be freed with modest_search_hit_list_free (). It is save to pass - * %NULL to this function so you can call this function on the result list no matter - * if a hit was found or not (means the list is empty - i.e. %NULL) - * FALSE will only be return if an error during the remote procedure call (rpc) - * occured or if the specified folder could not be found. - * - * NOTE: The body of a message can only be searched if it was previously downloaded by - * modest. This function does also not attempt do to remote searches (i.e. IMAP search). - * - * Example to search every account for message containing "no": - * - * ModestDBusSearchFlags flags; - * osso_context_t *osso_context; - * GList *hits; - * GList *iter; - * gboolean res; - * - * [...] Initialize osso context [...] - * - * res = libmodest_dbus_client_search (osso_context, - * "no", - * NULL, - * 0, - * 0, - * 0, - * flags, - * &hits); - * - * for (iter = hits; iter; iter = iter->next) { - * ModestSearchHit *hit = (ModestSearchHit *) iter->data; - * - * [...] Do something with the hit [...] - * - * } - * - * modest_search_hit_list_free (hits); - * - * - * Return value: TRUE if the search succeded or FALSE for an error during the search - **/ -gboolean -libmodest_dbus_client_search (osso_context_t *osso_ctx, - const gchar *query, - const gchar *folder, - time_t start_date, - time_t end_date, - guint32 min_size, - ModestDBusSearchFlags flags, - GList **hits) -{ - - DBusMessage *msg; - dbus_bool_t res; - DBusConnection *con; - DBusMessageIter iter; - DBusMessageIter child; - DBusMessage *reply = NULL; - gint timeout; - int arg_type; - dbus_int64_t sd_v; - dbus_int64_t ed_v; - dbus_int32_t flags_v; - dbus_uint32_t size_v; - - if (query == NULL) { - return FALSE; - } - - con = osso_get_dbus_connection (osso_ctx); - - if (con == NULL) { - g_warning ("Could not get dbus connection\n"); - return FALSE; - - } - - - msg = dbus_message_new_method_call (MODEST_DBUS_SERVICE, - MODEST_DBUS_OBJECT, - MODEST_DBUS_IFACE, - MODEST_DBUS_METHOD_SEARCH); - - if (msg == NULL) { - //ULOG_ERR_F("dbus_message_new_method_call failed"); - return OSSO_ERROR; - } - - if (folder == NULL) { - folder = ""; - } - - sd_v = (dbus_int64_t) start_date; - ed_v = (dbus_int64_t) end_date; - flags_v = (dbus_int32_t) flags; - size_v = (dbus_uint32_t) min_size; - - res = dbus_message_append_args (msg, - DBUS_TYPE_STRING, &query, - DBUS_TYPE_STRING, &folder, - DBUS_TYPE_INT64, &sd_v, - DBUS_TYPE_INT64, &ed_v, - DBUS_TYPE_INT32, &flags_v, - DBUS_TYPE_UINT32, &size_v, - DBUS_TYPE_INVALID); - - dbus_message_set_auto_start (msg, TRUE); - - /* Use a long timeout (2 minutes) because the search currently - * gets folders and messages from the servers. */ - timeout = 120000; //milliseconds. - //osso_rpc_get_timeout (osso_ctx, &timeout); - - /*printf("DEBUG: %s: Before dbus_connection_send_with_reply_and_block().\n", - __FUNCTION__); */ - /* TODO: Detect the timeout somehow. */ - DBusError err; - dbus_error_init (&err); - reply = dbus_connection_send_with_reply_and_block (con, - msg, - timeout, - &err); - /* printf("DEBUG: %s: dbus_connection_send_with_reply_and_block() finished.\n", - __FUNCTION__); */ - - dbus_message_unref (msg); - - if (!reply) { - g_warning("%s: dbus_connection_send_with_reply_and_block() error: %s", - __FUNCTION__, err.message); - return FALSE; - } - - switch (dbus_message_get_type (reply)) { - - case DBUS_MESSAGE_TYPE_ERROR: - dbus_set_error_from_message (&err, reply); - //XXX to GError?! - dbus_error_free (&err); - dbus_message_unref (reply); - return FALSE; - - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - /* ok we are good to go - * lets drop outa here and handle that */ - break; - default: - //ULOG_WARN_F("got unknown message type as reply"); - //retval->type = DBUS_TYPE_STRING; - //retval->value.s = g_strdup("Invalid return value"); - //XXX to GError?! - dbus_message_unref (reply); - return FALSE; - } - - g_debug ("%s: message return", __FUNCTION__); - - dbus_message_iter_init (reply, &iter); - arg_type = dbus_message_iter_get_arg_type (&iter); - - dbus_message_iter_recurse (&iter, &child); - *hits = NULL; - - do { - ModestSearchHit *hit; - - hit = modest_dbus_message_iter_get_search_hit (&child); - - if (hit) { - *hits = g_list_prepend (*hits, hit); - } - - } while (dbus_message_iter_next (&child)); - - dbus_message_unref (reply); - - - /* TODO: This is from osso source, do we need it? */ -#if 0 - /* Tell TaskNavigator to show "launch banner" */ - msg = dbus_message_new_method_call (TASK_NAV_SERVICE, - APP_LAUNCH_BANNER_METHOD_PATH, - APP_LAUNCH_BANNER_METHOD_INTERFACE, - APP_LAUNCH_BANNER_METHOD); - - if (msg == NULL) { - g_warn ("dbus_message_new_method_call failed"); - } - - - - dbus_message_append_args (msg, - DBUS_TYPE_STRING, - &service, - DBUS_TYPE_INVALID); - - b = dbus_connection_send (conn, msg, NULL); - - if (b == NULL) { - ULOG_WARN_F("dbus_connection_send failed"); - } - - dbus_message_unref (msg); -#endif - - return TRUE; -} - - -static void -modest_folder_result_free (ModestFolderResult *item) -{ - g_free (item->folder_name); - g_free (item->folder_uri); - g_slice_free (ModestFolderResult, item); -} - -void -modest_folder_result_list_free (GList *list) -{ - GList *iter; - - if (list == NULL) { - return; - } - - for (iter = list; iter; iter = iter->next) { - modest_folder_result_free ((ModestFolderResult *) iter->data); - } - - g_list_free (list); -} - - -/** Get the values from the complex type (GET_FOLDERS_RESULT_DBUS_TYPE) - * in the D-Bus return message. */ -static ModestFolderResult * -modest_dbus_message_iter_get_folder_item (DBusMessageIter *parent) -{ - gboolean error = FALSE; - ModestFolderResult *item = g_slice_new0 (ModestFolderResult); - - int arg_type = dbus_message_iter_get_arg_type (parent); - - if (arg_type != 'r') { - return NULL; - } - - DBusMessageIter child; - dbus_message_iter_recurse (parent, &child); - - /* folder name: */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - item->folder_name = _dbus_iter_get_string_or_null (&child); - - - dbus_bool_t res = dbus_message_iter_next (&child); - if (res == FALSE) { - error = TRUE; - goto out; - } - - /* folder URI: */ - arg_type = dbus_message_iter_get_arg_type (&child); - - if (arg_type != DBUS_TYPE_STRING) { - error = TRUE; - goto out; - } - - item->folder_uri = _dbus_iter_get_string_or_null (&child); - - -out: - if (error) { - g_warning ("%s: Error during unmarshalling", __FUNCTION__); - modest_folder_result_free (item); - item = NULL; - } - - return item; -} - -/** - * libmodest_dbus_client_get_folders: - * @osso_ctx: A valid #osso_context_t object. - * @folders: A pointer to a valid GList pointer that will contain the folder items - * (ModestFolderResult). The list and the items must be freed by the caller - * with modest_folder_result_list_free(). - * - * This method will obtain a list of folders in the default account. - * - * Upon success TRUE is returned and @folders will include the folders or the list - * might be empty if there are no folders. The returned - * list must be freed with modest_folder_result_list_free (). - * - * NOTE: A folder will only be retrieved if it was previously downloaded by - * modest. This function does also not attempt do to remote refreshes (i.e. IMAP). - * - * Return value: TRUE if the request succeded or FALSE for an error. - **/ -gboolean -libmodest_dbus_client_get_folders (osso_context_t *osso_ctx, - GList **folders) -{ - /* Initialize output argument: */ - if (folders) - *folders = NULL; - else - return FALSE; - - DBusConnection *con = osso_get_dbus_connection (osso_ctx); - - if (con == NULL) { - g_warning ("Could not get dbus connection\n"); - return FALSE; - - } - - DBusMessage *msg = dbus_message_new_method_call (MODEST_DBUS_SERVICE, - MODEST_DBUS_OBJECT, - MODEST_DBUS_IFACE, - MODEST_DBUS_METHOD_GET_FOLDERS); - - if (msg == NULL) { - //ULOG_ERR_F("dbus_message_new_method_call failed"); - return OSSO_ERROR; - } - - dbus_message_set_auto_start (msg, TRUE); - - /* Use a long timeout (2 minutes) because the search currently - * gets folders from the servers. */ - gint timeout = 120000; - //osso_rpc_get_timeout (osso_ctx, &timeout); - - DBusError err; - dbus_error_init (&err); - DBusMessage *reply = dbus_connection_send_with_reply_and_block (con, - msg, - timeout, - &err); - - dbus_message_unref (msg); - msg = NULL; - - if (reply == NULL) { - g_warning("%s: dbus_connection_send_with_reply_and_block() error:\n %s", - __FUNCTION__, err.message); - return FALSE; - } - - switch (dbus_message_get_type (reply)) { - - case DBUS_MESSAGE_TYPE_ERROR: - dbus_set_error_from_message (&err, reply); - //XXX to GError?! - dbus_error_free (&err); - dbus_message_unref (reply); - return FALSE; - - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - /* ok we are good to go - * lets drop outa here and handle that */ - break; - default: - //ULOG_WARN_F("got unknown message type as reply"); - //retval->type = DBUS_TYPE_STRING; - //retval->value.s = g_strdup("Invalid return value"); - //XXX to GError?! - dbus_message_unref (reply); - return FALSE; - } - - g_debug ("%s: message return", __FUNCTION__); - - DBusMessageIter iter; - dbus_message_iter_init (reply, &iter); - /* int arg_type = dbus_message_iter_get_arg_type (&iter); */ - - DBusMessageIter child; - dbus_message_iter_recurse (&iter, &child); - - do { - ModestFolderResult *item = modest_dbus_message_iter_get_folder_item (&child); - - if (item) { - *folders = g_list_append (*folders, item); - } - - } while (dbus_message_iter_next (&child)); - - dbus_message_unref (reply); - - - /* TODO: This is from osso source, do we need it? */ -#if 0 - /* Tell TaskNavigator to show "launch banner" */ - msg = dbus_message_new_method_call (TASK_NAV_SERVICE, - APP_LAUNCH_BANNER_METHOD_PATH, - APP_LAUNCH_BANNER_METHOD_INTERFACE, - APP_LAUNCH_BANNER_METHOD); - - if (msg == NULL) { - g_warn ("dbus_message_new_method_call failed"); - } - - - - dbus_message_append_args (msg, - DBUS_TYPE_STRING, - &service, - DBUS_TYPE_INVALID); - - b = dbus_connection_send (conn, msg, NULL); - - if (b == NULL) { - ULOG_WARN_F("dbus_connection_send failed"); - } - - dbus_message_unref (msg); -#endif - - return TRUE; -} - - diff --git a/libmodest-dbus-client/libmodest-dbus-client.h b/libmodest-dbus-client/libmodest-dbus-client.h deleted file mode 100644 index 03ac5d8..0000000 --- a/libmodest-dbus-client/libmodest-dbus-client.h +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (c) 2007, Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Nokia Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LIBMODEST_DBUS_CLIENT_H__ -#define __LIBMODEST_DBUS_CLIENT_H__ - -#include -#include -#include - - -/** - * libmodest_dbus_client_compose_mail: - * @osso_context: a valid osso_context instance - * @to: the To:-field of the message - * @cc: the Cc:-field of the message - * @bcc: the Bcc:-field of the message - * @subject: the Subject:-field of the message - * @body: the body (text) of the message - * @attachments: a list of (file://) URIs with the files to attach - * - * opens a new mail composer with the provided details filled in - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_compose_mail (osso_context_t *osso_context, const gchar *to, - const gchar *cc, const gchar *bcc, const gchar* subject, - const gchar* body, - GSList *attachments); - -/** - * libmodest_dbus_client_mail_to: - * @osso_context: a valid osso_context instance - * @mailto_uri: a 'mailto:foo@bar.cuux' URI - * - * opens a new mail composer with the provided details filled in, - * based on a mailto: string. apart from the To:-field (the first arg), - * also, cc, bcc, subject and body are supported, ie. "mailto:foo@bar.cuu?subject=test" - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_mail_to (osso_context_t *osso_context, - const gchar *mailto_uri); - - -/** - * libmodest_dbus_client_open_message: - * @osso_context: a valid osso_context instance - * @mail_uri: the unique URI referring to some message - * - * opens an existing message based on its URI; these URIs are unique pointers - * to some message, and are retrieved from modest. - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_open_message (osso_context_t *osso_context, - const gchar *mail_uri); - - -/** - * libmodest_dbus_client_send_and_receive: - * @osso_context: a valid osso_context instance - * - * send/receive messages - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_send_and_receive (osso_context_t *osso_context); - - - -/** - * libmodest_dbus_client_open_default_inbox: - * @osso_context: a valid osso_context instance - * - * start modest, and open the inbox for the default account - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context); - -/** - * libmodest_dbus_client_open_account: - * @osso_context: a valid osso_context instance - * @account_id: the unique ID of one account - * - * Starts Modest showing the account that is specified as - * parametter. Note that this only makes sense when the folder view is - * showing just one account - * - * Returns: TRUE upon success, FALSE otherwise - */ -gboolean libmodest_dbus_client_open_account (osso_context_t *osso_context, - const gchar *account_id); - - -/* - * below: functions specific to osso-global-search; not useful for other clients. - * - */ - -typedef enum { - - MODEST_DBUS_SEARCH_SUBJECT = (1 << 0), - MODEST_DBUS_SEARCH_SENDER = (1 << 1), - MODEST_DBUS_SEARCH_RECIPIENT = (1 << 2), - MODEST_DBUS_SEARCH_SIZE = (1 << 3), - MODEST_DBUS_SEARCH_BODY = (1 << 6) - -} ModestDBusSearchFlags; - -typedef struct { - gchar *msgid; /* E.g. the URI of the message. */ - gchar *subject; - gchar *folder; /* The name, not the URI. */ - gchar *sender; - guint64 msize; - gboolean has_attachment; - gboolean is_unread; - gint64 timestamp; -} ModestSearchHit; - - -void modest_search_hit_list_free (GList *hits); - - -gboolean libmodest_dbus_client_search (osso_context_t *osso_ctx, - const gchar *query, - const gchar *folder, - time_t start_date, - time_t end_date, - guint32 min_size, - ModestDBusSearchFlags flags, - GList **hits); - -gboolean libmodest_dbus_client_delete_message (osso_context_t *osso_ctx, - const char *msg_uri); - - -typedef struct { - gchar *folder_uri; - gchar *folder_name; -} ModestFolderResult; - -gboolean libmodest_dbus_client_get_folders (osso_context_t *osso_ctx, GList **folders); - -void modest_folder_result_list_free (GList *folders); - - - -#endif /* __LIBMODEST_DBUS_CLIENT_H__ */ diff --git a/libmodest-dbus-client/moving-to-libmodest-dbus-client.txt b/libmodest-dbus-client/moving-to-libmodest-dbus-client.txt deleted file mode 100644 index fb6fefb..0000000 --- a/libmodest-dbus-client/moving-to-libmodest-dbus-client.txt +++ /dev/null @@ -1,64 +0,0 @@ -Moving to libmodest-dbus-client -Time-stamp: <2007-10-11 18:16:37 (djcb)> -======================================== - -Some notes on how to migrate from osso-email-interface to the -new libmodest-dbus-client. - -1. debian/control -================= -In your debian/control-file, add "libmodest-dbus-client-dev" to your -Build-Depends, and remove any reference to osso-email-interface. - - -2. configure.(ac|in) -==================== -Add libmodest-dbus-client-1.0 to your modules, e.g. -PKG_CHECK_MODULES(LIBMODEST_DBUS_CLIENT,[libmodest-dbus-client-1.0]) -and, again, remove all reference to osso-email-interface, -libossoemailinterface and friends. - -3. #include -=========== -In your implementation files, remove (again) al references to -osso-email-interface, and add: -#include - - -4. replacing calls to osso-email-interface -========================================== -After all this has been done, all that is left is replacing the -library calls. - -We give the osso-email-interface calls, and the corresponding -libmodest-dbus-client call: - - -1. osso_email_files_email (osso_ctx, my_file_list); -becomes: - libmodest_dbus_client_compose_mail (osso_ctx, NULL, NULL, NULL, NULL, NULL, my_file_list); - - - - -2. osso_email_url_email (osso_ctx, url); -becomes: - libmodest_dbus_client_compose_mail (osso_ctx, NULL, NULL, NULL, NULL, url, NULL); - - - - -3. osso_email_emailto_email (osso_ctx, to_list); -becomes: - libmodest_dbus_client_mail_to (osso_ctx, to_list as_string); - -NOTE: libmodest_dbus_client expects to_list_as string, ie. a comma-separated -list of email addresses. - - - -Compile & run. That should do it! If you have any questions, pls. send them to -dirk-jan.binnema@nokia.com - - - diff --git a/libmodest-dbus-client/src/Makefile.am b/libmodest-dbus-client/src/Makefile.am new file mode 100644 index 0000000..9ae0381 --- /dev/null +++ b/libmodest-dbus-client/src/Makefile.am @@ -0,0 +1,44 @@ +# Copyright (c) 2006,2007 Nokia Corporation +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the Nokia Corporation nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +INCLUDES=\ + $(MODEST_GSTUFF_CFLAGS) \ + $(MODEST_PLATFORM_CFLAGS) \ + -I$(top_srcdir)/src \ + -DPREFIX=\"@prefix@\" + +lib_LTLIBRARIES = libmodest-dbus-client-1.0.la +libmodest_dbus_client_1_0_la_SOURCES = libmodest-dbus-api.h libmodest-dbus-client.h libmodest-dbus-client.c + +library_includedir=$(includedir)/libmodest-dbus-client-1.0/libmodest-dbus-client +library_include_HEADERS = libmodest-dbus-api.h libmodest-dbus-client.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libmodest-dbus-client-1.0.pc + +DISTCLEANFILES = $(pkgconfig_DATA) diff --git a/libmodest-dbus-client/src/README b/libmodest-dbus-client/src/README new file mode 100644 index 0000000..cd4379e --- /dev/null +++ b/libmodest-dbus-client/src/README @@ -0,0 +1,2 @@ +This is a C convenience API for using the modest D-Bus API, without needing to use the generic D-Bus +client library directly. \ No newline at end of file diff --git a/libmodest-dbus-client/src/libmodest-dbus-api.h b/libmodest-dbus-client/src/libmodest-dbus-api.h new file mode 100644 index 0000000..0f84496 --- /dev/null +++ b/libmodest-dbus-client/src/libmodest-dbus-api.h @@ -0,0 +1,110 @@ +/* Copyright (c) 2007, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#ifndef __MODEST_DBUS_API__ +#define __MODEST_DBUS_API__ + + +/* Note that the com.nokia service name and /com/nokia object name + * are what is assumed by the, bizarrely named, osso_rpc_run_with_defaults() function, + * so they are probably a good choice. */ +#define MODEST_DBUS_NAME "modest" +#define MODEST_DBUS_SERVICE "com.nokia."MODEST_DBUS_NAME +#define MODEST_DBUS_OBJECT "/com/nokia/"MODEST_DBUS_NAME /* Also known as a D-Bus Path. */ +#define MODEST_DBUS_IFACE "com.nokia."MODEST_DBUS_NAME + + +#define MODEST_DBUS_METHOD_MAIL_TO "MailTo" +enum ModestDbusMailToArguments +{ + MODEST_DBUS_MAIL_TO_ARG_URI, + MODEST_DBUS_MAIL_TO_ARGS_COUNT +}; + +#define MODEST_DBUS_METHOD_OPEN_MESSAGE "OpenMessage" +enum ModestDbusOpenMessageArguments +{ + MODEST_DBUS_OPEN_MESSAGE_ARG_URI, + MODEST_DBUS_OPEN_MESSAGE_ARGS_COUNT +}; + +#define MODEST_DBUS_METHOD_OPEN_ACCOUNT "OpenAccount" +enum ModestDbusOpenAccountArguments +{ + MODEST_DBUS_OPEN_ACCOUNT_ARG_ID, + MODEST_DBUS_OPEN_ACCOUNT_ARGS_COUNT +}; + +#define MODEST_DBUS_METHOD_SEND_RECEIVE "SendReceive" + +#define MODEST_DBUS_METHOD_COMPOSE_MAIL "ComposeMail" +enum ModestDbusComposeMailArguments +{ + MODEST_DBUS_COMPOSE_MAIL_ARG_TO, + MODEST_DBUS_COMPOSE_MAIL_ARG_CC, + MODEST_DBUS_COMPOSE_MAIL_ARG_BCC, + MODEST_DBUS_COMPOSE_MAIL_ARG_SUBJECT, + MODEST_DBUS_COMPOSE_MAIL_ARG_BODY, + MODEST_DBUS_COMPOSE_MAIL_ARG_ATTACHMENTS, + MODEST_DBUS_COMPOSE_MAIL_ARGS_COUNT +}; + +#define MODEST_DBUS_METHOD_DELETE_MESSAGE "DeleteMessage" +enum ModestDbusDeleteMessageArguments +{ + MODEST_DBUS_DELETE_MESSAGE_ARG_URI, + MODEST_DBUS_DELETE_MESSAGE_ARGS_COUNT +}; + +#define MODEST_DBUS_METHOD_OPEN_DEFAULT_INBOX "OpenDefaultInbox" + +/* + * these methods are for debugging only, and should _not_ be + * exported through libmodest-dbus-client + */ +#define MODEST_DBUS_METHOD_DUMP_OPERATION_QUEUE "DumpOperationQueue" +#define MODEST_DBUS_METHOD_DUMP_ACCOUNTS "DumpAccounts" +#define MODEST_DBUS_METHOD_DUMP_SEND_QUEUES "DumpSendQueues" + + + +/* These are handle via normal D-Bus instead of osso-rpc: */ +#define MODEST_DBUS_METHOD_SEARCH "Search" +#define MODEST_DBUS_METHOD_GET_FOLDERS "GetFolders" + +/** This is an undocumented hildon-desktop method that is + * sent to applications when they are started from the menu, + * but not when started from D-Bus activation, so that + * applications can be started without visible UI. + * At least, I think so. murrayc. + **/ +#define MODEST_DBUS_METHOD_TOP_APPLICATION "top_application" + +#endif /* __MODEST_DBUS_API__ */ diff --git a/libmodest-dbus-client/src/libmodest-dbus-client-1.0.pc.in b/libmodest-dbus-client/src/libmodest-dbus-client-1.0.pc.in new file mode 100644 index 0000000..930b644 --- /dev/null +++ b/libmodest-dbus-client/src/libmodest-dbus-client-1.0.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libmodest-dbus-client-1.0 +Description: Some library. +Requires: glib-2.0 dbus-1 +Version: @VERSION@ +Libs: -L${libdir} -lmodest-dbus-client-1.0 +Cflags: -I${includedir}/libmodest-dbus-client-1.0 diff --git a/libmodest-dbus-client/src/libmodest-dbus-client.c b/libmodest-dbus-client/src/libmodest-dbus-client.c new file mode 100644 index 0000000..43f5c9e --- /dev/null +++ b/libmodest-dbus-client/src/libmodest-dbus-client.c @@ -0,0 +1,984 @@ +/* Copyright (c) 2007, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "libmodest-dbus-client.h" +#include "libmodest-dbus-api.h" /* For the API strings. */ + +//#define DBUS_API_SUBJECT_TO_CHANGE 1 +#include +#include +#include + + + +/** Get a comma-separated list of attachement URI strings, + * from a list of strings. + */ +static gchar* get_attachments_string (GSList *attachments) +{ + if (!attachments) + return NULL; + + gchar *attachments_str = g_strdup(""); + + GSList *iter = attachments; + while (iter) + { + if (iter->data) { + gchar *escaped; + gchar *tmp; + escaped = g_uri_escape_string ((const gchar *) (iter->data), NULL, TRUE); + tmp = g_strconcat(attachments_str, ",", escaped, NULL); + g_free(escaped); + g_free(attachments_str); + attachments_str = tmp; + } + iter = g_slist_next(iter); + } + return attachments_str; +} + +/** + * libmodest_dbus_client_mail_to: + * @osso_context: a valid #osso_context_t object. + * @mailto_uri: A mailto URI. + * + * This function will try to do a remote procedure call (rpc) + * into modest (or start it if necessary) and open a composer + * window with the supplied parameters prefilled. + * + * Return value: Whether or not the rpc call to modest + * was successfull + **/ +gboolean +libmodest_dbus_client_mail_to (osso_context_t *osso_context, const gchar *mailto_uri) +{ + osso_rpc_t retval = { 0 }; + const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_MAIL_TO, &retval, + DBUS_TYPE_STRING, mailto_uri, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + return TRUE; +} + +/** + * libmodest_dbus_client_compose_mail: + * @osso_context: a valid #osso_context_t object. + * @to: The Recipients (From: line) + * @cc: Recipients for carbon copies + * @bcc: Recipients for blind carbon copies + * @subject: Subject line + * @body: The actual body of the mail to compose. + * @attachments: Additional list of attachments. A list of URI strings. + * + * This function will try to do a remote procedure call (rpc) + * into modest (or start it if necessary) and open a composer + * window with the supplied parameters prefilled. + * + * Return value: Whether or not the rpc call to modest + * was successfull + **/ +gboolean +libmodest_dbus_client_compose_mail (osso_context_t *osso_context, const gchar *to, const gchar *cc, + const gchar *bcc, const gchar* subject, const gchar* body, GSList *attachments) +{ + osso_rpc_t retval = { 0 }; + + gchar *attachments_str = get_attachments_string(attachments); + + const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_COMPOSE_MAIL, &retval, + DBUS_TYPE_STRING, to, + DBUS_TYPE_STRING, cc, + DBUS_TYPE_STRING, bcc, + DBUS_TYPE_STRING, subject, + DBUS_TYPE_STRING, body, + DBUS_TYPE_STRING, attachments_str, + DBUS_TYPE_INVALID); + + g_free (attachments_str); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + + return TRUE; +} + +/** + * libmodest_dbus_client_open_message: + * @osso_context: a valid #osso_context_t object. + * @msg_uri: A valid url to a mail + * + * This method will try to find the message supplied + * by @msg_uri and open it for display if found. + * It will use remote procedure calls (rpc) over + * dbus to do so. + * + * Return value: TRUE on successs, FALSE on error + **/ +gboolean +libmodest_dbus_client_open_message (osso_context_t *osso_context, const gchar *mail_uri) +{ + osso_rpc_t retval = { 0 }; + const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_OPEN_MESSAGE, &retval, + DBUS_TYPE_STRING, mail_uri, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + return TRUE; +} + +gboolean +libmodest_dbus_client_send_and_receive (osso_context_t *osso_context) +{ + osso_rpc_t retval = { 0 }; + const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_SEND_RECEIVE, &retval, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + return TRUE; +} + +gboolean +libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context) +{ + osso_rpc_t retval = { 0 }; + const osso_return_t ret = osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_OPEN_DEFAULT_INBOX, &retval, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + return TRUE; +} + +gboolean +libmodest_dbus_client_open_account (osso_context_t *osso_context, + const gchar *account_id) +{ + osso_rpc_t retval = { 0 }; + const osso_return_t ret = + osso_rpc_run_with_defaults(osso_context, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_OPEN_ACCOUNT, &retval, + DBUS_TYPE_STRING, account_id, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + printf("debug: %s: osso_rpc_run() failed.\n", __FUNCTION__); + return FALSE; + } else { + printf("debug: %s: osso_rpc_run() succeeded.\n", __FUNCTION__); + } + + osso_rpc_free_val(&retval); + + return TRUE; +} + +/** + * libmodest_dbus_client_delete_message: + * @osso_context: a valid #osso_context_t object. + * @msg_uri: A valid url to a mail + * + * This method will try to find the message supplied + * by @msg_uri and if found delete it. It will use + * remote procedure calls (rpc) over dbus to do so. + * + * Return value: TRUE on successs, FALSE on error + **/ +gboolean +libmodest_dbus_client_delete_message (osso_context_t *osso_ctx, + const char *msg_uri) +{ + osso_rpc_t retval = { 0 }; + osso_return_t ret; + + ret = osso_rpc_run_with_defaults (osso_ctx, + MODEST_DBUS_NAME, + MODEST_DBUS_METHOD_DELETE_MESSAGE, &retval, + DBUS_TYPE_STRING, msg_uri, + DBUS_TYPE_INVALID); + + if (ret != OSSO_OK) { + g_debug ("debug: osso_rpc_run() failed.\n"); + } else { + g_debug ("debug: osso_rpc_run() succeeded.\n"); + } + + osso_rpc_free_val (&retval); + + return ret == OSSO_OK; +} + +static void +modest_search_hit_free (ModestSearchHit *hit) +{ + g_free (hit->msgid); + g_slice_free (ModestSearchHit, hit); +} + +void +modest_search_hit_list_free (GList *hits) +{ + GList *iter; + + if (hits == NULL) { + return; + } + + for (iter = hits; iter; iter = iter->next) { + modest_search_hit_free ((ModestSearchHit *) iter->data); + } + + g_list_free (hits); +} + +static char * +_dbus_iter_get_string_or_null (DBusMessageIter *iter) +{ + const char *string = NULL; + char *ret = NULL; + + dbus_message_iter_get_basic (iter, &string); + + if (string && strlen (string)) { + ret = g_strdup (string); + } + + return ret; +} + +static guint64 +_dbus_iter_get_uint64 (DBusMessageIter *iter) +{ + dbus_uint64_t ui64v; + guint64 ret; + + ui64v = 0; + dbus_message_iter_get_basic (iter, &ui64v); + + ret = (guint64) ui64v; + + return ret; +} + + +static gint64 +_dbus_iter_get_int64 (DBusMessageIter *iter) +{ + dbus_int64_t i64v; + gint64 ret; + + i64v = 0; + dbus_message_iter_get_basic (iter, &i64v); + + ret = (gint64) i64v; + + return ret; +} + +static gboolean +_dbus_iter_get_boolean (DBusMessageIter *iter) + +{ + dbus_bool_t val; + gboolean ret; + + val = FALSE; + dbus_message_iter_get_basic (iter, &val); + + ret = (gboolean) val; + + return ret; +} + +/** Get the values from the complex type (SEARCH_HIT_DBUS_TYPE) + * in the D-Bus return message. */ +static ModestSearchHit * +modest_dbus_message_iter_get_search_hit (DBusMessageIter *parent) +{ + ModestSearchHit *hit; + DBusMessageIter child; + dbus_bool_t res; + int arg_type; + gboolean error; + + error = FALSE; + hit = g_slice_new0 (ModestSearchHit); + + arg_type = dbus_message_iter_get_arg_type (parent); + + if (arg_type != 'r') { + return NULL; + } + + dbus_message_iter_recurse (parent, &child); + + /* msgid */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + hit->msgid = _dbus_iter_get_string_or_null (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* subject */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + hit->subject = _dbus_iter_get_string_or_null (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* folder */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + hit->folder = _dbus_iter_get_string_or_null (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* sender */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + hit->sender = _dbus_iter_get_string_or_null (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* msize */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_UINT64) { + error = TRUE; + goto out; + } + + hit->msize = _dbus_iter_get_uint64 (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* has_attachment */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_BOOLEAN) { + error = TRUE; + goto out; + } + + hit->has_attachment = _dbus_iter_get_boolean (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* is_unread */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_BOOLEAN) { + error = TRUE; + goto out; + } + + hit->is_unread = _dbus_iter_get_boolean (&child); + + res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* timestamp */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_INT64) { + error = TRUE; + goto out; + } + + hit->timestamp = _dbus_iter_get_int64 (&child); + + res = dbus_message_iter_next (&child); + if (res == TRUE) { + error = TRUE; + goto out; + } + +out: + if (error) { + g_warning ("%s: Error during unmarshalling", __FUNCTION__); + modest_search_hit_free (hit); + hit = NULL; + } + + return hit; +} + +/** + * libmodest_dbus_client_search: + * @osso_ctx: A valid #osso_context_t object. + * @query: The term to search for. + * @folder: An url to specific folder or %NULL to search everywhere. + * @start_date: Search hits before this date will be ignored. + * @end_date: Search hits after this date will be ignored. + * @min_size: Messagers smaller then this size will be ingored. + * @flags: A list of flags where to search so the documentation + * of %ModestDBusSearchFlags for details. + * @hits: A pointer to a valid GList pointer that will contain the search + * hits (ModestSearchHit). The list and the items must be freed by the caller + * with modest_search_hit_list_free(). + * + * This method will search the folder specified by a valid url in @folder or all + * known accounts (local and remote) if %NULL for matches of the search term(s) + * specified in @query. It is legal to specify 0 in @start_date, @end_date and + * @min_size to ignore these parameters during the search otherwise those message + * that do not meet the specifed dates or size will be ignored. + * Where to search, be it subject, sender or the whole body can be specified by + * the @flags parameter. + * + * Upon success TRUE is returned and @hits will include the search hits or the list + * migh be empty if none of the messages matched the search criteria. The returned + * list must be freed with modest_search_hit_list_free (). It is save to pass + * %NULL to this function so you can call this function on the result list no matter + * if a hit was found or not (means the list is empty - i.e. %NULL) + * FALSE will only be return if an error during the remote procedure call (rpc) + * occured or if the specified folder could not be found. + * + * NOTE: The body of a message can only be searched if it was previously downloaded by + * modest. This function does also not attempt do to remote searches (i.e. IMAP search). + * + * Example to search every account for message containing "no": + * + * ModestDBusSearchFlags flags; + * osso_context_t *osso_context; + * GList *hits; + * GList *iter; + * gboolean res; + * + * [...] Initialize osso context [...] + * + * res = libmodest_dbus_client_search (osso_context, + * "no", + * NULL, + * 0, + * 0, + * 0, + * flags, + * &hits); + * + * for (iter = hits; iter; iter = iter->next) { + * ModestSearchHit *hit = (ModestSearchHit *) iter->data; + * + * [...] Do something with the hit [...] + * + * } + * + * modest_search_hit_list_free (hits); + * + * + * Return value: TRUE if the search succeded or FALSE for an error during the search + **/ +gboolean +libmodest_dbus_client_search (osso_context_t *osso_ctx, + const gchar *query, + const gchar *folder, + time_t start_date, + time_t end_date, + guint32 min_size, + ModestDBusSearchFlags flags, + GList **hits) +{ + + DBusMessage *msg; + dbus_bool_t res; + DBusConnection *con; + DBusMessageIter iter; + DBusMessageIter child; + DBusMessage *reply = NULL; + gint timeout; + int arg_type; + dbus_int64_t sd_v; + dbus_int64_t ed_v; + dbus_int32_t flags_v; + dbus_uint32_t size_v; + + if (query == NULL) { + return FALSE; + } + + con = osso_get_dbus_connection (osso_ctx); + + if (con == NULL) { + g_warning ("Could not get dbus connection\n"); + return FALSE; + + } + + + msg = dbus_message_new_method_call (MODEST_DBUS_SERVICE, + MODEST_DBUS_OBJECT, + MODEST_DBUS_IFACE, + MODEST_DBUS_METHOD_SEARCH); + + if (msg == NULL) { + //ULOG_ERR_F("dbus_message_new_method_call failed"); + return OSSO_ERROR; + } + + if (folder == NULL) { + folder = ""; + } + + sd_v = (dbus_int64_t) start_date; + ed_v = (dbus_int64_t) end_date; + flags_v = (dbus_int32_t) flags; + size_v = (dbus_uint32_t) min_size; + + res = dbus_message_append_args (msg, + DBUS_TYPE_STRING, &query, + DBUS_TYPE_STRING, &folder, + DBUS_TYPE_INT64, &sd_v, + DBUS_TYPE_INT64, &ed_v, + DBUS_TYPE_INT32, &flags_v, + DBUS_TYPE_UINT32, &size_v, + DBUS_TYPE_INVALID); + + dbus_message_set_auto_start (msg, TRUE); + + /* Use a long timeout (2 minutes) because the search currently + * gets folders and messages from the servers. */ + timeout = 120000; //milliseconds. + //osso_rpc_get_timeout (osso_ctx, &timeout); + + /*printf("DEBUG: %s: Before dbus_connection_send_with_reply_and_block().\n", + __FUNCTION__); */ + /* TODO: Detect the timeout somehow. */ + DBusError err; + dbus_error_init (&err); + reply = dbus_connection_send_with_reply_and_block (con, + msg, + timeout, + &err); + /* printf("DEBUG: %s: dbus_connection_send_with_reply_and_block() finished.\n", + __FUNCTION__); */ + + dbus_message_unref (msg); + + if (!reply) { + g_warning("%s: dbus_connection_send_with_reply_and_block() error: %s", + __FUNCTION__, err.message); + return FALSE; + } + + switch (dbus_message_get_type (reply)) { + + case DBUS_MESSAGE_TYPE_ERROR: + dbus_set_error_from_message (&err, reply); + //XXX to GError?! + dbus_error_free (&err); + dbus_message_unref (reply); + return FALSE; + + case DBUS_MESSAGE_TYPE_METHOD_RETURN: + /* ok we are good to go + * lets drop outa here and handle that */ + break; + default: + //ULOG_WARN_F("got unknown message type as reply"); + //retval->type = DBUS_TYPE_STRING; + //retval->value.s = g_strdup("Invalid return value"); + //XXX to GError?! + dbus_message_unref (reply); + return FALSE; + } + + g_debug ("%s: message return", __FUNCTION__); + + dbus_message_iter_init (reply, &iter); + arg_type = dbus_message_iter_get_arg_type (&iter); + + dbus_message_iter_recurse (&iter, &child); + *hits = NULL; + + do { + ModestSearchHit *hit; + + hit = modest_dbus_message_iter_get_search_hit (&child); + + if (hit) { + *hits = g_list_prepend (*hits, hit); + } + + } while (dbus_message_iter_next (&child)); + + dbus_message_unref (reply); + + + /* TODO: This is from osso source, do we need it? */ +#if 0 + /* Tell TaskNavigator to show "launch banner" */ + msg = dbus_message_new_method_call (TASK_NAV_SERVICE, + APP_LAUNCH_BANNER_METHOD_PATH, + APP_LAUNCH_BANNER_METHOD_INTERFACE, + APP_LAUNCH_BANNER_METHOD); + + if (msg == NULL) { + g_warn ("dbus_message_new_method_call failed"); + } + + + + dbus_message_append_args (msg, + DBUS_TYPE_STRING, + &service, + DBUS_TYPE_INVALID); + + b = dbus_connection_send (conn, msg, NULL); + + if (b == NULL) { + ULOG_WARN_F("dbus_connection_send failed"); + } + + dbus_message_unref (msg); +#endif + + return TRUE; +} + + +static void +modest_folder_result_free (ModestFolderResult *item) +{ + g_free (item->folder_name); + g_free (item->folder_uri); + g_slice_free (ModestFolderResult, item); +} + +void +modest_folder_result_list_free (GList *list) +{ + GList *iter; + + if (list == NULL) { + return; + } + + for (iter = list; iter; iter = iter->next) { + modest_folder_result_free ((ModestFolderResult *) iter->data); + } + + g_list_free (list); +} + + +/** Get the values from the complex type (GET_FOLDERS_RESULT_DBUS_TYPE) + * in the D-Bus return message. */ +static ModestFolderResult * +modest_dbus_message_iter_get_folder_item (DBusMessageIter *parent) +{ + gboolean error = FALSE; + ModestFolderResult *item = g_slice_new0 (ModestFolderResult); + + int arg_type = dbus_message_iter_get_arg_type (parent); + + if (arg_type != 'r') { + return NULL; + } + + DBusMessageIter child; + dbus_message_iter_recurse (parent, &child); + + /* folder name: */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + item->folder_name = _dbus_iter_get_string_or_null (&child); + + + dbus_bool_t res = dbus_message_iter_next (&child); + if (res == FALSE) { + error = TRUE; + goto out; + } + + /* folder URI: */ + arg_type = dbus_message_iter_get_arg_type (&child); + + if (arg_type != DBUS_TYPE_STRING) { + error = TRUE; + goto out; + } + + item->folder_uri = _dbus_iter_get_string_or_null (&child); + + +out: + if (error) { + g_warning ("%s: Error during unmarshalling", __FUNCTION__); + modest_folder_result_free (item); + item = NULL; + } + + return item; +} + +/** + * libmodest_dbus_client_get_folders: + * @osso_ctx: A valid #osso_context_t object. + * @folders: A pointer to a valid GList pointer that will contain the folder items + * (ModestFolderResult). The list and the items must be freed by the caller + * with modest_folder_result_list_free(). + * + * This method will obtain a list of folders in the default account. + * + * Upon success TRUE is returned and @folders will include the folders or the list + * might be empty if there are no folders. The returned + * list must be freed with modest_folder_result_list_free (). + * + * NOTE: A folder will only be retrieved if it was previously downloaded by + * modest. This function does also not attempt do to remote refreshes (i.e. IMAP). + * + * Return value: TRUE if the request succeded or FALSE for an error. + **/ +gboolean +libmodest_dbus_client_get_folders (osso_context_t *osso_ctx, + GList **folders) +{ + /* Initialize output argument: */ + if (folders) + *folders = NULL; + else + return FALSE; + + DBusConnection *con = osso_get_dbus_connection (osso_ctx); + + if (con == NULL) { + g_warning ("Could not get dbus connection\n"); + return FALSE; + + } + + DBusMessage *msg = dbus_message_new_method_call (MODEST_DBUS_SERVICE, + MODEST_DBUS_OBJECT, + MODEST_DBUS_IFACE, + MODEST_DBUS_METHOD_GET_FOLDERS); + + if (msg == NULL) { + //ULOG_ERR_F("dbus_message_new_method_call failed"); + return OSSO_ERROR; + } + + dbus_message_set_auto_start (msg, TRUE); + + /* Use a long timeout (2 minutes) because the search currently + * gets folders from the servers. */ + gint timeout = 120000; + //osso_rpc_get_timeout (osso_ctx, &timeout); + + DBusError err; + dbus_error_init (&err); + DBusMessage *reply = dbus_connection_send_with_reply_and_block (con, + msg, + timeout, + &err); + + dbus_message_unref (msg); + msg = NULL; + + if (reply == NULL) { + g_warning("%s: dbus_connection_send_with_reply_and_block() error:\n %s", + __FUNCTION__, err.message); + return FALSE; + } + + switch (dbus_message_get_type (reply)) { + + case DBUS_MESSAGE_TYPE_ERROR: + dbus_set_error_from_message (&err, reply); + //XXX to GError?! + dbus_error_free (&err); + dbus_message_unref (reply); + return FALSE; + + case DBUS_MESSAGE_TYPE_METHOD_RETURN: + /* ok we are good to go + * lets drop outa here and handle that */ + break; + default: + //ULOG_WARN_F("got unknown message type as reply"); + //retval->type = DBUS_TYPE_STRING; + //retval->value.s = g_strdup("Invalid return value"); + //XXX to GError?! + dbus_message_unref (reply); + return FALSE; + } + + g_debug ("%s: message return", __FUNCTION__); + + DBusMessageIter iter; + dbus_message_iter_init (reply, &iter); + /* int arg_type = dbus_message_iter_get_arg_type (&iter); */ + + DBusMessageIter child; + dbus_message_iter_recurse (&iter, &child); + + do { + ModestFolderResult *item = modest_dbus_message_iter_get_folder_item (&child); + + if (item) { + *folders = g_list_append (*folders, item); + } + + } while (dbus_message_iter_next (&child)); + + dbus_message_unref (reply); + + + /* TODO: This is from osso source, do we need it? */ +#if 0 + /* Tell TaskNavigator to show "launch banner" */ + msg = dbus_message_new_method_call (TASK_NAV_SERVICE, + APP_LAUNCH_BANNER_METHOD_PATH, + APP_LAUNCH_BANNER_METHOD_INTERFACE, + APP_LAUNCH_BANNER_METHOD); + + if (msg == NULL) { + g_warn ("dbus_message_new_method_call failed"); + } + + + + dbus_message_append_args (msg, + DBUS_TYPE_STRING, + &service, + DBUS_TYPE_INVALID); + + b = dbus_connection_send (conn, msg, NULL); + + if (b == NULL) { + ULOG_WARN_F("dbus_connection_send failed"); + } + + dbus_message_unref (msg); +#endif + + return TRUE; +} + + diff --git a/libmodest-dbus-client/src/libmodest-dbus-client.h b/libmodest-dbus-client/src/libmodest-dbus-client.h new file mode 100644 index 0000000..03ac5d8 --- /dev/null +++ b/libmodest-dbus-client/src/libmodest-dbus-client.h @@ -0,0 +1,177 @@ +/* Copyright (c) 2007, Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the Nokia Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __LIBMODEST_DBUS_CLIENT_H__ +#define __LIBMODEST_DBUS_CLIENT_H__ + +#include +#include +#include + + +/** + * libmodest_dbus_client_compose_mail: + * @osso_context: a valid osso_context instance + * @to: the To:-field of the message + * @cc: the Cc:-field of the message + * @bcc: the Bcc:-field of the message + * @subject: the Subject:-field of the message + * @body: the body (text) of the message + * @attachments: a list of (file://) URIs with the files to attach + * + * opens a new mail composer with the provided details filled in + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_compose_mail (osso_context_t *osso_context, const gchar *to, + const gchar *cc, const gchar *bcc, const gchar* subject, + const gchar* body, + GSList *attachments); + +/** + * libmodest_dbus_client_mail_to: + * @osso_context: a valid osso_context instance + * @mailto_uri: a 'mailto:foo@bar.cuux' URI + * + * opens a new mail composer with the provided details filled in, + * based on a mailto: string. apart from the To:-field (the first arg), + * also, cc, bcc, subject and body are supported, ie. "mailto:foo@bar.cuu?subject=test" + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_mail_to (osso_context_t *osso_context, + const gchar *mailto_uri); + + +/** + * libmodest_dbus_client_open_message: + * @osso_context: a valid osso_context instance + * @mail_uri: the unique URI referring to some message + * + * opens an existing message based on its URI; these URIs are unique pointers + * to some message, and are retrieved from modest. + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_open_message (osso_context_t *osso_context, + const gchar *mail_uri); + + +/** + * libmodest_dbus_client_send_and_receive: + * @osso_context: a valid osso_context instance + * + * send/receive messages + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_send_and_receive (osso_context_t *osso_context); + + + +/** + * libmodest_dbus_client_open_default_inbox: + * @osso_context: a valid osso_context instance + * + * start modest, and open the inbox for the default account + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context); + +/** + * libmodest_dbus_client_open_account: + * @osso_context: a valid osso_context instance + * @account_id: the unique ID of one account + * + * Starts Modest showing the account that is specified as + * parametter. Note that this only makes sense when the folder view is + * showing just one account + * + * Returns: TRUE upon success, FALSE otherwise + */ +gboolean libmodest_dbus_client_open_account (osso_context_t *osso_context, + const gchar *account_id); + + +/* + * below: functions specific to osso-global-search; not useful for other clients. + * + */ + +typedef enum { + + MODEST_DBUS_SEARCH_SUBJECT = (1 << 0), + MODEST_DBUS_SEARCH_SENDER = (1 << 1), + MODEST_DBUS_SEARCH_RECIPIENT = (1 << 2), + MODEST_DBUS_SEARCH_SIZE = (1 << 3), + MODEST_DBUS_SEARCH_BODY = (1 << 6) + +} ModestDBusSearchFlags; + +typedef struct { + gchar *msgid; /* E.g. the URI of the message. */ + gchar *subject; + gchar *folder; /* The name, not the URI. */ + gchar *sender; + guint64 msize; + gboolean has_attachment; + gboolean is_unread; + gint64 timestamp; +} ModestSearchHit; + + +void modest_search_hit_list_free (GList *hits); + + +gboolean libmodest_dbus_client_search (osso_context_t *osso_ctx, + const gchar *query, + const gchar *folder, + time_t start_date, + time_t end_date, + guint32 min_size, + ModestDBusSearchFlags flags, + GList **hits); + +gboolean libmodest_dbus_client_delete_message (osso_context_t *osso_ctx, + const char *msg_uri); + + +typedef struct { + gchar *folder_uri; + gchar *folder_name; +} ModestFolderResult; + +gboolean libmodest_dbus_client_get_folders (osso_context_t *osso_ctx, GList **folders); + +void modest_folder_result_list_free (GList *folders); + + + +#endif /* __LIBMODEST_DBUS_CLIENT_H__ */ diff --git a/libmodest-dbus-client/src/moving-to-libmodest-dbus-client.txt b/libmodest-dbus-client/src/moving-to-libmodest-dbus-client.txt new file mode 100644 index 0000000..fb6fefb --- /dev/null +++ b/libmodest-dbus-client/src/moving-to-libmodest-dbus-client.txt @@ -0,0 +1,64 @@ +Moving to libmodest-dbus-client +Time-stamp: <2007-10-11 18:16:37 (djcb)> +======================================== + +Some notes on how to migrate from osso-email-interface to the +new libmodest-dbus-client. + +1. debian/control +================= +In your debian/control-file, add "libmodest-dbus-client-dev" to your +Build-Depends, and remove any reference to osso-email-interface. + + +2. configure.(ac|in) +==================== +Add libmodest-dbus-client-1.0 to your modules, e.g. +PKG_CHECK_MODULES(LIBMODEST_DBUS_CLIENT,[libmodest-dbus-client-1.0]) +and, again, remove all reference to osso-email-interface, +libossoemailinterface and friends. + +3. #include +=========== +In your implementation files, remove (again) al references to +osso-email-interface, and add: +#include + + +4. replacing calls to osso-email-interface +========================================== +After all this has been done, all that is left is replacing the +library calls. + +We give the osso-email-interface calls, and the corresponding +libmodest-dbus-client call: + + +1. osso_email_files_email (osso_ctx, my_file_list); +becomes: + libmodest_dbus_client_compose_mail (osso_ctx, NULL, NULL, NULL, NULL, NULL, my_file_list); + + + + +2. osso_email_url_email (osso_ctx, url); +becomes: + libmodest_dbus_client_compose_mail (osso_ctx, NULL, NULL, NULL, NULL, url, NULL); + + + + +3. osso_email_emailto_email (osso_ctx, to_list); +becomes: + libmodest_dbus_client_mail_to (osso_ctx, to_list as_string); + +NOTE: libmodest_dbus_client expects to_list_as string, ie. a comma-separated +list of email addresses. + + + +Compile & run. That should do it! If you have any questions, pls. send them to +dirk-jan.binnema@nokia.com + + + diff --git a/src/dbus_api/modest-dbus-api.h b/src/dbus_api/modest-dbus-api.h deleted file mode 100644 index 0f84496..0000000 --- a/src/dbus_api/modest-dbus-api.h +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (c) 2007, Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Nokia Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __MODEST_DBUS_API__ -#define __MODEST_DBUS_API__ - - -/* Note that the com.nokia service name and /com/nokia object name - * are what is assumed by the, bizarrely named, osso_rpc_run_with_defaults() function, - * so they are probably a good choice. */ -#define MODEST_DBUS_NAME "modest" -#define MODEST_DBUS_SERVICE "com.nokia."MODEST_DBUS_NAME -#define MODEST_DBUS_OBJECT "/com/nokia/"MODEST_DBUS_NAME /* Also known as a D-Bus Path. */ -#define MODEST_DBUS_IFACE "com.nokia."MODEST_DBUS_NAME - - -#define MODEST_DBUS_METHOD_MAIL_TO "MailTo" -enum ModestDbusMailToArguments -{ - MODEST_DBUS_MAIL_TO_ARG_URI, - MODEST_DBUS_MAIL_TO_ARGS_COUNT -}; - -#define MODEST_DBUS_METHOD_OPEN_MESSAGE "OpenMessage" -enum ModestDbusOpenMessageArguments -{ - MODEST_DBUS_OPEN_MESSAGE_ARG_URI, - MODEST_DBUS_OPEN_MESSAGE_ARGS_COUNT -}; - -#define MODEST_DBUS_METHOD_OPEN_ACCOUNT "OpenAccount" -enum ModestDbusOpenAccountArguments -{ - MODEST_DBUS_OPEN_ACCOUNT_ARG_ID, - MODEST_DBUS_OPEN_ACCOUNT_ARGS_COUNT -}; - -#define MODEST_DBUS_METHOD_SEND_RECEIVE "SendReceive" - -#define MODEST_DBUS_METHOD_COMPOSE_MAIL "ComposeMail" -enum ModestDbusComposeMailArguments -{ - MODEST_DBUS_COMPOSE_MAIL_ARG_TO, - MODEST_DBUS_COMPOSE_MAIL_ARG_CC, - MODEST_DBUS_COMPOSE_MAIL_ARG_BCC, - MODEST_DBUS_COMPOSE_MAIL_ARG_SUBJECT, - MODEST_DBUS_COMPOSE_MAIL_ARG_BODY, - MODEST_DBUS_COMPOSE_MAIL_ARG_ATTACHMENTS, - MODEST_DBUS_COMPOSE_MAIL_ARGS_COUNT -}; - -#define MODEST_DBUS_METHOD_DELETE_MESSAGE "DeleteMessage" -enum ModestDbusDeleteMessageArguments -{ - MODEST_DBUS_DELETE_MESSAGE_ARG_URI, - MODEST_DBUS_DELETE_MESSAGE_ARGS_COUNT -}; - -#define MODEST_DBUS_METHOD_OPEN_DEFAULT_INBOX "OpenDefaultInbox" - -/* - * these methods are for debugging only, and should _not_ be - * exported through libmodest-dbus-client - */ -#define MODEST_DBUS_METHOD_DUMP_OPERATION_QUEUE "DumpOperationQueue" -#define MODEST_DBUS_METHOD_DUMP_ACCOUNTS "DumpAccounts" -#define MODEST_DBUS_METHOD_DUMP_SEND_QUEUES "DumpSendQueues" - - - -/* These are handle via normal D-Bus instead of osso-rpc: */ -#define MODEST_DBUS_METHOD_SEARCH "Search" -#define MODEST_DBUS_METHOD_GET_FOLDERS "GetFolders" - -/** This is an undocumented hildon-desktop method that is - * sent to applications when they are started from the menu, - * but not when started from D-Bus activation, so that - * applications can be started without visible UI. - * At least, I think so. murrayc. - **/ -#define MODEST_DBUS_METHOD_TOP_APPLICATION "top_application" - -#endif /* __MODEST_DBUS_API__ */ -- 1.7.9.5