![]() |
![]() |
![]() |
libjana Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites |
JanaComponent; enum JanaComponentType; JanaComponentType jana_component_get_component_type (JanaComponent *self
); gboolean jana_component_is_fully_represented (JanaComponent *self
); gchar * jana_component_get_uid (JanaComponent *self
); gchar ** jana_component_get_categories (JanaComponent *self
); void jana_component_set_categories (JanaComponent *self
,const gchar **categories
); gboolean jana_component_supports_custom_props (JanaComponent *self
); GList * jana_component_get_custom_props_list (JanaComponent *self
); gchar * jana_component_get_custom_prop (JanaComponent *self
,const gchar *name
); gboolean jana_component_set_custom_prop (JanaComponent *self
,const gchar *name
,const gchar *value
); void jana_component_props_list_free (GList *props
);
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.
typedef struct _JanaComponent JanaComponent;
The JanaComponent struct contains only private data.
typedef enum { JANA_COMPONENT_NULL, JANA_COMPONENT_EVENT, JANA_COMPONENT_NOTE, JANA_COMPONENT_TASK, } JanaComponentType;
Enum values for different types of component.
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.
|
A JanaComponent |
Returns : |
The JanaComponentType of self . |
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.
|
A JanaComponent |
Returns : |
TRUE if the underlying data of self is fully represented by the
libjana interface. |
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()
.
|
A JanaComponent |
Returns : |
The unique identifier of self . |
gchar ** jana_component_get_categories (JanaComponent *self
);
Retrieves the list of categories this component is filed under. See
jana_component_set_categories()
.
|
A JanaComponent |
Returns : |
A newly allocated, NULL-terminated string array, containing the
component categories, to be freed with g_strfreev() . |
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
.
|
A JanaComponent |
|
A NULL -terminated array of strings, or NULL
|
gboolean jana_component_supports_custom_props
(JanaComponent *self
);
Determines whether self
supports the setting and retrieval
of custom properties.
|
A JanaComponent |
Returns : |
TRUE if self supports custom properties, FALSE otherwise. |
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()
.
|
A JanaComponent |
Returns : |
A GList containing the properties set on self . |
gchar * jana_component_get_custom_prop (JanaComponent *self
,const gchar *name
);
Retrieve a custom property set on self
.
|
A JanaComponent |
|
The key name of the property |
Returns : |
A string associated with the custom property, name , or NULL
if the property has not been set. |
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.
|
A JanaComponent |
|
The key name of the property |
|
The value of the property |
Returns : |
TRUE if the property was set successfully, FALSE otherwise. |
void jana_component_props_list_free (GList *props
);
Frees a JanaComponent property list, returned by
jana_component_get_custom_props_list()
.
|
A property list returned by jana_component_get_custom_props_list()
|