aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-03 23:03:56 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-03 23:03:56 +0800
commita15df79e225ed290978c0650bc2a193086444707 (patch)
treeeec11ece68e526c9b76a05198104a671b04a85da /addressbook/backend/pas
parent9e7dabfa8274777916da364b50284cfa51ac9a6f (diff)
downloadgsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar.gz
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar.bz2
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar.lz
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar.xz
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.tar.zst
gsoc2013-evolution-a15df79e225ed290978c0650bc2a193086444707.zip
A bit of clean up.
2000-04-03 Christopher James Lahey <clahey@helixcode.com> * addressbook/backend/ebook/e-card-cursor.h, addressbook/backend/ebook/e-card.c: A bit of clean up. * addressbook/backend/ebook/e-book-types.h, addressbook/backend/ebook/e-book-view-listener.c, addressbook/backend/ebook/e-book-view-listener.h, addressbook/backend/ebook/e-book-view.c, addressbook/backend/ebook/e-book-view.h, addressbook/backend/pas/pas-book-view.c, addressbook/backend/pas/pas-book-view.h: New files for live views. * addressbook/backend/ebook/Makefile.am, addressbook/backend/ebook/e-book-listener.c, addressbook/backend/ebook/e-book-listener.h, addressbook/backend/ebook/e-book.c, addressbook/backend/ebook/e-book.h, addressbook/backend/ebook/test-client-list.c, addressbook/backend/ebook/test-client.c, addressbook/backend/pas/pas-backend-file.c, addressbook/backend/pas/pas-book.c, addressbook/backend/pas/pas-book.h, addressbook/backend/idl/addressbook.idl: Added live views and searching to the interface (neither is working yet.) svn path=/trunk/; revision=2280
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/Makefile.am10
-rw-r--r--addressbook/backend/pas/pas-backend-file.c69
-rw-r--r--addressbook/backend/pas/pas-book-view.c243
-rw-r--r--addressbook/backend/pas/pas-book-view.h49
-rw-r--r--addressbook/backend/pas/pas-book.c132
-rw-r--r--addressbook/backend/pas/pas-book.h70
6 files changed, 463 insertions, 110 deletions
diff --git a/addressbook/backend/pas/Makefile.am b/addressbook/backend/pas/Makefile.am
index 3d3dd6f082..f2cf0ffef9 100644
--- a/addressbook/backend/pas/Makefile.am
+++ b/addressbook/backend/pas/Makefile.am
@@ -40,19 +40,21 @@ pas_libs = \
libpas_la_SOURCES = \
$(CORBA_SOURCE) \
- pas-book.c \
pas-book-factory.c \
- pas-backend.c \
+ pas-book-view.c \
+ pas-book.c \
pas-backend-file.c \
+ pas-backend.c \
pas-card-cursor.c
libpasincludedir = $(includedir)/backend
libpasinclude_HEADERS = \
- pas-book.h \
pas-book-factory.h \
- pas-backend.h \
+ pas-book-view.h \
+ pas-book.h \
pas-backend-file.h \
+ pas-backend.h \
pas-card-cursor.h
wombat_SOURCES = \
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index 0fd172c844..18b8de104e 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -119,7 +119,9 @@ pas_backend_file_process_create_card (PASBackend *backend,
db_error = db->put (db, &id_dbt, &vcard_dbt, 0);
if (0 == db_error) {
+#if 0
pas_book_notify_add(book, id);
+#endif
pas_book_respond_create (
book,
@@ -158,7 +160,9 @@ pas_backend_file_process_remove_card (PASBackend *backend,
db_error = db->del (db, &id_dbt, 0);
if (0 == db_error) {
+#if 0
pas_book_notify_remove (book, req->id);
+#endif
pas_book_respond_remove (
book,
@@ -193,8 +197,9 @@ pas_backend_file_process_modify_card (PASBackend *backend,
db_error = db->put (db, &id_dbt, &vcard_dbt, 0);
if (0 == db_error) {
-
+#if 0
pas_book_notify_change (book, req->id);
+#endif
pas_book_respond_modify (
book,
@@ -250,7 +255,57 @@ pas_backend_file_build_all_cards_list(PASBackend *backend,
}
static void
-pas_backend_file_process_get_all_cards (PASBackend *backend,
+pas_backend_file_process_get_cursor (PASBackend *backend,
+ PASBook *book,
+ PASRequest *req)
+{
+ /*
+ PASBackendFile *bf = PAS_BACKEND_FILE (backend);
+ DB *db = bf->priv->file_db;
+ DBT id_dbt, vcard_dbt;
+ */
+ CORBA_Environment ev;
+ int db_error = 0;
+ PASBackendFileCursorPrivate *cursor_data;
+ PASCardCursor *cursor;
+ Evolution_Book corba_book;
+
+ cursor_data = g_new(PASBackendFileCursorPrivate, 1);
+ cursor_data->backend = backend;
+ cursor_data->book = book;
+
+ pas_backend_file_build_all_cards_list(backend, cursor_data);
+
+ corba_book = bonobo_object_corba_objref(BONOBO_OBJECT(book));
+
+ CORBA_exception_init(&ev);
+
+ Evolution_Book_ref(corba_book, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning("pas_backend_file_process_get_cursor: Exception reffing "
+ "corba book.\n");
+ }
+
+ CORBA_exception_free(&ev);
+
+ cursor = pas_card_cursor_new(get_length,
+ get_nth,
+ cursor_data);
+
+ gtk_signal_connect(GTK_OBJECT(cursor), "destroy",
+ GTK_SIGNAL_FUNC(cursor_destroy), cursor_data);
+
+ pas_book_respond_get_cursor (
+ book,
+ (db_error == 0
+ ? Evolution_BookListener_Success
+ : Evolution_BookListener_CardNotFound),
+ cursor);
+}
+
+static void
+pas_backend_file_process_get_book_view (PASBackend *backend,
PASBook *book,
PASRequest *req)
{
@@ -278,7 +333,7 @@ pas_backend_file_process_get_all_cards (PASBackend *backend,
Evolution_Book_ref(corba_book, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning("pas_backend_file_process_get_all_cards: Exception reffing "
+ g_warning("pas_backend_file_process_get_book_view: Exception reffing "
"corba book.\n");
}
@@ -338,8 +393,12 @@ pas_backend_file_process_client_requests (PASBook *book)
pas_backend_file_process_check_connection (backend, book, req);
break;
- case GetAllCards:
- pas_backend_file_process_get_all_cards (backend, book, req);
+ case GetCursor:
+ pas_backend_file_process_get_cursor (backend, book, req);
+ break;
+
+ case GetBookView:
+ pas_backend_file_process_get_book_view (backend, book, req);
break;
}
diff --git a/addressbook/backend/pas/pas-book-view.c b/addressbook/backend/pas/pas-book-view.c
new file mode 100644
index 0000000000..fc706bc897
--- /dev/null
+++ b/addressbook/backend/pas/pas-book-view.c
@@ -0,0 +1,243 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * pas-book-view.c
+ *
+ * Copyright 2000, Helix Code, Inc.
+ */
+
+#include <glib.h>
+#include "pas-book-view.h"
+
+static BonoboObjectClass *pas_book_view_parent_class;
+POA_Evolution_BookView__vepv pas_book_view_vepv;
+
+struct _PASBookViewPrivate {
+ Evolution_BookViewListener listener;
+};
+
+/**
+ * pas_book_view_notify_change:
+ */
+void
+pas_book_view_notify_change (PASBookView *book_view,
+ const GList *cards)
+{
+ CORBA_Environment ev;
+ gint i, length;
+ CORBA_sequence_Evolution_VCard card_sequence;
+
+ length = g_list_length((GList *) cards);
+
+ card_sequence._buffer = CORBA_sequence_Evolution_VCard_allocbuf(length);
+ card_sequence._maximum = length;
+ card_sequence._length = length;
+
+ for ( i = 0; cards; cards = g_list_next(cards), i++ ) {
+ card_sequence._buffer[i] = (char *) cards->data;
+ }
+
+ CORBA_exception_init (&ev);
+
+ Evolution_BookViewListener_signal_card_changed (
+ book_view->priv->listener, &card_sequence, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("pas_book_view_notify_change: Exception signaling BookListener!\n");
+ }
+
+ CORBA_exception_free (&ev);
+
+ CORBA_free(card_sequence._buffer);
+}
+
+/**
+ * pas_book_view_notify_remove:
+ */
+void
+pas_book_view_notify_remove (PASBookView *book_view,
+ const char *id)
+{
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ Evolution_BookViewListener_signal_card_removed (
+ book_view->priv->listener, (Evolution_CardId) id, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("pas_book_view_notify_remove: Exception signaling BookListener!\n");
+ }
+
+ CORBA_exception_free (&ev);
+}
+
+/**
+ * pas_book_view_notify_add:
+ */
+void
+pas_book_view_notify_add (PASBookView *book_view,
+ const GList *cards)
+{
+ CORBA_Environment ev;
+ gint i, length;
+ CORBA_sequence_Evolution_VCard card_sequence;
+
+ length = g_list_length((GList *)cards);
+
+ card_sequence._buffer = CORBA_sequence_Evolution_VCard_allocbuf(length);
+ card_sequence._maximum = length;
+ card_sequence._length = length;
+
+ for ( i = 0; cards; cards = g_list_next(cards), i++ ) {
+ card_sequence._buffer[i] = (char *) cards->data;
+ }
+
+ CORBA_exception_init (&ev);
+
+ Evolution_BookViewListener_signal_card_added (
+ book_view->priv->listener, &card_sequence, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("pas_book_view_notify_add: Exception signaling BookListener!\n");
+ }
+
+ CORBA_exception_free (&ev);
+
+ CORBA_free(card_sequence._buffer);
+}
+
+static gboolean
+pas_book_view_construct (PASBookView *book_view,
+ Evolution_BookViewListener listener)
+{
+ POA_Evolution_BookView *servant;
+ CORBA_Environment ev;
+ CORBA_Object obj;
+
+ g_assert (book_view != NULL);
+ g_assert (PAS_IS_BOOK_VIEW (book_view));
+ g_assert (listener != CORBA_OBJECT_NIL);
+
+ servant = (POA_Evolution_BookView *) g_new0 (BonoboObjectServant, 1);
+ servant->vepv = &pas_book_view_vepv;
+
+ CORBA_exception_init (&ev);
+
+ POA_Evolution_BookView__init ((PortableServer_Servant) servant, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_free (servant);
+ CORBA_exception_free (&ev);
+
+ return FALSE;
+ }
+
+ CORBA_exception_free (&ev);
+
+ obj = bonobo_object_activate_servant (BONOBO_OBJECT (book_view), servant);
+ if (obj == CORBA_OBJECT_NIL) {
+ g_free (servant);
+
+ return FALSE;
+ }
+
+ bonobo_object_construct (BONOBO_OBJECT (book_view), obj);
+
+ book_view->priv->listener = listener;
+
+ return TRUE;
+}
+
+/**
+ * pas_book_view_new:
+ */
+PASBookView *
+pas_book_view_new (Evolution_BookViewListener listener)
+{
+ PASBookView *book_view;
+
+ g_return_val_if_fail (listener != CORBA_OBJECT_NIL, NULL);
+
+ book_view = gtk_type_new (pas_book_view_get_type ());
+
+ if (! pas_book_view_construct (book_view, listener)) {
+ gtk_object_unref (GTK_OBJECT (book_view));
+
+ return NULL;
+ }
+
+ return book_view;
+}
+
+static void
+pas_book_view_destroy (GtkObject *object)
+{
+ PASBookView *book_view = PAS_BOOK_VIEW (object);
+
+ g_free (book_view->priv);
+
+ GTK_OBJECT_CLASS (pas_book_view_parent_class)->destroy (object);
+}
+
+static POA_Evolution_BookView__epv *
+pas_book_view_get_epv (void)
+{
+ POA_Evolution_BookView__epv *epv;
+
+ epv = g_new0 (POA_Evolution_BookView__epv, 1);
+
+ return epv;
+
+}
+
+static void
+pas_book_view_corba_class_init (void)
+{
+ pas_book_view_vepv.Bonobo_Unknown_epv = bonobo_object_get_epv ();
+ pas_book_view_vepv.Evolution_BookView_epv = pas_book_view_get_epv ();
+}
+
+static void
+pas_book_view_class_init (PASBookViewClass *klass)
+{
+ GtkObjectClass *object_class = (GtkObjectClass *) klass;
+
+ pas_book_view_parent_class = gtk_type_class (bonobo_object_get_type ());
+
+ object_class->destroy = pas_book_view_destroy;
+
+ pas_book_view_corba_class_init ();
+}
+
+static void
+pas_book_view_init (PASBookView *book_view)
+{
+ book_view->priv = g_new0 (PASBookViewPrivate, 1);
+ book_view->priv->listener = CORBA_OBJECT_NIL;
+}
+
+/**
+ * pas_book_view_get_type:
+ */
+GtkType
+pas_book_view_get_type (void)
+{
+ static GtkType type = 0;
+
+ if (! type) {
+ GtkTypeInfo info = {
+ "PASBookView",
+ sizeof (PASBookView),
+ sizeof (PASBookViewClass),
+ (GtkClassInitFunc) pas_book_view_class_init,
+ (GtkObjectInitFunc) pas_book_view_init,
+ NULL, /* reserved 1 */
+ NULL, /* reserved 2 */
+ (GtkClassInitFunc) NULL
+ };
+
+ type = gtk_type_unique (bonobo_object_get_type (), &info);
+ }
+
+ return type;
+}
+
diff --git a/addressbook/backend/pas/pas-book-view.h b/addressbook/backend/pas/pas-book-view.h
new file mode 100644
index 0000000000..b742b2ba1a
--- /dev/null
+++ b/addressbook/backend/pas/pas-book-view.h
@@ -0,0 +1,49 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * A wrapper object which exports the Evolution_Book CORBA interface
+ * and which maintains a request queue.
+ *
+ * Author:
+ * Nat Friedman (nat@helixcode.com)
+ *
+ * Copyright 2000, Helix Code, Inc.
+ */
+
+#ifndef __PAS_BOOK_VIEW_H__
+#define __PAS_BOOK_VIEW_H__
+
+#include <bonobo/bonobo-object.h>
+#include <libgnome/gnome-defs.h>
+#include <addressbook.h>
+
+typedef struct _PASBookView PASBookView;
+typedef struct _PASBookViewClass PASBookViewClass;
+typedef struct _PASBookViewPrivate PASBookViewPrivate;
+
+struct _PASBookView {
+ BonoboObject parent_object;
+ PASBookViewPrivate *priv;
+};
+
+struct _PASBookViewClass {
+ BonoboObjectClass parent_class;
+};
+
+PASBookView *pas_book_view_new (Evolution_BookViewListener listener);
+
+void pas_book_view_notify_change (PASBookView *book_view,
+ const GList *cards);
+void pas_book_view_notify_remove (PASBookView *book_view,
+ const char *id);
+void pas_book_view_notify_add (PASBookView *book_view,
+ const GList *cards);
+
+GtkType pas_book_view_get_type (void);
+
+#define PAS_BOOK_VIEW_TYPE (pas_book_view_get_type ())
+#define PAS_BOOK_VIEW(o) (GTK_CHECK_CAST ((o), PAS_BOOK_VIEW_TYPE, PASBookView))
+#define PAS_BOOK_VIEW_CLASS(k) (GTK_CHECK_CLASS_CAST((k), PAS_BOOK_VIEW_FACTORY_TYPE, PASBookViewClass))
+#define PAS_IS_BOOK_VIEW(o) (GTK_CHECK_TYPE ((o), PAS_BOOK_VIEW_TYPE))
+#define PAS_IS_BOOK_VIEW_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), PAS_BOOK_VIEW_TYPE))
+
+#endif /* ! __PAS_BOOK_VIEW_H__ */
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
index f571bc4044..47e5508654 100644
--- a/addressbook/backend/pas/pas-book.c
+++ b/addressbook/backend/pas/pas-book.c
@@ -91,12 +91,37 @@ pas_book_queue_modify_card (PASBook *book, const char *vcard)
}
static void
-pas_book_queue_get_all_cards (PASBook *book)
+pas_book_queue_get_cursor (PASBook *book, const char *search)
{
PASRequest *req;
- req = g_new0 (PASRequest, 1);
- req->op = GetAllCards;
+ req = g_new0 (PASRequest, 1);
+ req->op = GetCursor;
+ req->search = g_strdup(search);
+
+ pas_book_queue_request (book, req);
+}
+
+static void
+pas_book_queue_get_book_view (PASBook *book, const Evolution_BookViewListener listener, const char *search)
+{
+ PASRequest *req;
+ CORBA_Environment ev;
+
+ req = g_new0 (PASRequest, 1);
+ req->op = GetBookView;
+ req->search = g_strdup(search);
+
+ CORBA_exception_init (&ev);
+
+ req->listener = CORBA_Object_duplicate(listener, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("pas_book_queue_get_book_view: Exception "
+ "duplicating BookViewListener!\n");
+ }
+
+ CORBA_exception_free (&ev);
pas_book_queue_request (book, req);
}
@@ -130,12 +155,12 @@ impl_Evolution_Book_get_vcard (PortableServer_Servant servant,
static void
impl_Evolution_Book_create_card (PortableServer_Servant servant,
- const CORBA_char *vcard,
+ const Evolution_VCard vcard,
CORBA_Environment *ev)
{
PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
- pas_book_queue_create_card (book, vcard);
+ pas_book_queue_create_card (book, (const char *) vcard);
}
static void
@@ -150,21 +175,33 @@ impl_Evolution_Book_remove_card (PortableServer_Servant servant,
static void
impl_Evolution_Book_modify_card (PortableServer_Servant servant,
- const CORBA_char *vcard,
+ const Evolution_VCard vcard,
CORBA_Environment *ev)
{
PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
- pas_book_queue_modify_card (book, vcard);
+ pas_book_queue_modify_card (book, (const char *) vcard);
}
static void
-impl_Evolution_Book_get_all_cards (PortableServer_Servant servant,
- CORBA_Environment *ev)
+impl_Evolution_Book_get_cursor (PortableServer_Servant servant,
+ const CORBA_char *search,
+ CORBA_Environment *ev)
{
PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
- pas_book_queue_get_all_cards (book);
+ pas_book_queue_get_cursor (book, search);
+}
+
+static void
+impl_Evolution_Book_get_book_view (PortableServer_Servant servant,
+ const Evolution_BookViewListener listener,
+ const CORBA_char *search,
+ CORBA_Environment *ev)
+{
+ PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
+
+ pas_book_queue_get_book_view (book, listener, search);
}
static void
@@ -363,86 +400,48 @@ pas_book_respond_get_cursor (PASBook *book,
}
/**
- * pas_book_report_connection:
+ * pas_book_respond_get_cursor:
*/
void
-pas_book_report_connection (PASBook *book,
- gboolean connected)
+pas_book_respond_get_book_view (PASBook *book,
+ Evolution_BookListener_CallStatus status,
+ PASBookView *book_view)
{
CORBA_Environment ev;
+ CORBA_Object object;
CORBA_exception_init (&ev);
+
+ object = bonobo_object_corba_objref(BONOBO_OBJECT(book_view));
- Evolution_BookListener_report_connection_status (
- book->priv->listener, (CORBA_boolean) connected, &ev);
+ Evolution_BookListener_respond_get_view (
+ book->priv->listener, status, object, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_report_connection: Exception "
+ g_warning ("pas_book_respond_get_cursor: Exception "
"responding to BookListener!\n");
}
CORBA_exception_free (&ev);
}
-
-/**
- * pas_book_notify_change:
- */
-void
-pas_book_notify_change (PASBook *book,
- const char *id)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- Evolution_BookListener_signal_card_changed (
- book->priv->listener, (Evolution_CardId) id, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_notify_change: Exception signaling BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
/**
- * pas_book_notify_remove:
- */
-void
-pas_book_notify_remove (PASBook *book,
- const char *id)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- Evolution_BookListener_signal_card_removed (
- book->priv->listener, (Evolution_CardId) id, &ev);
-
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_notify_remove: Exception signaling BookListener!\n");
- }
-
- CORBA_exception_free (&ev);
-}
-
-/**
- * pas_book_notify_add:
+ * pas_book_report_connection:
*/
void
-pas_book_notify_add (PASBook *book,
- const char *id)
+pas_book_report_connection (PASBook *book,
+ gboolean connected)
{
CORBA_Environment ev;
CORBA_exception_init (&ev);
- Evolution_BookListener_signal_card_added (
- book->priv->listener, (Evolution_CardId) id, &ev);
+ Evolution_BookListener_report_connection_status (
+ book->priv->listener, (CORBA_boolean) connected, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("pas_book_notify_add: Exception signaling BookListener!\n");
+ g_warning ("pas_book_report_connection: Exception "
+ "responding to BookListener!\n");
}
CORBA_exception_free (&ev);
@@ -550,7 +549,8 @@ pas_book_get_epv (void)
epv->remove_card = impl_Evolution_Book_remove_card;
epv->modify_card = impl_Evolution_Book_modify_card;
epv->check_connection = impl_Evolution_Book_check_connection;
- epv->get_all_cards = impl_Evolution_Book_get_all_cards;
+ epv->get_cursor = impl_Evolution_Book_get_cursor;
+ epv->get_book_view = impl_Evolution_Book_get_book_view;
return epv;
diff --git a/addressbook/backend/pas/pas-book.h b/addressbook/backend/pas/pas-book.h
index ab0dced4e4..8d92f6a266 100644
--- a/addressbook/backend/pas/pas-book.h
+++ b/addressbook/backend/pas/pas-book.h
@@ -15,6 +15,7 @@
#include <bonobo/bonobo-object.h>
#include <libgnome/gnome-defs.h>
#include <addressbook.h>
+#include <pas-book-view.h>
typedef struct _PASBook PASBook;
typedef struct _PASBookPrivate PASBookPrivate;
@@ -26,14 +27,17 @@ typedef enum {
CreateCard,
RemoveCard,
ModifyCard,
- GetAllCards,
+ GetCursor,
+ GetBookView,
CheckConnection
} PASOperation;
typedef struct {
- PASOperation op;
- char *id;
- char *vcard;
+ PASOperation op;
+ char *id;
+ char *vcard;
+ char *search;
+ Evolution_BookViewListener listener;
} PASRequest;
struct _PASBook {
@@ -50,37 +54,33 @@ typedef struct {
typedef char * (*PASBookGetVCardFn) (PASBook *book, const char *id);
-PASBook *pas_book_new (PASBackend *backend,
- Evolution_BookListener listener,
- PASBookGetVCardFn get_vcard);
-PASBackend *pas_book_get_backend (PASBook *book);
-Evolution_BookListener pas_book_get_listener (PASBook *book);
-int pas_book_check_pending (PASBook *book);
-PASRequest *pas_book_pop_request (PASBook *book);
-
-void pas_book_respond_open (PASBook *book,
- Evolution_BookListener_CallStatus status);
-void pas_book_respond_create (PASBook *book,
- Evolution_BookListener_CallStatus status,
- const char *id);
-void pas_book_respond_remove (PASBook *book,
- Evolution_BookListener_CallStatus status);
-void pas_book_respond_modify (PASBook *book,
- Evolution_BookListener_CallStatus status);
-void pas_book_respond_get_cursor (PASBook *book,
- Evolution_BookListener_CallStatus status,
- PASCardCursor *cursor);
-void pas_book_report_connection (PASBook *book,
- gboolean connected);
-
-void pas_book_notify_change (PASBook *book,
- const char *id);
-void pas_book_notify_remove (PASBook *book,
- const char *id);
-void pas_book_notify_add (PASBook *book,
- const char *id);
-
-GtkType pas_book_get_type (void);
+PASBook *pas_book_new (PASBackend *backend,
+ Evolution_BookListener listener,
+ PASBookGetVCardFn get_vcard);
+PASBackend *pas_book_get_backend (PASBook *book);
+Evolution_BookListener pas_book_get_listener (PASBook *book);
+int pas_book_check_pending (PASBook *book);
+PASRequest *pas_book_pop_request (PASBook *book);
+
+void pas_book_respond_open (PASBook *book,
+ Evolution_BookListener_CallStatus status);
+void pas_book_respond_create (PASBook *book,
+ Evolution_BookListener_CallStatus status,
+ const char *id);
+void pas_book_respond_remove (PASBook *book,
+ Evolution_BookListener_CallStatus status);
+void pas_book_respond_modify (PASBook *book,
+ Evolution_BookListener_CallStatus status);
+void pas_book_respond_get_cursor (PASBook *book,
+ Evolution_BookListener_CallStatus status,
+ PASCardCursor *cursor);
+void pas_book_respond_get_book_view (PASBook *book,
+ Evolution_BookListener_CallStatus status,
+ PASBookView *book_view);
+void pas_book_report_connection (PASBook *book,
+ gboolean connected);
+
+GtkType pas_book_get_type (void);
#define PAS_BOOK_TYPE (pas_book_get_type ())
#define PAS_BOOK(o) (GTK_CHECK_CAST ((o), PAS_BOOK_TYPE, PASBook))