When moving messages to a local folder don't try to connect if the
[modest] / src / modest-platform.h
index 3b321b3..020a2c1 100644 (file)
@@ -215,13 +215,15 @@ void      modest_platform_run_sort_dialog       (GtkWindow *parent_window,
 /*
  * modest_platform_connect_and_wait:
  * @parent_window: the parent #GtkWindow for any interactive or progress feedback UI.
+ * @account: The account to be used.
  * @return value: Whether a connection was made.
  * 
  * Attempts to make a connection, possibly showing interactive UI to achieve this.
  * This will return TRUE immediately if a connection is already open.
  * Otherwise, this function blocks until the connection attempt has either succeded or failed.
+ * This also sets the account to online, if it is a store account, in case it has been set to offline mode.
  */            
-gboolean modest_platform_connect_and_wait (GtkWindow *parent_window);
+gboolean modest_platform_connect_and_wait (GtkWindow *parent_window, TnyAccount *account);
 
                
 /*
@@ -247,6 +249,14 @@ gboolean modest_platform_connect_and_wait_if_network_account (GtkWindow *parent_
 gboolean modest_platform_connect_and_wait_if_network_folderstore (GtkWindow *parent_window, TnyFolderStore *folder_store);
 
 /**
+ * modest_platform_is_network_folderstore:
+ * @folder_store: The folder store (folder or account) that needs to
+ * decide if need a connection in subsequent operations.
+ * @return value: Whether a connection is necessary for this folder_store.
+ */
+gboolean modest_platform_is_network_folderstore (TnyFolderStore *folder_store);
+
+/**
  * modest_platform_set_update_interval:
  * @minutes: The number of minutes between updates, or 0 for no updates.
  * 
@@ -305,6 +315,46 @@ GtkWidget *
 modest_platform_animation_banner (GtkWidget *parent,
                                  const gchar *annimation_name,
                                  const gchar *text);
+                                 
+/* TODO: This isn't platform-dependent, so this isn't the best place for this. */
+/* Return TRUE immediately if the account is already online,
+ * otherwise check every second for NUMBER_OF_TRIES seconds and return TRUE as 
+ * soon as the account is online, or FALSE if the account does 
+ * not become online in the NUMBER_OF_TRIES seconds.
+ * This is useful when the D-Bus method was run immediately after 
+ * the application was started (when using D-Bus activation), 
+ * because the account usually takes a short time to go online.
+ * The return value is maybe not very useful.
+ */
+gboolean modest_platform_check_and_wait_for_account_is_online(TnyAccount *account);
+
+
+
+/**
+ * modest_platform_run_certificate_confirmation_dialog:
+ * @server_name: name of the server we get this dialog for
+ * @certificate: the text representation of the certificate
+ *
+ * show the unknown-certificate confirmation dialog
+ *
+ *  Returns: TRUE (Ok-pressed) or FALSE (cancel pressed)
+ **/
+gboolean modest_platform_run_certificate_conformation_dialog (const gchar* server_name,
+                                                             const gchar *certificate);
+
+
+/**
+ * modest_platform_run_alert_dialog:
+ * @prompt: prompt for the dialog
+ * @is_question: is it a question dialog? 
+ *
+ * show the alert dialog for TnyAlerts
+ * if it's a aquest
+ *
+ *  Returns: TRUE (Ok-pressed) or FALSE (cancel pressed)
+ **/
+gboolean modest_platform_run_alert_dialog (const gchar* prompt, gboolean is_question);
+
 
 G_END_DECLS