Add a basic task cache
[milk] / src / milk-cache.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License as
4  * published by the Free Software Foundation; either version 2 of the
5  * License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10  * General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public
13  * License along with this program; if not, write to the
14  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
15  * Boston, MA  02110-1301  USA
16  *
17  * Authors: Travis Reitter <treitter@gmail.com>
18  */
19
20 #ifndef _MILK_CACHE_H
21 #define _MILK_CACHE_H
22
23 G_BEGIN_DECLS
24
25 #define MILK_TYPE_CACHE milk_cache_get_type()
26
27 #define MILK_CACHE(obj) \
28                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
29                 MILK_TYPE_CACHE, MilkCache))
30
31 #define MILK_CACHE_CLASS(klass) \
32                 (G_TYPE_CHECK_CLASS_CAST ((klass), \
33                 MILK_TYPE_CACHE, MilkCacheClass))
34
35 #define MILK_IS_CACHE(obj) \
36                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
37                 MILK_TYPE_CACHE))
38
39 #define MILK_IS_CACHE_CLASS(klass) \
40                 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
41                 MILK_TYPE_CACHE))
42
43 #define MILK_CACHE_GET_CLASS(obj) \
44                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
45                 MILK_TYPE_CACHE, MilkCacheClass))
46
47 typedef struct _MilkCache MilkCache;
48 typedef struct _MilkCacheClass MilkCacheClass;
49 typedef struct _MilkCachePrivate MilkCachePrivate;
50
51 struct _MilkCache
52 {
53         GObject parent;
54         MilkCachePrivate *priv;
55 };
56
57 struct _MilkCacheClass
58 {
59         GObjectClass parent_class;
60 };
61
62 GType milk_cache_get_type (void);
63
64
65 MilkCache*      milk_cache_get_default (void);
66
67 void            milk_cache_authenticate (MilkCache *cache);
68
69 GList*          milk_cache_get_active_tasks (MilkCache *cache);
70
71 char*           milk_cache_timeline_create (MilkCache  *cache,
72                                             GError    **error);
73
74 RtmTask*        milk_cache_task_add (MilkCache   *cache,
75                                      char        *timeline,
76                                      const char  *name,
77                                      GError     **error);
78
79 char*           milk_cache_task_complete (MilkCache  *cache,
80                                           char       *timeline,
81                                           RtmTask    *task,
82                                           GError    **error);
83
84 char*           milk_cache_task_delete (MilkCache  *cache,
85                                         char       *timeline,
86                                         RtmTask    *task,
87                                         GError    **error);
88
89 #endif /* _MILK_CACHE_H */