LtTag

LtTag — An object describing a tag.

Synopsis




            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);

Object Hierarchy


  GObject
   +----LtObject
         +----LtTag

Properties


  "description"          gchararray            : Read / Write
  "hidden"               gboolean              : Read / Write
  "image"                gchararray            : Read / Write
  "name"                 gchararray            : Read / Write / Construct Only

Signals


"sources-changed"
            void        user_function      (LtTag   *tag,
                                            gpointer user_data)      : Run last / Action

Description

The LtTag object is used to retrieve and manipulate properties of tags.

Details

LtTag

typedef struct _LtTag LtTag;

The LtTag struct contains private data only, and should be manipulated using the functions below.


lt_create_tag ()

LtTag*      lt_create_tag                   (const char *tag_name);

Creates a new tag.

tag_name : The tag to create
Returns : The new LtTag object.

lt_tag_lookup ()

LtTag*      lt_tag_lookup                   (const char *tag_name);

Look up an existing tag.

tag_name : The tag to look up
Returns : An LtTag object

lt_tag_lookup_many ()

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.

lt_tag_delete ()

void        lt_tag_delete                   (LtTag *tag);

Deletes a tag and any associations made to sources.

tag : An LtTag.

lt_tag_get_name ()

const char* lt_tag_get_name                 (const LtTag *tag);

Retrieve the name of a tag.

tag : An LtTag
Returns : the name of the tag.

lt_tag_set_hidden ()

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

lt_tag_get_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.

lt_tag_set_description ()

void        lt_tag_set_description          (LtTag *tag,
                                             const char *description);

Set the description for a tag.

tag : An LtTag
description : The new description

lt_tag_get_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.

lt_tag_set_image ()

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.

lt_tag_get_image ()

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.

lt_tag_get_sources ()

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.

lt_get_all_tags ()

GList*      lt_get_all_tags                 (void);

Retrieve all tags on the system.

Returns : A list of LtTag objects.

lt_get_visible_tags ()

GList*      lt_get_visible_tags             (void);

Retrieve all tags which are not marked as hidden.

Returns : A list of LtTag objects.

lt_get_tag_name_valid ()

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.

lt_get_tag_names_valid ()

gboolean    lt_get_tag_names_valid          (GList *tag_names);

Check a set of tag names to see if they are valid. Valid names do not contain any of the following set of characters: \t\n\r()[]<>+,'"

tag_names : A list of tag names
Returns : TRUE if the all of the tag names are valid.

Property Details

The "description" property

  "description"          gchararray            : Read / Write

The tag's description.

Default value: NULL


The "hidden" property

  "hidden"               gboolean              : Read / Write

The hidden state of the tag.

Default value: FALSE


The "image" property

  "image"                gchararray            : Read / Write

The tag's image.

Default value: NULL


The "name" property

  "name"                 gchararray            : Read / Write / Construct Only

The name of the tag.

Default value: NULL

Signal Details

The "sources-changed" signal

void        user_function                  (LtTag   *tag,
                                            gpointer user_data)      : Run last / Action

The ::sources-changed signal is emitted when sources are either tagged or untagged with this tag.

tag : An LtTag
user_data : user data set when the signal handler was connected.