diff options
author | JP Rosevear <jpr@ximian.com> | 2001-09-26 14:40:50 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-09-26 14:40:50 +0800 |
commit | 943c0e6e2393607a1adf380db102cc2bad61ff52 (patch) | |
tree | c8bcf65617509c8c40e74fcbd82ff956c9584026 /calendar/pcs/cal-backend.c | |
parent | 225b147233ea335927385c2f867218b6abfb3994 (diff) | |
download | gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.gz gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.zst gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.zip |
new proto
2001-09-26 JP Rosevear <jpr@ximian.com>
* pcs/cal.h: new proto
* pcs/cal.c (impl_Cal_set_mode): implement set mode method
(cal_class_init): set setMode function in epv
(cal_notify_mode): notify listener of mode change
* pcs/cal-factory.c (add_uri): deal with UriType renaming
* pcs/cal-backend.h: add new virtual methods and protos
* pcs/cal-backend.c (cal_backend_class_init): init new virtual
methods to null
(cal_backend_set_mode): sets mode
(cal_backend_get_mode): gets mode
* pcs/cal-backend-file.c (cal_backend_file_class_init): overide
get_mode and set_mode methods
(cal_backend_file_get_mode): return mode
(notify_mode): have listeners notified of the set mode call
(cal_backend_file_set_mode): set the mode by indicating not
supported
* cal-client/cal-listener.h: update proto
* cal-client/cal-listener.c (impl_notifyCalSetMode): implement set
mode callback
(cal_listener_construct): take set mode callback
(cal_listener_new): ditto
* cal-client/cal-client.h: update protos, add signal proto
* cal-client/cal-client.c (cal_client_class_init): add
cal_set_mode signal
(cal_set_mode_cb): handle set mode callback from listener
(cal_client_open_calendar): pass additional param to cal_listener_new
(cal_client_set_mode): wrapper to set the calendar mode
* idl/evolution-calendar.idl: make UriType into CalMode, add
SetModeStatus enum and notifyCalSetMode method to the listener
* gui/calendar-offline-handler.c (create_connection_list): fetch
the uri list ourselves
(impl_prepareForOffline): reflect param change of
create_connect_list
(update_offline): ditto
(backend_cal_set_mode): set mode call back
(backend_cal_opened): cal opened call back, set mode to local
(impl_goOffline): reflect UriType renaming
* cal-util/cal-util.h: rename UriType to CalMode
svn path=/trunk/; revision=13142
Diffstat (limited to 'calendar/pcs/cal-backend.c')
-rw-r--r-- | calendar/pcs/cal-backend.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c index 296af0e8a3..ae2bd328eb 100644 --- a/calendar/pcs/cal-backend.c +++ b/calendar/pcs/cal-backend.c @@ -144,7 +144,8 @@ cal_backend_class_init (CalBackendClass *class) class->get_uri = NULL; class->open = NULL; class->is_loaded = NULL; - class->is_remote = NULL; + class->get_mode = NULL; + class->set_mode = NULL; class->get_n_objects = NULL; class->get_object = NULL; class->get_object_component = NULL; @@ -297,28 +298,46 @@ cal_backend_is_loaded (CalBackend *backend) } /** - * cal_backend_is_remote: + * cal_backend_get_mode: * @backend: A calendar backend. * * Queries whether a calendar backend is connected remotely. * - * Return value: TRUE if the backend is connected remotely, FALSE - * otherwise. + * Return value: The current mode the calendar is in **/ -gboolean -cal_backend_is_remote (CalBackend *backend) +CalMode +cal_backend_get_mode (CalBackend *backend) { - gboolean result; + CalMode result; g_return_val_if_fail (backend != NULL, FALSE); g_return_val_if_fail (IS_CAL_BACKEND (backend), FALSE); - g_assert (CLASS (backend)->is_remote != NULL); - result = (* CLASS (backend)->is_remote) (backend); + g_assert (CLASS (backend)->get_mode != NULL); + result = (* CLASS (backend)->get_mode) (backend); return result; } + +/** + * cal_backend_set_mode: + * @backend: A calendar backend + * @mode: Mode to change to + * + * Sets the mode of the calendar + * + **/ +void +cal_backend_set_mode (CalBackend *backend, CalMode mode) +{ + g_return_if_fail (backend != NULL); + g_return_if_fail (IS_CAL_BACKEND (backend)); + + g_assert (CLASS (backend)->set_mode != NULL); + (* CLASS (backend)->set_mode) (backend, mode); +} + /** * cal_backend_get_n_objects: * @backend: A calendar backend. |