X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmaemo%2Fmodest-maemo-utils.h;h=c845d1fa086f48c743667200f5b36f1160e7e3e5;hp=a147024be7a06908f319d9228fdb5d7287bba4e4;hb=12a672c559d983c4e49a7e4054ee14c0177ecb1c;hpb=4980959c5745402614ce74aefaa285c0c650d3c9 diff --git a/src/maemo/modest-maemo-utils.h b/src/maemo/modest-maemo-utils.h index a147024..c845d1f 100644 --- a/src/maemo/modest-maemo-utils.h +++ b/src/maemo/modest-maemo-utils.h @@ -32,27 +32,15 @@ #define __MODEST_MAEMO_UTILS_H__ #include -#include +#include /* for FILE* */ +#include +#include +#include "widgets/modest-global-settings-dialog.h" +#include "widgets/modest-validating-entry.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: - * @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 @@ -65,93 +53,65 @@ 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 + * modest_maemo_utils_setup_images_filechooser: + * @chooser: a #GtkFileChooser * - * Returns: %TRUE if @filename currently exists, %FALSE otherwise + * Configures the default folder, and mime filter of a filechooser + * for images. */ -gboolean modest_maemo_utils_file_exists (const gchar *filename); +void modest_maemo_utils_setup_images_filechooser (GtkFileChooser *chooser); + /** - * modest_maemo_utils_create_temp_stream: - * @orig_name: a string with the original name of the extension, or %NULL - * @path: a string with the created file path - * - * Creates a temporary fs stream, in a random subdir of /tmp or /var/tmp. + * modest_maemo_utils_get_osso_context: * - * Returns: a #TnyFsStream, or %NULL if operation failed. + * get the osso_context pointer for this application + * + * Return: the osso context pointer */ -TnyFsStream *modest_maemo_utils_create_temp_stream (const gchar *orig_name, gchar **path); +osso_context_t *modest_maemo_utils_get_osso_context (void); /** - * 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. + * 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); -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 + * modest_maemo_get_osso_context: * - * 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. + * retrieve the osso context for this application * - * 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. + * Returns: the current osso_context_t ptr */ -void modest_maemo_show_information_note_in_main_context_and_forget (GtkWindow *parent_window, const gchar* message); +osso_context_t* modest_maemo_utils_get_osso_context (void); -/** modest_maemo_show_dialog_and_forget: - * @parent_window: The window for which the note should be transient. - * @message: The dialog to show. +/** + * modest_maemo_set_osso_context: + * + * remember the osso-context for this application * - * 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. + * @osso_context: a valid osso_context_t pointer + * */ -void modest_maemo_show_dialog_and_forget (GtkWindow *parent_window, GtkDialog *dialog); - - -void modest_maemo_set_thumbable_scrollbar (GtkScrolledWindow *win, gboolean thumbable); +void modest_maemo_utils_set_osso_context (osso_context_t *osso_context); /** - * modest_maemo_toggle_action_set_active_block_notify: - * @action: a #GtkToggleAction - * @value: a #gboolean + * modest_maemo_utils_get_manager_menubar_as_menu: + * @manager: a #GtkUIManager + * @item_name: a string + * + * obtains the node with name @item_name in @manager (which happens to be a menubar) as a + * #GtkMenu. * - * updates the toggle action active status, but blocking the notification of the changes. + * Returns: a #GtkMenu */ -void modest_maemo_toggle_action_set_active_block_notify (GtkToggleAction *action, gboolean value); +GtkWidget *modest_maemo_utils_get_manager_menubar_as_menu (GtkUIManager *manager, const gchar *item_name); #endif /*__MODEST_MAEMO_UTILS_H__*/