AXEvent
ax_event_handler.h
Go to the documentation of this file.
1 #ifndef _AX_EVENT_HANDLER_H_
2 #define _AX_EVENT_HANDLER_H_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
19 typedef struct _AXEventHandler AXEventHandler;
20 
33 typedef void (*AXSubscriptionCallback)(guint subscription,
34  AXEvent *event,
35  gpointer user_data);
36 
47 typedef void (*AXDeclarationCompleteCallback)(guint declaration,
48  gpointer user_data);
49 
57 
65 void
67 
88 gboolean
90  AXEventKeyValueSet *key_value_set,
91  gboolean stateless,
92  guint *declaration,
94  gpointer user_data,
95  GError **error);
96 
117 gboolean
119  const char *event_template,
120  AXEventKeyValueSet *key_value_set,
121  guint *declaration,
123  gpointer user_data,
124  GError **error);
125 
139 gboolean
141  guint declaration,
142  GError **error);
143 
158 gboolean
160  guint declaration,
161  AXEvent *event,
162  GError **error);
163 
184 gboolean
186  AXEventKeyValueSet *key_value_set,
187  guint *subscription,
188  AXSubscriptionCallback callback,
189  gpointer user_data,
190  GError **error);
191 
204 gboolean
206  guint subscription,
207  GError **error);
208 
209 #ifdef __cplusplus
210 }
211 #endif
212 
213 #endif /* _AX_EVENT_HANDLER_H_ */
gboolean ax_event_handler_unsubscribe(AXEventHandler *event_handler, guint subscription, GError **error)
Unsubscribes from an event or a set of events.
struct _AXEventHandler AXEventHandler
The AXEventHandler is an opaque data type used as an entry point into the event system.
Definition: ax_event_handler.h:19
struct _AXEventKeyValueSet AXEventKeyValueSet
The AXEventKeyValueSet is an opaque data type required to create event declarations, event subscription and for receiving events.
Definition: ax_event_key_value_set.h:73
void ax_event_handler_free(AXEventHandler *event_handler)
Destroys an AXEventHandler an deallocates all associated declarations and subscriptions. Any pending callbacks associated with the AXEventHandler will be cancelled.
gboolean ax_event_handler_subscribe(AXEventHandler *event_handler, AXEventKeyValueSet *key_value_set, guint *subscription, AXSubscriptionCallback callback, gpointer user_data, GError **error)
Subscribes to an event or a set of events.
struct _AXEvent AXEvent
The AXEvent is an opaque data type required to send and receive events.
Definition: ax_event.h:30
void(* AXSubscriptionCallback)(guint subscription, AXEvent *event, gpointer user_data)
This is the prototype of the callback function called whenever an event matching a subscription is re...
Definition: ax_event_handler.h:33
gboolean ax_event_handler_declare_from_template(AXEventHandler *event_handler, const char *event_template, AXEventKeyValueSet *key_value_set, guint *declaration, AXDeclarationCompleteCallback callback, gpointer user_data, GError **error)
Declares a new event based upon an event template.
gboolean ax_event_handler_send_event(AXEventHandler *event_handler, guint declaration, AXEvent *event, GError **error)
Sends an event.
void(* AXDeclarationCompleteCallback)(guint declaration, gpointer user_data)
This is the prototype of the callback function called when a declaration has registered with the even...
Definition: ax_event_handler.h:47
gboolean ax_event_handler_undeclare(AXEventHandler *event_handler, guint declaration, GError **error)
Undeclares an event. Any pending callbacks associated with the declaration will be cancelled...
gboolean ax_event_handler_declare(AXEventHandler *event_handler, AXEventKeyValueSet *key_value_set, gboolean stateless, guint *declaration, AXDeclarationCompleteCallback callback, gpointer user_data, GError **error)
Declares a new event.
AXEventHandler * ax_event_handler_new(void)
Creates a new AXEventHandler.