## GDataPicasaWebAlbum GDataPicasaWebAlbum — GData PicasaWeb album object |

## Stability Level

Stable, unless otherwise indicated

## Functions

GDataPicasaWebAlbum * | gdata_picasaweb_album_new ()
const gchar * | gdata_picasaweb_album_get_id ()
const gchar * | gdata_picasaweb_album_get_user ()
const gchar * | gdata_picasaweb_album_get_nickname ()
gint64 | gdata_picasaweb_album_get_edited ()
const gchar * | gdata_picasaweb_album_get_location ()
void | gdata_picasaweb_album_set_location ()
GDataPicasaWebVisibility | gdata_picasaweb_album_get_visibility ()
void | gdata_picasaweb_album_set_visibility ()
gint64 | gdata_picasaweb_album_get_timestamp ()
void | gdata_picasaweb_album_set_timestamp ()
guint | gdata_picasaweb_album_get_num_photos ()
guint | gdata_picasaweb_album_get_num_photos_remaining ()
glong | gdata_picasaweb_album_get_bytes_used ()
gboolean | gdata_picasaweb_album_is_commenting_enabled ()
void | gdata_picasaweb_album_set_is_commenting_enabled ()
guint | gdata_picasaweb_album_get_comment_count ()
const gchar * const * | gdata_picasaweb_album_get_tags ()
void | gdata_picasaweb_album_set_tags ()
GList * | gdata_picasaweb_album_get_contents ()
GList * | gdata_picasaweb_album_get_thumbnails ()
void | gdata_picasaweb_album_get_coordinates ()
void | gdata_picasaweb_album_set_coordinates ()

## Properties

gchar * | album-id | Read / Write / Construct Only
glong | bytes-used | Read
guint | comment-count | Read
gint64 | edited | Read
gboolean | is-commenting-enabled | Read / Write
gdouble | latitude | Read / Write
gchar * | location | Read / Write
gdouble | longitude | Read / Write
gchar * | nickname | Read
guint | num-photos | Read
guint | num-photos-remaining | Read
GStrv | tags | Read / Write
gint64 | timestamp | Read / Write
gchar * | user | Read
GDataPicasaWebVisibility | visibility | Read / Write

## Types and Values

| GDataPicasaWebAlbum
| GDataPicasaWebAlbumClass
enum | GDataPicasaWebVisibility

## Object Hierarchy

        GEnum
        ╰── GDataPicasaWebVisibility
        GObject
        ╰── GDataParsable
            ╰── GDataEntry
                ╰── GDataPicasaWebAlbum

## Includes

    #include <gdata/services/picasaweb/gdata-picasaweb-album.h>

## Description

GDataPicasaWebAlbum is a subclass of GDataEntry to represent an album from Google PicasaWeb.

For more details of Google PicasaWeb's GData API, see the online documentation.

Example 40. Getting Basic Album Data

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    GDataFeed *album_feed;
    GList *album_entries;

    /* Query for a feed of GDataPicasaWebAlbums owned by user "libgdata.picasaweb" */
    album_feed = gdata_picasaweb_service_query_all_albums (service, NULL, "libgdata.picasaweb", NULL, NULL, NULL, NULL);

    /* Get a list of GDataPicasaWebAlbums from the query's feed */
    for (album_entries = gdata_feed_get_entries (album_feed); album_entries != NULL; album_entries = album_entries->next) {
        GDataPicasaWebAlbum *album;
        guint num_photos;
        const gchar *owner_nickname, *title, *summary;
        gint64 timestamp;
        GList *thumbnails;

        album = GDATA_PICASAWEB_ALBUM (album_entries->data);

        /* Get various bits of information about the album */
        num_photos = gdata_picasaweb_album_get_num_photos (album);
        owner_nickname = gdata_picasaweb_album_get_nickname (album);
        title = gdata_entry_get_title (GDATA_ENTRY (album));
        summary = gdata_entry_get_summary (GDATA_ENTRY (album));
        /* Get the day the album was shot on or, if not set, when it was uploaded. This is in milliseconds since the epoch. */
        timestamp = gdata_picasaweb_album_get_timestamp (album);

        for (thumbnails = gdata_picasaweb_album_get_thumbnails (album); thumbnails != NULL; thumbnails = thumbnails->next) {
            GDataMediaThumbnail *thumbnail;
            GDataDownloadStream *download_stream;
            GdkPixbuf *pixbuf;

            thumbnail = GDATA_MEDIA_THUMBNAIL (thumbnails->data);
            /* Do something fun with the thumbnails, like download and display them. We could just as easily download them into
             * files using g_file_create() and g_output_stream_splice(), rather than create GdkPixbufs directly from them.
             * Note that this is a blocking operation. */
            download_stream = gdata_media_thumbnail_download (thumbnail, GDATA_SERVICE (service), NULL, NULL);
            pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (download_stream), NULL, NULL);
            g_object_unref (download_stream);
            /* ... */
            g_object_unref (pixbuf);
        }

        /* Do something worthwhile with your album data */
    }

    g_object_unref (album_feed);

