## GDataEntry

GDataEntry — GData entry object

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <gdata/gdata-entry.h>

                        GDataEntry;
                        GDataEntryClass;
    GDataEntry *        gdata_entry_new                     (const gchar *id);
    const gchar *       gdata_entry_get_title               (GDataEntry *self);
    void                gdata_entry_set_title               (GDataEntry *self,
                                                             const gchar *title);
    const gchar *       gdata_entry_get_summary             (GDataEntry *self);
    void                gdata_entry_set_summary             (GDataEntry *self,
                                                             const gchar *summary);
    const gchar *       gdata_entry_get_id                  (GDataEntry *self);
    const gchar *       gdata_entry_get_etag                (GDataEntry *self);
    const gchar *       gdata_entry_get_content             (GDataEntry *self);
    void                gdata_entry_set_content             (GDataEntry *self,
                                                             const gchar *content);
    const gchar *       gdata_entry_get_content_uri         (GDataEntry *self);
    void                gdata_entry_set_content_uri         (GDataEntry *self,
                                                             const gchar *content_uri);
    gint64              gdata_entry_get_published           (GDataEntry *self);
    gint64              gdata_entry_get_updated             (GDataEntry *self);
    GList *             gdata_entry_get_authors             (GDataEntry *self);
    void                gdata_entry_add_author              (GDataEntry *self,
                                                             GDataAuthor *author);
    void                gdata_entry_add_category            (GDataEntry *self,
                                                             GDataCategory *category);
    GList *             gdata_entry_get_categories          (GDataEntry *self);
    void                gdata_entry_add_link                (GDataEntry *self,
                                                             GDataLink *_link);
    gboolean            gdata_entry_remove_link             (GDataEntry *self,
                                                             GDataLink *_link);
    GDataLink *         gdata_entry_look_up_link            (GDataEntry *self,
                                                             const gchar *rel);
    GList *             gdata_entry_look_up_links           (GDataEntry *self,
                                                             const gchar *rel);
    gboolean            gdata_entry_is_inserted             (GDataEntry *self);
    const gchar *       gdata_entry_get_rights              (GDataEntry *self);
    void                gdata_entry_set_rights              (GDataEntry *self,
                                                             const gchar *rights);

## Object Hierarchy

      GObject
       +----GDataParsable
             +----GDataEntry
                   +----GDataAccessRule
                   +----GDataCalendarCalendar
                   +----GDataCalendarEvent
                   +----GDataComment
                   +----GDataContactsContact
                   +----GDataContactsGroup
                   +----GDataDocumentsEntry
                   +----GDataPicasaWebAlbum
                   +----GDataPicasaWebFile
                   +----GDataPicasaWebUser
                   +----GDataYouTubeVideo

## Known Derived Interfaces

GDataEntry is required by GDataAccessHandler and GDataCommentable.

## Properties

      "content"                  gchar*                : Read / Write
      "content-uri"              gchar*                : Read / Write
      "etag"                     gchar*                : Read / Write / Construct Only
      "id"                       gchar*                : Read / Write / Construct Only
      "is-inserted"              gboolean              : Read
      "published"                gint64                : Read
      "rights"                   gchar*                : Read / Write
      "summary"                  gchar*                : Read / Write
      "title"                    gchar*                : Read / Write
      "updated"                  gint64                : 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 {
    	GDataParsableClass parent;

    	gchar *(*get_entry_uri) (const gchar *id); /* G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC */
    	const gchar *kind_term;
    } GDataEntryClass;

The class structure for the GDataEntry type.

GDataParsableClass `parent`; | the parent class
`get_entry_uri` () | a function to build the entry URI for the entry, given its entry ID; free the URI with `g_free()`
const gchar *`kind_term`; | the term for this entry's kind category (see the documentation on kinds)

### gdata_entry_new ()

    GDataEntry *        gdata_entry_new                     (const gchar *id);

Creates a new GDataEntry with the given ID and default properties.

`id` : | the entry's ID, or `NULL`. [allow-none]
Returns : | a new GDataEntry; unref with `g_object_unref()`

