* add debugging code to the send-queue and the operations-queue;
[modest] / src / modest-mail-operation.h
index badbe1a..f86812a 100644 (file)
@@ -171,7 +171,6 @@ typedef void (*UpdateAccountCallback) (ModestMailOperation *self,
                                       TnyList *new_headers,
                                       gpointer user_data);
 
-
 /**
  * SaveToDraftsCallback:
  *
@@ -187,6 +186,26 @@ typedef void (*SaveToDraftstCallback) (ModestMailOperation *self,
                                       gpointer user_data);
 
 
+typedef gboolean (*RetrieveAllCallback) (GObject *source,
+                                        guint num_msgs,
+                                        guint limit);
+
+/**
+ * CreateFolderUserCallback:
+ *
+ * @mail_op: the current #ModestMailOperation.
+ * @folder: a #TnyFolder summary item.
+ * @user_data: generic data passed to user defined function.
+ *
+ * This function will be called after get_msg_cb private function, which is
+ * used as tinymail operation callback. The private function fills private 
+ * fields of mail operation and calls user defined callback if it exists.
+ */
+typedef void (*CreateFolderUserCallback) (ModestMailOperation *mail_op, 
+                                         TnyFolderStore *parent_folder,
+                                         TnyFolder *new_folder, 
+                                         gpointer user_data);
+
 /* This struct represents the internal state of a mail operation in a
    given time */
 typedef struct {
@@ -382,6 +401,7 @@ void modest_mail_operation_save_to_drafts   (ModestMailOperation *self,
  * modest_mail_operation_update_account:
  * @self: a #ModestMailOperation
  * @account_name: the id of a Modest account
+ * @poke_all: if TRUE it will also do a poke_status over all folders of the account
  * 
  * Asynchronously refreshes the root folders of the given store
  * account. The caller should add the #ModestMailOperation to a
@@ -402,10 +422,11 @@ void modest_mail_operation_save_to_drafts   (ModestMailOperation *self,
  * Note that the account_name *MUST* be a modest account name, not a
  * tinymail store account name
  * 
- * Returns: TRUE if the mail operation could be started, or FALSE otherwise
  **/
-gboolean      modest_mail_operation_update_account (ModestMailOperation *self,
+void          modest_mail_operation_update_account (ModestMailOperation *self,
                                                    const gchar *account_name,
+                                                   gboolean poke_all,
+                                                   RetrieveAllCallback retrieve_all_cb,
                                                    UpdateAccountCallback callback,
                                                    gpointer user_data);
 
@@ -425,9 +446,11 @@ gboolean      modest_mail_operation_update_account (ModestMailOperation *self,
  * 
  * Returns: a newly created #TnyFolder or NULL in case of error.
  **/
-TnyFolder*    modest_mail_operation_create_folder  (ModestMailOperation *self,
-                                                   TnyFolderStore *parent,
-                                                   const gchar *name);
+void    modest_mail_operation_create_folder  (ModestMailOperation *self,
+                                             TnyFolderStore *parent,
+                                             const gchar *name,
+                                             CreateFolderUserCallback callback,
+                                             gpointer user_data);
 
 /**
  * modest_mail_operation_remove_folder:
@@ -673,8 +696,38 @@ void      modest_mail_operation_refresh_folder  (ModestMailOperation *self,
                                                 RefreshAsyncUserCallback user_callback,
                                                 gpointer user_data);
 
+/**
+ * modest_mail_operation_get_account:
+ * @self: a #ModestMailOperation
+ * 
+ * Gets the account associated to a mail operation
+ * 
+ * Returns: the #TnyAccount associated to the #ModestMailOperation
+ **/
 TnyAccount *modest_mail_operation_get_account   (ModestMailOperation *self);
 
+
+/**
+ * modest_mail_operation_noop:
+ * @self: a #ModestMailOperation
+ * 
+ * Does nothing except emitting operation-started and
+ * operation-finished
+ **/
+void modest_mail_operation_noop (ModestMailOperation *self);
+
+
+/**
+ * modest_mail_operation_to_string:
+ * @self: a #ModestMailOperation
+ * 
+ * get a string representation of the mail operation (for debugging)
+ *
+ * Returns: a newly allocated string
+ **/
+gchar* modest_mail_operation_to_string (ModestMailOperation *self);
+
+
 G_END_DECLS
 
 #endif /* __MODEST_MAIL_OPERATION_H__ */