GDataEntry

GDataEntry — GData entry object

Stability Level

Unstable, unless otherwise indicated

Synopsis


#include <gdata/gdata-entry.h>

                    GDataEntry;
                    GDataEntryClass;
GDataEntry *        (*GDataEntryParserFunc)             (xmlDoc *doc,
                                                         xmlNode *node,
                                                         GError **error);
GDataEntry *        gdata_entry_new                     (void);
GDataEntry *        gdata_entry_new_from_xml            (const gchar *xml,
                                                         gint length,
                                                         GError **error);
const gchar *       gdata_entry_get_title               (GDataEntry *self);
void                gdata_entry_set_title               (GDataEntry *self,
                                                         const gchar *title);
const gchar *       gdata_entry_get_id                  (GDataEntry *self);
const gchar *       gdata_entry_get_content             (GDataEntry *self);
void                gdata_entry_set_content             (GDataEntry *self,
                                                         const gchar *content);
void                gdata_entry_get_published           (GDataEntry *self,
                                                         GTimeVal *published);
void                gdata_entry_get_updated             (GDataEntry *self,
                                                         GTimeVal *updated);
void                gdata_entry_add_author              (GDataEntry *self,
                                                         GDataAuthor *author);
void                gdata_entry_add_category            (GDataEntry *self,
                                                         GDataCategory *category);
void                gdata_entry_add_link                (GDataEntry *self,
                                                         GDataLink *link);
GDataLink *         gdata_entry_look_up_link            (GDataEntry *self,
                                                         const gchar *rel);
gboolean            gdata_entry_is_inserted             (GDataEntry *self);
gchar *             gdata_entry_get_xml                 (GDataEntry *self);

Object Hierarchy

  GObject
   +----GDataEntry
         +----GDataYouTubeVideo

Properties

  "content"                  gchar*                : Read / Write
  "id"                       gchar*                : Read
  "is-inserted"              gboolean              : Read
  "published"                GTimeVal*             : Read
  "title"                    gchar*                : Read / Write
  "updated"                  GTimeVal*             : Read

Description

GDataEntry represents a single object on the online service, such as a playlist, video or calendar event. It is a snapshot of the state of that object at the time of querying the service, so modifications made to a GDataEntry will not be automatically or magically propagated to the server.

Details

GDataEntry

typedef struct _GDataEntry GDataEntry;

All the fields in the GDataEntry structure are private and should never be accessed directly.


GDataEntryClass

typedef struct {
	GObjectClass parent;

	void (*get_xml) (GDataEntry *self, GString *xml_string);
	const gchar *(*get_namespaces) (GDataEntry *self);
} GDataEntryClass;

The class structure for the GDataEntry type.

GObjectClass parent;

the parent class

get_xml ()

a function to build an XML representation of the GDataEntry in its current state, appending it to the provided GString

get_namespaces ()

a function to return a string containing the namespace declarations used by the entry when represented in XML form

GDataEntryParserFunc ()

GDataEntry *        (*GDataEntryParserFunc)             (xmlDoc *doc,
                                                         xmlNode *node,
                                                         GError **error);

Callback function for operations which parse feeds, which should produce a new GDataEntry from the provided entry XML.

It can return any error, but GDataParserError errors are most likely and most expected.

doc :

the XML document

node :

the XML node for an element; the <entry> element

error :

a GError, or NULL

Returns :

a new GDataEntry, or NULL

gdata_entry_new ()

GDataEntry *        gdata_entry_new                     (void);

Creates a new GDataEntry with default properties.

Returns :

a new GDataEntry

gdata_entry_new_from_xml ()

GDataEntry *        gdata_entry_new_from_xml            (const gchar *xml,
                                                         gint length,
                                                         GError **error);

Creates a new GDataEntry from the provided xml.

If length is -1, xml will be assumed to be nul-terminated.

If an error occurs during parsing, a suitable error from GDataParserError will be returned.

xml :

the XML for just the entry, with full namespace declarations

length :

