GfFeed

GfFeed — GfFeed API

Synopsis




            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);

Object Hierarchy


  GObject
   +----GfObject
         +----GfFeed

Properties


  "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

Signal Prototypes


"event-added"
            void        user_function      (GfFeed *gffeed,
                                            GfEvent *arg1,
                                            gpointer user_data);
"event-removed"
            void        user_function      (GfFeed *gffeed,
                                            GfEvent *arg1,
                                            gpointer user_data);

Description

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.

Details

GfFeed

typedef struct _GfFeed GfFeed;

GfFeed is an opaque structure that should not be used directly.


gf_feed_new ()

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.

gf_feed_get_name ()

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.

gf_feed_get_image ()

GfImage*    gf_feed_get_image               (const GfFeed *feed);

Gets the GfImage associated with feed.

feed : The GfFeed Object.
Returns : The GfImage associated with feed or NULL.

gf_feed_get_i18n ()

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.

gf_feed_get_description ()

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.

gf_feed_add_event ()

GfEvent*    gf_feed_add_event               (GfFeed *feed,
                                             GfEvent *event);

Adds event to feed.

feed : The GfFeed Object.
event : The GfEvent to add.
Returns : Either a new GfEvent for the original event with an extra reference or NULL.

gf_feed_remove_event ()

gboolean    gf_feed_remove_event            (GfFeed *feed,
                                             GfEvent *event);

Removes event from feed.

feed : The GfFeed Object.
event : The GfEvent to remove.
Returns : TRUE on success, FALSE on failure.

gf_feed_emit_event ()

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.

gf_feed_list_events ()

GfEvent**   gf_feed_list_events             (const GfFeed *feed,
                                             guint *nevents);

Returns a newly allocated array of GfEvent's for the events in feed.

feed : The GfFeed instance.
nevents : The return address for the number of events.
Returns : A newly allocated array of GfEvent's.

gf_feed_freev ()

void        gf_feed_freev                   (GfFeed **feeds);

Free's an array of GfFeed's

feeds : An array of GfFeed's

gf_feed_set_feed_pool ()

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.

gf_feed_get_feed_pool ()

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.

Properties

The "description" property

  "description"          gchararray            : Read / Write / Construct Only

The description of this feed.

Default value: NULL


The "i18n" property

  "i18n"                 gchararray            : Read / Write / Construct Only

The translated name of this feed.

Default value: NULL


The "image" property

  "image"                GfImage               : Read / Write / Construct Only

The image for the feed.


The "name" property

  "name"                 gchararray            : Read / Write / Construct Only

The name of this feed.

Default value: NULL


The "pool" property

  "pool"                 GfFeedPool            : Read / Write

The pool this feed is in.

Signals

The "event-added" signal

void        user_function                  (GfFeed *gffeed,
                                            GfEvent *arg1,
                                            gpointer user_data);

gffeed : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.

The "event-removed" signal

void        user_function                  (GfFeed *gffeed,
                                            GfEvent *arg1,
                                            gpointer user_data);

gffeed : the object which received the signal.
arg1 :
user_data : user data set when the signal handler was connected.