X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-maemo-utils.h;h=a574aa3c9ca46fe025df5a8c5c60136664b63f8c;hb=1881edeebc36271aba89cb1b35e09567a2904731;hp=7282a9c380db883a4d591fceb3e84517b2f86588;hpb=434f59409e20ea0ae3a828422d1c9cc91fdde8fa;p=modest diff --git a/src/maemo/modest-maemo-utils.h b/src/maemo/modest-maemo-utils.h index 7282a9c..a574aa3 100644 --- a/src/maemo/modest-maemo-utils.h +++ b/src/maemo/modest-maemo-utils.h @@ -32,7 +32,11 @@ #define __MODEST_MAEMO_UTILS_H__ #include +#include /* for FILE* */ #include +#include +#include + #define MODEST_MAEMO_UTILS_MYDOCS_FOLDER "MyDocs" #define MODEST_MAEMO_UTILS_DEFAULT_IMAGE_FOLDER ".images" @@ -87,14 +91,18 @@ 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 + * @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. + * Returns: a #TnyFsStream, or %NULL if operation failed. Note that it is + * possible that the file already exists but it is not writable. In that case, + * the function would return NULL and @path would contain its path. */ -TnyFsStream *modest_maemo_utils_create_temp_stream (const gchar *extension, gchar **path); +TnyFsStream *modest_maemo_utils_create_temp_stream (const gchar *orig_name, const gchar *hash_base, gchar **path); /** * modest_maemo_utils_get_supported_secure_authentication_methods: @@ -122,14 +130,85 @@ GList* modest_maemo_utils_get_supported_secure_authentication_methods (ModestTra */ void modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser); -/** modest_maemo_show_information_note_and_forget: + +/** + * modest_maemo_utils_get_osso_context: + * + * get the osso_context pointer for this application + * + * Return: the osso context pointer + */ +osso_context_t *modest_maemo_utils_get_osso_context (void); + + + +/** 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. * - * Show the information note and destroy it when it is closed, without + * 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_information_note_and_forget (GtkWindow *parent_window, const gchar* message); +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); + + +/** + * modest_maemo_get_osso_context: + * + * retrieve the osso context for this application + * + * Returns: the current osso_context_t ptr + */ +osso_context_t* modest_maemo_utils_get_osso_context (void); + +/** + * modest_maemo_set_osso_context: + * + * remember the osso-context for this application + * + * @osso_context: a valid osso_context_t pointer + * + */ +void modest_maemo_utils_set_osso_context (osso_context_t *osso_context); #endif /*__MODEST_MAEMO_UTILS_H__*/