[evolution-data-server/openismus-work: 9/10] Added e_book_view_set_flags() api and EBookViewFlags type.



commit 53b5fe23d4d788606f70780e1f665630b829152e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu Jun 16 19:33:16 2011 +0900

    Added e_book_view_set_flags() api and EBookViewFlags type.
    
    Added flags to configure the behaviour of the EBookView and
    added the e_book_view_set_flags() api used to configure the
    view.

 addressbook/libebook/e-book-view.c |   25 +++++++++++++++++++++++++
 addressbook/libebook/e-book-view.h |   30 +++++++++++++++++++++++++++---
 2 files changed, 52 insertions(+), 3 deletions(-)
---
diff --git a/addressbook/libebook/e-book-view.c b/addressbook/libebook/e-book-view.c
index cbf48b4..6da2d7e 100644
--- a/addressbook/libebook/e-book-view.c
+++ b/addressbook/libebook/e-book-view.c
@@ -266,6 +266,31 @@ e_book_view_stop (EBookView *book_view)
 	}
 }
 
+
+/**
+ * e_book_view_set_flags:
+ * @book_view: an #EBookView
+ * @flags: the #EBookViewFlags for @book_view.
+ *
+ * Sets the @flags which control the behaviour of @book_view.
+ */
+void
+e_book_view_set_flags (EBookView      *book_view,
+		       EBookViewFlags  flags)
+{
+	GError *error = NULL;
+
+	g_return_if_fail (E_IS_BOOK_VIEW (book_view));
+
+	if (book_view->priv->gdbus_bookview) {
+		e_gdbus_book_view_call_set_flags_sync (book_view->priv->gdbus_bookview, flags, NULL, &error);
+		if (error) {
+			g_warning ("Cannot set flags on book view: %s\n", error->message);
+			g_error_free (error);
+		}
+	}
+}
+
 static void
 e_book_view_init (EBookView *book_view)
 {
diff --git a/addressbook/libebook/e-book-view.h b/addressbook/libebook/e-book-view.h
index 2148f74..526bc91 100644
--- a/addressbook/libebook/e-book-view.h
+++ b/addressbook/libebook/e-book-view.h
@@ -30,6 +30,29 @@ typedef struct _EBookViewPrivate EBookViewPrivate;
 
 struct _EBook;  /* Forward reference */
 
+
+/**
+ * EBookViewFlags:
+ * @E_BOOK_VIEW_NOTIFY_INITIAL: If this flag is set then all contacts matching the
+ *                              view's query will be sent as notifications when starting
+ *                              the view, otherwise only future changes will be reported.
+ *                              The default for a #EBookView is %TRUE.
+ *
+ * Flags that control the behaviour of an #EBookView.
+ */
+typedef enum {
+	E_BOOK_VIEW_NOTIFY_INITIAL = (1 << 0),
+} EBookViewFlags;
+
+
+/**
+ * E_BOOK_VIEW_DEFAULT_FLAGS:
+ *
+ * The default values for a book view's #EBookViewFlags
+ */
+#define E_BOOK_VIEW_DEFAULT_FLAGS  E_BOOK_VIEW_NOTIFY_INITIAL
+
+
 struct _EBookView {
 	GObject     parent;
 	/*< private >*/
@@ -61,9 +84,10 @@ struct _EBookViewClass {
 
 GType              e_book_view_get_type               (void);
 
-void               e_book_view_start                  (EBookView *book_view);
-void               e_book_view_stop                   (EBookView *book_view);
-
+void               e_book_view_start                  (EBookView      *book_view);
+void               e_book_view_stop                   (EBookView      *book_view);
+void               e_book_view_set_flags              (EBookView      *book_view,
+						       EBookViewFlags  flags);
 struct _EBook     *e_book_view_get_book               (EBookView *book_view);
 
 G_END_DECLS



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]