Modified webpage: now tinymail repository is in gitorious.
[modest] / src / widgets / modest-msg-view-window.h
index 1121687..0decc45 100644 (file)
 
 #include <tny-msg.h>
 #include <tny-folder.h>
+#ifdef MODEST_TOOLKIT_HILDON2
+#include <modest-hildon2-window.h>
+#else
+#include <modest-shell-window.h>
+#endif
 #include <widgets/modest-window.h>
-#include <gtk/gtktreemodel.h>
-#include <gtk/gtkenums.h>
+#include <widgets/modest-header-view.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -48,11 +53,19 @@ G_BEGIN_DECLS
 
 
 typedef struct {
-        ModestWindow parent;
+#ifdef MODEST_TOOLKIT_HILDON2
+       ModestHildon2Window parent;
+#else
+       ModestShellWindow parent;
+#endif
 } ModestMsgViewWindow;
        
 typedef struct {
-       ModestWindowClass parent_class;
+#ifdef MODEST_TOOLKIT_HILDON2
+       ModestHildon2WindowClass parent_class;
+#else
+       ModestShellWindowClass parent_class;
+#endif
 
        void (*msg_changed) (ModestMsgViewWindow *self,
                             GtkTreeModel *model,
@@ -79,6 +92,7 @@ GType        modest_msg_view_window_get_type    (void) G_GNUC_CONST;
  * modest_msg_view_window_new_for_attachment:
  * @msg: an #TnyMsg instance
  * @modest_account_name: the account name 
+ * @mailbox: the mailbox (if any)
  * 
  * instantiates a new #ModestMsgViewWindow widget to view a message that is an
  * attachment in another message.
@@ -88,13 +102,46 @@ 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_for_attachment         (TnyMsg *msg, 
-                                                   const gchar *modest_account_name,
-                                                   const gchar *msg_uid);
+                                                                  TnyMsg *top_msg,
+                                                                  const gchar *modest_account_name,
+                                                                  const gchar *mailbox,
+                                                                  const gchar *msg_uid);
+
+/**
+ * modest_msg_view_window_new_with_other_body:
+ * @msg: an #TnyMsg instance
+ * @modest_account_name: the account name 
+ * @mailbox: the mailbox (if any)
+ * 
+ * instantiates a new #ModestMsgViewWindow widget to view a message that is a different body
+ * 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_with_other_body         (TnyMsg *msg,
+                                                                  TnyMimePart *other_body,
+                                                                  TnyMsg *top_msg,
+                                                                  const gchar *modest_account_name,
+                                                                  const gchar *mailbox,
+                                                                  const gchar *msg_uid);
+
+/**
+ * modest_msg_view_window_is_other_body:
+ * @self: a #ModestMsgViewWindow
+ *
+ * tells if the view window is showing other body
+ *
+ * Returns: %TRUE if showing "not first body"
+ */
+gboolean modest_msg_view_window_is_other_body (ModestMsgViewWindow *self);
 
 /**
  * modest_msg_view_window_new_with_header_model:
  * @msg: an #TnyMsg instance
  * @modest_account_name: the account name 
+ * @mailbox: the mailbox (if any)
  * @model: a #GtkTreeModel, with the format used by #ModestHeaderView
  * @row_reference: a #GtkTreeRowReference, pointing to the position of @msg in @model.
  * 
@@ -107,12 +154,42 @@ ModestWindow*   modest_msg_view_window_new_for_attachment         (TnyMsg *msg,
  */
 ModestWindow*   modest_msg_view_window_new_with_header_model (TnyMsg *msg, 
                                                              const gchar *modest_account_name, 
+                                                             const gchar *mailbox,
                                                              const gchar *msg_uid,
                                                              GtkTreeModel *model, 
                                                              GtkTreeRowReference *row_reference);
 
+/**
+ * modest_msg_view_window_new_from_header_view:
+ * @header_view: an #ModestHeaderView instance
+ * @modest_account_name: the account name 
+ * @mailbox: the mailbox (if any)
+ * @msg_uid: the initial uid reserved by this window
+ * @row_reference: a #GtkTreeRowReference, pointing to the selected position @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.
+ * It's different from new_with_header_model, as it creates the window and then
+ * loads the message in that window.
+ *
+ * Returns: a new #ModestMsgViewWindow, or NULL in case of error
+ */
+ModestWindow*   modest_msg_view_window_new_from_header_view (ModestHeaderView *header_view, 
+                                                            const gchar *modest_account_name, 
+                                                            const gchar *mailbox,
+                                                            const gchar *msg_uid,
+                                                            GtkTreeRowReference *row_reference);
+
 
 /**
+ * modest_msg_view_window_new_from_uid:
+ */
+ModestWindow *
+modest_msg_view_window_new_from_uid (const gchar *modest_account_name,
+                                    const gchar *mailbox,
+                                    const gchar *msg_uid);
+                                             
+/**
  * modest_msg_view_window_new_for_search_result:
  * @msg: an #TnyMsg instance
  * @modest_account_name: the account name 
@@ -127,6 +204,7 @@ ModestWindow*   modest_msg_view_window_new_with_header_model (TnyMsg *msg,
 ModestWindow *
 modest_msg_view_window_new_for_search_result (TnyMsg *msg, 
                                              const gchar *modest_account_name,
+                                             const gchar *mailbox,
                                              const gchar *msg_uid);
                                              
 /**
@@ -153,6 +231,17 @@ modest_msg_view_window_get_header (ModestMsgViewWindow *self);
 TnyMsg*         modest_msg_view_window_get_message     (ModestMsgViewWindow *window);
 
 /**
+ * modest_msg_view_window_get_top_message:
+ * @window: an #ModestMsgViewWindow instance
+ * 
+ * get a new reference to the parent message of the tree of views. The caller
+ * must free this new reference
+ * 
+ * Returns: a new #TnyMsg instance, or NULL in case of error
+ */
+TnyMsg*         modest_msg_view_window_get_top_message     (ModestMsgViewWindow *window);
+
+/**
  * modest_msg_view_window_get_message_uid:
  * @msg: an #ModestMsgViewWindow instance
  * 
@@ -292,6 +381,46 @@ modest_msg_view_window_get_folder_type (ModestMsgViewWindow *window);
 gboolean 
 modest_msg_view_window_transfer_mode_enabled (ModestMsgViewWindow *self);
 
+/**
+ * modest_msg_view_window_add_to_contacts:
+ * @self: a #ModestMsgViewWindow
+ *
+ * activates the add to contacts use case. In Diablo and gnome it gets the
+ * clipboard selection current value and tries to add it to the addressbook.
+ * In fremantle, it shows the add to contacts dialog to select the recipient
+ * to add.
+ */
+void
+modest_msg_view_window_add_to_contacts (ModestMsgViewWindow *self);
+
+/**
+ * modest_msg_view_window_get_msg_view:
+ * @self: a #ModestMsgViewWindow
+ *
+ * Tells that external images should be fetched in this window.
+ */
+void
+modest_msg_view_window_fetch_images (ModestMsgViewWindow *self);
+
+/**
+ * modest_msg_view_window_has_blocked_external_images:
+ * @self: a #ModestMsgViewWindow
+ * 
+ * checks if the msg currently shown has blocked external images.
+ *
+ * Returns: %TRUE if external images are blocked, %FALSE otherwise
+ */
+gboolean modest_msg_view_window_has_blocked_external_images (ModestMsgViewWindow *self);
+
+/**
+ * modest_msg_view_window_reload:
+ * @self: a #ModestMsgViewWindow
+ *
+ * Reloads currently loaded message. This is intended to show the message in case it
+ * has some update on the previously visible result.
+ */
+void modest_msg_view_window_reload (ModestMsgViewWindow *self);
+
 G_END_DECLS
 
 #endif /* __MODEST_MSG_VIEW_WINDOW_H__ */