the length of xml, or -1

error :

a GError, or NULL

Returns :

a new GDataEntry, or NULL

gdata_entry_get_title ()

const gchar *       gdata_entry_get_title               (GDataEntry *self);

Returns the title of the entry.

self :

a GDataEntry

Returns :

the entry's title

gdata_entry_set_title ()

void                gdata_entry_set_title               (GDataEntry *self,
                                                         const gchar *title);

Sets the title of the entry.

self :

a GDataEntry

title :

the new entry title

gdata_entry_get_id ()

const gchar *       gdata_entry_get_id                  (GDataEntry *self);

Returns the URN ID of the entry; a unique and permanent identifier for the object the entry represents.

self :

a GDataEntry

Returns :

the entry's ID

gdata_entry_get_content ()

const gchar *       gdata_entry_get_content             (GDataEntry *self);

Returns the textual content in this entry.

self :

a GDataEntry

Returns :

the entry's content, or NULL

gdata_entry_set_content ()

void                gdata_entry_set_content             (GDataEntry *self,
                                                         const gchar *content);

Sets the entry's content to content.

self :

a GDataEntry

content :

the new content for the entry

gdata_entry_get_published ()

void                gdata_entry_get_published           (GDataEntry *self,
                                                         GTimeVal *published);

Puts the time the entry was originally published into published.

self :

a GDataEntry

published :

a GTimeVal

gdata_entry_get_updated ()

void                gdata_entry_get_updated             (GDataEntry *self,
                                                         GTimeVal *updated);

Puts the time the entry was last updated into updated.

self :

a GDataEntry

updated :

a GTimeVal

gdata_entry_add_author ()

void                gdata_entry_add_author              (GDataEntry *self,
                                                         GDataAuthor *author);

Adds author to the list of authors in the given GDataEntry.

self :

a GDataEntry

author :

a GDataAuthor to add

gdata_entry_add_category ()

void                gdata_entry_add_category            (GDataEntry *self,
                                                         GDataCategory *category);

Adds category to the list of categories in the given GDataEntry.

self :

a GDataEntry

category :

a GDataCategory to add

gdata_entry_add_link ()

void                gdata_entry_add_link                (GDataEntry *self,
                                                         GDataLink *link);

Adds link to the list of links in the given GDataEntry.

self :

a GDataEntry

link :

a GDataLink to add

gdata_entry_look_up_link ()

GDataLink *         gdata_entry_look_up_link            (GDataEntry *self,
                                                         const gchar *rel);

Looks up a link by rel value from the list of links in the entry.

self :

a GDataEntry

rel :

the value of the rel attribute of the desired link

Returns :

a GDataLink, or NULL if one was not found

gdata_entry_is_inserted ()

gboolean            gdata_entry_is_inserted             (GDataEntry *self);

Returns whether the entry is marked as having been inserted on (uploaded to) the server already.

self :

a GDataEntry

Returns :

TRUE if the entry has been inserted already, FALSE otherwise

gdata_entry_get_xml ()

gchar *             gdata_entry_get_xml                 (GDataEntry *self);

Builds an XML representation of the GDataEntry in its current state, such that it could be inserted on the server. The XML is guaranteed to have all its namespaces declared properly in a self-contained fashion. The root element is guaranteed to be <entry>.

self :

a GDataEntry

Returns :

the entry's XML; free with g_free()

Property Details

The "content" property

  "content"                  gchar*                : Read / Write

The textual content of this entry.

Default value: NULL


The "id" property

  "id"                       gchar*                : Read

The ID for this entry.

Default value: NULL


The "is-inserted" property

  "is-inserted"              gboolean              : Read

Whether the entry has been inserted on the server.

Default value: FALSE


The "published" property

  "published"                GTimeVal*             : Read

The time this entry was published.


The "title" property

  "title"                    gchar*                : Read / Write

The title for this entry.

Default value: NULL


The "updated" property

  "updated"                  GTimeVal*             : Read

The last update time for this entry.