aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-25 07:02:33 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-25 07:02:33 +0800
commite7a31c5035a0afeed6c1675e30487c1e2bdc139f (patch)
treeeb1e733a6fe69773498725efa64304a9234270bc /shell
parent95cae9b166587d19db3aadde6a21cc12c30da6e6 (diff)
downloadgsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.gz
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.bz2
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.lz
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.xz
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.tar.zst
gsoc2013-evolution-e7a31c5035a0afeed6c1675e30487c1e2bdc139f.zip
Commit recent work so I can merge from trunk.
svn path=/branches/kill-bonobo/; revision=36684
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-content.c42
-rw-r--r--shell/e-shell-content.h3
-rw-r--r--shell/e-shell-sidebar.c28
-rw-r--r--shell/e-shell-sidebar.h3
4 files changed, 76 insertions, 0 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 7a9d7cf3f0..bde5a84084 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -910,6 +910,14 @@ e_shell_content_get_type (void)
return type;
}
+/**
+ * e_shell_content_new:
+ * @shell_view: an #EShellView
+ *
+ * Creates a new #EShellContent instance belonging to @shell_view.
+ *
+ * Returns: a new #EShellContent instance
+ **/
GtkWidget *
e_shell_content_new (EShellView *shell_view)
{
@@ -919,6 +927,40 @@ e_shell_content_new (EShellView *shell_view)
E_TYPE_SHELL_CONTENT, "shell-view", shell_view, NULL);
}
+/**
+ * e_shell_content_check_state:
+ * @shell_content: an #EShellContent
+ *
+ * #EShellContent subclasses should implement the
+ * <structfield>check_state</structfield> method in #EShellContentClass
+ * to return a set of flags describing the current content selection.
+ * Subclasses are responsible for defining their own flags. This is
+ * primarily used to assist shell views with updating actions (see
+ * e_shell_view_update_actions()).
+ *
+ * Returns: a set of flags describing the current @shell_content selection
+ **/
+guint32
+e_shell_content_check_state (EShellContent *shell_content)
+{
+ EShellContentClass *shell_content_class;
+
+ g_return_val_if_fail (E_IS_SHELL_CONTENT (shell_content), 0);
+
+ shell_content_class = E_SHELL_CONTENT_GET_CLASS (shell_content);
+ g_return_val_if_fail (shell_content_class->check_state != NULL, 0);
+
+ return shell_content_class->check_state (shell_content);
+}
+
+/**
+ * e_shell_content_get_shell_view:
+ * @shell_content: an #EShellContent
+ *
+ * Returns the #EShellView that was passed to e_shell_content_new().
+ *
+ * Returns: the #EShellView to which @shell_content belongs
+ **/
EShellView *
e_shell_content_get_shell_view (EShellContent *shell_content)
{
diff --git a/shell/e-shell-content.h b/shell/e-shell-content.h
index 8d1276c94e..035168d0c4 100644
--- a/shell/e-shell-content.h
+++ b/shell/e-shell-content.h
@@ -76,10 +76,13 @@ struct _EShellContentClass {
/* Factory Methods */
RuleContext * (*new_search_context) (void);
+
+ guint32 (*check_state) (EShellContent *shell_content);
};
GType e_shell_content_get_type (void);
GtkWidget * e_shell_content_new (struct _EShellView *shell_view);
+guint32 e_shell_content_check_state (EShellContent *shell_content);
struct _EShellView *
e_shell_content_get_shell_view (EShellContent *shell_content);
RuleContext * e_shell_content_get_context (EShellContent *shell_content);
diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c
index df0a9ece9c..3f2494cba4 100644
--- a/shell/e-shell-sidebar.c
+++ b/shell/e-shell-sidebar.c
@@ -433,6 +433,8 @@ e_shell_sidebar_get_type (void)
* @shell_view: an #EShellView
*
* Creates a new #EShellSidebar instance belonging to @shell_view.
+ *
+ * Returns: a new #EShellSidebar instance
**/
GtkWidget *
e_shell_sidebar_new (EShellView *shell_view)
@@ -445,6 +447,32 @@ e_shell_sidebar_new (EShellView *shell_view)
}
/**
+ * e_shell_sidebar_check_state:
+ * @shell_sidebar an #EShellSidebar
+ *
+ * #EShellSidebar subclasses should implement the
+ * <structfield>check_state</structfield> method in #EShellSidebarClass
+ * to return a set of flags describing the current sidebar selection.
+ * Subclasses are responsible for defining their own flags. This is
+ * primarily used to assist shell views with updating actions (see
+ * e_shell_view_update_actions()).
+ *
+ * Returns: a set of flags describing the current @shell_sidebar selection
+ **/
+guint32
+e_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
+{
+ EShellSidebarClass *shell_sidebar_class;
+
+ g_return_val_if_fail (E_IS_SHELL_SIDEBAR (shell_sidebar), 0);
+
+ shell_sidebar_class = E_SHELL_SIDEBAR_GET_CLASS (shell_sidebar);
+ g_return_val_if_fail (shell_sidebar_class->check_state != NULL, 0);
+
+ return shell_sidebar_class->check_state (shell_sidebar);
+}
+
+/**
* e_shell_sidebar_get_shell_view:
* @shell_sidebar: an #EShellSidebar
*
diff --git a/shell/e-shell-sidebar.h b/shell/e-shell-sidebar.h
index 275e66a7ca..1cf141b2a8 100644
--- a/shell/e-shell-sidebar.h
+++ b/shell/e-shell-sidebar.h
@@ -71,10 +71,13 @@ struct _EShellSidebar {
struct _EShellSidebarClass {
GtkBinClass parent_class;
+
+ guint32 (*check_state) (EShellSidebar *shell_sidebar);
};
GType e_shell_sidebar_get_type (void);
GtkWidget * e_shell_sidebar_new (struct _EShellView *shell_view);
+guint32 e_shell_sidebar_check_state (EShellSidebar *shell_sidebar);
struct _EShellView *
e_shell_sidebar_get_shell_view (EShellSidebar *shell_sidebar);
const gchar * e_shell_sidebar_get_primary_text(EShellSidebar *shell_sidebar);