ac6af70828550b216009a2435d7303ba1dca0b4d
[modest] / tests / dbus_api / test_compose_mail.c
1 #include <libmodest-dbus-client/libmodest-dbus-client.h>
2 #include <stdio.h>
3
4
5 int main(int argc, char *argv[])
6 {
7         GSList *attachments = NULL;
8         /* Initialize maemo application */
9         osso_context_t * osso_context = osso_initialize(
10             "test_hello", "0.0.1", TRUE, NULL);
11                
12         /* Check that initialization was ok */
13         if (osso_context == NULL)
14         {
15                 printf("osso_initialize() failed.\n");
16             return OSSO_ERROR;
17         }
18         
19         /* Call the function in libmodest-dbus-client: */
20         /* TODO: The Message URI system is not yet implemented. */
21         
22         attachments = g_slist_append(attachments, "/home/m/MyDocs/bar1.txt,/home/m/MyDocs/foo.txt");
23         
24         const gboolean ret = libmodest_dbus_client_compose_mail (
25                 osso_context,
26                 "marcusb@openismus.com", /* to */
27                 "cc test", /* cc */
28                 "bcc test", /* bcc */
29                 "test subject", /* subject */
30                 "test body\nline two", /* body */
31                 attachments);
32                 
33         
34         if (!ret) {
35                         printf("libmodest_dbus_client_open_message() failed.\n");
36                 return OSSO_ERROR;
37         } else {
38                 printf("libmodest_dbus_client_open_message() succeeded!\n");
39         }
40                 
41     /* Exit */
42     return 0;
43 }