![]() | ![]() | ![]() | Libtlen2 Reference Manual | ![]() |
---|
#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);
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;
void (*TlenEventCallback) (TlenConnection *tc);
Callback executed when new event appeared.
tc : | connection. |
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. |
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. |
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. |
<<< Connection | Utils >>> |