GrssFeedEnclosure

GrssFeedEnclosure — a component attached to an item

Types and Values

Object Hierarchy

    GObject
    ╰── GrssFeedEnclosure

Description

GrssFeedEnclosure describes an external element embedded into a GrssFeedItem: it may be an image, a video of other kind of file to be presented with the parent item.

Functions

grss_feed_enclosure_new ()

GrssFeedEnclosure *
grss_feed_enclosure_new (gchar *url);

Allocates a new GrssFeedEnclosure, to be downloaded separately.

Parameters

url

URL of the external element.

 

Returns

a new GrssFeedEnclosure.


grss_feed_enclosure_get_url ()

const gchar *
grss_feed_enclosure_get_url (GrssFeedEnclosure *enclosure);

Retrieves the URL of the enclosure .

Parameters

enclosure

a GrssFeedEnclosure.

 

Returns

the URL where the enclosure may be found.


grss_feed_enclosure_set_format ()

void
grss_feed_enclosure_set_format (GrssFeedEnclosure *enclosure,
                                gchar *type);

To set the type of the external file.

Parameters

enclosure

a GrssFeedEnclosure.

 

type

type of content.

 

grss_feed_enclosure_get_format ()

const gchar *
grss_feed_enclosure_get_format (GrssFeedEnclosure *enclosure);

Retrieves the format of the enclosed file.

Parameters

enclosure

a GrssFeedEnclosure.

 

Returns

type of enclosure .


grss_feed_enclosure_set_length ()

void
grss_feed_enclosure_set_length (GrssFeedEnclosure *enclosure,
                                gsize length);

To set the size of the embedded enclosure .

Parameters

enclosure

a GrssFeedEnclosure.

 

length

size of the enclosure, in bytes.

 

grss_feed_enclosure_get_length ()

gsize
grss_feed_enclosure_get_length (GrssFeedEnclosure *enclosure);

Retrieves the size of the embedded file.

Parameters

enclosure

a GrssFeedEnclosure.

 

Returns

size of the enclosure , in bytes.


grss_feed_enclosure_fetch ()

GFile *
grss_feed_enclosure_fetch (GrssFeedEnclosure *enclosure,
                           GError **error);

Utility to fetch a GrssFeedEnclosure. Contents are stored in a temporary GFile, which is suggested to move on a permanent location to keep it over time.

Parameters

enclosure

a GrssFeedEnclosure.

 

error

if an error occurred, NULL is returned and this is filled with the message.

 

Returns

temporary file where the contents have been written, or NULL if an error occours.

[transfer full]


grss_feed_enclosure_fetch_async ()

void
grss_feed_enclosure_fetch_async (GrssFeedEnclosure *enclosure,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

Similar to grss_feed_enclosure_fetch(), but asyncronous.

Parameters

enclosure

a GrssFeedEnclosure.

 

callback

function to invoke at the end of the download.

 

user_data

data passed to the callback.

 

grss_feed_enclosure_fetch_finish ()

GFile *
grss_feed_enclosure_fetch_finish (GrssFeedEnclosure *enclosure,
                                  GAsyncResult *res,
                                  GError **error);

Finalizes an asyncronous operation started with grss_feed_enclosure_fetch_async().

Parameters

enclosure

a GrssFeedEnclosure.

 

res

the GAsyncResult passed to the callback.

 

error

if an error occurred, NULL is returned and this is filled with the message.

 

Returns

temporary file where the contents have been written, or NULL if an error occours.

[transfer full]

Types and Values

GRSS_FEED_ENCLOSURE_TYPE

#define GRSS_FEED_ENCLOSURE_TYPE		(grss_feed_enclosure_get_type())