aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client/cal-listener.h
Commit message (Collapse)AuthorAgeFilesLines
* New function. We need this from code that dynamically updates from aFederico Mena Quintero2000-08-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-08-28 Federico Mena Quintero <federico@helixcode.com> * cal-client/cal-client.c (cal_client_is_loaded): New function. We need this from code that dynamically updates from a client and could not have connected to the "cal_loaded" signal right after the client was created. * gui/calendar-model.c (load_objects): Do not try to load the objects if the client has not been loaded yet. (cal_loaded_cb): Check the status value. * gui/calendar-model.h (CalendarModel): Declare the private structure here so that gdb will give me love. * pcs/cal-factory.h (CalFactory): Likewise. * pcs/cal.h (Cal): Likewise. * cal-client/cal-listener.h (CalListener): Likewise. * cal-client/cal-client.h (CalClient): Likewise. * pcs/cal-backend.h (CalBackend): This no longer has a private structure, so remove it. * cal-util/Makefile.am (libcal_util_la_SOURCES): Removed the vCalendar and old iCalendar cruft. (libcal_utilinclude_HEADERS): Likewise. Removed the obsolete iCalendar test program. svn path=/trunk/; revision=5091
* CalBackendClass now is just an interface for calendar backends; this is anFederico Mena Quintero2000-05-091-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-05-08 Federico Mena Quintero <federico@helixcode.com> * pcs/cal-backend.h (CalBackendClass): CalBackendClass now is just an interface for calendar backends; this is an abstract class. Put in the vtable for the backend methods. * pcs/cal-backend.c (cal_backend_new): Removed function, since CalBackend is not just an abstract class. Removed implementation-specific functions and made public functions call the virtual methods instead. * pcs/cal-backend-imc.[ch]: New files with the CalBackendIMC implementation; this implements a backend for iCalendar and vCalendar files. Moved the implementation-specific stuff from cal-backend.[ch] to here. * pcs/cal-backend-imc.c (CalendarFormat): Moved enumeration to here. Added a CAL_UNKNOWN value for when the backend is not loaded yet. (cal_backend_imc_init): Initialize priv->format as CAL_UNKNOWN. (save_to_vcal): Use the same VCProdIdProp value as in cal-util/calobj.c. Use "1.0" as the VCVersionProp as per the vCalendar spec. (ensure_uid): Return nothing, since the result value need not be used anymore. (add_object): Since we mark the calendar as dirty anyways, we do not need to check the result value of ensure_uid() anymore. (remove_object): Asssert that we know how to handle the object's type. We do this in add_object() anyways. * pcs/Makefile.am (libpcs_a_SOURCES): Added cal-backend-imc.[ch]. * gui/gnome-cal.c: Replaced debugging printf()s with g_message() so that we can see the line number where they occur. * gui/gnome-cal.c (gnome_calendar_load_cb): Sort of handle the LOAD_METHOD_NOT_SUPPORTED result code, and added a default for the switch. * cal-client/cal-listener.h (CalListenerLoadStatus): Removed enumeration; it is stupid to translate all values for the CalClient when it is going to translate them again. (CalListenerClass::cal_loaded): This signal now passes the LoadStatus directly from the CORBA side. * cal-client/cal-listener.c (Listener_cal_loaded): Do not translate the status value. * cal-client/cal-client.h (CalClientLoadStatus): Added the CAL_CLIENT_LOAD_METHOD_NOT_SUPPORTED error code. * cal-client/cal-client.c (cal_loaded_cb): Translate the CORBA version of the LoadStatus result code. * pcs/cal-factory.c (CalFactoryPrivate): New methods field for the hash table from method strings to the GtkTypes for backend class types. (cal_factory_init): Create the priv->methods hash table. (cal_factory_destroy): Free the priv->methods hash table. (cal_factory_register_method): New function to register a backend class for a particular URI method. (launch_backend_for_uri): New function to launch a backend for a particular URI's method. (load_backend): Use launch_backend_for_uri(). Move the error notification code from load_fn() to here. (create_backend): Use launch_backend_for_uri(). Move the error notification code form create_fn() to here; it is #ifdefed out since currently cal_backend_create() does not have any error reporting capabilities. * idl/evolution-calendar.idl (Listener::LoadStatus): Added a PROTOCOL_NOT_SUPPORTED error code. * pcs/cal-factory.c (cal_factory_load cal_factory_create): Removed functions, since they were supposed to be internal only. (CalFactory_load): Call queue_load_create_job() directly. (CalFactory_create): Likewise. svn path=/trunk/; revision=2921
* Implemented.Federico Mena Quintero2000-02-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-11 Federico Mena Quintero <federico@helixcode.com> * cal-client.c (cal_client_update_object): Implemented. * cal.c (cal_notify_update): New function to notify the listener about an updated object. (Cal_update_object): Implemented. (Cal_get_uids): set_release() the sequence to TRUE. (Cal_get_events_in_range): Likewise. * cal-backend.c (remove_object): New function to remove objects from a calendar backend. (cal_backend_update_object): New public function to update an object and notify clients about it. * evolution-calendar.idl (Cal): Added update_object() and delete_object() methods. (Listener): Removed the obj_changed method and renamed obj_added to obj_updated. We now only have updated and removed notifiers. * cal-listener.[ch]: Removed the "changed" notification code. Changed the "added" notification code to the "updated" notification. * cal-client.c: Likewise. * tlacuache.c (create_cal_factory): Connect to "destroy" on the factory and exit the main loop when the factory is destroyed. * cal-factory.c (backend_destroy_cb): New callback used when a backend is destroyed. Removes the backend from the factory's hash table and unrefs the factory if all backends go away. (add_calendar_client): Free the environment. * cal.c (cal_new): Use bonobo_object_unref() if we fail to initialize. * cal-listener.c (cal_listener_new): Likewise. * layout.c (layout_events): Plug li.partition memory leak. svn path=/trunk/; revision=1742
* Connect to the Cal's destroy signal. (cal_backend_remove_cal): KilledFederico Mena Quintero2000-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-10 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (cal_backend_add_cal): Connect to the Cal's destroy signal. (cal_backend_remove_cal): Killed function now that removal of Cal objects is done in their destroy callback. (cal_destroy_cb): New callback to remove a Cal from the backend's list of clients. Also, the backend destroys itself when there are no more clients connected to it. (save): New placeholder function to save a backend. (destroy): New function to destroy a backend's data. (cal_backend_destroy): Save the calendar and destroy it. * cal.c (cal_destroy): Reset the priv->backend to NULL. * cal-factory.c (add_calendar_client): There is no need to call cal_backend_remove_cal(); we can now just destroy the Cal object. (create_fn): Make sure we always unref the URI. (load_fn): Move the URI unref to the end of the function for safety. * cal-factory.c (add_calendar_client): Unref the Cal only if notification of the listener was unsuccessful. Otherwise, the calendar user agent (Listener side) keeps the reference. * tl-test.c (list_uids): Free the calobj. * cal-client.c (cal_loaded_cb): Use bonobo_object_unref() to get rid of the listener. (load_or_create): Likewise. (destroy_factory): New function to get rid of the factory. (destroy_listener): New function to get rid of the listener. (destroy_cal): New function to get rid of the calendar client interface object. (cal_client_destroy): Free all resources. (cal_client_get_object): CORBA_free() the calobj string. Boy, I love memprof. * cal-listener.c (cal_listener_destroy): Reset the priv->cal to CORBA_OBJECT_NIL. * cal-backend.c (cal_backend_remove_cal): Do not unref the Cal, since the calendar user agent owns it. (cal_backend_add_cal): Do not ref the Cal, since the calendar user agent owns it. * cal-factory.c (add_calendar_client): Use bonobo_object_unref() to get rid of the calendar client interface object. * calobj.c (ical_object_create_from_vobject): Duplicate the default "PUBLIC" string. 2000-02-09 Federico Mena Quintero <federico@helixcode.com> * cal-factory.c (cal_factory_load): Added documentation comment. (load_fn): Do not print a message if the backend could not be loaded due to a non-fatal error. (queue_load_create_job): Moved the stuff from cal_factory_load() to here. Now this function serves to queue load or create requests. (cal_factory_load): Use queue_load_create_job(). (cal_factory_create): Implemented; use queue_load_create_job(). (create_fn): New job handler for creating new calendars. (create_backend): New function to create a new backend with a new calendar. (add_backend): New helper function to add backends to the factory's hash table. (load_backend): Use add_backend() instead of adding the backend by ourselves. * cal-client.c (load_or_create): Moved the functionality from cal_client_load_calendar() to here, and added an option to create a new calendar instead of loading an existing one. (cal_client_load_calendar): Use load_or_create(). (cal_client_create_calendar): Implemented. * cal-backend.c (cal_backend_create): Implemented. * evolution-calendar.idl (LoadStatus): Added an IN_USE error for create requests. * cal-listener.h (CalListenerLoadStatus): Added CAL_LISTENER_LOAD_IN_USE. * cal-listener.c (Listener_cal_loaded): Convert the IN_USE error. * cal-client.h (CalClientLoadStatus): Added CAL_CLIENT_LOAD_IN_USE. * cal-client.c (cal_loaded_cb): Handle CAL_LISTENER_LOAD_IN_USE. * tl-test.c: New test program for the calendar client side; it also exercises the server side by sending commands to it. * Makefile.am: Added the tl-test program. * tlacuache.gnorba: Updated. * tlacuache.c (create_cal_factory): Use the right GOAD id. * cal-client.c (cal_client_construct): Use the right GOAD id. svn path=/trunk/; revision=1732
* New function to create the base VObject for a calendar.Federico Mena Quintero2000-02-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 2000-02-04 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (get_calendar_base_vobject): New function to create the base VObject for a calendar. (cal_backend_get_object): Create the base calendar and add the sought object to it, then stringify it. * evolution-calendar.idl (Listener::obj_added Listener::obj_changed): Now these pass in just the UIDs, not the complete objects. * cal-listener.c (Listener_obj_added): Changed to pass in the uid, not the object. (Listener_obj_changed): Likewise. * cal-client.h (CalClientClass): Made the obj_added and obj_changed signals take in the UIDs, not the full objects. * cal-client.c (obj_added_cb): Likewise. (obj_changed_cb): Likewise. svn path=/trunk/; revision=1666
* Handle the cal_loaded signal from the listener. Store the calendar clientFederico Mena Quintero2000-02-011-0/+2
| | | | | | | | | | | | | | | | 2000-02-01 Federico Mena Quintero <federico@helixcode.com> * cal-client.c (cal_loaded): Handle the cal_loaded signal from the listener. Store the calendar client interface object, and emit our own cal_loaded signal. (cal_client_load_calendar): Connect to the listener's signals. (cal_client_class_init): Added the "obj_added", "obj_removed", öbj_changed" signals. (obj_added_cb): Handle the signal from the listener. (obj_removed_cb): Likewise. (obj_changed_cb): Likewise. svn path=/trunk/; revision=1658
* Changed the namespace from GNOME::Calendar to Evolution::Calendar.Federico Mena Quintero2000-01-291-10/+12
| | | | | | | | | | | | | | | | | 2000-01-30 Federico Mena Quintero <federico@helixcode.com> * evolution-calendar.idl: Changed the namespace from GNOME::Calendar to Evolution::Calendar. (Listener::LoadStatus): Fixed SUCESSS -> SUCCESS typo. And I never noticed it in the implementation. Ain't M-/ grand? * Makefile.am: Changed ocurrences of gnome-calendar.idl to evolution-calendar.idl. * *.[ch]: Changed GNOME_Calendar_foo identifiers to Evolution_Calendar_foo. svn path=/trunk/; revision=1652
* Make Evolution compile with the latest Bonobo changes.Arturo Espinosa2000-01-261-4/+4
| | | | | | | | Make Evolution compile with the latest Bonobo changes. Miguel. svn path=/trunk/; revision=1636
* Take in a GnomeVFSURI, not a string.Federico Mena Quintero2000-01-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | 2000-01-22 Federico Mena Quintero <federico@helixcode.com> * cal-backend.c (cal_backend_load): Take in a GnomeVFSURI, not a string. * cal-listener.c (Listener_cal_loaded): Pass the load status to the signal. (cal_listener_destroy): Better error checking. (cal_listener_new): Better error checking. * cal-listener.h (CalListenerLoadStatus): New enum for the load status of a calendar. (CalListenerClass): Added the status argument to the cal_loaded signal. * gnome-calendar.idl (cal_loaded): Added a load status code. * cal-backend.h (CalBackendLoadStatus): Renamed from CalBackendLoadResult. svn path=/trunk/; revision=1607
* Sync - FedericoArturo Espinosa2000-01-181-2/+1
| | | | svn path=/trunk/; revision=1585
* Removed the CORBA listener methods, adjusted for the new IDL.Federico Mena Quintero2000-01-121-0/+5
| | | | | | | | | | | | | | | | | | 2000-01-11 Federico Mena Quintero <federico@helixcode.com> * cal.c: Removed the CORBA listener methods, adjusted for the new IDL. * cal-listener.c (cal_listener_init): Create the private structure. In it we hold a reference to the calendar the listener is watching. (cal_listener_destroy): Destroy the private structure and unref the calendar. (Listener_cal_loaded): Stuff the calendar into our private data. (Listener_obj_added): Adjusted for new IDL. (Listener_obj_removed): Likewise. svn path=/trunk/; revision=1560
* New IDL for the personal calendar server.Federico Mena Quintero2000-01-121-0/+70
2000-01-11 Federico Mena Quintero <federico@helixcode.com> * gnome-calendar.idl: New IDL for the personal calendar server. * cal.h cal.c: New files with the calendar object. * cal-listener.h cal-listener.c: New files with the calendar listener object. * cal-factory.h cal-factory.c: New files with the calendar factory object. svn path=/trunk/; revision=1555