Emit signal limit_error also in msg view.
[modest] / src / widgets / modest-msg-view.h
index e348762..0ee8b1c 100644 (file)
 #include <tny-msg.h>
 #include <tny-mime-part.h>
 #include <tny-msg-view.h>
+#include <tny-header-view.h>
 #include <widgets/modest-recpt-view.h>
+#include <widgets/modest-zoomable.h>
+#include <widgets/modest-isearch-view.h>
+#include <widgets/modest-mime-part-view.h>
 
 G_BEGIN_DECLS
 
 /* convenience macros */
 #define MODEST_TYPE_MSG_VIEW             (modest_msg_view_get_type())
 #define MODEST_MSG_VIEW(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_MSG_VIEW,ModestMsgView))
-#define MODEST_MSG_VIEW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_MSG_VIEW,ModestMsgViewClass))
 #define MODEST_IS_MSG_VIEW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_MSG_VIEW))
-#define MODEST_IS_MSG_VIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_MSG_VIEW))
-#define MODEST_MSG_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_MSG_VIEW,ModestMsgViewClass))
+#define MODEST_MSG_VIEW_GET_IFACE(obj)   (G_TYPE_INSTANCE_GET_INTERFACE((obj),MODEST_TYPE_MSG_VIEW,ModestMsgViewIface))
 
 typedef struct _ModestMsgView      ModestMsgView;
-typedef struct _ModestMsgViewClass ModestMsgViewClass;
-
-struct _ModestMsgView {
-       GtkVBox parent;
-};
-
-struct _ModestMsgViewClass {
-       GtkVBoxClass parent_class;
-
-       void (*link_hover)         (ModestMsgView *msgview, const gchar* link,
-                                   gpointer user_data);
-       void (*link_clicked)       (ModestMsgView *msgview, const gchar* link,
+typedef struct _ModestMsgViewIface ModestMsgViewIface;
+
+struct _ModestMsgViewIface {
+       GTypeInterface parent;
+
+       void (*set_msg_with_other_body_func) (ModestMsgView *self, TnyMsg *msg, TnyMimePart *other_body);
+       GtkAdjustment* (*get_vadjustment_func) (ModestMsgView *self);
+       GtkAdjustment* (*get_hadjustment_func) (ModestMsgView *self);
+       void (*set_vadjustment_func) (ModestMsgView *self, GtkAdjustment *vadj);
+       void (*set_hadjustment_func) (ModestMsgView *self, GtkAdjustment *vadj);
+       void (*set_shadow_type_func) (ModestMsgView *self, GtkShadowType type);
+       GtkShadowType (*get_shadow_type_func) (ModestMsgView *self);
+       TnyHeaderFlags (*get_priority_func) (ModestMsgView *self);
+       void (*set_priority_func) (ModestMsgView *self, TnyHeaderFlags flags);
+       void (*set_view_images_func) (ModestMsgView *self, gboolean view_images);
+       TnyList * (*get_selected_attachments_func) (ModestMsgView *self);
+       TnyList * (*get_attachments_func) (ModestMsgView *self);
+       void (*grab_focus_func) (ModestMsgView *self);
+       void (*remove_attachment_func) (ModestMsgView *view, TnyMimePart *attachment);
+       void (*set_branding_func) (ModestMsgView *view, const gchar *brand_name, const GdkPixbuf *brand_icon);
+
+       /* signals */
+       void (*set_scroll_adjustments)      (ModestMsgView *msg_view,
+                                            GtkAdjustment *hadj,
+                                            GtkAdjustment *vadj);
+       
+       void (*link_contextual)    (ModestMsgView *msgview, const gchar* link,
                                    gpointer user_data);
-       void (*attachment_clicked) (ModestMsgView *msgview, int index,
+       void (*attachment_clicked) (ModestMsgView *msgview, TnyMimePart *mime_part,
                                    gpointer user_data);
        void (*recpt_activated)    (ModestMsgView *msgview, const gchar *address,
                                    gpointer user_data);
+       gboolean (*fetch_image)    (ModestMsgView *msgview, const gchar *uri,
+                                   TnyStream *stream);
+       void (*show_details)       (ModestMsgView *msgview, gpointer userdata);
+
+       void (*request_fetch_images_func) (ModestMsgView *msgview);
+       gboolean (*has_blocked_external_images_func) (ModestMsgView *msgview);
+       void (*limit_error)        (ModestMsgView *msgview);
 };
 
 
@@ -71,48 +95,30 @@ struct _ModestMsgViewClass {
  *
  * modest_msg_view_get_type
  *
- * get the GType for the this class
+ * get the GType for the this interface
  *
- * Returns: the GType for this class
+ * Returns: the GType for this interface
  */
 GType        modest_msg_view_get_type    (void) G_GNUC_CONST;
 
-
-/**
- * modest_msg_view_new 
- * @tny_msg: a TnyMsg instance, or NULL
- *
- * create a new ModestMsgView widget (a GtkScrolledWindow subclass),
- * and display the @tny_msg e-mail message in it. If @tny_msg is NULL,
- * then a blank page will be displayed
- *  
- * Returns: a new ModestMsgView widget, or NULL if there's an error
- */
-GtkWidget*   modest_msg_view_new          (TnyMsg *tny_msg);
-
-
-/**
- * modest_msg_view_set_message
- * @self: a ModestMsgView instance
- * @tny_msg: a TnyMsg instance, or NULL
- *
- * display the @tny_msg e-mail message. If @tny_msg is NULL,
- * then a blank page will be displayed
- *  */
-void         modest_msg_view_set_message  (ModestMsgView *self, TnyMsg *tny_msg);
-
-
-
-/**
- * modest_msg_view_set_message
- * @self: a ModestMsgView instance
- *
- * get the @tny_msg e-mail message.
- *
- * Returns: the message or NULL
- */
-TnyMsg*      modest_msg_view_get_message  (ModestMsgView *self);
-
+void modest_msg_view_set_msg_with_other_body (ModestMsgView *self, TnyMsg *msg, TnyMimePart *part);
+GtkAdjustment *modest_msg_view_get_vadjustment (ModestMsgView *self);
+GtkAdjustment *modest_msg_view_get_hadjustment (ModestMsgView *self);
+void modest_msg_view_set_vadjustment (ModestMsgView *self, GtkAdjustment *vadj);
+void modest_msg_view_set_hadjustment (ModestMsgView *self, GtkAdjustment *hadj);
+void modest_msg_view_set_shadow_type (ModestMsgView *self, GtkShadowType type);
+GtkShadowType modest_msg_view_get_shadow_type (ModestMsgView *self);
+
+TnyHeaderFlags modest_msg_view_get_priority (ModestMsgView *self);
+void modest_msg_view_set_priority (ModestMsgView *self, TnyHeaderFlags flags);
+TnyList *modest_msg_view_get_selected_attachments (ModestMsgView *self);
+TnyList *modest_msg_view_get_attachments (ModestMsgView *self);
+void modest_msg_view_grab_focus (ModestMsgView *self);
+void modest_msg_view_remove_attachment (ModestMsgView *view, TnyMimePart *attachment);
+void modest_msg_view_set_branding (ModestMsgView *view, const gchar *brand_name, const GdkPixbuf *brand_icon);
+void modest_msg_view_set_view_images (ModestMsgView *view, gboolean view_images);
+void modest_msg_view_request_fetch_images (ModestMsgView *view);
+gboolean modest_msg_view_has_blocked_external_images (ModestMsgView *view);
 
 
 G_END_DECLS