AXEvent
|
The AXEventElementItem and its associated functions. The functions in this module are not thread safe. More...
Go to the source code of this file.
Typedefs | |
typedef struct _AXEventElementItem | AXEventElementItem |
The AXEventElementItem is a n opaque data type representing a node in a tree. | |
Functions | |
AXEventElementItem * | ax_event_element_item_new (const gchar *name, const gchar *name_space) |
Creates a new node in the tree. More... | |
void | ax_event_element_item_free (AXEventElementItem *node) |
Frees an AXEventElementItem . More... | |
gboolean | ax_event_element_item_get_name (AXEventElementItem *node, gchar **name, GError **error) |
Get the name of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_get_name_space (AXEventElementItem *node, gchar **name_space, GError **error) |
Get the name space of the name of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_set_attributes (AXEventElementItem *node, GHashTable *attributes, GError **error) |
Adds attributes to an AXEventElementItem . If called more than once on the same AXEventElementItem , only the attributes provided in the last call are used. The attributes can be removed by providing NULL as attributes. More... | |
gboolean | ax_event_element_item_get_attributes (AXEventElementItem *node, GHashTable **attributes, GError **error) |
Get the attributes of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_set_body (AXEventElementItem *node, const gchar *body, GError **error) |
Set the body of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_get_body (AXEventElementItem *node, gchar **body, GError **error) |
Get the body of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_add_child (AXEventElementItem *node, AXEventElementItem *child, GError **error) |
Add an child to an AXEventElementItem . More... | |
gboolean | ax_event_element_item_get_first_child (AXEventElementItem *parent, AXEventElementItem **child, GError **error) |
Retrieve the first child of an AXEventElementItem . More... | |
gboolean | ax_event_element_item_get_next_child (AXEventElementItem *child, AXEventElementItem **sibling, GError **error) |
Retrieve the sibling of a child. More... | |
The AXEventElementItem and its associated functions. The functions in this module are not thread safe.
Most events require nothing more than a set of keys and primitive type values, but in some cases primitive types are not enough to communicate all the details of an event. Using an AXEventElementItem as a data value enables an application to pass any data, that can be represented by a tree, as a value.
AXEventElementItem* ax_event_element_item_new | ( | const gchar * | name, |
const gchar * | name_space | ||
) |
Creates a new node in the tree.
name | The name of the node |
name_space | The name space the name of the node is part of. |
AXEventElementItem
if successful otherwise NULL. void ax_event_element_item_free | ( | AXEventElementItem * | node | ) |
Frees an AXEventElementItem
.
node | An AXEventElementItem node. |
gboolean ax_event_element_item_get_name | ( | AXEventElementItem * | node, |
gchar ** | name, | ||
GError ** | error | ||
) |
Get the name of an AXEventElementItem
.
node | An AXEventElementItem . |
name | The return location of the name. It's the responsibility of the caller to free the memory returned in this pointer. |
error | The return location for an error or NULL . |
TRUE
if the name was successfully retrieved, otherwise FALSE
. If FALSE
and error
is not NULL, then error
contains a detailed description of the error. gboolean ax_event_element_item_get_name_space | ( | AXEventElementItem * | node, |
gchar ** | name_space, | ||
GError ** | error | ||
) |
Get the name space of the name of an AXEventElementItem
.
node | An AXEventElementItem . |
name_space | The return location of the name space. It's the responsibility of the caller to free the memory returned through this pointer. |
error | The return location for an error or NULL . |
TRUE
if the name space is successfully retrieved, otherwise FALSE
. If FALSE
and error
is not NULL, then error
contains a detailed description of the error. gboolean ax_event_element_item_set_attributes | ( | AXEventElementItem * | node, |
GHashTable * | attributes, | ||
GError ** | error | ||
) |
Adds attributes to an AXEventElementItem
. If called more than once on the same AXEventElementItem
, only the attributes provided in the last call are used. The attributes can be removed by providing NULL
as attributes.
node | An AXEventElementItem . |
attributes | A GHashTable in which the keys and values are strings representing the names and values of the attributes. If NULL is provided, any previously set attributes are removed. |
error | The return location for an error or NULL . |
TRUE
if the attributes were successfully set, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detalied description of the error. gboolean ax_event_element_item_get_attributes | ( | AXEventElementItem * | node, |
GHashTable ** | attributes, | ||
GError ** | error | ||
) |
Get the attributes of an AXEventElementItem
.
node | An AXEventElementItem . |
attributes | The return location for the attributes. It's the responsibility of the caller to free the GHashTable by calling g_hash_table_destroy() . |
error | The return location for an error or NULL . |
TRUE
if the attributes were successfully retrieved, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of the error. gboolean ax_event_element_item_set_body | ( | AXEventElementItem * | node, |
const gchar * | body, | ||
GError ** | error | ||
) |
Set the body of an AXEventElementItem
.
node | An AXEventElementItem . |
body | The body or NULL to remove any previously set body. |
error | The return location for an error or NULL . |
TRUE
if the body was successfully set, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of of the error. gboolean ax_event_element_item_get_body | ( | AXEventElementItem * | node, |
gchar ** | body, | ||
GError ** | error | ||
) |
Get the body of an AXEventElementItem
.
node | An AXEventElementItem . |
body | The return location for the body. It's the responsibilty of the caller to free the memory returned through this pointer. |
error | The return location for an error or NULL . |
TRUE
if the body was successfully retrieved, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of the error. gboolean ax_event_element_item_add_child | ( | AXEventElementItem * | node, |
AXEventElementItem * | child, | ||
GError ** | error | ||
) |
Add an child to an AXEventElementItem
.
node | The parent AXEventElementItem . |
child | The child of the parent. |
error | The return location for an error or NULL . |
TRUE
if the child as successfully added, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of the error. gboolean ax_event_element_item_get_first_child | ( | AXEventElementItem * | parent, |
AXEventElementItem ** | child, | ||
GError ** | error | ||
) |
Retrieve the first child of an AXEventElementItem
.
parent | An AXEventElementItem . |
child | The return location for the child AXEventElementItem . It's the responsibility of the caller to free the memory returned through this pointer. |
error | The return location for an error or NULL . |
TRUE
if successfull, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of the error. gboolean ax_event_element_item_get_next_child | ( | AXEventElementItem * | child, |
AXEventElementItem ** | sibling, | ||
GError ** | error | ||
) |
Retrieve the sibling of a child.
child | An AXEventElementItem . |
sibling | The return location for the next sibling. If the last sibling has been reached, NULL is returned. |
error | The return location for an error or NULL . |
TRUE
if successfull, otherwise FALSE
. If FALSE
and error
is not NULL
, then error
contains a detailed description of the error.