## GDataLink GDataLink — Atom link element |

## Stability Level

Unstable, unless otherwise indicated

## Synopsis

    #include <gdata/atom/gdata-link.h>

    #define             GDATA_LINK_ALTERNATE
    #define             GDATA_LINK_BATCH
    #define             GDATA_LINK_EDIT
    #define             GDATA_LINK_EDIT_MEDIA
    #define             GDATA_LINK_ENCLOSURE
    #define             GDATA_LINK_RELATED
    #define             GDATA_LINK_SELF
    #define             GDATA_LINK_VIA
                        GDataLink;
                        GDataLinkClass;
    GDataLink *         gdata_link_new                      (const gchar *uri,
                                                             const gchar *relation_type);
    const gchar *       gdata_link_get_uri                  (GDataLink *self);
    void                gdata_link_set_uri                  (GDataLink *self,
                                                             const gchar *uri);
    const gchar *       gdata_link_get_relation_type        (GDataLink *self);
    void                gdata_link_set_relation_type        (GDataLink *self,
                                                             const gchar *relation_type);
    const gchar *       gdata_link_get_content_type         (GDataLink *self);
    void                gdata_link_set_content_type         (GDataLink *self,
                                                             const gchar *content_type);
    const gchar *       gdata_link_get_language             (GDataLink *self);
    void                gdata_link_set_language             (GDataLink *self,
                                                             const gchar *language);
    const gchar *       gdata_link_get_title                (GDataLink *self);
    void                gdata_link_set_title                (GDataLink *self,
                                                             const gchar *title);
    gint                gdata_link_get_length               (GDataLink *self);
    void                gdata_link_set_length               (GDataLink *self,
                                                             gint length);

## Object Hierarchy

      GObject
       +----GDataParsable
             +----GDataLink

## Implemented Interfaces

GDataLink implements GDataComparable.

## Properties

      "content-type"             gchar*                : Read / Write
      "language"                 gchar*                : Read / Write
      "length"                   gint                  : Read / Write
      "relation-type"            gchar*                : Read / Write
      "title"                    gchar*                : Read / Write
      "uri"                      gchar*                : Read / Write

## Description

GDataLink represents a "link" element from the Atom specification.

## Details

### GDATA_LINK_ALTERNATE

    #define GDATA_LINK_ALTERNATE "http://www.iana.org/assignments/relation/alternate"

The relation type URI for alternate resources to the current one.

For more information, see the Atom specification.

Since 0.4.0

### GDATA_LINK_BATCH

    #define GDATA_LINK_BATCH "http://schemas.google.com/g/2005#batch"

The relation type URI for the batch operation URI for a given GDataFeed.

For more information, see the GData specification.

Since 0.7.0

### GDATA_LINK_EDIT

    #define GDATA_LINK_EDIT "http://www.iana.org/assignments/relation/edit"

The relation type URI of the edit location for this resource.

For more information, see the Atom Publishing Protocol specification.

Since 0.4.0

### GDATA_LINK_EDIT_MEDIA

    #define GDATA_LINK_EDIT_MEDIA "http://www.iana.org/assignments/relation/edit-media"

The relation type URI of the edit location for media resources attached to this resource.

For more information, see the Atom Publishing Protocol specification.

Since 0.4.0

### GDATA_LINK_ENCLOSURE

    #define GDATA_LINK_ENCLOSURE "http://www.iana.org/assignments/relation/enclosure"

The relation type URI for attached objects which may be large in size.

For more information, see the Atom specification.

Since 0.4.0

### GDATA_LINK_RELATED

    #define GDATA_LINK_RELATED "http://www.iana.org/assignments/relation/related"

The relation type URI for resources related to the current one.

For more information, see the Atom specification.

Since 0.4.0

### GDATA_LINK_SELF

    #define GDATA_LINK_SELF "http://www.iana.org/assignments/relation/self"

The relation type URI for the current resource.

For more information, see the Atom specification.

Since 0.4.0

### GDATA_LINK_VIA

    #define GDATA_LINK_VIA "http://www.iana.org/assignments/relation/via"

The relation type URI for the source document of the current resource.

For more information, see the Atom specification.

Since 0.4.0

### GDataLink

    typedef struct _GDataLink GDataLink;

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

### GDataLinkClass

    typedef struct {
    } GDataLinkClass;

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

Since 0.4.0

### gdata_link_new ()

    GDataLink *         gdata_link_new                      (const gchar *uri,
                                                             const gchar *relation_type);

Creates a new GDataLink. More information is available in the Atom specification.

`uri` : | the link's IRI
`relation_type` : | the relationship of the link to the current document, or `NULL`. [allow-none]
Returns : | a new GDataLink, or `NULL`; unref with `g_object_unref()`

### gdata_link_get_uri ()

    const gchar *       gdata_link_get_uri                  (GDataLink *self);