## Functions

### gdata_picasaweb_album_new ()

    GDataPicasaWebAlbum *
    gdata_picasaweb_album_new (const gchar *id);

Creates a new GDataPicasaWebAlbum with the given ID and default properties. `id` is the ID which would be returned by `gdata_entry_get_id()`, not `gdata_picasaweb_album_get_id()`.

If `id` is not `NULL` and can't be parsed to extract an album ID, `NULL` will be returned.

#### Parameters

id | the album's entry ID, or `NULL`. | [allow-none]

#### Returns

a new GDataPicasaWebAlbum, or `NULL`; unref with `g_object_unref()`

Since: 0.4.0

### gdata_picasaweb_album_get_id ()

    const gchar *
    gdata_picasaweb_album_get_id (GDataPicasaWebAlbum *self);

Gets the “album-id” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the album's ID

Since: 0.7.0

### gdata_picasaweb_album_get_user ()

    const gchar *
    gdata_picasaweb_album_get_user (GDataPicasaWebAlbum *self);

Gets the “user” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the album owner's username

Since: 0.4.0

### gdata_picasaweb_album_get_nickname ()

    const gchar *
    gdata_picasaweb_album_get_nickname (GDataPicasaWebAlbum *self);

Gets the “nickname” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the album owner's nickname

Since: 0.4.0

### gdata_picasaweb_album_get_edited ()

    gint64
    gdata_picasaweb_album_get_edited (GDataPicasaWebAlbum *self);

Gets the “edited” property. If the property is unset, `-1` will be returned.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the UNIX timestamp for the time the album was last edited, or `-1`

Since: 0.4.0

### gdata_picasaweb_album_get_location ()

    const gchar *
    gdata_picasaweb_album_get_location (GDataPicasaWebAlbum *self);

Gets the “location” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the album's location, or `NULL`

Since: 0.4.0

### gdata_picasaweb_album_set_location ()

    void
    gdata_picasaweb_album_set_location (GDataPicasaWebAlbum *self,
                                        const gchar *location);

Sets the “location” property to `location` .

Set `location` to `NULL` to unset the property.

#### Parameters

self | a GDataPicasaWebAlbum |
location | the new album location, or `NULL`. | [allow-none]

Since: 0.4.0

### gdata_picasaweb_album_get_visibility ()

    GDataPicasaWebVisibility
    gdata_picasaweb_album_get_visibility (GDataPicasaWebAlbum *self);

Gets the “visibility” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the album's visibility level

Since: 0.4.0

### gdata_picasaweb_album_set_visibility ()

    void
    gdata_picasaweb_album_set_visibility (GDataPicasaWebAlbum *self,
                                          GDataPicasaWebVisibility visibility);

Sets the “visibility” property to `visibility` .

#### Parameters

self | a GDataPicasaWebAlbum |
visibility | the new album visibility level |

Since: 0.4.0

### gdata_picasaweb_album_get_timestamp ()

    gint64
    gdata_picasaweb_album_get_timestamp (GDataPicasaWebAlbum *self);

Gets the “timestamp” property. This value usually holds either the date that best corresponds to the album of photos, or to the day it was uploaded. It's a UNIX timestamp in milliseconds (not seconds) since the epoch. If the property is unset, `-1` will be returned.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the UNIX timestamp for the timestamp property in milliseconds, or `-1`

Since: 0.4.0

### gdata_picasaweb_album_set_timestamp ()

    void
    gdata_picasaweb_album_set_timestamp (GDataPicasaWebAlbum *self,
                                         gint64 timestamp);

Sets the “timestamp” property from `timestamp` . This should be a UNIX timestamp in milliseconds (not seconds) since the epoch.

Set `timestamp` to `-1` to unset the property.

#### Parameters

self | a GDataPicasaWebAlbum |
timestamp | a UNIX timestamp, or `-1` |

Since: 0.4.0

### gdata_picasaweb_album_get_num_photos ()

    guint
    gdata_picasaweb_album_get_num_photos (GDataPicasaWebAlbum *self);

Gets the “num-photos” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the number of photos currently in the album

Since: 0.4.0

