Add store protocol to the data obtained in DBUS GetUnreadMessages
[modest] / libmodest-dbus-client / src / libmodest-dbus-client.h
index e0aa53a..5ffa393 100644 (file)
@@ -119,6 +119,18 @@ gboolean libmodest_dbus_client_send_and_receive_full (osso_context_t *osso_conte
                                                      const gchar *account,
                                                      gboolean manual);
 
+/**
+ * libmodest_dbus_client_update_folder_counts:
+ * @osso_context: a valid osso_context instance
+ * @account: the account name
+ *
+ * updates folder counts of @account.
+ *
+ * Returns: %TRUE upon success, %FALSE otherwise
+ */
+gboolean libmodest_dbus_client_update_folder_counts (osso_context_t *osso_context,
+                                                    const gchar *account);
+
 
 
 /**
@@ -132,24 +144,43 @@ gboolean libmodest_dbus_client_send_and_receive_full (osso_context_t *osso_conte
 gboolean libmodest_dbus_client_open_default_inbox (osso_context_t *osso_context);
 
 /**
- * libmodest_dbus_client_open_account:
+ * libmodest_dbus_client_open_edit_accounts_dialog
+ * @osso_context: a valid osso_context instance
+ *
+ * Starts Modest showing the edit accounts dialog on top of the
+ * initial window. If there is no account then the new account dialog
+ * is automatically launched
+ *
+ * Returns: TRUE upon success, FALSE otherwise
+ */
+gboolean  libmodest_dbus_client_open_edit_accounts_dialog (osso_context_t *osso_context);
+
+/**
+ * libmodest_dbus_client_open_default_inbox:
  * @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
+ * start modest, and open the inbox for the default account
  *
  * Returns: TRUE upon success, FALSE otherwise
  */
-gboolean  libmodest_dbus_client_open_account (osso_context_t *osso_context,
-                                             const gchar *account_id);
+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 id of the account to open
+ *
+ * Shows the folders of a given 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 {
 
@@ -173,6 +204,7 @@ typedef struct {
 } ModestSearchHit;
 
 
+void modest_account_hits_list_free (GList *account_hits);
 void modest_search_hit_list_free (GList *hits);
 
 
@@ -185,6 +217,25 @@ gboolean libmodest_dbus_client_search            (osso_context_t          *osso_
                                                  ModestDBusSearchFlags    flags,
                                                  GList                  **hits);
 
+typedef struct {
+       gchar *subject;
+       time_t timestamp;
+} ModestGetUnreadMessagesHit;
+
+typedef struct {
+       gchar *account_id;
+       gchar *account_name;
+       gchar *store_protocol;
+       GList *hits;
+} ModestAccountHits;
+
+/**
+ * this method returns in account_hit_list a list of #ModestAccountHits.
+ */
+gboolean libmodest_dbus_client_get_unread_messages (osso_context_t *osso_ctx,
+                                                   gint msgs_per_account,
+                                                   GList **account_hits_list);
+
 gboolean libmodest_dbus_client_delete_message   (osso_context_t   *osso_ctx,
                                                 const char       *msg_uri);