Gets the "uri" property. The return value is guaranteed to be a valid IRI, as specified by the Atom protocol. Common relationship values such as `alternate` are returned as `http://www.iana.org/assignments/relation/alternate`.

For more information, see the Atom specification.

`self` : | a GDataLink
Returns : | the link's URI

Since 0.4.0

### gdata_link_set_uri ()

    void                gdata_link_set_uri                  (GDataLink *self,
                                                             const gchar *uri);

Sets the "uri" property to `uri`.

`self` : | a GDataLink
`uri` : | the new URI for the link

Since 0.4.0

### gdata_link_get_relation_type ()

    const gchar *       gdata_link_get_relation_type        (GDataLink *self);

Gets the "relation-type" property.

`self` : | a GDataLink
Returns : | the link's relation type

Since 0.4.0

### gdata_link_set_relation_type ()

    void                gdata_link_set_relation_type        (GDataLink *self,
                                                             const gchar *relation_type);

Sets the "relation-type" property to `relation_type`. If `relation_type` is one of the standard Atom relation types, use one of the defined relation type values, instead of a static string. e.g. `GDATA_LINK_EDIT` or `GDATA_LINK_SELF`.

Set `relation_type` to `NULL` to unset the property in the link.

`self` : | a GDataLink
`relation_type` : | the new relation type for the link, or `NULL`. [allow-none]

Since 0.4.0

### gdata_link_get_content_type ()

    const gchar *       gdata_link_get_content_type         (GDataLink *self);

Gets the "content-type" property.

`self` : | a GDataLink
Returns : | the link's content type, or `NULL`

Since 0.4.0

### gdata_link_set_content_type ()

    void                gdata_link_set_content_type         (GDataLink *self,
                                                             const gchar *content_type);

Sets the "content-type" property to `content_type`.

Set `content_type` to `NULL` to unset the property in the link.

`self` : | a GDataLink
`content_type` : | the new content type for the link, or `NULL`. [allow-none]

Since 0.4.0

### gdata_link_get_language ()

    const gchar *       gdata_link_get_language             (GDataLink *self);

Gets the "language" property.

`self` : | a GDataLink
Returns : | the link's language, or `NULL`

Since 0.4.0

### gdata_link_set_language ()

    void                gdata_link_set_language             (GDataLink *self,
                                                             const gchar *language);

Sets the "language" property to `language`.

Set `language` to `NULL` to unset the property in the link.

`self` : | a GDataLink
`language` : | the new language for the link, or `NULL`. [allow-none]

Since 0.4.0

### gdata_link_get_title ()

    const gchar *       gdata_link_get_title                (GDataLink *self);

Gets the "title" property.

`self` : | a GDataLink
Returns : | the link's title, or `NULL`

Since 0.4.0

### gdata_link_set_title ()

    void                gdata_link_set_title                (GDataLink *self,
                                                             const gchar *title);

Sets the "title" property to `title`.

Set `title` to `NULL` to unset the property in the link.

`self` : | a GDataLink
`title` : | the new title for the link, or `NULL`. [allow-none]

Since 0.4.0

### gdata_link_get_length ()

    gint                gdata_link_get_length               (GDataLink *self);

Gets the "length" property.

`self` : | a GDataLink
Returns : | the link's length, or `-1`

Since 0.4.0

### gdata_link_set_length ()

    void                gdata_link_set_length               (GDataLink *self,
                                                             gint length);

Sets the "length" property to `length`.

Set `length` to `-1` to unset the property in the link.

`self` : | a GDataLink
`length` : | the new length for the link, or `-1`

Since 0.4.0

## Property Details

### The `"content-type"` property

      "content-type"             gchar*                : Read / Write

An advisory media type: it is a hint about the type of the representation that is expected to be returned when the value of the "uri" property is dereferenced.

For more information, see the Atom specification.

Default value: NULL

Since 0.4.0

### The `"language"` property

      "language"                 gchar*                : Read / Write

Describes the language of the resource pointed to by the "uri" property.

For more information, see the Atom specification.

Default value: NULL

Since 0.4.0

### The `"length"` property

      "length"                   gint                  : Read / Write

Indicates an advisory length of the linked content in octets. `-1` means the length is unspecified.

For more information, see the Atom specification.

Allowed values: >= G_MAXULONG

Default value: -1

Since 0.4.0

### The `"relation-type"` property

      "relation-type"            gchar*                : Read / Write

The link relation type.

For more information, see the Atom specification.

Default value: "http://www.iana.org/assignments/relation/alternate"

Since 0.4.0

### The `"title"` property

      "title"                    gchar*                : Read / Write

Conveys human-readable information about the link.

For more information, see the Atom specification.

Default value: NULL

Since 0.4.0

### The `"uri"` property

      "uri"                      gchar*                : Read / Write

The link's IRI.

For more information, see the Atom specification.

Default value: NULL

Since 0.4.0