From 96d24f1297eaa5a6333b9fcfdf35420d273703af Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 1 Aug 2001 03:41:51 +0000 Subject: The Wombat now keeps track of which categories are present in the objects 2001-07-31 Federico Mena Quintero The Wombat now keeps track of which categories are present in the objects of a calendar. It will notify the clients of changes in this set. This is to make the category drop-down menus in the calendar/tasks views be always up to date. * idl/evolution-calendar.idl (Listener): Added a notifyCategoriesChanged() method. The Wombat now keeps track of the categories within a calendar. * cal-client/cal-listener.[ch]: Switched it to use BonoboXObject. Also added the notifyCategoriesChanged implementation. * cal-client/cal-client.[ch]: Added a "categories_changed" signal. * pcs/cal-backend-file.c: Maintain a list of the live categories. (update_categories_from_comp): New function to maintain the set of live categories. (add_component): Update the set of categories. (remove_component): Likewise. (open_cal): Notify about changes in the set of categories. (create_cal): Likewise. (cal_backend_file_update_objects): Likewise. (cal_backend_file_remove_object): Likewise. (notify_categories_changed): New function to notify the clients about the current set of categories. * pcs/cal.c (cal_notify_categories_changed): New function. svn path=/trunk/; revision=11536 --- calendar/cal-client/cal-listener.h | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'calendar/cal-client/cal-listener.h') diff --git a/calendar/cal-client/cal-listener.h b/calendar/cal-client/cal-listener.h index fa9209cc79..4cbbd8b8c9 100644 --- a/calendar/cal-client/cal-listener.h +++ b/calendar/cal-client/cal-listener.h @@ -1,7 +1,6 @@ /* Evolution calendar listener * - * Copyright (C) 2000 Ximian, Inc. - * Copyright (C) 2000 Ximian, Inc. + * Copyright (C) 2001 Ximian, Inc. * * Author: Federico Mena-Quintero * @@ -24,7 +23,7 @@ #define CAL_LISTENER_H #include -#include +#include #include "evolution-calendar.h" BEGIN_GNOME_DECLS @@ -38,21 +37,20 @@ BEGIN_GNOME_DECLS #define IS_CAL_LISTENER(obj) (GTK_CHECK_TYPE ((obj), CAL_LISTENER_TYPE)) #define IS_CAL_LISTENER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), CAL_LISTENER_TYPE)) -typedef struct _CalListener CalListener; -typedef struct _CalListenerClass CalListenerClass; +typedef struct CalListenerPrivate CalListenerPrivate; -typedef struct _CalListenerPrivate CalListenerPrivate; - -struct _CalListener { - BonoboObject object; +typedef struct { + BonoboXObject xobject; /* Private data */ CalListenerPrivate *priv; -}; +} CalListener; + +typedef struct { + BonoboXObjectClass parent_class; -struct _CalListenerClass { - BonoboObjectClass parent_class; -}; + POA_GNOME_Evolution_Calendar_Listener__epv epv; +} CalListenerClass; /* Notification functions */ typedef void (* CalListenerCalOpenedFn) (CalListener *listener, @@ -67,25 +65,26 @@ typedef void (* CalListenerObjRemovedFn) (CalListener *listener, const GNOME_Evolution_Calendar_CalObjUID uid, gpointer data); +typedef void (* CalListenerCategoriesChangedFn) (CalListener *listener, + const GNOME_Evolution_Calendar_StringSeq *categories, + gpointer data); + GtkType cal_listener_get_type (void); CalListener *cal_listener_construct (CalListener *listener, - GNOME_Evolution_Calendar_Listener corba_listener, CalListenerCalOpenedFn cal_opened_fn, CalListenerObjUpdatedFn obj_updated_fn, CalListenerObjRemovedFn obj_removed_fn, + CalListenerCategoriesChangedFn categories_changed_fn, gpointer fn_data); -GNOME_Evolution_Calendar_Listener cal_listener_corba_object_create (BonoboObject *object); - CalListener *cal_listener_new (CalListenerCalOpenedFn cal_opened_fn, CalListenerObjUpdatedFn obj_updated_fn, CalListenerObjRemovedFn obj_removed_fn, + CalListenerCategoriesChangedFn categories_changed_fn, gpointer fn_data); -POA_GNOME_Evolution_Calendar_Listener__epv *cal_listener_get_epv (void); - END_GNOME_DECLS -- cgit v1.2.3