aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-09-26 14:40:50 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-09-26 14:40:50 +0800
commit943c0e6e2393607a1adf380db102cc2bad61ff52 (patch)
treec8bcf65617509c8c40e74fcbd82ff956c9584026 /calendar/pcs/cal.c
parent225b147233ea335927385c2f867218b6abfb3994 (diff)
downloadgsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar
gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.gz
gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.bz2
gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.lz
gsoc2013-evolution-943c0e6e2393607a1adf380db102cc2bad61ff52.tar.xz
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.c')
-rw-r--r--calendar/pcs/cal.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index 481019bcb8..7a21aed95e 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -78,6 +78,20 @@ uncorba_obj_type (GNOME_Evolution_Calendar_CalObjType type)
| ((type & GNOME_Evolution_Calendar_TYPE_JOURNAL) ? CALOBJ_TYPE_JOURNAL : 0));
}
+static void
+impl_Cal_set_mode (PortableServer_Servant servant,
+ GNOME_Evolution_Calendar_CalMode mode,
+ CORBA_Environment *ev)
+{
+ Cal *cal;
+ CalPrivate *priv;
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ cal_backend_set_mode (priv->backend, mode);
+}
+
/* Cal::get_n_objects method */
static CORBA_long
impl_Cal_get_n_objects (PortableServer_Servant servant,
@@ -590,6 +604,7 @@ cal_class_init (CalClass *klass)
/* Epv methods */
epv->_get_uri = impl_Cal_get_uri;
+ epv->setMode = impl_Cal_set_mode;
epv->countObjects = impl_Cal_get_n_objects;
epv->getObject = impl_Cal_get_object;
epv->getTimezoneObject = impl_Cal_get_timezone_object;
@@ -620,6 +635,38 @@ cal_init (Cal *cal)
BONOBO_X_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal);
/**
+ * cal_notify_mode:
+ * @cal: A calendar client interface.
+ * @status: Status of the mode set.
+ * @mode: The current mode.
+ *
+ * Notifys the listener of the results of a setMode call.
+ **/
+void
+cal_notify_mode (Cal *cal,
+ GNOME_Evolution_Calendar_Listener_SetModeStatus status,
+ GNOME_Evolution_Calendar_CalMode mode)
+{
+ CalPrivate *priv;
+ CORBA_Environment ev;
+
+ g_return_if_fail (cal != NULL);
+ g_return_if_fail (IS_CAL (cal));
+
+ priv = cal->priv;
+ g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
+
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_Calendar_Listener_notifyCalSetMode (priv->listener, status, mode, &ev);
+
+ if (BONOBO_EX (&ev))
+ g_message ("cal_notify_mode(): could not notify the listener "
+ "about a mode change");
+
+ CORBA_exception_free (&ev);
+}
+
+/**
* cal_notify_update:
* @cal: A calendar client interface.
* @uid: UID of object that was updated.