### gdata_picasaweb_album_get_num_photos_remaining ()

    guint
    gdata_picasaweb_album_get_num_photos_remaining
                                   (GDataPicasaWebAlbum *self);

Gets the “num-photos-remaining” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the number of photos that can still be uploaded to the album

Since: 0.4.0

### gdata_picasaweb_album_get_bytes_used ()

    glong
    gdata_picasaweb_album_get_bytes_used (GDataPicasaWebAlbum *self);

Gets the “bytes-used” property. It will return `-1` if the current authenticated user is not the owner of the album.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the number of bytes used by the album and its contents, or `-1`

Since: 0.4.0

### gdata_picasaweb_album_is_commenting_enabled ()

    gboolean
    gdata_picasaweb_album_is_commenting_enabled
                                   (GDataPicasaWebAlbum *self);

Gets the “is-commenting-enabled” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

`TRUE` if commenting is enabled for the album, `FALSE` otherwise

Since: 0.4.0

### gdata_picasaweb_album_set_is_commenting_enabled ()

    void
    gdata_picasaweb_album_set_is_commenting_enabled
                                   (GDataPicasaWebAlbum *self,
                                    gboolean is_commenting_enabled);

Sets the “is-commenting-enabled” property to `is_commenting_enabled` .

#### Parameters

self | a GDataPicasaWebAlbum |
is_commenting_enabled | `TRUE` if commenting should be enabled for the album, `FALSE` otherwise |

Since: 0.4.0

### gdata_picasaweb_album_get_comment_count ()

    guint
    gdata_picasaweb_album_get_comment_count
                                   (GDataPicasaWebAlbum *self);

Gets the “comment-count” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

the number of comments on the album

Since: 0.4.0

### gdata_picasaweb_album_get_tags ()

    const gchar * const *
    gdata_picasaweb_album_get_tags (GDataPicasaWebAlbum *self);

Gets the “tags” property.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

a `NULL`-terminated array of tags associated with all the photos in the album, or `NULL`.

[array zero-terminated=1][transfer none]

Since: 0.4.0

### gdata_picasaweb_album_set_tags ()

    void
    gdata_picasaweb_album_set_tags (GDataPicasaWebAlbum *self,
                                    const gchar * const *tags);

Sets the “tags” property to `tags` .

Set `tags` to `NULL` to unset the album's tag list.

#### Parameters

self | a GDataPicasaWebAlbum |
tags | the new `NULL`-terminated array of tags, or `NULL`. | [array zero-terminated=1][allow-none]

Since: 0.4.0

### gdata_picasaweb_album_get_contents ()

    GList *
    gdata_picasaweb_album_get_contents (GDataPicasaWebAlbum *self);

Returns a list of media content, such as the cover image for the album.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

a GList of GDataMediaContent items.

[element-type GData.MediaContent][transfer none]

Since: 0.4.0

### gdata_picasaweb_album_get_thumbnails ()

    GList *
    gdata_picasaweb_album_get_thumbnails (GDataPicasaWebAlbum *self);

Returns a list of thumbnails, often at different sizes, for this album.

#### Parameters

self | a GDataPicasaWebAlbum |

#### Returns

a GList of GDataMediaThumbnails, or `NULL`.

[element-type GData.MediaThumbnail][transfer none]

Since: 0.4.0

### gdata_picasaweb_album_get_coordinates ()

    void
    gdata_picasaweb_album_get_coordinates (GDataPicasaWebAlbum *self,
                                           gdouble *latitude,
                                           gdouble *longitude);

Gets the “latitude” and “longitude” properties, setting the out parameters to them. If either latitude or longitude is `NULL`, that parameter will not be set. If the coordinates are unset, `latitude` and `longitude` will be set to `G_MAXDOUBLE`.

#### Parameters

self | a GDataPicasaWebAlbum |
latitude | return location for the latitude, or `NULL`. | [out caller-allocates][allow-none]
longitude | return location for the longitude, or `NULL`. | [out caller-allocates][allow-none]

Since: 0.5.0

### gdata_picasaweb_album_set_coordinates ()

    void
    gdata_picasaweb_album_set_coordinates (GDataPicasaWebAlbum *self,
                                           gdouble latitude,
                                           gdouble longitude);

Sets the “latitude” and “longitude” properties to `latitude` and `longitude` respectively.

#### Parameters

self | a GDataPicasaWebAlbum |
latitude | the album's new latitude coordinate, or `G_MAXDOUBLE` |
longitude | the album's new longitude coordinate, or `G_MAXDOUBLE` |

Since: 0.5.0

## Types and Values

