LtSource

LtSource — An object describing a tagged item.

Synopsis




            LtSource;
LtSource*   lt_create_source                (const char *uri);
LtSource*   lt_source_lookup                (const char *uri);
GList*      lt_source_lookup_many           (GList *uris);
void        lt_source_delete                (LtSource *source);
void        lt_source_set_uri               (LtSource *source,
                                             const char *new_uri);
const char* lt_source_get_uri               (const LtSource *source);
const char* lt_source_get_filename          (const LtSource *source);
const char* lt_source_get_schema            (const LtSource *source);
void        lt_source_tag                   (LtSource *source,
                                             GList *tags);
void        lt_source_tag_with_names        (LtSource *source,
                                             GList *tag_names);
void        lt_source_untag                 (LtSource *source,
                                             GList *tags);
void        lt_source_untag_with_names      (LtSource *source,
                                             GList *tag_names);
GList*      lt_source_get_tags              (const LtSource *source);
GList*      lt_get_all_sources              (void);
GList*      lt_get_sources_with_schema      (const char *schema);
GList*      lt_get_sources_with_tags        (GList *tags,
                                             const char *schema);
GList*      lt_get_sources_with_tag_names   (GList *tag_names,
                                             const char *schema);

Object Hierarchy


  GObject
   +----LtObject
         +----LtSource

Properties


  "schema"               gchararray            : Read
  "uri"                  gchararray            : Read / Write / Construct

Signals


"tags-changed"
            void        user_function      (LtSource *source,
                                            gpointer  user_data)      : Run last / Action

Description

The LtSource object refers to an item (uri) to be tagged.

Details

LtSource

typedef struct _LtSource LtSource;

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


lt_create_source ()

LtSource*   lt_create_source                (const char *uri);

Look up a source referring to a URI. If there is not already a source for this URI, it will be created.

uri : The URI of the item.
Returns : A new LtSource

lt_source_lookup ()

LtSource*   lt_source_lookup                (const char *uri);

Look up a source referring to a URI.

uri : The URI of the item.
Returns : A new LtSource referring to the URI. If this item has no existing tags, this will return NULL.

lt_source_lookup_many ()

GList*      lt_source_lookup_many           (GList *uris);

Look up LtSource objects for multiple URIs.

uris : A list of URIs to look up.
Returns : A list of LtSource objects.

lt_source_delete ()

void        lt_source_delete                (LtSource *source);

Deletes a source and any associations made to tags.

source : The source to delete.

lt_source_set_uri ()

void        lt_source_set_uri               (LtSource *source,
                                             const char *new_uri);

Set the URI for a source

source : An LtSource
new_uri : The URI to set

lt_source_get_uri ()

const char* lt_source_get_uri               (const LtSource *source);

Get the URI for a source.

source : An LtSource
Returns : The URI of the source.

lt_source_get_filename ()

const char* lt_source_get_filename          (const LtSource *source);

Get the filename for a source. The URI schema of the source must be "file".

source : An LtSource
Returns : The filename of the source.

lt_source_get_schema ()

const char* lt_source_get_schema            (const LtSource *source);

Get the schema for a source.

source : An LtSource
Returns : The schema.

lt_source_tag ()

void        lt_source_tag                   (LtSource *source,
                                             GList *tags);

Tag a source with a set of tags. This only adds associations, preserving existing tags.

source : An LtSource
tags : A list of LtTag objects

lt_source_tag_with_names ()

void        lt_source_tag_with_names        (LtSource *source,
                                             GList *tag_names);

Tag a source with a set of tags. This only adds associations, preserving existing tags.

source : An LtSource
tag_names : A list of tag names

lt_source_untag ()

void        lt_source_untag                 (LtSource *source,
                                             GList *tags);

Remove a set of associations from a source.

source : An LtSource
tags : A list of LtTag objects

lt_source_untag_with_names ()

void        lt_source_untag_with_names      (LtSource *source,
                                             GList *tag_names);

Remove a set of associations from a source.

source : An LtSource
tag_names : A list of tag names

lt_source_get_tags ()

GList*      lt_source_get_tags              (const LtSource *source);

Returns a list of tags on the specified source.

source : An LtSource
Returns : The tag objects associated with the source.

lt_get_all_sources ()

GList*      lt_get_all_sources              (void);

Look up all tagged sources.

Returns : A list of all tagged sources.

lt_get_sources_with_schema ()

GList*      lt_get_sources_with_schema      (const char *schema);

Look up tagged sources with the specified schema.

schema : The schema.
Returns : The list of tagged sources.

lt_get_sources_with_tags ()

GList*      lt_get_sources_with_tags        (GList *tags,
                                             const char *schema);

Look up all sources tagged with the specified tags. This optionally takes a schema to match against. It can be NULL.

tags : The list of tag objects to match against.
schema : The optional schema to match against, or NULL.
Returns : The list of sources.

lt_get_sources_with_tag_names ()

GList*      lt_get_sources_with_tag_names   (GList *tag_names,
                                             const char *schema);

Look up all sources tagged with the specified tag names. This optionally takes a schema to match against. It can be NULL.

tag_names : The list of tag names to match against.
schema : The optional schema to match against, or NULL.
Returns : The list of sources.

Property Details

The "schema" property

  "schema"               gchararray            : Read

The schema of the source's URI.

Default value: NULL


The "uri" property

  "uri"                  gchararray            : Read / Write / Construct

The URI of the source.

Default value: NULL

Signal Details

The "tags-changed" signal

void        user_function                  (LtSource *source,
                                            gpointer  user_data)      : Run last / Action

The ::tags-changed signal is emitted when the tags associated with this source are changed.

source : An LtSource
user_data : user data set when the signal handler was connected.