From 03b108ff71143f55f6dc913286a71cd821fd1c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Tue, 20 Jan 2015 01:09:57 -0500 Subject: [PATCH] GcalView: add get_children by uuid method After adding it and removing it, and adding it again. I think this time is for good. We're keeping GcalView interface as parent of every view shown in the application. --- src/gcal-view.c | 19 +++++++++++++++++++ src/gcal-view.h | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/src/gcal-view.c b/src/gcal-view.c index 989da237..c0202ea7 100644 --- a/src/gcal-view.c +++ b/src/gcal-view.c @@ -193,3 +193,22 @@ gcal_view_get_right_header (GcalView *view) return GCAL_VIEW_GET_INTERFACE (view)->get_right_header (view); } + +/** + * gcal_view_get_children_by_uuid: + * @view: a #GcalView + * @uuid: The unique id of an event + * + * Returns a list with every event that has the passed uuid + * + * Returns: (transfer full): a {@link GList} instance + **/ +GList* +gcal_view_get_children_by_uuid (GcalView *view, + const gchar *uuid) +{ + g_return_val_if_fail (GCAL_IS_VIEW (view), NULL); + g_return_val_if_fail (GCAL_VIEW_GET_INTERFACE (view)->get_children_by_uuid, NULL); + + return GCAL_VIEW_GET_INTERFACE (view)->get_children_by_uuid (view, uuid); +} diff --git a/src/gcal-view.h b/src/gcal-view.h index 0922db8f..e28a8ad1 100644 --- a/src/gcal-view.h +++ b/src/gcal-view.h @@ -58,6 +58,8 @@ struct _GcalViewIface /* Update NavBar headings */ gchar* (*get_left_header) (GcalView *view); gchar* (*get_right_header) (GcalView *view); + + GList* (*get_children_by_uuid) (GcalView *view, const gchar *uuid); }; GType gcal_view_get_type (void); @@ -78,6 +80,9 @@ gchar* gcal_view_get_left_header (GcalView *view); gchar* gcal_view_get_right_header (GcalView *view); +GList* gcal_view_get_children_by_uuid (GcalView *view, + const gchar *uuid); + G_END_DECLS #endif /* __GCAL_MONTH_VIEW_H__ */