[libgdata/657539-tasks-tests: 6/19] tasks: Add helper constants for GDataTasksTask:status



commit 4b96f5b68c0bc70bf7b0d76fc3c36ff9f9dbe5fd
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 31 00:04:28 2014 +0100

    tasks: Add helper constants for GDataTasksTask:status
    
    So the user doesn’t need to keep typing out the well-known strings which
    form the accepted values of GDataTasksTask:status.
    
    This adds new API:
     • GDATA_TASKS_STATUS_NEEDS_ACTION
     • GDATA_TASKS_STATUS_COMPLETED

 docs/reference/gdata-sections.txt       |    2 ++
 gdata/services/tasks/gdata-tasks-task.c |    5 +++--
 gdata/services/tasks/gdata-tasks-task.h |   27 +++++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt
index fdcac2f..7f935c8 100644
--- a/docs/reference/gdata-sections.txt
+++ b/docs/reference/gdata-sections.txt
@@ -2523,6 +2523,8 @@ GDataTasksQueryPrivate
 <SECTION>
 <FILE>gdata-tasks-task</FILE>
 <TITLE>GDataTasksTask</TITLE>
+GDATA_TASKS_STATUS_NEEDS_ACTION
+GDATA_TASKS_STATUS_COMPLETED
 GDataTasksTask
 GDataTasksTaskClass
 gdata_tasks_task_new
diff --git a/gdata/services/tasks/gdata-tasks-task.c b/gdata/services/tasks/gdata-tasks-task.c
index 6f00fcf..202a9a2 100644
--- a/gdata/services/tasks/gdata-tasks-task.c
+++ b/gdata/services/tasks/gdata-tasks-task.c
@@ -135,13 +135,14 @@ gdata_tasks_task_class_init (GDataTasksTaskClass *klass)
        /**
         * GDataTasksTask:status:
         *
-        * Status of the task. This is either "needsAction" or "completed".
+        * Status of the task. This is either %GDATA_TASKS_STATUS_NEEDS_ACTION
+        * or %GDATA_TASKS_STATUS_COMPLETED.
         *
         * Since: 0.15.0
         */
        g_object_class_install_property (gobject_class, PROP_STATUS,
                                         g_param_spec_string ("status",
-                                        "Status of task", "Status of the task. This is either 
\"needsAction\" or \"completed\".",
+                                        "Status of task", "Status of the task.",
                                         NULL,
                                         G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
diff --git a/gdata/services/tasks/gdata-tasks-task.h b/gdata/services/tasks/gdata-tasks-task.h
index e1f7d71..b887a1a 100644
--- a/gdata/services/tasks/gdata-tasks-task.h
+++ b/gdata/services/tasks/gdata-tasks-task.h
@@ -28,6 +28,33 @@
 
 G_BEGIN_DECLS
 
+/**
+ * GDATA_TASKS_STATUS_NEEDS_ACTION:
+ *
+ * A value for #GDataTasksTask:status indicating the task still needs action
+ * before it is complete.
+ *
+ * Reference:
+ * <ulink type="http" url="https://developers.google.com/google-apps/tasks/v1/reference/tasks#status";>
+ * Google Tasks documentation</ulink>.
+ *
+ * Since: UNRELEASED
+ */
+#define GDATA_TASKS_STATUS_NEEDS_ACTION "needsAction"
+
+/**
+ * GDATA_TASKS_STATUS_COMPLETED:
+ *
+ * A value for #GDataTasksTask:status indicating the task has been completed.
+ *
+ * Reference:
+ * <ulink type="http" url="https://developers.google.com/google-apps/tasks/v1/reference/tasks#status";>
+ * Google Tasks documentation</ulink>.
+ *
+ * Since: UNRELEASED
+ */
+#define GDATA_TASKS_STATUS_COMPLETED "completed"
+
 #define GDATA_TYPE_TASKS_TASK          (gdata_tasks_task_get_type ())
 #define GDATA_TASKS_TASK(o)                    (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_TASKS_TASK, 
GDataTasksTask))
 #define GDATA_TASKS_TASK_CLASS(k)              (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_TASKS_TASK, 
GDataTasksTaskClass))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]