Added OpenAccount DBUS method
authorSergio Villar Senin <svillar@igalia.com>
Fri, 27 Feb 2009 12:04:09 +0000 (12:04 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Fri, 27 Feb 2009 12:04:09 +0000 (12:04 +0000)
pmo-trunk-r7724

libmodest-dbus-client/libmodest-dbus-client.c
libmodest-dbus-client/libmodest-dbus-client.h
src/dbus_api/modest-dbus-api.h
src/dbus_api/modest-dbus-callbacks.h

index d4ab4c9..874d5db 100644 (file)
@@ -222,6 +222,30 @@ libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context)
        return TRUE;
 }
 
+gboolean
+libmodest_dbus_client_open_account (osso_context_t *osso_context,
+                                   const gchar *account_id)
+{
+       osso_rpc_t retval;
+       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.
index e9e35a2..03ac5d8 100644 (file)
@@ -62,7 +62,7 @@ gboolean libmodest_dbus_client_compose_mail (osso_context_t *osso_context, const
  * 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, 
@@ -76,7 +76,7 @@ gboolean libmodest_dbus_client_mail_to (osso_context_t *osso_context,
  *
  * 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, 
@@ -88,7 +88,7 @@ gboolean  libmodest_dbus_client_open_message (osso_context_t *osso_context,
  * @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);
@@ -100,11 +100,24 @@ gboolean libmodest_dbus_client_send_and_receive (osso_context_t *osso_context);
  * @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);
 
 
 /*
index 4e980bc..0f84496 100644 (file)
@@ -55,6 +55,13 @@ enum ModestDbusOpenMessageArguments
        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"
index 5063767..9d40fd9 100644 (file)
@@ -38,7 +38,7 @@
 gint modest_dbus_req_handler(const gchar * interface, const gchar * method,
                       GArray * arguments, gpointer data,
                       osso_rpc_t * retval);
-                      
+
 void modest_osso_cb_hw_state_handler(osso_hw_state_t *state, gpointer data);
 
 DBusHandlerResult modest_dbus_req_filter (DBusConnection *con,