aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/cal-backend.c27
-rw-r--r--calendar/pcs/cal-backend.h2
-rw-r--r--calendar/pcs/cal-factory.c4
-rw-r--r--calendar/pcs/cal.c30
4 files changed, 61 insertions, 2 deletions
diff --git a/calendar/pcs/cal-backend.c b/calendar/pcs/cal-backend.c
index 983edbb3cc..91ffd8dc1d 100644
--- a/calendar/pcs/cal-backend.c
+++ b/calendar/pcs/cal-backend.c
@@ -385,3 +385,30 @@ cal_backend_load (CalBackend *backend, GnomeVFSURI *uri)
priv->loaded = TRUE;
return CAL_BACKEND_LOAD_SUCCESS;
}
+
+/**
+ * cal_backend_get_object:
+ * @backend: A calendar backend.
+ * @uid: Unique identifier for a calendar object.
+ *
+ * Queries a calendar backend for a calendar object based on its unique
+ * identifier.
+ *
+ * Return value: The string representation of the sought object, or NULL if no
+ * object had the specified UID.
+ **/
+char *
+cal_backend_get_object (CalBackend *backend, const char *uid)
+{
+ CalBackendPrivate *priv;
+
+ g_return_val_if_fail (backend != NULL, NULL);
+ g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL);
+
+ priv = backend->priv;
+ g_return_val_if_fail (priv->loaded, NULL);
+
+ g_return_val_if_fail (uid != NULL, NULL);
+
+ /* FIXME */
+}
diff --git a/calendar/pcs/cal-backend.h b/calendar/pcs/cal-backend.h
index 31f726a68f..e972cbd59e 100644
--- a/calendar/pcs/cal-backend.h
+++ b/calendar/pcs/cal-backend.h
@@ -66,6 +66,8 @@ void cal_backend_remove_cal (CalBackend *backend, Cal *cal);
CalBackendLoadStatus cal_backend_load (CalBackend *backend, GnomeVFSURI *uri);
+char *cal_backend_get_object (CalBackend *backend, const char *uid);
+
END_GNOME_DECLS
diff --git a/calendar/pcs/cal-factory.c b/calendar/pcs/cal-factory.c
index f544964612..d5b79ef423 100644
--- a/calendar/pcs/cal-factory.c
+++ b/calendar/pcs/cal-factory.c
@@ -156,7 +156,7 @@ cal_factory_destroy (GtkObject *object)
/* CalFactory::load method */
static void
CalFactory_load (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
Evolution_Calendar_Listener listener,
CORBA_Environment *ev)
{
@@ -187,7 +187,7 @@ CalFactory_load (PortableServer_Servant servant,
/* CalFactory::create method */
static void
CalFactory_create (PortableServer_Servant servant,
- CORBA_char *uri,
+ const CORBA_char *uri,
Evolution_Calendar_Listener listener,
CORBA_Environment *ev)
{
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index eac02bb6d4..1403c2c028 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -167,6 +167,35 @@ Cal_get_uri (PortableServer_Servant servant,
}
+/* Cal::get_object method */
+static Evolution_Calendar_CalObj
+Cal_get_object (PortableServer_Servant servant,
+ const Evolution_Calendar_CalObjUID uid,
+ CORBA_Environment *ev)
+{
+ Cal *cal;
+ CalPrivate *priv;
+ char *calobj;
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ calobj = cal_backend_get_object (priv->backend, uid);
+
+ if (uid) {
+ CORBA_char *calobj_copy;
+
+ calobj_copy = CORBA_string_dup (calobj);
+ g_free (calobj);
+ return calobj_copy;
+ } else {
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_Evolution_Calendar_Cal_NotFound,
+ NULL);
+ return NULL;
+ }
+}
+
/**
* cal_get_epv:
* @void:
@@ -182,6 +211,7 @@ cal_get_epv (void)
epv = g_new0 (POA_Evolution_Calendar_Cal__epv, 1);
epv->_get_uri = Cal_get_uri;
+ epv->get_object = Cal_get_object;
return epv;
}