GrssFeedItem

GrssFeedItem — a feed item

Synopsis

struct              GrssFeedItem;
GrssFeedItem *      grss_feed_item_new                  (GrssFeedChannel *parent);
GrssFeedChannel *   grss_feed_item_get_parent           (GrssFeedItem *item);
void                grss_feed_item_set_id               (GrssFeedItem *item,
                                                         gchar *id);
const gchar *       grss_feed_item_get_id               (GrssFeedItem *item);
void                grss_feed_item_set_title            (GrssFeedItem *item,
                                                         gchar *title);
const gchar *       grss_feed_item_get_title            (GrssFeedItem *item);
void                grss_feed_item_set_description      (GrssFeedItem *item,
                                                         gchar *description);
const gchar *       grss_feed_item_get_description      (GrssFeedItem *item);
void                grss_feed_item_add_category         (GrssFeedItem *item,
                                                         gchar *category);
const GList *       grss_feed_item_get_categories       (GrssFeedItem *item);
void                grss_feed_item_set_source           (GrssFeedItem *item,
                                                         gchar *source);
const gchar *       grss_feed_item_get_source           (GrssFeedItem *item);
void                grss_feed_item_set_real_source      (GrssFeedItem *item,
                                                         gchar *realsource,
                                                         gchar *title);
void                grss_feed_item_get_real_source      (GrssFeedItem *item,
                                                         const gchar **realsource,
                                                         const gchar **title);
void                grss_feed_item_set_related          (GrssFeedItem *item,
                                                         gchar *related);
const gchar *       grss_feed_item_get_related          (GrssFeedItem *item);
void                grss_feed_item_set_copyright        (GrssFeedItem *item,
                                                         gchar *copyright);
const gchar *       grss_feed_item_get_copyright        (GrssFeedItem *item);
void                grss_feed_item_set_author           (GrssFeedItem *item,
                                                         gchar *author);
const gchar *       grss_feed_item_get_author           (GrssFeedItem *item);
void                grss_feed_item_add_contributor      (GrssFeedItem *item,
                                                         gchar *contributor);
const GList *       grss_feed_item_get_contributors     (GrssFeedItem *item);
void                grss_feed_item_set_comments_url     (GrssFeedItem *item,
                                                         gchar *url);
const gchar *       grss_feed_item_get_comments_url     (GrssFeedItem *item);
void                grss_feed_item_set_geo_point        (GrssFeedItem *item,
                                                         double latitude,
                                                         double longitude);
gboolean            grss_feed_item_get_geo_point        (GrssFeedItem *item,
                                                         double *latitude,
                                                         double *longitude);
void                grss_feed_item_set_publish_time     (GrssFeedItem *item,
                                                         time_t publish);
time_t              grss_feed_item_get_publish_time     (GrssFeedItem *item);
void                grss_feed_item_add_enclosure        (GrssFeedItem *item,
                                                         GrssFeedEnclosure *enclosure);
const GList *       grss_feed_item_get_enclosures       (GrssFeedItem *item);

Object Hierarchy

  GObject
   +----GrssFeedItem

Description

GrssFeedItem is an abstraction for an item, collects all information about a single element found into a feed. It mostly is a passive container for attributes.

Details

struct GrssFeedItem

struct GrssFeedItem;


grss_feed_item_new ()

GrssFeedItem *      grss_feed_item_new                  (GrssFeedChannel *parent);

To allocate a new empty GrssFeedItem.

parent :

the feed from which the new item belongs.

Returns :

a new GrssFeedItem.

grss_feed_item_get_parent ()

GrssFeedChannel *   grss_feed_item_get_parent           (GrssFeedItem *item);

Retrieves the feed from which the item belongs.

item :

a GrssFeedItem.

Returns :

the parent feed, as set in grss_feed_item_new().

grss_feed_item_set_id ()

void                grss_feed_item_set_id               (GrssFeedItem *item,
                                                         gchar *id);

