2007-07-31 Philip Van Hoof <pvanhoof@gnome.org>
[modest] / src / widgets / modest-window.h
index ada4a82..be1c722 100644 (file)
@@ -39,19 +39,32 @@ G_BEGIN_DECLS
 #include <config.h>
 #endif /*HAVE_CONFIG_H*/
 
+#include <gtk/gtk.h>
+
 /* 
  * admittedly, the ifdefs for gtk and maemo are rather ugly; still
  * this way is probably the easiest to maintain
  */
-#if MODEST_PLATFORM_ID==1   /* gtk */
+#ifdef MODEST_PLATFORM_GNOME
 #include <gtk/gtkwindow.h>
 typedef GtkWindow      ModestWindowParent;
 typedef GtkWindowClass ModestWindowParentClass;
-#elif MODEST_PLATFORM_ID==2   /* hildon (maemo) */
+#endif /* MODEST_PLATFORM_GNOME */
+
+#ifdef MODEST_PLATFORM_MAEMO
+#ifdef MODEST_HAVE_HILDON0_WIDGETS
 #include <hildon-widgets/hildon-window.h>
+#else
+#include <hildon/hildon-window.h>
+#endif /*MODEST_HAVE_HILDON0_WIDGETS*/
 typedef HildonWindow      ModestWindowParent;
 typedef HildonWindowClass ModestWindowParentClass;
-#endif /*MODEST_PLATFORM_ID*/
+
+#ifndef GTK_STOCK_FULLSCREEN
+#define GTK_STOCK_FULLSCREEN ""
+#endif /*GTK_STOCK_FULLSCREEN*/
+
+#endif /*MODEST_PLATFORM_MAEMO */
 
 /* convenience macros */
 #define MODEST_TYPE_WINDOW             (modest_window_get_type())
@@ -70,11 +83,159 @@ struct _ModestWindow {
 
 struct _ModestWindowClass {
        ModestWindowParentClass parent_class;
+
+       /* virtual methods */
+       void (*set_zoom_func) (ModestWindow *self, gdouble zoom);
+       gdouble (*get_zoom_func) (ModestWindow *self);
+       gboolean (*zoom_plus_func) (ModestWindow *self);
+       gboolean (*zoom_minus_func) (ModestWindow *self);
+       void (*show_toolbar_func) (ModestWindow *self, gboolean show_toolbar);
+       void (*save_state_func) (ModestWindow *self);
+       void (*disconnect_signals_func) (ModestWindow *self);
 };
 
-/* member functions */
+/**
+ * modest_window_get_type:
+ *
+ * get the #GType for #ModestWindow
+ * 
+ * Returns: the type
+ */    
 GType        modest_window_get_type    (void) G_GNUC_CONST;
 
+
+/**
+ * modest_window_get_active_account:
+ * @self: a modest window instance
+ * 
+ * get the name of the active account
+ * 
+ * Returns: the active account name as a constant string
+ */    
+const gchar* modest_window_get_active_account (ModestWindow *self);
+
+
+
+/**
+ * modest_window_set_active_account:
+ * @self: a modest window instance
+ * @active_account: a new active account name for this window
+ * 
+ * set the active account for this window
+ * 
+ */    
+void modest_window_set_active_account (ModestWindow *self, const gchar *active_account);
+
+/**
+ * modest_window_set_zoom:
+ * @window: a #ModestWindow instance
+ * @zoom: the zoom level (1.0 is no zoom)
+ *
+ * sets the zoom level of the window
+ */
+void            modest_window_set_zoom    (ModestWindow *window,
+                                          gdouble value);
+
+/**
+ * modest_window_get_zoom:
+ * @window: a #ModestWindow instance
+ *
+ * gets the zoom of the window
+ *
+ * Returns: the current zoom value (1.0 is no zoom)
+ */
+gdouble         modest_window_get_zoom    (ModestWindow *window);
+
+/**
+ * modest_window_zoom_plus:
+ * @window: a #ModestWindow
+ *
+ * increases one level the zoom.
+ *
+ * Returns: %TRUE if successful, %FALSE if increasing zoom is not available
+ */
+gboolean modest_window_zoom_plus (ModestWindow *window);
+
+/**
+ * modest_window_zoom_minus:
+ * @window: a #ModestWindow
+ *
+ * decreases one level the zoom.
+ *
+ * Returns: %TRUE if successful, %FALSE if increasing zoom is not available
+ */
+gboolean modest_window_zoom_minus (ModestWindow *window);
+
+
+/**
+ * modest_window_show_toolbar:
+ * @window: 
+ * @view_toolbar: whether or not the toolbar should be shown
+ * 
+ * shows/hides the window toolbar
+ **/
+void     modest_window_show_toolbar (ModestWindow *window, 
+                                    gboolean show_toolbar);
+                                    
+/**
+ * modest_window_save_state:
+ * @window: 
+ * 
+ * Ask the window to save its settings for loading again later.
+ * This actually invokes the save_setting_func vfunc, which 
+ * derived windows should implement.
+ **/
+void     modest_window_save_state (ModestWindow *window);
+
+
+/**
+ * modest_window_get_action:
+ * @window: a #ModestWindow instance object
+ * @action_path: the full path of required action.
+ * 
+ * Get an action from ui manager, using @action_path parameter,
+ * which represent the full path to the required action into UIManager 
+ * xml definition.
+ **/
+GtkAction * modest_window_get_action (ModestWindow *window, const gchar *action_path); 
+
+/**
+ * modest_window_get_action_widget:
+ * @window: a #ModestWindow instance object
+ * @action_path: the full path of required action.
+ * 
+ * Get action widget from ui manager, using @action_path parameter,
+ * which represent the full path to the required action into UIManager 
+ * xml definition.
+ **/
+GtkWidget *modest_window_get_action_widget (ModestWindow *window, 
+                                           const gchar *action_path);
+
+/**
+ * modest_window_check_dimming_rules:
+ * @self: a #ModestWindow instance object
+ * 
+ * Calls UI Dimming Manager of @self window to check all dimming rules.
+ * 
+ **/
+void modest_window_check_dimming_rules (ModestWindow *self);
+
+/**
+ * modest_window_check_dimming_rules:
+ * @self: a #ModestWindow instance object
+ * @group: a #ModestWindow instance object
+ * 
+ * Calls UI Dimming Manager of @self window to check @group_name specific
+ * dimming rules.
+ * 
+ **/
+void modest_window_check_dimming_rules_group (ModestWindow *self,
+                                             const gchar *group_name);
+
+
+void modest_window_disconnect_signals (ModestWindow *self);
+
+
 G_END_DECLS
 
 #endif /* __MODEST_WINDOW_H__ */