[303:14] static extends: object
Generated metadata helpers for FileFilter class surfaces.
properties ()
Returns property metadata for
FileFilter.
A list.[285:14] static extends: object
Alternate constructors for FileFilter. Usage:
FileFilterCtors.<name>(...). The primary constructor lives
directly on FileFilter.
newFromGvariant (object variant)
Deserialize a file filter from a
GVariant. The variant must be in the format produced by [method@Gtk.FileFilter.to_gvariant].
variant is an a{sv} GVariant.A new FileFilter.[35:7] extends: object
Filters files by name or mime type. GtkFileFilter can be used to restrict
the files being shown in a file chooser. Files can be filtered based on their
name (with [method@Gtk.FileFilter.add_pattern] or
[method@Gtk.FileFilter.add_suffix]) 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 file chooser (see
[method@Gtk.FileDialog.set_filters]), 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> and <suffixes> elements and listing the
rules within. Specifying a <mime-type> or <pattern> or <suffix> has the
same effect as as calling [method@Gtk.FileFilter.add_mime_type] or
[method@Gtk.FileFilter.add_pattern] or [method@Gtk.FileFilter.add_suffix]. An
example of a UI definition fragment specifying GtkFileFilter rules: xml <object class="GtkFileFilter"> <property name="name" translatable="yes">Text and Images</property> <mime-types> <mime-type>text/plain</mime-type> <mime-type>image/ *</mime-type> </mime-types> <patterns> <pattern>*.txt</pattern> </patterns> <suffixes> <suffix>png</suffix> </suffixes> </object>
FileFilter (Handle = null)
Creates a new
GtkFileFilterwith no rules added to it. Such a filter doesn’t accept any files, so is not particularly useful until you add rules with [method@Gtk.FileFilter.add_mime_type], [method@Gtk.FileFilter.add_pattern], [method@Gtk.FileFilter.add_suffix] or [method@Gtk.FileFilter.add_pixbuf_formats]. To create a filter that accepts any file, use:c GtkFileFilter *filter = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter, "*");
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.asFilter ()
Wraps this handle as
Filter.
A Filter object.asBuildable ()
Wraps this handle as
Buildable.
A Buildable object.getProperty (string Name)
Reads one generated property by name.
setProperty (string Name, Value)
Writes one generated property by name.
setName (string Value)
The human-readable name of the filter. This is the string that will be displayed in the user interface if there is a selectable list of filters.
Value is the new property value.None.add_mime_type (string mime_type)
Adds a rule allowing a given mime type.
mime_type is name of a MIME type.None.add_mime_types (list mime_types)
Adds a rule allowing a given array of mime types. It can for example be used with Gly.Loader.get_mime_types. This is equivalent to calling [method@Gtk.FileFilter.add_mime_type] for all the supported mime types.
mime_types is a %NULL-terminated array of mime types.None.add_pattern (string pattern)
Adds a rule allowing a shell style glob pattern. Note that it depends on the platform whether pattern matching ignores case or not. On Windows, it does, on other platforms, it doesn't.
pattern is a shell style glob pattern.None.add_pixbuf_formats ()
Adds a rule allowing image files in the formats supported by
GdkPixbuf. This is equivalent to calling [method@Gtk.FileFilter.add_mime_type] for all the supported mime types.
None.add_suffix (string suffix)
Adds a suffix match rule to a filter. This is similar to adding a match for the pattern "*.@suffix" An exaple to filter files with the suffix ".sub":
c gtk_file_filter_add_suffix (filter, "sub");Filters with multiple dots are allowed. In contrast to pattern matches, suffix matches are always case-insensitive.
suffix is filename suffix to match.None.get_attributes ()
Gets the attributes that need to be filled in for the
GFileInfopassed to this filter. This function will not typically be used by applications; it is intended for use in file chooser implementation.
the attributes.get_name ()
Gets the human-readable name for the filter. See [method@Gtk.FileFilter.set_name].
the human-readable name of the filter.set_name (string name)
Sets a human-readable name of the filter. This is the string that will be displayed in the user interface if there is a selectable list of filters.
name is the human-readable name for the filter.None.to_gvariant ()
Serialize a file filter to an
a{sv}variant.
a new, floating, GVariant.