Class
PurpleTags
unstable since: 3.0
Description [src]
final class Purple.Tags : GObject.Object
implements Gio.ListModel {
/* No available fields */
}
Tags is an object that can be used to keep track of arbitrary tags on
objects. Tags are simple strings that use the first ‘:’ to delimit a value.
For example: foo
is a tag with just a name and no value, but foo:bar
is
a tag with a name and value. Also, foo:
is still considered a name and
value, but the value is an empty string.
Please note this distinction when the API calls for a name versus a tag which would be the name and the value.
Available since: 3.0
Instance methods
purple_tags_add
Adds tag
to tags
. If the tag already exists, the existing tag will be replaced.
unstable since: 3.0
purple_tags_add_with_value
Formats name
and value
into a tag and adds it to tags
. If the tag already
exists, the existing tag will be replaced.
unstable since: 3.0
purple_tags_get_all_with_name
Gets a a new tags object with all of the tags that are named name
.
unstable since: 3.0
purple_tags_remove
Removes tag
from tags
. Note that this is the tag name and value not just
the name.
unstable since: 3.0
purple_tags_remove_with_value
A helper function around purple_tags_remove()
that builds the tag variable
from name
and value
.
unstable since: 3.0
purple_tags_to_string
Creates a separator
delimited string containing each item in tags
.
unstable since: 3.0
Methods inherited from GListModel (5)
g_list_model_get_item
Get the item at position
.
g_list_model_get_item_type
Gets the type of the items in list
.
g_list_model_get_n_items
Gets the number of items in list
.
g_list_model_get_object
Get the item at position
.
g_list_model_items_changed
Emits the GListModel::items-changed
signal on list
.
Signals
Purple.Tags::added
Emitted when a tag is added. The tag as well as its name and value are provided to be as flexible as possible.
unstable since: 3.0
Purple.Tags::removed
Emitted when a tag is removed. The tag as well as its name and value are provided to be as flexible as possible.
unstable since: 3.0
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Signals inherited from GListModel (1)
GListModel::items-changed
This signal is emitted whenever items were added to or removed
from list
. At position
, removed
items were removed and added
items were added in their place.