aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-06-20 23:21:48 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-06-20 23:21:48 +0800
commitd9e3885428ec973fc18995b83daf6a1ad82103f0 (patch)
tree8401c9b4bce95c2ab4611e23bd20388cf2cf0875 /calendar/pcs/cal.c
parentd4f63382f5717da28b2f5371662d4c508cccdfac (diff)
downloadgsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar.gz
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar.bz2
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar.lz
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar.xz
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.tar.zst
gsoc2013-evolution-d9e3885428ec973fc18995b83daf6a1ad82103f0.zip
added getFreeBusy method
2001-06-20 Rodrigo Moya <rodrigo@ximian.com> * idl/evolution-calendar.idl: added getFreeBusy method * pcs/cal.c (impl_Cal_get_free_busy): implementation of the new getFreeBusy added method * pcs/cal-backend.[ch]: added new virtual method to the CalBackend class (get_free_busy) * pcs/cal-backend-db.c (cal_backend_db_get_free_busy): new function, not implemented yet * pcs/cal-backend-file.c (cal_backend_file_get_free_busy): new funtion, not implemented yet svn path=/trunk/; revision=10333
Diffstat (limited to 'calendar/pcs/cal.c')
-rw-r--r--calendar/pcs/cal.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index 42ccbf3cee..3bcc0c1f6b 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -227,6 +227,40 @@ impl_Cal_get_objects_in_range (PortableServer_Servant servant,
return seq;
}
+/* Cal::get_free_busy method */
+static GNOME_Evolution_Calendar_CalObjUIDSeq *
+impl_Cal_get_free_busy (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_Time_t start,
+ GNOME_Evolution_Calendar_Time_t end,
+ CORBA_Environment *ev)
+{
+ Cal *cal;
+ CalPrivate *priv;
+ time_t t_start, t_end;
+ GNOME_Evolution_Calendar_CalObjUIDSeq *seq;
+ GList *uids;
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ t_start = (time_t) start;
+ t_end = (time_t) end;
+
+ if (t_start > t_end || t_start == -1 || t_end == -1) {
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_GNOME_Evolution_Calendar_Cal_InvalidRange,
+ NULL);
+ return NULL;
+ }
+
+ uids = cal_backend_get_free_busy (priv->backend, t_start, t_end);
+ seq = build_uid_seq (uids);
+
+ cal_obj_uid_list_free (uids);
+
+ return seq;
+}
+
/* Cal::get_alarms_in_range method */
static GNOME_Evolution_Calendar_CalComponentAlarmsSeq *
impl_Cal_get_alarms_in_range (PortableServer_Servant servant,
@@ -503,6 +537,7 @@ cal_class_init (CalClass *klass)
epv->getUIDs = impl_Cal_get_uids;
epv->getChanges = impl_Cal_get_changes;
epv->getObjectsInRange = impl_Cal_get_objects_in_range;
+ epv->getFreeBusy = impl_Cal_get_free_busy;
epv->getAlarmsInRange = impl_Cal_get_alarms_in_range;
epv->getAlarmsForObject = impl_Cal_get_alarms_for_object;
epv->updateObject = impl_Cal_update_object;