Sets our main struct and passes it to the parent class.
Creates a new GtkFileFilter with no rules added to it.
Deserialize a file filter from a GVariant.
Adds a rule allowing a given mime type to @filter.
Adds a rule allowing a shell style glob to a filter.
Adds a rule allowing image files in the formats supported by GdkPixbuf.
Gets the attributes that need to be filled in for the GFileInfo passed to this filter.
Get the main Gtk struct
Gets the human-readable name for the filter.
the main Gtk struct as a void*
Sets a human-readable name of the filter.
Serialize a file filter to an a{sv} variant.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
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().
Gets the known strictness of @filters. If the strictness is not known, %GTK_FILTER_MATCH_SOME is returned.
Checks if the given @item is matched by the filter or not.
Emitted whenever the filter changed.
Get the main Gtk struct
the main Gtk struct as a void*
Gets the ID of the @buildable object.
GtkFileFilter filters files by name or mime type.
GtkFileFilter can be used to restrict the files being shown in a GtkFileChooser. Files can be filtered based on their name (with [method@Gtk.FileFilter.add_pattern]) or on their mime type (with [method@Gtk.FileFilter.add_mime_type]).
Filtering by mime types handles aliasing and subclassing of mime types; e.g. a filter for text/plain also matches a file with mime type application/rtf, since application/rtf is a subclass of text/plain. Note that GtkFileFilter allows wildcards for the subtype of a mime type, so you can e.g. filter for image/\*.
Normally, file filters are used by adding them to a GtkFileChooser (see [method@Gtk.FileChooser.add_filter]), but it is also possible to manually use a file filter on any [class@Gtk.FilterListModel] containing GFileInfo objects.
GtkFileFilter as GtkBuildable
The GtkFileFilter implementation of the GtkBuildable interface supports adding rules using the <mime-types> and <patterns> elements and listing the rules within. Specifying a <mime-type> or <pattern> has the same effect as as calling [method@Gtk.FileFilter.add_mime_type] or [method@Gtk.FileFilter.add_pattern].
An example of a UI definition fragment specifying GtkFileFilter rules: