Added an extra folder to be looked into to confirm with the changes made to osso...
[modest] / src / modest-mail-operation.h
index 8ff9dfe..2894a09 100644 (file)
@@ -88,7 +88,8 @@ typedef void (*ErrorCheckingUserCallback) (ModestMailOperation *mail_op, gpointe
 /**
  * GetMsgAsyncUserCallback:
  *
- * @obj: a #GObject generic object which has created current mail operation.
+ * @mail_op: the current #ModestMailOperation.
+ * @header: a #TnyHeader summary item.
  * @msg: a #TnyMsg message retrieved by async operation.
  * @user_data: generic data passed to user defined function.
  *
@@ -117,7 +118,7 @@ typedef void (*XferMsgsAsynUserCallback) (const GObject *obj, gpointer user_data
 /**
  * RefreshAsyncUserCallback:
  *
- * @obj: a #GObject generic object which has created current mail operation.
+ * @mail_op: the current #ModestMailOperation.
  * @folder: a #TnyFolder which has been refreshed .
  * @user_data: generic data passed to user defined function.
  *
@@ -125,10 +126,25 @@ typedef void (*XferMsgsAsynUserCallback) (const GObject *obj, gpointer user_data
  * used as tinymail operation callback. The private function fills private 
  * fields of mail operation and calls user defined callback if it exists.
  */
-typedef void (*RefreshAsyncUserCallback) (const GObject *obj, 
+typedef void (*RefreshAsyncUserCallback) (ModestMailOperation *mail_op, 
                                          TnyFolder *folder, 
                                          gpointer user_data);
 
+/**
+ * UpdateAccountCallback:
+ *
+ * @obj: a #GObject generic object which has created current mail operation.
+ * @new_messages: the amount of new messages received
+ * @user_data: generic data passed to user defined function.
+ *
+ * This is the callback of the update_account operation. It informs
+ * the caller about the amount of new messages that have been
+ * downloaded
+ */
+typedef void (*UpdateAccountCallback) (ModestMailOperation *self, 
+                                      gint new_messages,
+                                      gpointer user_data);
+
 /* This struct represents the internal state of a mail operation in a
    given time */
 typedef struct {
@@ -340,7 +356,9 @@ void    modest_mail_operation_save_to_drafts   (ModestMailOperation *self,
  * Returns: TRUE if the mail operation could be started, or FALSE otherwise
  **/
 gboolean      modest_mail_operation_update_account (ModestMailOperation *self,
-                                                   const gchar *account_name);
+                                                   const gchar *account_name,
+                                                   UpdateAccountCallback callback,
+                                                   gpointer user_data);
 
 /* Functions that perform store operations */
 
@@ -397,6 +415,8 @@ void          modest_mail_operation_rename_folder  (ModestMailOperation *self,
  * @folder: a #TnyFolder
  * @parent: the new parent of the folder as #TnyFolderStore
  * @delete_original: wheter or not delete the original folder
+ * @user_callback: a #XferMsgsAsynUserCallback function to call after tinymail callback execution.
+ * @user_data: generic user data which will be passed to @user_callback function.
  * 
  * Sets the given @folder as child of a provided #TnyFolderStore. This
  * operation also transfers all the messages contained in the folder
@@ -411,7 +431,10 @@ void          modest_mail_operation_rename_folder  (ModestMailOperation *self,
 void          modest_mail_operation_xfer_folder    (ModestMailOperation *self,
                                                    TnyFolder *folder,
                                                    TnyFolderStore *parent,
-                                                   gboolean delete_original);
+                                                   gboolean delete_original,
+                                                   XferMsgsAsynUserCallback user_callback,
+                                                   gpointer user_data);
+                                                   
 
 /* Functions that performs msg operations */