1 /* gtd-task.h
2  *
3  * Copyright (C) 2015-2020 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef GTD_TASK_H
20 #define GTD_TASK_H
21 
22 #include "gtd-object.h"
23 
24 #include <glib-object.h>
25 
26 G_BEGIN_DECLS
27 
28 #define GTD_TYPE_TASK (gtd_task_get_type())
29 
30 G_DECLARE_DERIVABLE_TYPE (GtdTask, gtd_task, GTD, TASK, GtdObject)
31 
32 struct _GtdTaskClass
33 {
34   GtdObjectClass parent;
35 
36   gboolean      (*get_complete)                       (GtdTask              *self);
37   void          (*set_complete)                       (GtdTask              *self,
38                                                        gboolean              complete);
39 
40   GDateTime*    (*get_creation_date)                  (GtdTask              *self);
41   void          (*set_creation_date)                  (GtdTask              *self,
42                                                        GDateTime            *dt);
43 
44   GDateTime*    (*get_completion_date)                (GtdTask              *self);
45   void          (*set_completion_date)                (GtdTask              *self,
46                                                        GDateTime            *dt);
47 
48   const gchar*  (*get_description)                    (GtdTask              *self);
49   void          (*set_description)                    (GtdTask              *self,
50                                                        const gchar          *description);
51 
52   GDateTime*    (*get_due_date)                       (GtdTask              *self);
53   void          (*set_due_date)                       (GtdTask              *self,
54                                                        GDateTime            *due_date);
55 
56   gboolean      (*get_important)                      (GtdTask              *self);
57   void          (*set_important)                      (GtdTask              *self,
58                                                        gboolean              important);
59 
60   gint64        (*get_position)                       (GtdTask              *task);
61   void          (*set_position)                       (GtdTask              *task,
62                                                        gint64                position);
63 
64   const gchar*  (*get_title)                          (GtdTask              *self);
65   void          (*set_title)                          (GtdTask              *self,
66                                                        const gchar          *title);
67 
68   gpointer       padding[8];
69 };
70 
71 GtdTask*            gtd_task_new                      (void);
72 
73 gboolean            gtd_task_get_complete             (GtdTask              *task);
74 
75 void                gtd_task_set_complete             (GtdTask              *task,
76                                                        gboolean              complete);
77 
78 GDateTime*          gtd_task_get_creation_date        (GtdTask              *task);
79 
80 void                gtd_task_set_creation_date        (GtdTask              *task,
81                                                        GDateTime            *dt);
82 
83 GDateTime*          gtd_task_get_completion_date      (GtdTask              *task);
84 
85 const gchar*        gtd_task_get_description          (GtdTask              *task);
86 
87 void                gtd_task_set_description          (GtdTask              *task,
88                                                        const gchar          *description);
89 
90 GDateTime*          gtd_task_get_due_date             (GtdTask              *task);
91 
92 void                gtd_task_set_due_date             (GtdTask              *task,
93                                                        GDateTime            *dt);
94 
95 gboolean            gtd_task_get_important            (GtdTask              *self);
96 
97 void                gtd_task_set_important            (GtdTask              *self,
98                                                        gboolean              important);
99 
100 GtdTaskList*        gtd_task_get_list                 (GtdTask              *task);
101 
102 void                gtd_task_set_list                 (GtdTask              *task,
103                                                        GtdTaskList          *list);
104 
105 gint64              gtd_task_get_position             (GtdTask              *self);
106 
107 void                gtd_task_set_position             (GtdTask              *self,
108                                                        gint64                position);
109 
110 const gchar*        gtd_task_get_title                (GtdTask              *task);
111 
112 void                gtd_task_set_title                (GtdTask              *task,
113                                                        const gchar          *title);
114 
115 gint                gtd_task_compare                  (GtdTask              *t1,
116                                                        GtdTask              *t2);
117 
118 GtdProvider*        gtd_task_get_provider             (GtdTask              *self);
119 
120 G_END_DECLS
121 
122 #endif /* GTD_TASK_H */
123