1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
4
* Ebby Wiselyn <ebbywiselyn@gmail.com>
5
* Jason Willis <zenbrother@gmail.com>
7
* Copyright 2007, Novell, Inc.
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of version 2 of the GNU Lesser General Public
11
* License as published by the Free Software Foundation.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU Lesser General Public License for more details.
18
* * You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
25
#ifndef _GDATA_SERVICE_H_
26
#define _GDATA_SERVICE_H_
29
#include <glib-object.h>
31
#include "gdata-feed.h"
32
#include "gdata-entry.h"
36
#define GDATA_TYPE_SERVICE (gdata_service_get_type())
37
#define GDATA_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GDATA_TYPE_SERVICE, GDataService))
38
#define GDATA_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GDATA_TYPE_SERVICE, GDataServiceClass))
39
#define GDATA_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GDATA_TYPE_SERVICE))
40
#define GDATA_IS_SERVICE_CLASS(klass)(G_TYPE_CHECK_CLASS_TYPE((klass), GDATA_TYPE_SERVICE))
41
#define GDATA_SERVICE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE((obj), GDATA_TYPE_SERVICE, GDataServiceIface))
43
typedef struct _GDataService GDataService;
44
typedef struct _GDataServiceIface GDataServiceIface;
46
struct _GDataServiceIface {
48
GTypeInterface parent;
51
void (*set_credentials)(GDataService *self, const gchar *username, const gchar *password);
52
GDataFeed * (*get_feed) (GDataService *self, const gchar *feed_getURL);
53
GDataEntry* (*insert_entry)(GDataService *self, const gchar *feed_postURL, GDataEntry *entry);
54
GDataEntry* (*get_entry) (GDataService *self, const gchar *entry_getURL);
55
GDataEntry* (*update_entry)(GDataService *self, GDataEntry *entry);
56
GDataEntry* (*update_entry_with_link)(GDataService *self, GDataEntry *entry, gchar *link);
57
void (*delete_entry)(GDataService *self, GDataEntry *entry);
60
GType gdata_service_get_type(void);
62
/* Function Prototypes */
63
void gdata_service_set_credentials(GDataService *self, const gchar *username, const gchar *password);
65
GDataFeed* gdata_service_get_feed(GDataService *self, const gchar *feed_getURL);
67
GDataEntry* gdata_service_insert_entry(GDataService *self, const gchar *feed_postURL, GDataEntry *entry);
69
GDataEntry* gdata_service_get_entry(GDataService *self, const gchar *entry_getURL);
71
GDataEntry* gdata_service_update_entry(GDataService *self, GDataEntry *entry);
73
GDataEntry* gdata_service_update_entry_with_link(GDataService *self, GDataEntry *entry, gchar *link);
75
void gdata_service_delete_entry(GDataService *self, GDataEntry *entry);