Events

Name

Events -- 

Synopsis



#define     TLEN_EVENT_PRESENCE             (x)
#define     TLEN_EVENT_ROSTER               (x)
#define     TLEN_EVENT_MESSAGE              (x)
#define     TLEN_EVENT_PUBDIR               (x)
enum        TlenEventType;
struct      TlenEvent;
void        (*TlenEventCallback)            (TlenConnection *tc);
TlenEvent*  tlen_event_new                  (TlenEventType type);
void        tlen_event_free                 (TlenEvent *ev);
gboolean    tlen_event_add                  (TlenConnection *tc,
                                             TlenEvent *event);
gboolean    tlen_event_clear                (TlenConnection *tc);

Description

Details

TLEN_EVENT_PRESENCE()

#define TLEN_EVENT_PRESENCE(x) ((TlenEventPresence*)(x->event))

x :


TLEN_EVENT_ROSTER()

#define TLEN_EVENT_ROSTER(x) ((TlenEventRoster*)(x->event))

x :


TLEN_EVENT_MESSAGE()

#define TLEN_EVENT_MESSAGE(x) ((TlenEventMessage*)(x->event))

x :


TLEN_EVENT_PUBDIR()

#define TLEN_EVENT_PUBDIR(x) ((TlenEventPubdir*)(x->event))

x :


enum TlenEventType

typedef enum{
  TLEN_EVENT_UNKNOWN          = 0,
  TLEN_EVENT_CONNECTED,
  TLEN_EVENT_CONNECTION_FAILED,
  TLEN_EVENT_DISCONNECTED,
  TLEN_EVENT_UNAUTHORIZED,
  TLEN_EVENT_LOGGED,
  TLEN_EVENT_PRESENCE,            /* TlenEventPresence  */
  TLEN_EVENT_ROSTER,              /* TlenEventRoster    */
  TLEN_EVENT_MESSAGE,             /* TlenEventMessage   */
  TLEN_EVENT_CRITICAL_FAILURE,
  TLEN_EVENT_PUBDIR,
  TLEN_EVENT_PUBDIR_CHANGED,
  TLEN_EVENT_SEARCH,
  TLEN_EVENT_NEWMAIL,
  TLEN_EVENT_WEBMSG,
  TLEN_EVENT_FILE,
} TlenEventType;


struct TlenEvent

struct TlenEvent {

  gpointer event;
  TlenEventType type;
};


TlenEventCallback ()

void        (*TlenEventCallback)            (TlenConnection *tc);

Callback executed when new event appeared.

tc :

connection.


tlen_event_new ()

TlenEvent*  tlen_event_new                  (TlenEventType type);

Create new event.

type :

event type to create.

Returns :

new event of type type or NULL if error occured.


tlen_event_free ()

void        tlen_event_free                 (TlenEvent *ev);

Free event memory.

ev :

event to free.


tlen_event_add ()

gboolean    tlen_event_add                  (TlenConnection *tc,
                                             TlenEvent *event);

Add new event to the end of events lists associated with tc.

tc :

TlenConnection to use.

event :

event to add.

Returns :

TRUE if event was added succesfully, FALSE otherwise.


tlen_event_clear ()

gboolean    tlen_event_clear                (TlenConnection *tc);

Remove all events from the events list associated with tc.

tc :

TlenConnection to use.

Returns :

TRUE if list was cleared, FALSE otherwise.