### 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, or `NULL`. [allow-none]

### gdata_entry_get_summary ()

    const gchar *       gdata_entry_get_summary             (GDataEntry *self);

Returns the summary of the entry.

`self` : | a GDataEntry
Returns : | the entry's summary, or `NULL`

Since 0.4.0

### gdata_entry_set_summary ()

    void                gdata_entry_set_summary             (GDataEntry *self,
                                                             const gchar *summary);

Sets the summary of the entry.

`self` : | a GDataEntry
`summary` : | the new entry summary, or `NULL`. [allow-none]

Since 0.4.0

### 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_etag ()

    const gchar *       gdata_entry_get_etag                (GDataEntry *self);

Returns the ETag of the entry; a unique identifier for each version of the entry. For more information, see the online documentation.

`self` : | a GDataEntry
Returns : | the entry's ETag

Since 0.2.0

### gdata_entry_get_content ()

    const gchar *       gdata_entry_get_content             (GDataEntry *self);

Returns the textual content in this entry. If the content in this entry is pointed to by a URI, `NULL` will be returned; the content URI will be returned by `gdata_entry_get_content_uri()`.

`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`. This unsets "content-uri".

`self` : | a GDataEntry
`content` : | the new content for the entry, or `NULL`. [allow-none]

### gdata_entry_get_content_uri ()

    const gchar *       gdata_entry_get_content_uri         (GDataEntry *self);

Returns a URI pointing to the content of this entry. If the content in this entry is stored directly, `NULL` will be returned; the content will be returned by `gdata_entry_get_content()`.

`self` : | a GDataEntry
Returns : | a URI pointing to the entry's content, or `NULL`

Since 0.7.0

### gdata_entry_set_content_uri ()

    void                gdata_entry_set_content_uri         (GDataEntry *self,
                                                             const gchar *content_uri);

Sets the URI pointing to the entry's content to `content`. This unsets "content".

`self` : | a GDataEntry
`content_uri` : | the new URI pointing to the content for the entry, or `NULL`. [allow-none]

Since 0.7.0

### gdata_entry_get_published ()

    gint64              gdata_entry_get_published           (GDataEntry *self);

Gets the time the entry was originally published.

`self` : | a GDataEntry
Returns : | the UNIX timestamp for the original publish time of the entry

### gdata_entry_get_updated ()

    gint64              gdata_entry_get_updated             (GDataEntry *self);

Gets the time the entry was last updated.

`self` : | a GDataEntry
Returns : | the UNIX timestamp for the last update of the entry

### gdata_entry_get_authors ()

    GList *             gdata_entry_get_authors             (GDataEntry *self);

Gets a list of the GDataAuthors for this entry.

`self` : | a GDataEntry
Returns : | a GList of GDataAuthors. [element-type GData.Author][transfer none]

Since 0.7.0

### gdata_entry_add_author ()

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

Adds `author` to the list of authors in the given GDataEntry and increments its reference count.

Duplicate authors will not be added to the list.

