aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/pas
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-09-22 19:13:53 +0800
committerChris Lahey <clahey@src.gnome.org>2000-09-22 19:13:53 +0800
commitb2019f34096c075bedcc2f9db7ee94d493225768 (patch)
tree60117e19ac3be2357786d4fd6dec1b6454de9daa /addressbook/backend/pas
parent0d39d588a7da56bca9c195615d765edd572b3a41 (diff)
downloadgsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar.gz
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar.bz2
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar.lz
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar.xz
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.tar.zst
gsoc2013-evolution-b2019f34096c075bedcc2f9db7ee94d493225768.zip
Added evolution-addressbook-ldap.xml.
2000-09-22 Christopher James Lahey <clahey@helixcode.com> * ui/Makefile.am: Added evolution-addressbook-ldap.xml. * ui/evolution-addressbook-ldap.xml: New file. (A Variation on evolution-addressbook.xml) * ui/evolution-addressbook.xml: Added View All and Stop buttons. From addressbook/ChangeLog: 2000-09-22 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-book.c, backend/ebook/e-book.h, backend/idl/addressbook.idl, backend/pas/pas-backend-file.c, backend/pas/pas-backend-ldap.c, backend/pas-backend.c, backend/pas/pas-backend.h, backend/pas/pas-book.c, backend/pas/pas-book.h: Added a function to query static capabilities (capabilities that can be reported immediately) and implemented them in the 2 servers. * gui/component/addressbook.c: Added a View All button and a Stop button. Sorted out the new directory server stuff a bit. * gui/widgets/e-addressbook-model.c, gui/widgets/e-addressbook-model.h: Cleaned up a bit. Added a stop function. Check for capabilities before deciding whether to load all cards when initially viewed. * gui/widgets/e-addressbook-view.c, gui/widgets/e-addressbook-view.h: Added stop and view all functions. * gui/widgets/e-minicard-view-widget.c, gui/widgets/e-minicard-view-widget.h, gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h: Added a stop function. Check for capabilities before deciding whether to load all cards when initially viewed. svn path=/trunk/; revision=5547
Diffstat (limited to 'addressbook/backend/pas')
-rw-r--r--addressbook/backend/pas/pas-backend-file.c15
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c15
-rw-r--r--addressbook/backend/pas/pas-backend.c16
-rw-r--r--addressbook/backend/pas/pas-backend.h24
-rw-r--r--addressbook/backend/pas/pas-book.c33
-rw-r--r--addressbook/backend/pas/pas-book.h61
6 files changed, 106 insertions, 58 deletions
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index b7eb57e81a..a54d32d424 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -1175,6 +1175,12 @@ pas_backend_file_remove_client (PASBackend *backend,
pas_backend_last_client_gone (backend);
}
+static char *
+pas_backend_file_get_static_capabilities (PASBackend *backend)
+{
+ return g_strdup("local");
+}
+
static gboolean
pas_backend_file_construct (PASBackendFile *backend)
{
@@ -1230,10 +1236,11 @@ pas_backend_file_class_init (PASBackendFileClass *klass)
parent_class = PAS_BACKEND_CLASS (klass);
/* Set the virtual methods. */
- parent_class->load_uri = pas_backend_file_load_uri;
- parent_class->get_uri = pas_backend_file_get_uri;
- parent_class->add_client = pas_backend_file_add_client;
- parent_class->remove_client = pas_backend_file_remove_client;
+ parent_class->load_uri = pas_backend_file_load_uri;
+ parent_class->get_uri = pas_backend_file_get_uri;
+ parent_class->add_client = pas_backend_file_add_client;
+ parent_class->remove_client = pas_backend_file_remove_client;
+ parent_class->get_static_capabilities = pas_backend_file_get_static_capabilities;
object_class->destroy = pas_backend_file_destroy;
}
diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c
index 08fe3ef773..59c721415f 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -1352,6 +1352,12 @@ pas_backend_ldap_remove_client (PASBackend *backend,
pas_backend_last_client_gone (backend);
}
+static char *
+pas_backend_ldap_get_static_capabilites (PASBackend *backend)
+{
+ return g_strdup("net");
+}
+
static gboolean
pas_backend_ldap_construct (PASBackendLDAP *backend)
{
@@ -1415,10 +1421,11 @@ pas_backend_ldap_class_init (PASBackendLDAPClass *klass)
parent_class = PAS_BACKEND_CLASS (klass);
/* Set the virtual methods. */
- parent_class->load_uri = pas_backend_ldap_load_uri;
- parent_class->get_uri = pas_backend_ldap_get_uri;
- parent_class->add_client = pas_backend_ldap_add_client;
- parent_class->remove_client = pas_backend_ldap_remove_client;
+ parent_class->load_uri = pas_backend_ldap_load_uri;
+ parent_class->get_uri = pas_backend_ldap_get_uri;
+ parent_class->add_client = pas_backend_ldap_add_client;
+ parent_class->remove_client = pas_backend_ldap_remove_client;
+ parent_class->get_static_capabilities = pas_backend_ldap_get_static_capabilites;
object_class->destroy = pas_backend_ldap_destroy;
}
diff --git a/addressbook/backend/pas/pas-backend.c b/addressbook/backend/pas/pas-backend.c
index 3d315c2faf..1568918560 100644
--- a/addressbook/backend/pas/pas-backend.c
+++ b/addressbook/backend/pas/pas-backend.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Author:
* Nat Friedman (nat@helixcode.com)
@@ -95,6 +96,17 @@ pas_backend_remove_client (PASBackend *backend,
CLASS (backend)->remove_client (backend, book);
}
+char *
+pas_backend_get_static_capabilities (PASBackend *backend)
+{
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (PAS_IS_BACKEND (backend), NULL);
+
+ g_assert (CLASS (backend)->get_static_capabilities != NULL);
+
+ return CLASS (backend)->get_static_capabilities (backend);
+}
+
/**
* pas_backend_last_client_gone:
* @backend: An addressbook backend.
@@ -133,6 +145,10 @@ pas_backend_class_init (PASBackendClass *klass)
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, pas_backend_signals, LAST_SIGNAL);
+
+ klass->add_client = NULL;
+ klass->remove_client = NULL;
+ klass->get_static_capabilities = NULL;
}
/**
diff --git a/addressbook/backend/pas/pas-backend.h b/addressbook/backend/pas/pas-backend.h
index a1d1a291fd..4045074284 100644
--- a/addressbook/backend/pas/pas-backend.h
+++ b/addressbook/backend/pas/pas-backend.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* An abstract class which defines the API to a given backend.
* There will be one PASBackend object for every URI which is loaded.
@@ -43,6 +44,7 @@ typedef struct {
const char *(* get_uri) (PASBackend *backend);
gboolean (*add_client) (PASBackend *backend, Evolution_BookListener listener);
void (*remove_client) (PASBackend *backend, PASBook *book);
+ char *(*get_static_capabilities) (PASBackend *backend);
/* Notification signals */
void (* last_client_gone) (PASBackend *backend);
@@ -50,18 +52,20 @@ typedef struct {
typedef PASBackend * (*PASBackendFactoryFn) (void);
-gboolean pas_backend_construct (PASBackend *backend);
-gboolean pas_backend_load_uri (PASBackend *backend,
- const char *uri);
-const char *pas_backend_get_uri (PASBackend *backend);
-gboolean pas_backend_add_client (PASBackend *backend,
- Evolution_BookListener listener);
-void pas_backend_remove_client (PASBackend *backend,
- PASBook *book);
+gboolean pas_backend_construct (PASBackend *backend);
+gboolean pas_backend_load_uri (PASBackend *backend,
+ const char *uri);
+const char *pas_backend_get_uri (PASBackend *backend);
-void pas_backend_last_client_gone (PASBackend *backend);
+gboolean pas_backend_add_client (PASBackend *backend,
+ Evolution_BookListener listener);
+void pas_backend_remove_client (PASBackend *backend,
+ PASBook *book);
+char *pas_backend_get_static_capabilities (PASBackend *backend);
-GtkType pas_backend_get_type (void);
+void pas_backend_last_client_gone (PASBackend *backend);
+
+GtkType pas_backend_get_type (void);
#define PAS_BACKEND_TYPE (pas_backend_get_type ())
#define PAS_BACKEND(o) (GTK_CHECK_CAST ((o), PAS_BACKEND_TYPE, PASBackend))
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
index 55caf1dce7..4cd51237a1 100644
--- a/addressbook/backend/pas/pas-book.c
+++ b/addressbook/backend/pas/pas-book.c
@@ -241,6 +241,20 @@ impl_Evolution_Book_check_connection (PortableServer_Servant servant,
pas_book_queue_check_connection (book);
}
+static char *
+impl_Evolution_Book_get_static_capabilities (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
+ char *temp;
+ char *ret_val;
+
+ temp = pas_backend_get_static_capabilities (book->priv->backend);
+ ret_val = CORBA_string_dup(temp);
+ g_free(temp);
+ return ret_val;
+}
+
/**
* pas_book_get_backend:
*/
@@ -598,15 +612,16 @@ pas_book_get_epv (void)
epv = g_new0 (POA_Evolution_Book__epv, 1);
- epv->get_vcard = impl_Evolution_Book_get_vcard;
- epv->can_write = impl_Evolution_Book_can_write;
- epv->can_write_card = impl_Evolution_Book_can_write_card;
- epv->create_card = impl_Evolution_Book_create_card;
- 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_cursor = impl_Evolution_Book_get_cursor;
- epv->get_book_view = impl_Evolution_Book_get_book_view;
+ epv->get_vcard = impl_Evolution_Book_get_vcard;
+ epv->can_write = impl_Evolution_Book_can_write;
+ epv->can_write_card = impl_Evolution_Book_can_write_card;
+ epv->create_card = impl_Evolution_Book_create_card;
+ 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_static_capabilities = impl_Evolution_Book_get_static_capabilities;
+ 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 43a94b6600..9ca81eb25d 100644
--- a/addressbook/backend/pas/pas-book.h
+++ b/addressbook/backend/pas/pas-book.h
@@ -56,38 +56,37 @@ typedef char * (*PASBookGetVCardFn) (PASBook *book, const char *id);
typedef gboolean (*PASBookCanWriteFn) (PASBook *book);
typedef gboolean (*PASBookCanWriteCardFn) (PASBook *book, const char *id);
-PASBook *pas_book_new (PASBackend *backend,
- Evolution_BookListener listener,
- PASBookGetVCardFn get_vcard,
- PASBookCanWriteFn can_write,
- PASBookCanWriteCardFn can_write_card);
-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);
+PASBook *pas_book_new (PASBackend *backend,
+ Evolution_BookListener listener,
+ PASBookGetVCardFn get_vcard,
+ PASBookCanWriteFn can_write,
+ PASBookCanWriteCardFn can_write_card);
+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);
-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);
-
-gboolean pas_book_can_write (PASBook *book);
-gboolean pas_book_can_write_card (PASBook *book,
- const char *id);
-GtkType pas_book_get_type (void);
+gboolean pas_book_can_write (PASBook *book);
+gboolean pas_book_can_write_card (PASBook *book,
+ const char *id);
+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))