diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-04-27 00:44:49 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-04-27 00:44:49 +0800 |
commit | da12dd29a85fae5e4ebaffcfb9c40fa6068ec55d (patch) | |
tree | 90800ebe3c35b148eb0c1c7a537ebbc13835f7c9 /calendar/pcs/cal-backend.c | |
parent | 49802408e28d3f3938fd9c6c8c7c36a499277983 (diff) | |
download | gsoc2013-evolution-da12dd29a85fae5e4ebaffcfb9c40fa6068ec55d.tar.gz gsoc2013-evolution-da12dd29a85fae5e4ebaffcfb9c40fa6068ec55d.tar.zst gsoc2013-evolution-da12dd29a85fae5e4ebaffcfb9c40fa6068ec55d.zip |
Fixes #41661
2003-04-24 Rodrigo Moya <rodrigo@ximian.com>
Fixes #41661
* idl/evolution-calendar.idl: added discardAlarm method to
GNOME:Evolution:Calendar:Cal interface.
* pcs/cal.c (cal_class_init): set new epv's method.
(impl_Cal_discardAlarm): implementation of new CORBA method.
* pcs/cal-backend.[ch]: added 'discard_alarm' virtual method, and
CAL_BACKEND_RESULT_NOT_IMPLEMENTED to CalBackendResult enum.
(cal_backend_class_init): initialize new class method.
(cal_backend_discard_alarm): new method.
(cal_backend_update_objects, cal_backend_remove_object): return
proper CalBackendResult values.
* pcs/cal-backend-file.c (cal_backend_file_class_init): initialize
new class method.
(cal_backend_file_discard_alarm): implementation of new method.
* pcs/cal-client.[ch] (cal_client_discard_alarm): new function.
* gui/alarm-notify/alarm-queue.c (remove_qeueud_alarm): don't remove
the alarm directly from the component, call cal_client_discard_alarm
and let the backend deal with it.
svn path=/trunk/; revision=20973
Diffstat (limited to 'calendar/pcs/cal-backend.c')
-rw-r--r-- | calendar/pcs/cal-backend.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c index 22eecadecc..bf974ddc70 100644 --- a/calendar/pcs/cal-backend.c +++ b/calendar/pcs/cal-backend.c @@ -193,6 +193,7 @@ cal_backend_class_init (CalBackendClass *class) class->get_changes = NULL; class->get_alarms_in_range = NULL; class->get_alarms_for_object = NULL; + class->discard_alarm = NULL; class->update_objects = NULL; class->remove_object = NULL; class->send_object = NULL; @@ -825,6 +826,30 @@ cal_backend_get_alarms_for_object (CalBackend *backend, const char *uid, } /** + * cal_backend_discard_alarm + * @backend: A calendar backend. + * @uid: UID of the component to discard the alarm from. + * @auid: Alarm ID. + * + * Discards an alarm from the given component. This allows the specific backend + * to do whatever is needed to really discard the alarm. + * + * Return value: a #CalBackendResult value, which indicates the + * result of the operation. + **/ +CalBackendResult +cal_backend_discard_alarm (CalBackend *backend, const char *uid, const char *auid) +{ + g_return_val_if_fail (backend != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (IS_CAL_BACKEND (backend), CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (uid != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (auid != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (CLASS (backend)->discard_alarm != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + + return (* CLASS (backend)->discard_alarm) (backend, uid, auid); +} + +/** * cal_backend_update_objects: * @backend: A calendar backend. * @calobj: String representation of the new calendar object(s). @@ -839,9 +864,9 @@ cal_backend_get_alarms_for_object (CalBackend *backend, const char *uid, CalBackendResult cal_backend_update_objects (CalBackend *backend, const char *calobj, CalObjModType mod) { - g_return_val_if_fail (backend != NULL, FALSE); - g_return_val_if_fail (IS_CAL_BACKEND (backend), FALSE); - g_return_val_if_fail (calobj != NULL, FALSE); + g_return_val_if_fail (backend != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (IS_CAL_BACKEND (backend), CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (calobj != NULL, CAL_BACKEND_RESULT_NOT_FOUND); g_assert (CLASS (backend)->update_objects != NULL); return (* CLASS (backend)->update_objects) (backend, calobj, mod); @@ -861,9 +886,9 @@ cal_backend_update_objects (CalBackend *backend, const char *calobj, CalObjModTy CalBackendResult cal_backend_remove_object (CalBackend *backend, const char *uid, CalObjModType mod) { - g_return_val_if_fail (backend != NULL, FALSE); - g_return_val_if_fail (IS_CAL_BACKEND (backend), FALSE); - g_return_val_if_fail (uid != NULL, FALSE); + g_return_val_if_fail (backend != NULL, CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (IS_CAL_BACKEND (backend), CAL_BACKEND_RESULT_NOT_FOUND); + g_return_val_if_fail (uid != NULL, CAL_BACKEND_RESULT_NOT_FOUND); g_assert (CLASS (backend)->remove_object != NULL); return (* CLASS (backend)->remove_object) (backend, uid, mod); |