| Guifications Library Reference Manual |
|---|
GfFeedGfFeed — GfFeed API |
GfFeed;
GfFeed* gf_feed_new (const gchar *name,
GfImage *image,
const gchar *i18n,
const gchar *description);
gchar* gf_feed_get_name (const GfFeed *feed);
GfImage* gf_feed_get_image (const GfFeed *feed);
gchar* gf_feed_get_i18n (const GfFeed *feed);
gchar* gf_feed_get_description (const GfFeed *feed);
GfEvent* gf_feed_add_event (GfFeed *feed,
GfEvent *event);
gboolean gf_feed_remove_event (GfFeed *feed,
GfEvent *event);
void gf_feed_emit_event (const GfFeed *feed,
const gchar *event_name,
const GfEventInfo *event_info);
GfEvent** gf_feed_list_events (const GfFeed *feed,
guint *nevents);
void gf_feed_freev (GfFeed **feeds);
void gf_feed_set_feed_pool (GfFeed *feed,
GfFeedPool *feed_pool);
GfFeedPool* gf_feed_get_feed_pool (const GfFeed *feed);
"description" gchararray : Read / Write / Construct Only "i18n" gchararray : Read / Write / Construct Only "image" GfImage : Read / Write / Construct Only "name" gchararray : Read / Write / Construct Only "pool" GfFeedPool : Read / Write
"event-added" void user_function (GfFeed *gffeed, GfEvent *arg1, gpointer user_data); "event-removed" void user_function (GfFeed *gffeed, GfEvent *arg1, gpointer user_data);
A feed is an incoming transport. As an example, we'll look at how we would do this with gaim.
The Gaim plugin will create a connection to the Guifications daemon via a specific GfConnection. After the connection has been established, the gaim plugin with then register itself as a feed. Upon successful registration, the plugin will then add all of it's events to the feed; sign on, sign off, etc.
Once the feed has been registered, anything can query it for it's list of events, and so on. This way we can display a list of feeds, toggle whether or not they're enabled, and so on.
With this model, a plugin can register multiple feeds, and teh user, at their discretion, can enable and disable those feeds.
typedef struct _GfFeed GfFeed;
GfFeed is an opaque structure that should not be used directly.
GfFeed* gf_feed_new (const gchar *name, GfImage *image, const gchar *i18n, const gchar *description);
Creates a new GfFeed Object.
name : |
The name of the feed. |
image : |
The image the feed should use. |
i18n : |
The translated name of the feed. |
description : |
A short description of the feed. |
| Returns : | A newly created GfFeed Object or NULL. |
gchar* gf_feed_get_name (const GfFeed *feed);
Gets the name from feed.
Note: This value must be freed.
feed : |
The GfFeed. |
| Returns : | The name of feed or NULL.
|
GfImage* gf_feed_get_image (const GfFeed *feed);
Gets the GfImage associated with feed.
gchar* gf_feed_get_i18n (const GfFeed *feed);
Gets the translated name for feed.
Note: This value must be freed.
feed : |
The GfFeed Object. |
| Returns : | The translated name of feed.
|
gchar* gf_feed_get_description (const GfFeed *feed);
Gets the description for feed.
Note: This value must be freed.
feed : |
The GfFeed Object. |
| Returns : | The description of feed.
|
gboolean gf_feed_remove_event (GfFeed *feed, GfEvent *event);
Removes event from feed.
void gf_feed_emit_event (const GfFeed *feed, const gchar *event_name, const GfEventInfo *event_info);
Emits the GfEvent named event_name for feed with the information in event_info.
feed : |
The GfFeed Object. |
event_name : |
The name of the event. |
event_info : |
The GfEventInfo to use. |
GfEvent** gf_feed_list_events (const GfFeed *feed, guint *nevents);
Returns a newly allocated array of GfEvent's for the events in feed.
void gf_feed_freev (GfFeed **feeds);
Free's an array of GfFeed's
feeds : |
An array of GfFeed's |
void gf_feed_set_feed_pool (GfFeed *feed, GfFeedPool *feed_pool);
Sets the GfFeedPool for feed.
Note: This should only be used by GfFeedPool implementations.
feed : |
The GfFeed Object. |
feed_pool : |
The GfFeedPool Object. |
GfFeedPool* gf_feed_get_feed_pool (const GfFeed *feed);
Gets the GfFeedPool to which feed is registered.
feed : |
The GfFeed Object. |
| Returns : | The GfFeedPool or NULL. |
description" property"description" gchararray : Read / Write / Construct Only
The description of this feed.
Default value: NULL
i18n" property"i18n" gchararray : Read / Write / Construct Only
The translated name of this feed.
Default value: NULL
name" property"name" gchararray : Read / Write / Construct Only
The name of this feed.
Default value: NULL
| << GfEventInfo | GfFeedPool >> |