Merge local development branch
[milk] / src / milk-auth.h
diff --git a/src/milk-auth.h b/src/milk-auth.h
new file mode 100644 (file)
index 0000000..28faf3e
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * 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_AUTH_H
+#define _MILK_AUTH_H
+
+G_BEGIN_DECLS
+
+#define MILK_TYPE_AUTH milk_auth_get_type()
+
+#define MILK_AUTH(obj) \
+                (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+                MILK_TYPE_AUTH, MilkAuth))
+
+#define MILK_AUTH_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_CAST ((klass), \
+                MILK_TYPE_AUTH, MilkAuthClass))
+
+#define MILK_IS_AUTH(obj) \
+                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+                MILK_TYPE_AUTH))
+
+#define MILK_IS_AUTH_CLASS(klass) \
+                (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+                MILK_TYPE_AUTH))
+
+#define MILK_AUTH_GET_CLASS(obj) \
+                (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+                MILK_TYPE_AUTH, MilkAuthClass))
+
+typedef struct _MilkAuth MilkAuth;
+typedef struct _MilkAuthClass MilkAuthClass;
+typedef struct _MilkAuthPrivate MilkAuthPrivate;
+
+struct _MilkAuth
+{
+        GObject parent;
+        MilkAuthPrivate *priv;
+};
+
+struct _MilkAuthClass
+{
+        GObjectClass parent_class;
+};
+
+typedef enum {
+        MILK_AUTH_STATE_DISCONNECTED,
+        MILK_AUTH_STATE_CONNECTED,
+        MILK_AUTH_STATE_SERVICE_UNAVAILABLE,
+        NUM_MILK_AUTH_STATES,
+} MilkAuthState;
+
+GType milk_auth_get_type (void);
+
+
+MilkAuth*     milk_auth_get_default     (void);
+void          milk_auth_log_in          (MilkAuth    *auth);
+MilkAuthState milk_auth_get_state       (MilkAuth    *auth);
+GList*        milk_auth_get_tasks       (MilkAuth    *auth,
+                                         const char  *last_sync,
+                                         GError     **error);
+char*         milk_auth_timeline_create (MilkAuth    *auth,
+                                         GError     **error);
+RtmTask*      milk_auth_task_add        (MilkAuth    *auth,
+                                         char        *timeline,
+                                         const char  *name,
+                                         GError     **error);
+char*         milk_auth_task_complete   (MilkAuth    *auth,
+                                         char        *timeline,
+                                         RtmTask     *task,
+                                         GError     **error);
+char*         milk_auth_task_delete     (MilkAuth    *auth,
+                                         char        *timeline,
+                                         RtmTask     *task,
+                                         GError     **error);
+
+#endif /* _MILK_AUTH_H */