aboutsummaryrefslogtreecommitdiff
path: root/src/planner.h
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-06 14:34:32 +0000
committerTarmac <Unknown>2013-09-06 14:34:32 +0000
commitddebe3c47040869cb8fe94729c43f10f2b763550 (patch)
tree178833e4a78443e278275c8ff3bbe2ae424cbcca /src/planner.h
parentc312fcce200445ec1e6d9b69f35c6a6cb9e80313 (diff)
parentf35c8eb35f88ef43e71395445067d30cd3a48c72 (diff)
downloadayatana-indicator-datetime-ddebe3c47040869cb8fe94729c43f10f2b763550.tar.gz
ayatana-indicator-datetime-ddebe3c47040869cb8fe94729c43f10f2b763550.tar.bz2
ayatana-indicator-datetime-ddebe3c47040869cb8fe94729c43f10f2b763550.zip
Make the EDS planner nonblocking. Fixes: https://bugs.launchpad.net/bugs/1204532.
Approved by Ted Gould, PS Jenkins bot.
Diffstat (limited to 'src/planner.h')
-rw-r--r--src/planner.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/src/planner.h b/src/planner.h
index f6148c6..206bfe5 100644
--- a/src/planner.h
+++ b/src/planner.h
@@ -22,6 +22,7 @@
#include <glib.h>
#include <glib-object.h> /* parent class */
+#include <gio/gio.h>
G_BEGIN_DECLS
@@ -70,7 +71,16 @@ struct _IndicatorDatetimePlannerClass
/* virtual functions */
- GSList* (*get_appointments) (IndicatorDatetimePlanner * self, GDateTime * begin, GDateTime * end);
+ void (*get_appointments) (IndicatorDatetimePlanner * self,
+ GDateTime * begin,
+ GDateTime * end,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+ GSList* (*get_appointments_finish) (IndicatorDatetimePlanner * self,
+ GAsyncResult * res,
+ GError ** error);
+
gboolean (*is_configured) (IndicatorDatetimePlanner * self);
void (*activate) (IndicatorDatetimePlanner * self);
@@ -85,17 +95,33 @@ void indicator_datetime_appt_free (struct IndicatorDatetimeAppt * appt);
/**
* Get a list of appointments, sorted by start time.
+ */
+void indicator_datetime_planner_get_appointments (IndicatorDatetimePlanner * self,
+ GDateTime * begin,
+ GDateTime * end,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+/**
+ * Finishes the async call begun with indicator_datetime_planner_get_appointments()
*
- * An easy way to free the list properly in one step is as follows:
- *
- * g_slist_free_full (list, (GDestroyNotify)indicator_datetime_appt_free);
- *
+ * To free the list properly, use indicator_datetime_planner_free_appointments()
*
* Return value: (element-type IndicatorDatetimeAppt)
* (transfer full):
* list of appointments
*/
-GSList * indicator_datetime_planner_get_appointments (IndicatorDatetimePlanner * self, GDateTime * begin, GDateTime * end);
+GSList * indicator_datetime_planner_get_appointments_finish (IndicatorDatetimePlanner * self,
+ GAsyncResult * res,
+ GError ** error);
+
+/**
+ * Convenience function for freeing a GSList of IndicatorDatetimeAppt.
+ *
+ * Equivalent to g_slist_free_full (list, (GDestroyNotify)indicator_datetime_appt_free);
+ */
+void indicator_datetime_planner_free_appointments (GSList *);
+
/**
* Returns false if the planner's backend is not configured.