X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-msg-view-window.h;h=11216873b479684e536338839f316d609fe869b6;hp=e74482be0fdf034ff19194d34fb0a7c0be917fc5;hb=f6d386ff93e929092ba105385a29d760aeba9ff7;hpb=64a3cb5e8f9865d3923a638837ef76570429d31c diff --git a/src/widgets/modest-msg-view-window.h b/src/widgets/modest-msg-view-window.h index e74482b..1121687 100644 --- a/src/widgets/modest-msg-view-window.h +++ b/src/widgets/modest-msg-view-window.h @@ -31,8 +31,10 @@ #define __MODEST_MSG_VIEW_WINDOW_H__ #include +#include #include #include +#include G_BEGIN_DECLS @@ -51,8 +53,16 @@ typedef struct { typedef struct { ModestWindowClass parent_class; - /* insert signal callback declarations, eg. */ - /* void (* my_event) (ModestEditMsgWindow* obj); */ + + void (*msg_changed) (ModestMsgViewWindow *self, + GtkTreeModel *model, + GtkTreeRowReference *row_reference, + gpointer user_data); + + gboolean (*scroll_child) (ModestMsgViewWindow *self, + GtkScrollType scroll_type, + gboolean horizontal, + gpointer userdata); } ModestMsgViewWindowClass; /** @@ -66,42 +76,77 @@ GType modest_msg_view_window_get_type (void) G_GNUC_CONST; /** - * modest_msg_view_window_new: + * modest_msg_view_window_new_for_attachment: * @msg: an #TnyMsg instance - * @account: the account name + * @modest_account_name: the account name * - * instantiates a new #ModestMsgViewWindow widget. The account name is used to + * instantiates a new #ModestMsgViewWindow widget to view a message that is an + * attachment in another message. + * The account name is used to * set the proper account when choosing reply/forward from the msg view window * * Returns: a new #ModestMsgViewWindow, or NULL in case of error */ -ModestWindow* modest_msg_view_window_new (TnyMsg *msg, const gchar *account); +ModestWindow* modest_msg_view_window_new_for_attachment (TnyMsg *msg, + const gchar *modest_account_name, + const gchar *msg_uid); /** * modest_msg_view_window_new_with_header_model: * @msg: an #TnyMsg instance - * @account: the account name + * @modest_account_name: the account name * @model: a #GtkTreeModel, with the format used by #ModestHeaderView - * @iter: a #GtkTreeIter, pointing to the position of @msg in @model. + * @row_reference: a #GtkTreeRowReference, pointing to the position of @msg in @model. * * instantiates a new #ModestMsgViewWindow widget. The account name is used to * set the proper account when choosing reply/forward from the msg view window. * This constructor also passes a reference to the @model of the header view - * to allow selecting previous/next messages. + * to allow selecting previous/next messages in the message list when appropriate. * * Returns: a new #ModestMsgViewWindow, or NULL in case of error */ ModestWindow* modest_msg_view_window_new_with_header_model (TnyMsg *msg, - const gchar *account, + const gchar *modest_account_name, + const gchar *msg_uid, GtkTreeModel *model, GtkTreeRowReference *row_reference); /** + * modest_msg_view_window_new_for_search_result: + * @msg: an #TnyMsg instance + * @modest_account_name: the account name + * + * instantiates a new #ModestMsgViewWindow widget. The account name is used to + * set the proper account when choosing reply/forward from the msg view window. + * This constructor marks the window as being for a search result, which should + * cause some UI to be disabled, such as the previous/next buttons. + * + * Returns: a new #ModestMsgViewWindow, or NULL in case of error + */ +ModestWindow * +modest_msg_view_window_new_for_search_result (TnyMsg *msg, + const gchar *modest_account_name, + const gchar *msg_uid); + +/** + * modest_msg_view_window_get_header: + * @window: an #ModestMsgViewWindow instance + * + * get the message header in this msg view. Header instance is get + * from tree_model of headers list. + * + * Returns: a new #TnyHeader instance, or NULL in case of error + */ +TnyHeader* +modest_msg_view_window_get_header (ModestMsgViewWindow *self); + +/** * modest_msg_view_window_get_message: * @window: an #ModestMsgViewWindow instance * - * get the message in this msg view + * get a new reference to the message in this msg view. The caller + * must free this new reference * * Returns: a new #TnyMsg instance, or NULL in case of error */ @@ -141,14 +186,6 @@ gboolean modest_msg_view_window_select_next_message (ModestMsgViewWindow gboolean modest_msg_view_window_select_previous_message (ModestMsgViewWindow *window); /** - * modest_msg_view_window_toggle_fullscreen: - * @window: a #ModestMsgViewWindow - * - * toggles the current fullscreen status - */ -void modest_msg_view_window_toggle_fullscreen (ModestMsgViewWindow *window); - -/** * modest_msg_view_window_view_attachment: * @window: a #ModestMsgViewWindow * @mime_part: a #TnyMimePart @@ -161,26 +198,99 @@ void modest_msg_view_window_view_attachment (ModestMsgViewWindow *win TnyMimePart *mime_part); /** + * modest_msg_view_window_get_attachments: + * @window: a #ModestMsgViewWindow + * + * Get selected attachments from #ModetMsgView private object. + */ +TnyList * modest_msg_view_window_get_attachments (ModestMsgViewWindow *win); + +/** * modest_msg_view_window_save_attachments: * @window: a #ModestMsgViewWindow - * @mime_parts: a #GList of #TnyMimePart + * @mime_parts: a #TnyList of #TnyMimePart * * Save the #TnyMimePart attachments in @mime_parts, or currently selected attachments * if @mime_parts is %NULL, offering a dialog to the user to choose the location. */ void modest_msg_view_window_save_attachments (ModestMsgViewWindow *window, - GList *mime_parts); + TnyList *mime_parts); /** * modest_msg_view_window_remove_attachments: * @window: a #ModestMsgViewWindow - * @mime_parts: a #GList of #TnyMimePart + * @get_all: a #gboolean. If %TRUE, purges all attachmnents, if %FALSE, + * purges only selected ones. * - * Removes the attachments in @mime_parts, or currently selected attachments - * if @mime_parts is %NULL, from local storage. + * Removes selected attachments. */ void modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, - GList *mime_parts); + gboolean get_all); + + +/** + * modest_msg_view_window_toolbar_on_transfer_mode: + * @window: a #ModestMsgViewWindow + * + * Check if toolbar is in transfer mode, which determines whether a + * transfer operation is being processed. + */ +gboolean modest_msg_view_window_toolbar_on_transfer_mode (ModestMsgViewWindow *self); + + +/** + * modest_msg_view_window_last_message_selected: + * @window: a #ModestMsgViewWindow + * + * Check message currently viewed is the last message into folder . +*/ +gboolean modest_msg_view_window_last_message_selected (ModestMsgViewWindow *window); + + +/** + * modest_msg_view_window_first_message_selected: + * @window: a #ModestMsgViewWindow + * + * Check message currently viewed is the last message into folder . +*/ +gboolean modest_msg_view_window_first_message_selected (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_has_headers_model: + * @window: a #ModestMsgViewWindow + * + * Check if window has been created with a full headers model. +*/ +gboolean modest_msg_view_window_has_headers_model (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_is_search_result: + * @window: a #ModestMsgViewWindow + * + * Check if window has been created to show a search result. + */ +gboolean modest_msg_view_window_is_search_result (ModestMsgViewWindow *window); + + +/** + * modest_msg_view_window_get_folder_type: + * @window: a #ModestMsgViewWindow + * + * Gets folder type of message currently viewed . +*/ +TnyFolderType +modest_msg_view_window_get_folder_type (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_transfer_mode_enabled: + * @window: a #ModestMsgViewWindow + * + * Determines if some transfer operation is in progress. + * + * Returns: TRUE if transfer mode is enabled, FASE otherwise. +*/ +gboolean +modest_msg_view_window_transfer_mode_enabled (ModestMsgViewWindow *self); G_END_DECLS