To set the ID of the item. This parameter has not a particular format: it is just a string used to identify in unique way the item.

item :

a GrssFeedItem.

id :

the new ID to set.

grss_feed_item_get_id ()

const gchar *       grss_feed_item_get_id               (GrssFeedItem *item);

Retrieves the ID assigned to the item. If no ID was set with grss_feed_item_set_id() this returns the same of grss_feed_item_get_source(). Pay attention to the fact this library do not check uniqueness of assigned IDs.

item :

GrssFeedItem from which retrieve the ID.

Returns :

ID of the item.

grss_feed_item_set_title ()

void                grss_feed_item_set_title            (GrssFeedItem *item,
                                                         gchar *title);

To set a title to the item.

item :

a GrssFeedItem.

title :

title of the item.

grss_feed_item_get_title ()

const gchar *       grss_feed_item_get_title            (GrssFeedItem *item);

Retrieves the title assigned to item.

item :

a GrssFeedItem.

Returns :

title of the element.

grss_feed_item_set_description ()

void                grss_feed_item_set_description      (GrssFeedItem *item,
                                                         gchar *description);

To set the description of item. Usually "description" means his content.

item :

a GrssFeedItem.

description :

content of the item.

grss_feed_item_get_description ()

const gchar *       grss_feed_item_get_description      (GrssFeedItem *item);

Retrieves the description of the item.

item :

a GrssFeedItem.

Returns :

description of item.

grss_feed_item_add_category ()

void                grss_feed_item_add_category         (GrssFeedItem *item,
                                                         gchar *category);

Adds a category to the item. The complete list can be obtained with grss_feed_item_get_categories().

item :

a GrssFeedItem.

category :

a new category to assign to the item.

grss_feed_item_get_categories ()

const GList *       grss_feed_item_get_categories       (GrssFeedItem *item);

Retrieves list of categories assigned to the item.

item :

a GrssFeedItem.

Returns :

list of strings, one for assigned category. Do not free or modify this list.

grss_feed_item_set_source ()

void                grss_feed_item_set_source           (GrssFeedItem *item,
                                                         gchar *source);

To set the source of the item.

item :

a GrssFeedItem.

source :

URL of the item.

grss_feed_item_get_source ()

const gchar *       grss_feed_item_get_source           (GrssFeedItem *item);

Retrieves the URL where the item can be found.

item :

a GrssFeedItem.

Returns :

URL of the item, or NULL.

grss_feed_item_set_real_source ()

void                grss_feed_item_set_real_source      (GrssFeedItem *item,
                                                         gchar *realsource,
                                                         gchar *title);

To set an alternative real source for item. This parameter is used by web aggregators to explicit the origin of a content reproduced in them.

item :

a GrssFeedItem.

realsource :

URL of the real source for the item.

title :

title of the real source.

grss_feed_item_get_real_source ()

void                grss_feed_item_get_real_source      (GrssFeedItem *item,
                                                         const gchar **realsource,
                                                         const gchar **title);

Retrieves references to the real source of item.

item :

a GrssFeedItem.

realsource :

will be assigned to the URL of the real source, or NULL.

title :

will be assigned to the title of the real source, or NULL.

grss_feed_item_set_related ()

void                grss_feed_item_set_related          (GrssFeedItem *item,
                                                         gchar *related);

To set reference to a post related to item.

item :

a GrssFeedItem.

related :

reference to a related post.

grss_feed_item_get_related ()

const gchar *       grss_feed_item_get_related          (GrssFeedItem *item);

Retrieves indication about posts related to item.

item :

a GrssFeedItem.

Returns :

related posts, or NULL.

grss_feed_item_set_copyright ()

void                grss_feed_item_set_copyright        (GrssFeedItem *item,
                                                         gchar *copyright);

To set a copyright reference to item.

item :

a GrssFeedItem.

copyright :

copyright declaration for the item.

grss_feed_item_get_copyright ()

const gchar *       grss_feed_item_get_copyright        (GrssFeedItem *item);

