FeedsStore

FeedsStore — abstract class for feeds permanent storage

Stability Level

, unless otherwise indicated

Synopsis

                    FeedsStore;
GList*              feeds_store_get_channels            (FeedsStore *store);
GList*              feeds_store_get_items_by_channel    (FeedsStore *store,
                                                         FeedChannel *channel);
gboolean            feeds_store_has_item                (FeedsStore *store,
                                                         FeedChannel *channel,
                                                         const gchar *id);
void                feeds_store_add_item_in_channel     (FeedsStore *store,
                                                         FeedChannel *channel,
                                                         FeedItem *item);
void                feeds_store_switch                  (FeedsStore *store,
                                                         gboolean run);

Object Hierarchy

  GObject
   +----FeedsStore

Description

FeedsStore is a class which abstracts storage of feeds, implementing some behaviours valid for all. Extensions of this must provide implementation of different callbacks so to permit permanent saving of channels and feeds.

Details

FeedsStore

typedef struct _FeedsStore FeedsStore;


feeds_store_get_channels ()

GList*              feeds_store_get_channels            (FeedsStore *store);

To retrieve list of feeds permanently saved into the store

store :

a FeedsStore

Returns :

list of FeedChannel found in the store. Do not modify or free it

feeds_store_get_items_by_channel ()

GList*              feeds_store_get_items_by_channel    (FeedsStore *store,
                                                         FeedChannel *channel);

To retrieve list of items saved into the store, assigned to the given channel

store :

a FeedsStore

channel :

parent feed containing required items

Returns :

list of FeedItem found in the store. Do not modify or free it

feeds_store_has_item ()

gboolean            feeds_store_has_item                (FeedsStore *store,
                                                         FeedChannel *channel,
                                                         const gchar *id);

To retrieve an item into a feed, given his unique ID

store :

a FeedsStore

channel :

parent feed containing required item

id :

unique ID to look for

Returns :

TRUE if the specified item exists, FALSE otherwise

feeds_store_add_item_in_channel ()

void                feeds_store_add_item_in_channel     (FeedsStore *store,
                                                         FeedChannel *channel,
                                                         FeedItem *item);

To save a new FeedItem into the store. It performs a check to grant item is not already saved

store :

a FeedsStore

channel :

parent feed for the new item

item :

new item to permanently save

feeds_store_switch ()

void                feeds_store_switch                  (FeedsStore *store,
                                                         gboolean run);

This is to permit the store to auto-update itself: it creates an internal FeedsPool and listens for his signals, so to implement the whole loop fetch-parse-save trasparently

store :

a FeedsStore

run :

TRUE to run the store, FALSE to stop