### GDataPicasaWebAlbum

    typedef struct _GDataPicasaWebAlbum GDataPicasaWebAlbum;

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

Since: 0.4.0

### GDataPicasaWebAlbumClass

    typedef struct {
    } GDataPicasaWebAlbumClass;

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

Since: 0.4.0

### enum GDataPicasaWebVisibility

Visibility statuses available for albums on PicasaWeb. For more information, see the

online documentation.

#### Members

GDATA_PICASAWEB_PUBLIC | the album is visible to everyone, regardless of whether they're authenticated |
GDATA_PICASAWEB_PRIVATE | the album is visible only to authenticated users in a whitelist |

Since: 0.4.0

## Property Details

### The `“album-id”` property

      “album-id”                 gchar *

The ID of the album. This is a substring of the ID returned by `gdata_entry_get_id()` for GDataPicasaWebAlbums; for example, if `gdata_entry_get_id()` returned "http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249" for a particular GDataPicasaWebAlbum, the “album-id” property would be "5328889949261497249".

For more information, see the gphoto specification.

Flags: Read / Write / Construct Only

Default value: NULL

Since: 0.7.0

### The `“bytes-used”` property

      “bytes-used”               glong

The number of bytes consumed by this album and its contents. Note that this is only set if the authenticated user is the owner of the album; it's otherwise `-1`.

For more information, see the gphoto specification.

Flags: Read

Allowed values: >= -1

Default value: -1

Since: 0.4.0

### The `“comment-count”` property

      “comment-count”            guint

The number of comments on the album.

For more information, see the gphoto specification.

Flags: Read

Default value: 0

Since: 0.4.0

### The `“edited”` property

      “edited”                   gint64

The time this album was last edited. If the album has not been edited yet, the content indicates the time it was created.

For more information, see the Atom Publishing Protocol specification.

Flags: Read

Allowed values: >= -1

Default value: -1

Since: 0.4.0

### The `“is-commenting-enabled”` property

      “is-commenting-enabled”    gboolean

Whether commenting is enabled for this album.

Flags: Read / Write

Default value: FALSE

### The `“latitude”` property

      “latitude”                 gdouble

The location as a latitude coordinate associated with this album. Valid latitudes range from `-90.0` to `90.0` inclusive.

For more information, see the GeoRSS specification.

Flags: Read / Write

Allowed values: [-90,90]

Default value: 0

Since: 0.5.0

### The `“location”` property

      “location”                 gchar *

The user-specified location associated with the album. A place name.

For more information, see the gphoto specification.

Flags: Read / Write

Default value: NULL

Since: 0.4.0

### The `“longitude”` property

      “longitude”                gdouble

The location as a longitude coordinate associated with this album. Valid longitudes range from `-180.0` to `180.0` inclusive.

For more information, see the GeoRSS specification.

Flags: Read / Write

Allowed values: [-180,180]

Default value: 0

Since: 0.5.0

### The `“nickname”` property

      “nickname”                 gchar *

The user's nickname. This is a user-specified value that should be used when referring to the user by name.

For more information, see the gphoto specification.

Flags: Read

Default value: NULL

Since: 0.4.0

### The `“num-photos”` property

      “num-photos”               guint

The number of photos and videos in the album.

For more information, see the gphoto specification.

Flags: Read

Default value: 0

Since: 0.4.0

### The `“num-photos-remaining”` property

      “num-photos-remaining”     guint

The number of photos and videos that can still be uploaded to this album. This doesn't account for quota, just a hardcoded maximum number per album set by Google.

For more information, see the gphoto specification.

Flags: Read

Default value: 0

Since: 0.4.0

### The `“tags”` property

      “tags”                     GStrv

A `NULL`-terminated array of tags associated with the album; all the tags associated with the individual photos in the album.

For more information, see the Media RSS specification.

Flags: Read / Write

Since: 0.4.0

### The `“timestamp”` property

      “timestamp”                gint64

The timestamp of when the album occurred, settable by the user. This a UNIX timestamp in milliseconds (not seconds) since the epoch.

For more information, see the gphoto specification.

Flags: Read / Write

Allowed values: >= -1

Default value: -1

Since: 0.4.0

### The `“user”` property

      “user”                     gchar *

The username of the album owner.

For more information, see the gphoto specification.

Flags: Read

Default value: NULL

Since: 0.4.0

### The `“visibility”` property

      “visibility”               GDataPicasaWebVisibility

The visibility (or access rights) of the album.

For more information, see the gphoto specification.

Flags: Read / Write

Default value: GDATA_PICASAWEB_PRIVATE

Since: 0.4.0