StringFilter

GtkStringFilter determines whether to include items by comparing strings to a fixed search term.

The strings are obtained from the items by evaluating a GtkExpression set with [method@Gtk.StringFilter.set_expression], and they are compared against a search term set with [method@Gtk.StringFilter.set_search].

GtkStringFilter has several different modes of comparison - it can match the whole string, just a prefix, or any substring. Use [method@Gtk.StringFilter.set_match_mode] choose a mode.

It is also possible to make case-insensitive comparisons, with [method@Gtk.StringFilter.set_ignore_case].

Constructors

this
this(GtkStringFilter* gtkStringFilter, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(Expression expression)

Creates a new string filter.

Members

Functions

getExpression
Expression getExpression()

Gets the expression that the string filter uses to obtain strings from items.

getIgnoreCase
bool getIgnoreCase()

Returns whether the filter ignores case differences.

getMatchMode
GtkStringFilterMatchMode getMatchMode()

Returns the match mode that the filter is using.

getSearch
string getSearch()

Gets the search term.

getStringFilterStruct
GtkStringFilter* getStringFilterStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setExpression
void setExpression(Expression expression)

Sets the expression that the string filter uses to obtain strings from items.

setIgnoreCase
void setIgnoreCase(bool ignoreCase)

Sets whether the filter ignores case differences.

setMatchMode
void setMatchMode(GtkStringFilterMatchMode mode)

Sets the match mode for the filter.

setSearch
void setSearch(string search)

Sets the string to search for.

Static functions

getType
GType getType()

Variables

gtkStringFilter
GtkStringFilter* gtkStringFilter;

the main Gtk struct

Inherited Members

From Filter

gtkFilter
GtkFilter* gtkFilter;

the main Gtk struct

getFilterStruct
GtkFilter* getFilterStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
changed
void changed(GtkFilterChange change)

Emits the #GtkFilter::changed signal to notify all users of the filter that the filter changed. Users of the filter should then check items again via gtk_filter_match().

getStrictness
GtkFilterMatch getStrictness()

Gets the known strictness of @filters. If the strictness is not known, %GTK_FILTER_MATCH_SOME is returned.

match
bool match(ObjectG item)

Checks if the given @item is matched by the filter or not.

addOnChanged
gulong addOnChanged(void delegate(GtkFilterChange, Filter) dlg, ConnectFlags connectFlags)

Emitted whenever the filter changed.

Meta