* leak fixes; free both list and its elements when we call modest_account_mgr_account...
[modest] / src / maemo / modest-maemo-utils.h
index 99fb67b..186c7fe 100644 (file)
 #ifndef __MODEST_MAEMO_UTILS_H__
 #define __MODEST_MAEMO_UTILS_H__
 
+#include <gtk/gtk.h>
+#include <modest-protocol-info.h>
+
+/**
+ * modest_maemo_utils_menubar_to_menu:
+ * @ui_manager: a ui manager, with the menubar at "/MenuBar" 
+ * 
+ * convert a menubar description (in a GtkUIManager) in to a menu
+ * 
+ * Returns: a new menu, or NULL in case of error
+ */
+GtkWidget*    modest_maemo_utils_menubar_to_menu (GtkUIManager *ui_manager);
+
+
 /**
  * modest_maemo_utils_get_device_name
  *
  * get the name for this device. Note: this queries the bluetooth
  * name over DBUS, and may block. The result will be available in
- * MODEST_DEVICE_NAME in ModestConf; it will be updated when it
+ * MODEST_CONF_DEVICE_NAME in ModestConf; it will be updated when it
  * changes
  * 
  */
 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_protocol_info_protocol_is_local_store:
+ * @proto: the protocol
+ * @hostname: hostname of the mail server to check
+ * @port: mail server port
+ * @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, GtkWindow *parent_window);
 
 #endif /*__MODEST_MAEMO_UTILS_H__*/