![]() |
![]() |
![]() |
libleaftag Reference Manual | ![]() |
---|---|---|---|---|
LtTag; LtTag* lt_create_tag (const char *tag_name); LtTag* lt_tag_lookup (const char *tag_name); GList* lt_tag_lookup_many (GList *tag_names); void lt_tag_delete (LtTag *tag); const char* lt_tag_get_name (const LtTag *tag); void lt_tag_set_hidden (LtTag *tag, gboolean hidden); gboolean lt_tag_get_hidden (const LtTag *tag); void lt_tag_set_description (LtTag *tag, const char *description); const char* lt_tag_get_description (const LtTag *tag); void lt_tag_set_image (LtTag *tag, const char *image_path); const char* lt_tag_get_image (const LtTag *tag); GList* lt_tag_get_sources (const LtTag *tag, const char *schema); GList* lt_get_all_tags (void); GList* lt_get_visible_tags (void); gboolean lt_get_tag_name_valid (const char *tag_name); gboolean lt_get_tag_names_valid (GList *tag_names);
"description" gchararray : Read / Write "hidden" gboolean : Read / Write "image" gchararray : Read / Write "name" gchararray : Read / Write / Construct Only
typedef struct _LtTag LtTag;
The LtTag struct contains private data only, and should be manipulated using the functions below.
LtTag* lt_create_tag (const char *tag_name);
Creates a new tag.
tag_name : |
The tag to create |
Returns : | The new LtTag object. |
LtTag* lt_tag_lookup (const char *tag_name);
Look up an existing tag.
tag_name : |
The tag to look up |
Returns : | An LtTag object |
GList* lt_tag_lookup_many (GList *tag_names);
Look up a set of existing tags.
tag_names : |
A list of tag names to look up |
Returns : | A list of LtTag objects. |
void lt_tag_delete (LtTag *tag);
Deletes a tag and any associations made to sources.
tag : |
An LtTag. |
const char* lt_tag_get_name (const LtTag *tag);
Retrieve the name of a tag.
tag : |
An LtTag |
Returns : | the name of the tag. |
void lt_tag_set_hidden (LtTag *tag, gboolean hidden);
Set the hidden status of a tag. Hidden tags will generally not be shown in lists of tags.
tag : |
An LtTag |
hidden : |
Whether the tag should be hidden |
gboolean lt_tag_get_hidden (const LtTag *tag);
Look up whether a tag is marked as hidden.
tag : |
An LtTag |
Returns : | TRUE if the tag is hidden. |
void lt_tag_set_description (LtTag *tag, const char *description);
Set the description for a tag.
tag : |
An LtTag |
description : |
The new description |
const char* lt_tag_get_description (const LtTag *tag);
Look up the description for a tag.
tag : |
An LtTag |
Returns : | The description as previously set. |
void lt_tag_set_image (LtTag *tag, const char *image_path);
Sets the image for a tag.
tag : |
An LtTag |
image_path : |
A string describing an image. This can be either a filename or a stock ID. |
const char* lt_tag_get_image (const LtTag *tag);
Look up the image for a tag.
tag : |
An LtTag |
Returns : | A string describing an image. This can be either a filename or a stock ID. |
GList* lt_tag_get_sources (const LtTag *tag, const char *schema);
Look up sources for a tag.
tag : |
An LtTag |
schema : |
A schema to filter by. If this is NULL, sources for this tag in all schemas will be returned. |
Returns : | A list of LtSource objects. |
GList* lt_get_all_tags (void);
Retrieve all tags on the system.
Returns : | A list of LtTag objects. |
GList* lt_get_visible_tags (void);
Retrieve all tags which are not marked as hidden.
Returns : | A list of LtTag objects. |
gboolean lt_get_tag_name_valid (const char *tag_name);
Check a tag name to see if it is valid. Valid names do not contain any of
the following set of characters: \t\n\r()
[]<>+,'"
tag_name : |
A tag name |
Returns : | TRUE if the tag name is valid. |