Retrieves copyright reference for the item.

item :

a GrssFeedItem.

Returns :

copyright mark, or NULL.

grss_feed_item_set_author ()

void                grss_feed_item_set_author           (GrssFeedItem *item,
                                                         gchar *author);

To assign an author to the item.

item :

a GrssFeedItem.

author :

name of the author.

grss_feed_item_get_author ()

const gchar *       grss_feed_item_get_author           (GrssFeedItem *item);

Retrieves the author of item.

item :

a GrssFeedItem.

Returns :

author of the item, or NULL.

grss_feed_item_add_contributor ()

void                grss_feed_item_add_contributor      (GrssFeedItem *item,
                                                         gchar *contributor);

To add a contributor to the item.

item :

a GrssFeedItem.

contributor :

name of the contributor for the item.

grss_feed_item_get_contributors ()

const GList *       grss_feed_item_get_contributors     (GrssFeedItem *item);

Retrieves contributors for item.

item :

a GrssFeedItem.

Returns :

list of contributors to the item.

grss_feed_item_set_comments_url ()

void                grss_feed_item_set_comments_url     (GrssFeedItem *item,
                                                         gchar *url);

To assign the URL where to fetch comments for the item.

item :

a GrssFeedItem.

url :

URL where to retrieve comments to the item.

grss_feed_item_get_comments_url ()

const gchar *       grss_feed_item_get_comments_url     (GrssFeedItem *item);

Retrieves the URL where to catch comments to the item.

item :

a GrssFeedItem.

Returns :

URL to parse to read comments for item, or NULL.

grss_feed_item_set_geo_point ()

void                grss_feed_item_set_geo_point        (GrssFeedItem *item,
                                                         double latitude,
                                                         double longitude);

To assign geographic context to the item. Passing -1 as latitude or longitude, the relative value is untouched in the object. This is to easy assignment of coordinates in more than a single step. If both are -1, nothing happens.

item :

a GrssFeedItem.

latitude :

latitude of the point, or -1 to leave the previous one.

longitude :

longitude of the point, or -1 to leave the previous one.

grss_feed_item_get_geo_point ()

gboolean            grss_feed_item_get_geo_point        (GrssFeedItem *item,
                                                         double *latitude,
                                                         double *longitude);

Retrieves the geo reference of the item.

item :

a GrssFeedItem.

latitude :

will be assigned to the latitude of the point, or NULL.

longitude :

will be assigned to the longitude of the point, or NULL.

Returns :

TRUE if item has geographic coordinates assigned and latitude and longitude have been set, FALSE if item has not geo reference.

grss_feed_item_set_publish_time ()

void                grss_feed_item_set_publish_time     (GrssFeedItem *item,
                                                         time_t publish);

To set the publish time of the item.

item :

a GrssFeedItem.

publish :

publishing timestamp of the item.

grss_feed_item_get_publish_time ()

time_t              grss_feed_item_get_publish_time     (GrssFeedItem *item);

Retrieves the publish time of the item. By default this value is the current timestamp assigned when creating the GrssFeedItem, and may be changed with grss_feed_item_set_publish_time().

item :

a GrssFeedItem.

Returns :

publish time of item.

grss_feed_item_add_enclosure ()

void                grss_feed_item_add_enclosure        (GrssFeedItem *item,
                                                         GrssFeedEnclosure *enclosure);

Adds an enclosure to the item. That external elements may be references to images, videos, or other contents (usually multimedial) embedded in the element.

item :

a GrssFeedItem.

enclosure :

a GrssFeedEnclosure to add to the item.

grss_feed_item_get_enclosures ()

const GList *       grss_feed_item_get_enclosures       (GrssFeedItem *item);

Retrieves the list of enclosures added with grss_feed_item_add_enclosure().

item :

a GrssFeedItem.

Returns :

a list of GrssFeedEnclosure. This is a direct reference to the internal list, do not free or modify it.