2007-07-09 Murray Cumming <murrayc@murrayc.com>
[modest] / src / maemo / modest-maemo-utils.h
index aa23b4f..7282a9c 100644 (file)
 #define __MODEST_MAEMO_UTILS_H__
 
 #include <gtk/gtk.h>
+#include <modest-protocol-info.h>
+
+#define MODEST_MAEMO_UTILS_MYDOCS_FOLDER "MyDocs"
+#define MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER ".images"
+
+typedef enum {
+       MODEST_MAEMO_UTILS_GET_SUPPORTED_SECURE_AUTHENTICATION_ERROR_CANCELED
+} ModestMaemoUtilsGetSupportedSecureAuthenticationError;
+
+GQuark modest_maemo_utils_get_supported_secure_authentication_error_quark (void);
 
 /**
  * modest_maemo_utils_menubar_to_menu:
@@ -55,5 +65,71 @@ GtkWidget*    modest_maemo_utils_menubar_to_menu (GtkUIManager *ui_manager);
  */
 void modest_maemo_utils_get_device_name (void);
 
+/**
+ * modest_maemo_utils_folder_writable:
+ * @filename: a string
+ *
+ * Checks if @filename is in a writable folder
+ *
+ * Returns: %TRUE if @filename is writable, %FALSE otherwise
+ */
+gboolean modest_maemo_utils_folder_writable (const gchar *filename);
+
+/**
+ * modest_maemo_utils_file_exists:
+ * @filename: a string
+ *
+ * Checks if @filename exists
+ *
+ * Returns: %TRUE if @filename currently exists, %FALSE otherwise
+ */
+gboolean modest_maemo_utils_file_exists (const gchar *filename);
+
+/**
+ * modest_maemo_utils_create_temp_stream:
+ * @extension: a string with the extension the file should get, or %NULL
+ * @path: a string with the created file path
+ *
+ * Creates a temporary fs stream 
+ *
+ * Returns: a #TnyFsStream, or %NULL if operation failed.
+ */
+TnyFsStream *modest_maemo_utils_create_temp_stream (const gchar *extension, gchar **path);
+
+/**
+ * modest_maemo_utils_get_supported_secure_authentication_methods:
+ * @proto: the protocol
+ * @hostname: hostname of the mail server to check
+ * @port: mail server port
+ * @username: username of the account to check for
+ * @parent_window: a GtkWindow that can be used a parent for progress indication
+ *
+ * Get a list of supported authentication methods of the server
+ *  
+ * Returns: GList* of the method names. This list needs to be freed using g_list_free.
+ *
+ */
+
+GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTransportStoreProtocol proto, 
+       const gchar* hostname, gint port, const gchar* username, GtkWindow *parent_window, GError** error);
+
+/**
+ * modest_maemo_utils_setup_images_filechooser:
+ * @chooser: a #GtkFileChooser
+ *
+ * Configures the default folder, and mime filter of a filechooser
+ * for images.
+ */
+void modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser);
+
+/** modest_maemo_show_information_note_and_forget:
+ * @parent_window: The window for which the note should be transient.
+ * @message: The text to show.
+ * 
+ * Show the information note and destroy it when it is closed, without 
+ * blocking. Use this when you don't want to use gtk_dialog_run(), which might lead 
+ * to hangs.
+ */
+void modest_maemo_show_information_note_and_forget (GtkWindow *parent_window, const gchar* message);
 
 #endif /*__MODEST_MAEMO_UTILS_H__*/