From 21e60e238477edd1ad157bd17024d5ea6395e048 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 28 Mar 2000 03:52:46 +0000 Subject: Fixed some warnings. 2000-03-27 Christopher James Lahey * addressbook/backend/ebook/test-card.c: Fixed some warnings. * addressbook/backend/ebook/test-client.c: Added a section to test cursors and returning an id when adding. * addressbook/backend/ebook/e-card-pairs.h: Removed the address pairs since they were added to e-card.c. * addressbook/backend/ebook/e-card.c, addressbook/backend/ebook/e-card.h: Made the set_id function take a const char *. * 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/idl/addressbook.idl, addressbook/backend/pas/pas-backend-file.c, addressbook/backend/pas/pas-book.c, addressbook/backend/pas/pas-book.h: Added a get_all_cards function and made the response to the create_card function include the card id. * addressbook/backend/ebook/Makefile.am: Added e-card-cursor.c and e-card-cursor.h. * addressbook/backend/ebook/e-card-cursor.c, addressbook/backend/ebook/e-card-cursor.h: New class for proxying to an Evolution_CardCursor. * addressbook/backend/pas/Makefile.am: Added pas-card-cursor.c and pas-card-cursor.h. * addressbook/backend/pas/pas-card-cursor.c, addressbook/backend/pas/pas-card-cursor.h: New bonobo class for making an Evolution_CardCursor server. svn path=/trunk/; revision=2205 --- addressbook/backend/pas/pas-book.c | 53 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) (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 907ff6482a..f571bc4044 100644 --- a/addressbook/backend/pas/pas-book.c +++ b/addressbook/backend/pas/pas-book.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * pas-book.c * @@ -89,6 +90,17 @@ pas_book_queue_modify_card (PASBook *book, const char *vcard) pas_book_queue_request (book, req); } +static void +pas_book_queue_get_all_cards (PASBook *book) +{ + PASRequest *req; + + req = g_new0 (PASRequest, 1); + req->op = GetAllCards; + + pas_book_queue_request (book, req); +} + static void pas_book_queue_check_connection (PASBook *book) { @@ -146,6 +158,15 @@ impl_Evolution_Book_modify_card (PortableServer_Servant servant, pas_book_queue_modify_card (book, vcard); } +static void +impl_Evolution_Book_get_all_cards (PortableServer_Servant servant, + CORBA_Environment *ev) +{ + PASBook *book = PAS_BOOK (bonobo_object_from_servant (servant)); + + pas_book_queue_get_all_cards (book); +} + static void impl_Evolution_Book_check_connection (PortableServer_Servant servant, CORBA_Environment *ev) @@ -253,14 +274,15 @@ pas_book_respond_open (PASBook *book, */ void pas_book_respond_create (PASBook *book, - Evolution_BookListener_CallStatus status) + Evolution_BookListener_CallStatus status, + const char *id) { CORBA_Environment ev; CORBA_exception_init (&ev); Evolution_BookListener_respond_create_card ( - book->priv->listener, status, &ev); + book->priv->listener, status, (char *)id, &ev); if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("pas_book_respond_create: Exception " @@ -314,6 +336,32 @@ pas_book_respond_modify (PASBook *book, CORBA_exception_free (&ev); } +/** + * pas_book_respond_get_cursor: + */ +void +pas_book_respond_get_cursor (PASBook *book, + Evolution_BookListener_CallStatus status, + PASCardCursor *cursor) +{ + CORBA_Environment ev; + CORBA_Object object; + + CORBA_exception_init (&ev); + + object = bonobo_object_corba_objref(BONOBO_OBJECT(cursor)); + + Evolution_BookListener_respond_get_cursor ( + book->priv->listener, status, object, &ev); + + if (ev._major != CORBA_NO_EXCEPTION) { + g_warning ("pas_book_respond_get_cursor: Exception " + "responding to BookListener!\n"); + } + + CORBA_exception_free (&ev); +} + /** * pas_book_report_connection: */ @@ -502,6 +550,7 @@ 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; return epv; -- cgit v1.2.3