11.101Class GtkRecentFilter

A filter for selecting a subset of recently used files

Class GtkRecentFilter

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_add_pattern()), on their mime type (with gtk_file_filter_add_mime_type()), on the application that has registered them (with gtk_recent_filter_add_application()), or by a custom filter function (with gtk_recent_filter_add_custom()).

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_add_filter(), but it is also possible to manually use a filter on a file with gtk_recent_filter_filter().

Methods
add_ageAdds a rule that allows resources based on their age - that is, the number of days elapsed since they were last modified.
add_applicationAdds a rule that allows resources based on the name of the application that has registered them.
add_customAdds a rule to a filter that allows resources based on a custom callback function.
add_groupAdds a rule that allows resources based on the name of the group to which they belong
add_mime_typeAdds a rule that allows resources based on their registered MIME type.
add_patternAdds a rule that allows resources based on a pattern matching their display name.
add_pixbuf_formatsAdds a rule allowing image files in the formats supported by GdkPixbuf.
filterTests whether a file should be displayed according to filter.
get_nameGets the human-readable name for the filter.
get_neededGets the fields that need to be filled in for the structure passed to gtk_recent_filter_filter()
set_nameSets the human-readable name of the filter.

Methods

add_age

Adds a rule that allows resources based on their age - that is, the number of days elapsed since they were last modified.

GtkRecentFilter.add_age( age )
age number of days

add_application

Adds a rule that allows resources based on the name of the application that has registered them.

GtkRecentFilter.add_application( application )
application an application name

add_custom

Adds a rule to a filter that allows resources based on a custom callback function.

GtkRecentFilter.add_custom( needed, func, data )
needed bitfield of flags (GtkRecentFilterFlags) indicating the information that the custom filter function needs.
func callback function; if the function returns TRUE, then the file will be displayed.
data data to pass to func, or nil

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.

add_group

Adds a rule that allows resources based on the name of the group to which they belong

GtkRecentFilter.add_group( group )
group a group name

add_mime_type

Adds a rule that allows resources based on their registered MIME type.

GtkRecentFilter.add_mime_type( mime_type )
mime_type a MIME type

add_pattern

Adds a rule that allows resources based on a pattern matching their display name.

GtkRecentFilter.add_pattern( pattern )
pattern a file pattern

add_pixbuf_formats

Adds a rule allowing image files in the formats supported by GdkPixbuf.

GtkRecentFilter.add_pixbuf_formats()

filter

Tests whether a file should be displayed according to filter.

GtkRecentFilter.filter( filter_info )
filter_info a GtkRecentFilterInfo structure containing information about a recently used resource
ReturnTRUE if the file should be displayed

The GtkRecentFilterInfo structure filter_info should include the fields returned from gtk_recent_filter_get_needed().

This function will not typically be used by applications; it is intended principally for use in the implementation of GtkRecentChooser.

get_name

Gets the human-readable name for the filter.

GtkRecentFilter.get_name()
Returnthe name of the filter, or NULL.

get_needed

Gets the fields that need to be filled in for the structure passed to gtk_recent_filter_filter()

GtkRecentFilter.get_needed()
Returnbitfield of flags indicating needed fields when calling gtk_recent_filter_filter()

This function will not typically be used by applications; it is intended principally for use in the implementation of GtkRecentChooser.

set_name

Sets the human-readable name of the filter.

GtkRecentFilter.set_name( name )
name the human readable name of 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.

Made with http://www.falconpl.org