From e6d81792c4c7950a5a897211ace6590d4ad458f6 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 18 Feb 2001 03:24:33 +0000 Subject: add sequence typedef, and add getSupportedFields method. 2001-02-17 Chris Toshok * backend/idl/addressbook.idl: add sequence 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 --- addressbook/backend/pas/pas-book.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'addressbook/backend/pas/pas-book.c') 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; -- cgit v1.2.3