`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, and increments its reference count.

Duplicate categories will not be added to the list.

`self` : | a GDataEntry
`category` : | a GDataCategory to add

### gdata_entry_get_categories ()

    GList *             gdata_entry_get_categories          (GDataEntry *self);

Gets a list of the GDataCategorys containing this entry.

`self` : | a GDataEntry
Returns : | a GList of GDataCategorys. [element-type GData.Category][transfer none]

Since 0.2.0

### gdata_entry_add_link ()

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

Adds `_link` to the list of links in the given GDataEntry and increments its reference count.

Duplicate links will not be added to the list.

`self` : | a GDataEntry
`_link` : | a GDataLink to add

### gdata_entry_remove_link ()

    gboolean            gdata_entry_remove_link             (GDataEntry *self,
                                                             GDataLink *_link);

Removes `_link` from the list of links in the given GDataEntry and decrements its reference count (since the GDataEntry held a reference to it while it was in the list).

`self` : | a GDataEntry
`_link` : | a GDataLink to remove
Returns : | `TRUE` if `_link` was found in the GDataEntry and removed, `FALSE` if it was not found

Since 0.10.0

### gdata_entry_look_up_link ()

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

Looks up a link by relation type from the list of links in the entry. If the link has one of the standard Atom relation types, use one of the defined `rel` values, instead of a static string. e.g. `GDATA_LINK_EDIT` or `GDATA_LINK_SELF`.

In the rare event of requiring a list of links with the same `rel` value, use `gdata_entry_look_up_links()`.

`self` : | a GDataEntry
`rel` : | the value of the `rel` attribute of the desired link
Returns : | a GDataLink, or `NULL` if one was not found. [transfer none]

Since 0.1.1

### gdata_entry_look_up_links ()

    GList *             gdata_entry_look_up_links           (GDataEntry *self,
                                                             const gchar *rel);

Looks up a list of links by relation type from the list of links in the entry. If the links have one of the standard Atom relation types, use one of the defined `rel` values, instead of a static string. e.g. `GDATA_LINK_EDIT` or `GDATA_LINK_SELF`.

If you will only use the first link found, consider calling `gdata_entry_look_up_link()` instead.

`self` : | a GDataEntry
`rel` : | the value of the `rel` attribute of the desired links
Returns : | a GList of GDataLinks, or `NULL` if none were found; free the list with `g_list_free()`. [element-type GData.Link][transfer container]

Since 0.4.0

### 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_rights ()

    const gchar *       gdata_entry_get_rights              (GDataEntry *self);

Returns the rights pertaining to the entry, or `NULL` if not set.

`self` : | a GDataEntry
Returns : | the entry's rights information

Since 0.5.0

### gdata_entry_set_rights ()

    void                gdata_entry_set_rights              (GDataEntry *self,
                                                             const gchar *rights);

Sets the rights for this entry.

`self` : | a GDataEntry
`rights` : | the new rights, or `NULL`. [allow-none]

Since 0.5.0

## Property Details

### The `"content"` property

      "content"                  gchar*                : Read / Write

The content of the entry. This is mutually exclusive with "content".

For more information, see the Atom specification.

Default value: NULL

### The `"content-uri"` property

      "content-uri"              gchar*                : Read / Write

A URI pointing to the location of the content of the entry. This is mutually exclusive with "content".

For more information, see the Atom specification.

Default value: NULL

Since 0.7.0

### The `"etag"` property

      "etag"                     gchar*                : Read / Write / Construct Only

An identifier for a particular version of the entry. This changes every time the entry on the server changes, and can be used for conditional retrieval and locking.

For more information, see the GData specification.

Default value: NULL

Since 0.2.0

### The `"id"` property

      "id"                       gchar*                : Read / Write / Construct Only

A permanent, universally unique identifier for the entry, in IRI form.

For more information, see the Atom specification.

Default value: NULL

### The `"is-inserted"` property

      "is-inserted"              gboolean              : Read

Whether the entry has been inserted on the server. This is `FALSE` for entries which have just been created using `gdata_entry_new()` and `TRUE` for entries returned from the server by queries. It is set to `TRUE` when an entry is inserted using `gdata_service_insert_entry()`.

Default value: FALSE

### The `"published"` property

      "published"                gint64                : Read

The date and time the entry was first published or made available.

For more information, see the Atom specification.

Allowed values: >= -1

Default value: -1

### The `"rights"` property

      "rights"                   gchar*                : Read / Write

The ownership rights pertaining to the entry.

For more information, see the Atom specification.

Default value: NULL

Since 0.5.0

### The `"summary"` property

      "summary"                  gchar*                : Read / Write

A short summary, abstract, or excerpt of the entry.

For more information, see the Atom specification.

Default value: NULL

Since 0.4.0

### The `"title"` property

      "title"                    gchar*                : Read / Write

A human-readable title for the entry.

For more information, see the Atom specification.

Default value: NULL

### The `"updated"` property

      "updated"                  gint64                : Read

The date and time when the entry was most recently updated significantly.

For more information, see the Atom specification.

Allowed values: >= -1

Default value: -1