aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-02-18 11:24:33 +0800
committerChris Toshok <toshok@src.gnome.org>2001-02-18 11:24:33 +0800
commite6d81792c4c7950a5a897211ace6590d4ad458f6 (patch)
tree8e6419caba5dbda8c71fc24177218f23491f1679 /addressbook/backend
parentec5d0a0fab3c33f68efe32decf6a55f0b174a796 (diff)
downloadgsoc2013-evolution-e6d81792c4c7950a5a897211ace6590d4ad458f6.tar.gz
gsoc2013-evolution-e6d81792c4c7950a5a897211ace6590d4ad458f6.tar.zst
gsoc2013-evolution-e6d81792c4c7950a5a897211ace6590d4ad458f6.zip
add sequence<string> typedef, and add getSupportedFields method.
2001-02-17 Chris Toshok <toshok@ximian.com> * backend/idl/addressbook.idl: add sequence<string> typedef, and add getSupportedFields method. * backend/pas/pas-book.c (impl_GNOME_Evolution_Addressbook_Book_getSupportedFields): new function. * backend/pas/pas-backend.c (pas_backend_class_init): init get_supported_fields = NULL. (pas_backend_get_supported_fields): new function. * backend/pas/pas-backend.h: add prototype for pas_backend_get_supported_fields. * backend/pas/pas-backend-file.c (pas_backend_file_get_supported_fields): new function. (pas_backend_file_class_init): fill in get_supported_fields. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_get_supported_fields): new function. (pas_backend_ldap_class_init): fill in get_supported_fields. svn path=/trunk/; revision=8270
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/idl/addressbook.idl4
-rw-r--r--addressbook/backend/pas/pas-backend-file.c10
-rw-r--r--addressbook/backend/pas/pas-backend-ldap.c10
-rw-r--r--addressbook/backend/pas/pas-backend.c13
-rw-r--r--addressbook/backend/pas/pas-backend.h3
-rw-r--r--addressbook/backend/pas/pas-book.c27
6 files changed, 67 insertions, 0 deletions
diff --git a/addressbook/backend/idl/addressbook.idl b/addressbook/backend/idl/addressbook.idl
index 14d35dc934..87a7992f7b 100644
--- a/addressbook/backend/idl/addressbook.idl
+++ b/addressbook/backend/idl/addressbook.idl
@@ -15,6 +15,7 @@ module Addressbook {
typedef string CardId;
typedef string VCard;
typedef sequence<VCard> VCardList;
+ typedef sequence<string> stringlist;
interface CardCursor : Bonobo::Unknown {
long count ();
@@ -90,6 +91,8 @@ module Addressbook {
void checkConnection ();
+ stringlist getSupportedFields ();
+
string getStaticCapabilities ();
string getName ();
@@ -105,6 +108,7 @@ module Addressbook {
ProtocolNotSupported,
AuthenticationFailed,
AuthenticationRequired,
+ UnsupportedField,
OtherError
};
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index f9e2c53a2d..94e65c9d81 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -1428,6 +1428,15 @@ pas_backend_file_get_static_capabilities (PASBackend *backend)
return g_strdup("local");
}
+static int
+pas_backend_file_get_supported_fields (PASBackend *backend,
+ char ***fields)
+{
+ printf ("in pas_backend_file_get_supported_fields\n");
+ *fields = NULL;
+ return 0;
+}
+
static gboolean
pas_backend_file_construct (PASBackendFile *backend)
{
@@ -1488,6 +1497,7 @@ pas_backend_file_class_init (PASBackendFileClass *klass)
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;
+ parent_class->get_supported_fields = pas_backend_file_get_supported_fields;
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 9ac3a9f457..60e3aa0c88 100644
--- a/addressbook/backend/pas/pas-backend-ldap.c
+++ b/addressbook/backend/pas/pas-backend-ldap.c
@@ -2215,6 +2215,15 @@ pas_backend_ldap_get_static_capabilites (PASBackend *backend)
return g_strdup("net");
}
+static int
+pas_backend_ldap_get_supported_fields (PASBackend *backend,
+ char ***fields)
+{
+ printf ("in pas_backend_ldap_get_supported_fields\n");
+ *fields = NULL;
+ return 0;
+}
+
static gboolean
pas_backend_ldap_construct (PASBackendLDAP *backend)
{
@@ -2283,6 +2292,7 @@ pas_backend_ldap_class_init (PASBackendLDAPClass *klass)
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;
+ parent_class->get_supported_fields = pas_backend_ldap_get_supported_fields;
object_class->destroy = pas_backend_ldap_destroy;
}
diff --git a/addressbook/backend/pas/pas-backend.c b/addressbook/backend/pas/pas-backend.c
index 22b7184813..30bfdf773f 100644
--- a/addressbook/backend/pas/pas-backend.c
+++ b/addressbook/backend/pas/pas-backend.c
@@ -107,6 +107,18 @@ pas_backend_get_static_capabilities (PASBackend *backend)
return CLASS (backend)->get_static_capabilities (backend);
}
+int
+pas_backend_get_supported_fields (PASBackend *backend,
+ char ***fields)
+{
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (PAS_IS_BACKEND (backend), NULL);
+
+ g_assert (CLASS (backend)->get_supported_fields != NULL);
+
+ return CLASS (backend)->get_supported_fields (backend, fields);
+}
+
/**
* pas_backend_last_client_gone:
* @backend: An addressbook backend.
@@ -149,6 +161,7 @@ pas_backend_class_init (PASBackendClass *klass)
klass->add_client = NULL;
klass->remove_client = NULL;
klass->get_static_capabilities = NULL;
+ klass->get_supported_fields = NULL;
}
/**
diff --git a/addressbook/backend/pas/pas-backend.h b/addressbook/backend/pas/pas-backend.h
index be08d48950..547824ea44 100644
--- a/addressbook/backend/pas/pas-backend.h
+++ b/addressbook/backend/pas/pas-backend.h
@@ -45,6 +45,7 @@ typedef struct {
gboolean (*add_client) (PASBackend *backend, GNOME_Evolution_Addressbook_BookListener listener);
void (*remove_client) (PASBackend *backend, PASBook *book);
char *(*get_static_capabilities) (PASBackend *backend);
+ int (*get_supported_fields) (PASBackend *backend, char ***fields);
/* Notification signals */
void (* last_client_gone) (PASBackend *backend);
@@ -63,6 +64,8 @@ void pas_backend_remove_client (PASBackend *backen
PASBook *book);
char *pas_backend_get_static_capabilities (PASBackend *backend);
+int pas_backend_get_supported_fields (PASBackend *backend,
+ char ***fields);
void pas_backend_last_client_gone (PASBackend *backend);
GtkType pas_backend_get_type (void);
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c
index 783c699603..2cb6c2f142 100644
--- a/addressbook/backend/pas/pas-book.c
+++ b/addressbook/backend/pas/pas-book.c
@@ -315,6 +315,32 @@ impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities (PortableServer_Serv
return ret_val;
}
+static GNOME_Evolution_Addressbook_stringlist *
+impl_GNOME_Evolution_Addressbook_Book_getSupportedFields (PortableServer_Servant servant,
+ CORBA_Environment *ev)
+{
+ PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant));
+ GNOME_Evolution_Addressbook_stringlist *stringlist;
+ char **supported_fields;
+ int num_fields, i;
+
+ stringlist = GNOME_Evolution_Addressbook_stringlist__alloc ();
+ num_fields = pas_backend_get_supported_fields (book->priv->backend, &supported_fields);
+
+ stringlist->_buffer = CORBA_sequence_CORBA_string_allocbuf (num_fields);
+ stringlist->_maximum = num_fields;
+ stringlist->_length = num_fields;
+
+ for (i = 0; num_fields; i++) {
+ stringlist->_buffer[i] = CORBA_string_dup (supported_fields[i]);
+ g_free (supported_fields[i]);
+ }
+
+ g_free (supported_fields);
+
+ return stringlist;
+}
+
/**
* pas_book_get_backend:
*/
@@ -729,6 +755,7 @@ pas_book_get_epv (void)
epv->modifyCard = impl_GNOME_Evolution_Addressbook_Book_modifyCard;
epv->checkConnection = impl_GNOME_Evolution_Addressbook_Book_checkConnection;
epv->getStaticCapabilities = impl_GNOME_Evolution_Addressbook_Book_getStaticCapabilities;
+ epv->getSupportedFields = impl_GNOME_Evolution_Addressbook_Book_getSupportedFields;
epv->getCursor = impl_GNOME_Evolution_Addressbook_Book_getCursor;
epv->getBookView = impl_GNOME_Evolution_Addressbook_Book_getBookView;
epv->getChanges = impl_GNOME_Evolution_Addressbook_Book_getChanges;