Top |
char * | delimiter-chars | Read / Write |
gpointer | filter-data | Read / Write |
gpointer | filter-function | Read / Write |
gboolean | invalid | Read / Write |
gpointer | match-data | Read / Write |
gpointer | match-function | Read / Write |
gboolean | modified | Read / Write |
char * | placeholder-text | Read / Write |
gpointer | sanitize-data | Read / Write |
gpointer | sanitize-function | Read / Write |
gpointer | sort-data | Read / Write |
gpointer | sort-function | Read / Write |
GStrv | tags | Read / Write |
void | activate | Run First |
void | invalid-changed | Run First |
void | modified-changed | Run First |
void | tag-added | Run First |
void | tag-removed | Run First |
GnuiTaggedEntry implements GtkAccessible, GtkBuildable, GtkConstraintTarget and GtkEditable.
GnuiTaggedEntry
is a text entry widget that lets the user provide an
array of strings (namely tags).
gboolean (*GnuiTaggedEntryFilterFunc) (GnuiTaggedEntry *self
,const gchar *tag
,gpointer user_data
);
A function type for determining whether a tag can be added
It is granted that the strings passed to the filter function are always
non-NULL
and with a length greater than zero, therefore the filter
function must not check for NULL
or ""
.
self |
The tagged entry. |
[auto][not nullable] |
tag |
The tag to check. |
[auto][not nullable][non-zero length][transfer none] |
user_data |
The “filter-data” property. |
[auto][nullable][closure] |
gboolean (*GnuiTaggedEntryMatchFunc) (const gchar *entry_tag
,const gchar *other_tag
,gpointer user_data
);
A function type for determining whether two tags match
The first argument passed to the match function is always a tag already in the entry, while the second argument is what is being checked for equality.
It is granted that the strings passed to the match function are always
non-NULL
and with a length greater than zero, therefore the match
function must not check for NULL
or ""
.
entry_tag |
A tag from the tagged entry. |
[auto][not nullable][non-zero length][transfer none] |
other_tag |
A
string to compare with |
[auto][not nullable][non-zero length][transfer none] |
user_data |
The “match-data” property. |
[auto][nullable][closure] |
gchar * (*GnuiTaggedEntrySanitizeFunc) (GnuiTaggedEntry *self
,const gchar *tag
,gpointer user_data
);
A function type for allocating the strings that are added to the tagged entry as tags based on the given input
It is granted that the strings passed to the sanitize function are always
non-NULL
and with a length greater than zero, therefore the sanitize
function must not check for NULL
or ""
.
If tag
must not be inserted this function must return NULL
.
self |
The tagged entry. |
[auto][not nullable] |
tag |
The tag to sanitize. |
[auto][not nullable][non-zero length][transfer none] |
user_data |
The “sanitize-data” property. |
[auto][nullable][closure] |
gint (*GnuiTaggedEntrySortFunc) (const gchar *tag_1
,const gchar *tag_2
,gpointer user_data
);
A function type for sorting the tags added to the tagged entry
It is granted that the strings passed to the sort function are always
non-NULL
and with a length greater than zero, therefore the sort function
must not check for NULL
or ""
.
tag_1 |
The first tag. |
[auto][not nullable][non-zero length][transfer none] |
tag_2 |
The second tag. |
[auto][not nullable][non-zero length][transfer none] |
user_data |
The “sort-data” property. |
[auto][nullable][closure] |
gboolean gnui_tagged_entry_has_tag (GnuiTaggedEntry * const self
,const gchar * const tag
);
Get whether a tagged entry has a particular tag
A tagged entry must always have a match function; if the
“match-function” property is set to NULL
literal equality
checks between strings will be performed in order to find the given tag.
gboolean gnui_tagged_entry_remove_tag (GnuiTaggedEntry * const self
,const gchar * const tag
);
Remove a particular tag from a tagged entry
A tagged entry must always have a match function; if the
“match-function” property is set to NULL
literal equality
checks between strings will be performed in order to find the tag to
remove.
void
gnui_tagged_entry_remove_all_tags (GnuiTaggedEntry * const self
);
Remove all the tags from a tagged entry
gboolean gnui_tagged_entry_populate (GnuiTaggedEntry * const self
,const gboolean pinned
,...
);
Clear and populate a tagged entry
gboolean gnui_tagged_entry_populate_strv (GnuiTaggedEntry * const self
,const gchar * const * const tags
,const gboolean pinned
);
Clear and populate a tagged entry, using an array of strings as input
self |
The tagged entry to populate. |
[not nullable] |
tags |
An array containing zero or more
strings to insert into the tagged entry as tags, followed by
|
[transfer none][nullable] |
pinned |
Whether the tags added must be pinned |
gboolean gnui_tagged_entry_add_tag (GnuiTaggedEntry * const self
,const gchar * const tag
,const gboolean pinned
);
Add a a tag to a tagged entry
gboolean gnui_tagged_entry_add_tags (GnuiTaggedEntry * const self
,const gboolean pinned
,...
);
Add a group of tags to a tagged entry
gsize gnui_tagged_entry_parse_expression (GnuiTaggedEntry * const self
,const gchar * const expression
,const gboolean pinned
);
Parse a delimited string and add its tags to a tagged entry
gboolean gnui_tagged_entry_rename_tag (GnuiTaggedEntry * const self
,const gchar * const old_name
,const gchar * const new_name
);
Rename a particular tag in a tagged entry
A tagged entry must always have a match function; if the
“match-function” property is set to NULL
, in order to find
the tag to rename literal equality checks between strings will be
performed.
gboolean gnui_tagged_entry_set_pin (GnuiTaggedEntry * const self
,const gchar * const tag
,const gboolean pinned
);
Pin/unpin a given tag
A tagged entry must always have a match function; if the
“match-function” property is set to NULL
, in order to find
the tag to pin/unpin literal equality checks between strings will be
performed.
gboolean gnui_tagged_entry_set_pins (GnuiTaggedEntry * const self
,const gboolean pinned
,...
);
Pin/unpin a group of tags
A tagged entry must always have a match function; if the
“match-function” property is set to NULL
, in order to find
the tag to pin/unpin literal equality checks between strings will be
performed.
void
gnui_tagged_entry_activate (GnuiTaggedEntry * const self
);
Activate a tagged entry (similar to pressing ENTER
)
const gchar *
gnui_tagged_entry_get_delimiter_chars (GnuiTaggedEntry * const self
);
Get the delimiter characters of a tagged entry
[get-property delimiter-chars]
void gnui_tagged_entry_set_delimiter_chars (GnuiTaggedEntry * const self
,const gchar *delimiter_chars
);
Set the delimiter characters of a tagged entry
If no delimiters are set, new tags can be added only by activating the
tagged entry (usually by pressing ENTER
).
[set-property delimiter-chars]
gpointer
gnui_tagged_entry_get_filter_data (GnuiTaggedEntry * const self
);
Get the closure data passed to the “filter-function”
[get-property filter-data]
void gnui_tagged_entry_set_filter_data (GnuiTaggedEntry * const self
,const gpointer filter_data
);
Set the closure data passed to the “filter-function”
If later you need to destroy filter_data
, connect the address to the
tagged entry's “destroy” signal.
1 2 3 4 5 6 |
g_signal_connect_swapped( my_tagged_entry, "destroy", G_CALLBACK(my_destroy_listener), filter_data ); |
[set-property filter-data]
self |
The tagged entry. |
[not nullable] |
filter_data (nullable) |
The closure data to pass to the “filter-function” |
GnuiTaggedEntryFilterFunc
gnui_tagged_entry_get_filter_function (GnuiTaggedEntry * const self
);
Get the function that determines whether a tag can be added
[get-property filter-function]
void gnui_tagged_entry_set_filter_function (GnuiTaggedEntry * const self
,const GnuiTaggedEntryFilterFunc filter_func
);
Set the function that determines whether a tag can be added
It is granted that the strings passed to the filter function are always
non-NULL
and with a length greater than zero, therefore the filter
function must not check for NULL
or ""
.
[set-property filter-function]
gboolean
gnui_tagged_entry_get_invalid (GnuiTaggedEntry * const self
);
Get whether the tagged entry is in invalid state
[get-property invalid]
void gnui_tagged_entry_set_invalid (GnuiTaggedEntry * const self
,const gboolean invalid
);
Set whether the tagged entry is in invalid state
[set-property invalid]
gpointer
gnui_tagged_entry_get_match_data (GnuiTaggedEntry * const self
);
Get the closure data passed to the “match-function”
[get-property match-data]
void gnui_tagged_entry_set_match_data (GnuiTaggedEntry * const self
,const gpointer match_data
);
Set the closure data passed to the “match-function”
If later you need to destroy match_data
, connect the address to the tagged
entry's “destroy” signal.
1 2 3 4 5 6 |
g_signal_connect_swapped( my_tagged_entry, "destroy", G_CALLBACK(my_destroy_listener), match_data ); |
[set-property match-data]
self |
The tagged entry. |
[not nullable] |
match_data |
The closure data to pass to the “match-function”. |
[nullable] |
GnuiTaggedEntryMatchFunc
gnui_tagged_entry_get_match_function (GnuiTaggedEntry * const self
);
Get the function that determines whether two tags match
[get-property match-function]
void gnui_tagged_entry_set_match_function (GnuiTaggedEntry * const self
,const GnuiTaggedEntryMatchFunc match_func
);
Set the function that determines whether two tags match
The first argument passed to the match function is always a tag already in the entry, whereas the second argument is what is being checked for equality.
It is granted that the strings passed to the match function are always
non-NULL
and with a length greater than zero, therefore the match
function must not check for NULL
or ""
.
A tagged entry must always have a match function; if match_func
is set to
NULL
a literal equality check between string will be used as the match
function.
[set-property match-function]
gboolean
gnui_tagged_entry_get_modified (GnuiTaggedEntry * const self
);
Get whether the tagged entry has been modified by the user
[get-property modified]
void gnui_tagged_entry_set_modified (GnuiTaggedEntry * const self
,const gboolean modified
);
Set whether the tagged entry has been modified by the user
[set-property modified]
const char *
gnui_tagged_entry_get_placeholder_text
(GnuiTaggedEntry * const self
);
Get the text that must be displayed when the tagged entry is empty
[get-property placeholder-text]
void gnui_tagged_entry_set_placeholder_text (GnuiTaggedEntry * const self
,const char * const placeholder_text
);
Set the text that must be displayed when the tagged entry is empty
[set-property placeholder-text]
gpointer
gnui_tagged_entry_get_sanitize_data (GnuiTaggedEntry * const self
);
Get the closure data passed to the “sanitize-function”
[get-property sanitize-data]
void gnui_tagged_entry_set_sanitize_data (GnuiTaggedEntry * const self
,const gpointer sanitize_data
);
Set the closure data passed to the “sanitize-function”
If later you need to destroy sanitize_data
, connect the address to the
tagged entry's “destroy” signal.
1 2 3 4 5 6 |
g_signal_connect_swapped( my_tagged_entry, "destroy", G_CALLBACK(my_destroy_listener), sanitize_data ); |
[set-property sanitize-data]
self |
The tagged entry. |
[not nullable] |
sanitize_data (nullable) |
The closure data to pass to the “sanitize-function” |
GnuiTaggedEntrySanitizeFunc
gnui_tagged_entry_get_sanitize_function
(GnuiTaggedEntry * const self
);
Get the function that allocates the strings that must be added to the tagged entry as tags, based on the given input
It is granted that the strings passed to the sanitize function are always
non-NULL
and with a length greater than zero, therefore the sanitize
function must not check for NULL
or ""
.
[get-property sanitize-function]
void gnui_tagged_entry_set_sanitize_function (GnuiTaggedEntry * const self
,const GnuiTaggedEntrySanitizeFunc sanitize_func
);
Set the function that allocates the strings that must be added to the tagged entry as tags, based on the given input
It is granted that the strings passed to the sanitize function are always
non-NULL
and with a length greater than zero, therefore the sanitize
function must not check for NULL
or ""
.
If this function set to NULL
,
will be used.g_strdup()
[set-property sanitize-function]
gpointer
gnui_tagged_entry_get_sort_data (GnuiTaggedEntry * const self
);
Get the closure data passed to the “sort-function”
[get-property sort-data]
void gnui_tagged_entry_set_sort_data (GnuiTaggedEntry * const self
,const gpointer sort_data
);
Get the closure data passed to the “sort-function”
If later you need to destroy sort_data
, connect the address to the tagged
entry's “destroy” signal.
1 2 3 4 5 6 |
g_signal_connect_swapped( my_tagged_entry, "destroy", G_CALLBACK(my_destroy_listener), sort_data ); |
[set-property sort-data]
self |
The tagged entry. |
[not nullable] |
sort_data (nullable) |
The closure data to pass to the “sort-function” |
GnuiTaggedEntrySortFunc
gnui_tagged_entry_get_sort_function (GnuiTaggedEntry * const self
);
Get the function that sorts the tags added to the tagged entry
[get-property sort-function]
void gnui_tagged_entry_set_sort_function (GnuiTaggedEntry * const self
,const GnuiTaggedEntrySortFunc sort_func
);
Set the function that sorts the tags added to the tagged entry
It is granted that the strings passed to the sort function are always
non-NULL
and with a length greater than zero, therefore the sort function
must not check for NULL
or ""
.
Even if
takes less parameters than a strcmp()
GnuiTaggedEntrySortFunc
,
you can use
too as sort function.strcmp()
[set-property sort-function]
const gchar * const *
gnui_tagged_entry_get_tags (GnuiTaggedEntry * const self
);
Get the tagged entry's tags
[get-property tags]
void gnui_tagged_entry_set_tags (GnuiTaggedEntry * const self
,const gchar * const * const tags
);
Set the tagged entry's tags
The tags added using this function (or, equivalently, using
) are always unpinned. For populating a tagged
entry with pinned tags please use g_object_set_property()
.gnui_tagged_entry_populate_strv()
[set-property tags]
void
gnui_tagged_entry_invalidate_filter (GnuiTaggedEntry * const self
);
For each tag in the tagged entry call the “filter-function”
void
gnui_tagged_entry_invalidate_sort (GnuiTaggedEntry * const self
);
For each tag in the tagged entry call the “sort-function”
GtkText *
gnui_tagged_entry_get_text_delegate (GnuiTaggedEntry * const self
);
Get the tagged entry's GtkText
delegate
void (*GnuiTaggedEntrySignalHandlerTagAdded) (GnuiTaggedEntry *self
,const gchar *tag
,gpointer user_data
);
A handler function type for the “tag-added” signal
void (*GnuiTaggedEntrySignalHandlerTagRemoved) (GnuiTaggedEntry *self
,const gchar *tag
,gpointer user_data
);
A handler function type for the “tag-removed” signal
void (*GnuiTaggedEntrySignalHandlerActivate) (GnuiTaggedEntry *self
,gpointer user_data
);
A handler function type for the “activate” signal
void (*GnuiTaggedEntrySignalHandlerInvalidChanged) (GnuiTaggedEntry *self
,gboolean invalid
,gpointer user_data
);
A handler function type for the “invalid-changed” signal
self |
The tagged entry. |
[auto][not nullable] |
invalid |
The current state of the “invalid” property. |
[auto] |
user_data |
The custom data passed to the signal. |
[auto][nullable][closure] |
void (*GnuiTaggedEntrySignalHandlerModifiedChanged) (GnuiTaggedEntry *self
,gboolean modified
,gpointer user_data
);
A handler function type for the “modified-changed” signal
self |
The tagged entry. |
[auto][not nullable] |
modified |
The current state of the “modified” property. |
[auto] |
user_data |
The custom data passed to the signal. |
[auto][nullable][closure] |
#define GNUI_TYPE_TAGGED_ENTRY (gnui_tagged_entry_get_type())
The GType
of GnuiTaggedEntry
“delimiter-chars”
property “delimiter-chars” char *
A NIL-terminated array of characters (i.e. a “C string”) to use as input delimiters between different tags.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
Default value: NULL
“filter-data”
property“filter-data” gpointer
Closure data for “filter-function” – use the “destroy” signal if later you want to free it.
[closure]
Owner: GnuiTaggedEntry
Flags: Read / Write
“filter-function”
property“filter-function” gpointer
Function to use to determine if a tag is valid.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
“invalid”
property“invalid” gboolean
Whether the tagged entry is in “invalid” state.
Owner: GnuiTaggedEntry
Flags: Read / Write
Default value: FALSE
“match-data”
property“match-data” gpointer
Closure data for “match-function” – use the “destroy” signal if later you want to free it.
[closure]
Owner: GnuiTaggedEntry
Flags: Read / Write
“match-function”
property“match-function” gpointer
Function to use to determine if two tags match.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
“modified”
property“modified” gboolean
Whether the tagged entry has been modified.
Owner: GnuiTaggedEntry
Flags: Read / Write
Default value: FALSE
“placeholder-text”
property “placeholder-text” char *
The text to be displayed when the tagged entry is empty.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
Default value: NULL
“sanitize-data”
property“sanitize-data” gpointer
Closure data for “sanitize-function” – use the “destroy” signal if later you want to free it.
[closure]
Owner: GnuiTaggedEntry
Flags: Read / Write
“sanitize-function”
property“sanitize-function” gpointer
Function to use to sanitize (and allocate) each new tag.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
“sort-data”
property“sort-data” gpointer
Closure data for “sort-function” – use the “destroy” signal if later you want to free it.
[closure]
Owner: GnuiTaggedEntry
Flags: Read / Write
“sort-function”
property“sort-function” gpointer
Function to use to sort the tag order.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
“tags”
property“tags” GStrv
The current tags.
[nullable]
Owner: GnuiTaggedEntry
Flags: Read / Write
“activate”
signalvoid user_function (GnuiTaggedEntry *self, gpointer user_data)
Signal emitted when a tagged entry is activated (usually by pressing
ENTER
)
GnuiTaggedEntrySignalHandlerActivate is the function type of reference for this signal, which takes parameters' constness into account.
self |
The tagged entry that emitted the signal. |
[auto][non-nullable] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“invalid-changed”
signalvoid user_function (GnuiTaggedEntry *self, gboolean invalid, gpointer user_data)
Signal emitted when the “invalid” property changes
GnuiTaggedEntrySignalHandlerInvalidChanged is the function type of reference for this signal, which takes parameters' constness into account.
self |
The tagged entry that emitted the signal. |
[auto][non-nullable] |
invalid |
The new value of the “invalid” property. |
[auto] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“modified-changed”
signalvoid user_function (GnuiTaggedEntry *self, gboolean modified, gpointer user_data)
Signal emitted when the “modified” property changes
GnuiTaggedEntrySignalHandlerModifiedChanged is the function type of reference for this signal, which takes parameters' constness into account.
self |
The tagged entry that emitted the signal. |
[auto][non-nullable] |
modified |
The new value of the “modified” property. |
[auto] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“tag-added”
signalvoid user_function (GnuiTaggedEntry *self, char *tag, gpointer user_data)
Signal emitted when a new tag is added to the tagged entry
GnuiTaggedEntrySignalHandlerTagAdded is the function type of reference for this signal, which takes parameters' constness into account.
self |
The tagged entry that emitted the signal. |
[auto][non-nullable] |
tag |
The tag added. |
[auto][not nullable][transfer none] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“tag-removed”
signalvoid user_function (GnuiTaggedEntry *self, char *tag, gpointer user_data)
Signal emitted when a tag is removed from the tagged entry
GnuiTaggedEntrySignalHandlerTagRemoved is the function type of reference for this signal, which takes parameters' constness into account.
self |
The tagged entry that emitted the signal. |
[auto][non-nullable] |
tag |
The tag removed. |
[auto][not nullable][transfer none] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First