Files
evolution/calendar/evolution-calendar.idl
Federico Mena Quintero ca082de77a Added get_uids() method to get a list of UIDs based on object types.
2000-02-08  Federico Mena Quintero  <federico@helixcode.com>

	* evolution-calendar.idl (Cal): Added get_uids() method to get a
	list of UIDs based on object types.

	* cal-backend.c (cal_backend_get_uids): Implemented get_uids() in
	the backend.

	* cal.c (Cal_get_uids): Implemented get_uids() method.

	* cal-client.c (cal_client_get_uids): Implemented client-side
	function.

	* cal-util.c (cal_obj_instance_list_free): Doh.  Free the list,
	not the last link.
	(cal_obj_uid_list_free): New function to free a list of UIDs.

	* GnomeCal.idl (Repository): Removed unused method
	get_object_by_id_list().  This is just for cleanup purposes and to
	remind me exactly of what needs to be moved over to
	evolution-calendar.idl.
	(Repository): Removed unused get_objects() method.

	* corba-cal.c (init_calendar_repo_class): Removed the unused
	get_objects method.

	* calobj.h (CalObjFindStatus): New status value enumeration for
	the find function.

	* calobj.c (ical_object_find_in_string): New function to parse a
	complete calendar and find a calendar object in it.  This should
	be used instead ical_object_new_from_string() in the future.

	* evolution-calendar.idl (CalObjInstance): Added an uid field.
	Now the idea is that whenever calendar object strings are passed
	around, their UIDs are passed along with them so that the actual
	object can be pulled from the whole VCAL object using its UID to
	identify it.

	* cal-util.h (CalObjInstance): Added uid field.

	* cal-util.c (cal_obj_instance_list_free): Free the UIDs.

	* cal-backend.c (build_event_list): Store the object's UID in the
	instance structure.

	* cal.c (Cal_get_events_in_range): Copy the UID field to the CORBA
	structure.

	* cal-client.c (cal_client_get_events_in_range): Copy the UID
	field from the CORBA structure.

	* main.c (gnome_cal_file_menu): Removed unfinished html-month stuff.

	* Makefile.am (gnomecal_SOURCES): Removed html-month.c.

	* gnome-cal.c: #include "alarm.h"
	(mail_notify): Made static.

	* alarm.h: #include "calobj.h"

	* corba-cal-factory.h (init_corba_server): Fixed prototype.

	* quick-view.c (create_items_for_event): Made static.

	* gncal-todo.c (column_resized): Made static.

	* layout.c (find_index): Made static.

svn path=/trunk/; revision=1699
2000-02-09 08:04:33 +00:00

117 lines
3.0 KiB
Plaintext

/* Evolution calendar interface
*
* Copyright (C) 2000 Eskil Heyn Olsen
* Copyright (C) 2000 Helix Code, Inc.
*
* Authors: Eskil Heyn Olsen <deity@eskil.dk>
* Federico Mena-Quintero <federico@helixcode.com>
*/
#ifndef _EVOLUTION_CALENDAR_IDL_
#define _EVOLUTION_CALENDAR_IDL_
#include <Bonobo.idl>
module Evolution {
module Calendar {
/* A calendar object (event/todo/journal/etc), represented as an
* iCalendar string.
*/
typedef string CalObj;
/* An unique identifier for a calendar object */
typedef string CalObjUID;
/* Sequence of unique identifiers */
typedef sequence<CalObjUID> CalObjUIDSeq;
/* Flags for getting UID sequences */
typedef long CalObjType;
const CalObjType TYPE_EVENT = 1 << 0;
const CalObjType TYPE_TODO = 1 << 1;
const CalObjType TYPE_JOURNAL = 1 << 2;
const CalObjType TYPE_OTHER = 1 << 3;
const CalObjType TYPE_ANY = 0x0f;
/* Used to store a time_t */
typedef unsigned long Time_t;
/* An instance of a calendar object that actually occurs. These are
* "virtual" objects in that they are used to represent instances of
* recurring events and alarms. "Real" objects just contain the
* information required to figure out the times at which they recur or
* trigger.
*/
struct CalObjInstance {
CalObjUID uid;
CalObj calobj;
Time_t start;
Time_t end;
};
typedef sequence<CalObjInstance> CalObjInstanceSeq;
interface Listener;
/* Calendar client interface */
interface Cal : Bonobo::Unknown {
exception NotFound {};
exception InvalidRange {};
/* A calendar is identified by its URI */
readonly attribute string uri;
/* Gets an object based on its URI */
CalObj get_object (in CalObjUID uid)
raises (NotFound);
/* Gets a list of UIDs based on object type */
CalObjUIDSeq get_uids (in CalObjType type);
/* Gets the events that occur or recur in the specified time range */
CalObjInstanceSeq get_events_in_range (in Time_t start, in Time_t end)
raises (InvalidRange);
};
/* Listener for changes in a calendar */
interface Listener : Bonobo::Unknown {
/* Return status when loading a calendar; we need better error reporting */
enum LoadStatus {
SUCCESS,
ERROR
};
/* Called from a CalFactory when a calendar is initially loaded
* or created. The listener must remember the cal object.
*/
void cal_loaded (in LoadStatus status, in Cal cal);
/* Called from a Calendar when an object is added */
void obj_added (in CalObjUID uid);
/* Called from a Calendar when an object is removed */
void obj_removed (in CalObjUID uid);
/* Called from a Calendar when an object is changed */
void obj_changed (in CalObjUID uid);
};
/* A calendar factory, can load and create calendars */
interface CalFactory : Bonobo::Unknown {
exception NilListener {};
/* Load a calendar from an URI */
void load (in string uri, in Listener listener)
raises (NilListener);
/* Create a new calendar at the specified URI */
void create (in string uri, in Listener listener)
raises (NilListener);
};
};
};
#endif