GtkStringFilter — Filtering by strings
GtkStringFilter * | gtk_string_filter_new () |
const char * | gtk_string_filter_get_search () |
void | gtk_string_filter_set_search () |
GtkExpression * | gtk_string_filter_get_expression () |
void | gtk_string_filter_set_expression () |
gboolean | gtk_string_filter_get_ignore_case () |
void | gtk_string_filter_set_ignore_case () |
GtkStringFilterMatchMode | gtk_string_filter_get_match_mode () |
void | gtk_string_filter_set_match_mode () |
GtkExpression * | expression | Read / Write |
gboolean | ignore-case | Read / Write |
GtkStringFilterMatchMode | match-mode | Read / Write |
char * | search | Read / Write |
GObject ╰── GtkFilter ╰── GtkStringFilter
#include <gtk/gtk.h>
GtkStringFilter determines whether to include items by looking at strings and comparing them to a fixed search term. The strings are obtained from the items by evaluating a GtkExpression.
GtkStringFilter has several different modes of comparison - it can match the whole string, just a prefix, or any substring.
GtkStringFilter *
gtk_string_filter_new (GtkExpression *expression
);
Creates a new string filter.
You will want to set up the filter by providing a string to search for and by providing a property to look up on the item.
expression | The expression to evaluate or | [transfer full][nullable] |
a new GtkStringFilter
const char *
gtk_string_filter_get_search (GtkStringFilter *self
);
Gets the search string set via gtk_string_filter_set_search()
.
self |
The search string.
[nullable][transfer none]
void gtk_string_filter_set_search (GtkStringFilter *self
,const char *search
);
Sets the string to search for.
self | ||
search | The string to search for or | [transfer none][nullable] |
GtkExpression *
gtk_string_filter_get_expression (GtkStringFilter *self
);
Gets the expression that the string filter uses to obtain strings from items.
self |
void gtk_string_filter_set_expression (GtkStringFilter *self
,GtkExpression *expression
);
Sets the expression that the string filter uses to obtain strings from items. The expression must have a value type of G_TYPE_STRING.
self | ||
expression |
gboolean
gtk_string_filter_get_ignore_case (GtkStringFilter *self
);
Returns whether the filter ignores case differences.
self |
TRUE
if the filter ignores case
void gtk_string_filter_set_ignore_case (GtkStringFilter *self
,gboolean ignore_case
);
Sets whether the filter ignores case differences.
self | ||
ignore_case |
|
GtkStringFilterMatchMode
gtk_string_filter_get_match_mode (GtkStringFilter *self
);
Returns the match mode that the filter is using.
self |
the match mode of the filter
void gtk_string_filter_set_match_mode (GtkStringFilter *self
,GtkStringFilterMatchMode mode
);
Sets the match mode for the filter.
self | ||
mode | the new match mode |
typedef struct _GtkStringFilter GtkStringFilter;
Specifies how search strings are matched inside text.
GTK_STRING_FILTER_MATCH_MODE_EXACT | The search string and text must match exactly. | |
GTK_STRING_FILTER_MATCH_MODE_SUBSTRING | The search string must be contained as a substring inside the text. | |
GTK_STRING_FILTER_MATCH_MODE_PREFIX | The text must begin with the search string. |
“expression”
property“expression” GtkExpression *
The expression to evaluate on item to get a string to compare with
[type GtkExpression]
Owner: GtkStringFilter
Flags: Read / Write
“ignore-case”
property“ignore-case” gboolean
If matching is case sensitive
Owner: GtkStringFilter
Flags: Read / Write
Default value: TRUE
“match-mode”
property“match-mode” GtkStringFilterMatchMode
If exact matches are necessary or if substrings are allowed
Owner: GtkStringFilter
Flags: Read / Write
Default value: GTK_STRING_FILTER_MATCH_MODE_SUBSTRING
“search”
property“search” char *
The search term
Owner: GtkStringFilter
Flags: Read / Write
Default value: NULL
© 2005–2020 The GNOME Project
Licensed under the GNU Lesser General Public License version 2.1 or later.
https://developer.gnome.org/gtk4/4.0/GtkStringFilter.html