Top | ![]() |
![]() |
![]() |
![]() |
JanaComponentType | jana_component_get_component_type () |
gboolean | jana_component_is_fully_represented () |
gchar * | jana_component_get_uid () |
gchar ** | jana_component_get_categories () |
void | jana_component_set_categories () |
gboolean | jana_component_supports_custom_props () |
GList * | jana_component_get_custom_props_list () |
gchar * | jana_component_get_custom_prop () |
gboolean | jana_component_set_custom_prop () |
void | jana_component_props_list_free () |
JanaComponent is the basic interface for a component in a JanaStore. A component is uniquely identifiable, has a type and optionally, can store custom properties as key-value pairs.
JanaComponentType
jana_component_get_component_type (JanaComponent *self
);
Get the JanaComponentType of self
. The component type will
tell you if the component can be cast to a more specific type.
gboolean
jana_component_is_fully_represented (JanaComponent *self
);
Determines whether the underlying data of self
is fully
represented by the libjana interface. If it isn't, there may be data
in the component that is not reachable via libjana and modifying the
object may destroy this data.
gchar *
jana_component_get_uid (JanaComponent *self
);
Get a unique identifying string for self
. This can be used as the
key in a hash table and does not change when modifying the component. A
JanaComponent that is not a part of a JanaStore may not have a uid.
This function returns a newly allocated string. To avoid this allocation
please use jana_component_peek_uid()
.
gchar **
jana_component_get_categories (JanaComponent *self
);
Retrieves the list of categories this component is filed under. See
jana_component_set_categories()
.
void jana_component_set_categories (JanaComponent *self
,const gchar **categories
);
Sets or clears the component's category list, overriding any previous set.
list. categories
should be an array of NULL
-terminated UTF-8 strings, and
the final member of the array should be NULL
.
gboolean
jana_component_supports_custom_props (JanaComponent *self
);
Determines whether self
supports the setting and retrieval
of custom properties.
GList *
jana_component_get_custom_props_list (JanaComponent *self
);
Get a GList of properties set on self
. The data component of each
list element contains an array of two strings. The first string is the
property name, the second the value. This list can be freed using
jana_component_props_list_free()
.
gchar * jana_component_get_custom_prop (JanaComponent *self
,const gchar *name
);
Retrieve a custom property set on self
.
gboolean jana_component_set_custom_prop (JanaComponent *self
,const gchar *name
,const gchar *value
);
Set a property on self
. If the property has been set previously, the value
will be overwritten. Implementations of JanaComponent may require that
property names conform to a particular specification.
void
jana_component_props_list_free (GList *props
);
Frees a JanaComponent property list, returned by
jana_component_get_custom_props_list()
.
typedef struct _JanaComponent JanaComponent;
The JanaComponent struct contains only private data.