X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-msg-view-window.h;h=de899969577a655063a6ac5067adac7c31b95528;hb=bb515e94c04fe931befaebe40d91fa3e9217b7d6;hp=e607e0bb87a3edfab542b67406c779811744633c;hpb=91bdef6072bc9012f8d8690dacf3893c4ec351de;p=modest diff --git a/src/widgets/modest-msg-view-window.h b/src/widgets/modest-msg-view-window.h index e607e0b..de89996 100644 --- a/src/widgets/modest-msg-view-window.h +++ b/src/widgets/modest-msg-view-window.h @@ -32,6 +32,7 @@ #include #include +#include G_BEGIN_DECLS @@ -74,18 +75,189 @@ GType modest_msg_view_window_get_type (void) G_GNUC_CONST; * * 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 (TnyMsg *msg, + const gchar *account, + const gchar *msg_uid); + +/** + * modest_msg_view_window_new_with_header_model: + * @msg: an #TnyMsg instance + * @account: the account name + * @model: a #GtkTreeModel, with the format used by #ModestHeaderView + * @iter: a #GtkTreeIter, 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. + * + * 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 *msg_uid, + GtkTreeModel *model, + GtkTreeRowReference *row_reference); /** + * 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: - * @msg: an #ModestMsgViewWindow instance + * @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 */ -TnyMsg* modest_msg_view_window_get_message (ModestMsgViewWindow *window); +TnyMsg* modest_msg_view_window_get_message (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_get_message_uid: + * @msg: an #ModestMsgViewWindow instance + * + * gets the unique identifier for the message in this msg view. The + * returned value *must* not be freed + * + * Returns: the id of the #TnyMsg being shown, or NULL in case of error + */ +const gchar* modest_msg_view_window_get_message_uid (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_select_first_message: + * @window: a #ModestMsgViewWindow instance + * + * select the first message obtained from the header view this view + * was called from + * + * Returns: %TRUE if a new message is shown. + */ +gboolean modest_msg_view_window_select_first_message (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_select_next_message: + * @window: a #ModestMsgViewWindow instance + * + * select the next message obtained from the header view this view + * was called from + * + * Returns: %TRUE if a new message is shown. + */ +gboolean modest_msg_view_window_select_next_message (ModestMsgViewWindow *window); + +/** + * modest_msg_view_window_select_previous_message: + * @window: a #ModestMsgViewWindow instance + * + * select the previous message obtained from the header view this view + * was called from + * + * Returns: %TRUE if a new message is shown. + */ +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 + * + * Opens @mime_part, or the currently selected attachment if @mime_part is %NULL. + * If it's a message, it opens it for viewing. Otherwise it opens a temporary file + * with the contents of the attachment. + */ +void modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, + TnyMimePart *mime_part); + +/** + * modest_msg_view_window_get_attachments: + * @window: a #ModestMsgViewWindow + * + * Get selected attachments from #ModetMsgView private object. + */ +GList * modest_msg_view_window_get_attachments (ModestMsgViewWindow *win); + +/** + * modest_msg_view_window_save_attachments: + * @window: a #ModestMsgViewWindow + * @mime_parts: a #GList 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); + +/** + * modest_msg_view_window_remove_attachments: + * @window: a #ModestMsgViewWindow + * + * Removes selected attachments. + */ +void modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window); + + +/** + * 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_get_folder_type: + * @window: a #ModestMsgViewWindow + * + * Gets folder type of message currently viewed . +*/ +TnyFolderType +modest_msg_view_window_get_folder_type (ModestMsgViewWindow *window); G_END_DECLS