Add a basic task cache
[milk] / src / milk-cache.h
diff --git a/src/milk-cache.h b/src/milk-cache.h
new file mode 100644 (file)
index 0000000..d774fe0
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
+ *
+ * Authors: Travis Reitter <treitter@gmail.com>
+ */
+
+#ifndef _MILK_CACHE_H
+#define _MILK_CACHE_H
+
+G_BEGIN_DECLS
+
+#define MILK_TYPE_CACHE milk_cache_get_type()
+
+#define MILK_CACHE(obj) \
+                (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                MILK_TYPE_CACHE, MilkCache))
+
+#define MILK_CACHE_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                MILK_TYPE_CACHE, MilkCacheClass))
+
+#define MILK_IS_CACHE(obj) \
+                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                MILK_TYPE_CACHE))
+
+#define MILK_IS_CACHE_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                MILK_TYPE_CACHE))
+
+#define MILK_CACHE_GET_CLASS(obj) \
+                (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                MILK_TYPE_CACHE, MilkCacheClass))
+
+typedef struct _MilkCache MilkCache;
+typedef struct _MilkCacheClass MilkCacheClass;
+typedef struct _MilkCachePrivate MilkCachePrivate;
+
+struct _MilkCache
+{
+        GObject parent;
+        MilkCachePrivate *priv;
+};
+
+struct _MilkCacheClass
+{
+        GObjectClass parent_class;
+};
+
+GType milk_cache_get_type (void);
+
+
+MilkCache*      milk_cache_get_default (void);
+
+void            milk_cache_authenticate (MilkCache *cache);
+
+GList*          milk_cache_get_active_tasks (MilkCache *cache);
+
+char*           milk_cache_timeline_create (MilkCache  *cache,
+                                            GError    **error);
+
+RtmTask*        milk_cache_task_add (MilkCache   *cache,
+                                     char        *timeline,
+                                     const char  *name,
+                                     GError     **error);
+
+char*           milk_cache_task_complete (MilkCache  *cache,
+                                          char       *timeline,
+                                          RtmTask    *task,
+                                          GError    **error);
+
+char*           milk_cache_task_delete (MilkCache  *cache,
+                                        char       *timeline,
+                                        RtmTask    *task,
+                                        GError    **error);
+
+#endif /* _MILK_CACHE_H */