X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-maemo-utils.h;h=42cef66c7b264224553637296cf6edfec0a06337;hb=86d39a078ecce7b01f067ca8df29817887beeb15;hp=9f1735f08b5856fc43497a5e4780aa1b6e779cce;hpb=6bab4bfef92fef73852d6acd51d1ebf381a338e4;p=modest diff --git a/src/maemo/modest-maemo-utils.h b/src/maemo/modest-maemo-utils.h index 9f1735f..42cef66 100644 --- a/src/maemo/modest-maemo-utils.h +++ b/src/maemo/modest-maemo-utils.h @@ -32,7 +32,18 @@ #define __MODEST_MAEMO_UTILS_H__ #include +#include /* for FILE* */ #include +#include + +#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: @@ -78,19 +89,23 @@ gboolean modest_maemo_utils_file_exists (const gchar *filename); /** * modest_maemo_utils_create_temp_stream: + * @orig_name: a string with the original name of the extension, or %NULL + * @hash_base: if %NULL, subdir will be random. If not, it will be a hash + * of this. * @path: a string with the created file path * - * Creates a temporary fs stream + * Creates a temporary fs stream, in a random subdir of /tmp or /var/tmp. * * Returns: a #TnyFsStream, or %NULL if operation failed. */ -TnyFsStream *modest_maemo_utils_create_temp_stream (gchar **path); +TnyFsStream *modest_maemo_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base, gchar **path); /** - * modest_protocol_info_protocol_is_local_store: + * 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 @@ -100,6 +115,64 @@ TnyFsStream *modest_maemo_utils_create_temp_stream (gchar **path); */ GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTransportStoreProtocol proto, - const gchar* hostname, gint port, GtkWindow *parent_window); + 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_in_main_context_and_forget: + * @parent_window: The window for which the note should be transient. + * @message: The text to show. + * + * This calls modest_maemo_show_information_note_and_forget() in an idle handler. + * This should be used when you are not sure that you are in the main context, + * because you should try to use GTK+ UI code only in the main context. + */ +void modest_maemo_show_information_note_in_main_context_and_forget (GtkWindow *parent_window, const gchar* message); + +/** modest_maemo_show_dialog_and_forget: + * @parent_window: The window for which the note should be transient. + * @message: The dialog to show. + * + * Show the dialog 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_dialog_and_forget (GtkWindow *parent_window, GtkDialog *dialog); + + +/** + * modest_maemo_open_mcc_mapping_file: + * + * open the mcc mapping file, or NULL if it fails + * + * Returns: file ptr or NULL in case of error + */ +FILE* modest_maemo_open_mcc_mapping_file (void); + +/** + * modest_maemo_set_thumbable_scrollbar: + * @win: a scrollable window + * @thumbable: set it to thumbable (TRUE) or small (FALSE) + * + * changes the thumbability of scrollbars in a scrollable window + */ +void modest_maemo_set_thumbable_scrollbar (GtkScrolledWindow *win, gboolean thumbable); + + +/** + * modest_maemo_toggle_action_set_active_block_notify: + * @action: a #GtkToggleAction + * @value: a #gboolean + * + * updates the toggle action active status, but blocking the notification of the changes. + */ +void modest_maemo_toggle_action_set_active_block_notify (GtkToggleAction *action, gboolean value); #endif /*__MODEST_MAEMO_UTILS_H__*/