Creates a new #GtkRecentFilter with no rules added to it. Such filter does not accept any recently used resources, so is not particularly useful until you add rules with gtk.recent_filter.RecentFilter.addPattern, gtk.recent_filter.RecentFilter.addMimeType, gtk.recent_filter.RecentFilter.addApplication, gtk.recent_filter.RecentFilter.addAge. To create a filter that accepts any recently used resource, use:
Adds a rule that allows resources based on their age - that is, the number of days elapsed since they were last modified.
Adds a rule that allows resources based on the name of the application that has registered them.
Adds a rule to a filter that allows resources based on a custom callback function. The bitfield needed which is passed in provides information about what sorts of information that the filter function needs; this allows GTK+ to avoid retrieving expensive information when it isn’t needed by the filter.
Adds a rule that allows resources based on the name of the group to which they belong
Adds a rule that allows resources based on their registered MIME type.
Adds a rule that allows resources based on a pattern matching their display name.
Adds a rule allowing image files in the formats supported by GdkPixbuf.
Tests whether a file should be displayed according to filter. The #GtkRecentFilterInfo filter_info should include the fields returned from gtk.recent_filter.RecentFilter.getNeeded, and must set the #GtkRecentFilterInfo.contains field of filter_info to indicate which fields have been set.
Gets the human-readable name for the filter. See gtk.recent_filter.RecentFilter.setName.
Gets the fields that need to be filled in for the #GtkRecentFilterInfo passed to gtk.recent_filter.RecentFilter.filter
Returns this, for use in with statements.
Sets the human-readable name of the filter; this is the string that will be displayed in the recently used resources selector user interface if there is a selectable list of filters.
Get builder for gtk.recent_filter.RecentFilter
Adds a child to buildable. type is an optional string describing how the child should be added.
Constructs a child of buildable with the name name.
This is similar to gtk.buildable.Buildable.parserFinished but is called once for each custom tag handled by the buildable.
This is called for each unknown element under <child>.
Get the internal child called childname of the buildable object.
Gets the name of the buildable object.
Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk.builder.Builder.addFromFile or gtk.builder.Builder.addFromString is called on a builder.
Sets the property name name to value on the buildable object.
Sets the name of the buildable object.
Returns this, for use in with statements.
Get builder for gobject.initially_unowned.InitiallyUnowned
Adds a child to buildable. type is an optional string describing how the child should be added.
Constructs a child of buildable with the name name.
This is similar to gtk.buildable.Buildable.parserFinished but is called once for each custom tag handled by the buildable.
This is called for each unknown element under <child>.
Get the internal child called childname of the buildable object.
Gets the name of the buildable object.
Called when the builder finishes the parsing of a [GtkBuilder UI definition][BUILDER-UI]. Note that this will be called once for each time gtk.builder.Builder.addFromFile or gtk.builder.Builder.addFromString is called on a builder.
Sets the property name name to value on the buildable object.
Sets the name of the buildable object.
A #GtkRecentFilter can be used to restrict the files being shown in a #GtkRecentChooser. Files can be filtered based on their name (with gtk.recent_filter.RecentFilter.addPattern), on their mime type (with gtk.file_filter.FileFilter.addMimeType), on the application that has registered them (with gtk.recent_filter.RecentFilter.addApplication), or by a custom filter function (with gtk.recent_filter.RecentFilter.addCustom).
Filtering by mime type 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 #GtkRecentFilter allows wildcards for the subtype of a mime type, so you can e.g. filter for image/\*.
Normally, filters are used by adding them to a #GtkRecentChooser, see gtk.recent_chooser.RecentChooser.addFilter, but it is also possible to manually use a filter on a file with gtk.recent_filter.RecentFilter.filter.
Recently used files are supported since GTK+ 2.10.
GtkRecentFilter as GtkBuildable
The GtkRecentFilter implementation of the GtkBuildable interface supports adding rules using the <mime-types>, <patterns> and <applications> elements and listing the rules within. Specifying a <mime-type>, <pattern> or <application> has the same effect as calling gtk.recent_filter.RecentFilter.addMimeType, gtk.recent_filter.RecentFilter.addPattern or gtk.recent_filter.RecentFilter.addApplication.
An example of a UI definition fragment specifying gtk.recent_filter.RecentFilter rules: