TnyList *new_headers,
gpointer user_data);
-
/**
* SaveToDraftsCallback:
*
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 {
* 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
* 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);
*
* 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:
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__ */