GtkRecentFilter {RGtk2} | R Documentation

## GtkRecentFilter

### Description

A filter for selecting a subset of recently used files

### Methods and Functions

`gtkRecentFilterNew()`
`gtkRecentFilterGetName(object)`
`gtkRecentFilterSetName(object, name)`
`gtkRecentFilterAddMimeType(object, mime.type)`
`gtkRecentFilterAddPattern(object, pattern)`
`gtkRecentFilterAddPixbufFormats(object)`
`gtkRecentFilterAddApplication(object, application)`
`gtkRecentFilterAddGroup(object, group)`
`gtkRecentFilterAddAge(object, days)`
`gtkRecentFilterAddCustom(object, needed, func, data)`
`gtkRecentFilterGetNeeded(object)`
`gtkRecentFilterFilter(object, filter.info)`
`gtkRecentFilter()`

### Hierarchy

    GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkRecentFilter

### Detailed Description

A `GtkRecentFilter` can be used to restrict the files being shown in a `GtkRecentChooser`. Files can be filtered based on their name (with `gtkRecentFilterAddPattern`), on their mime type (with `gtkFileFilterAddMimeType`), on the application that has registered them (with `gtkRecentFilterAddApplication`), or by a custom filter function (with `gtkRecentFilterAddCustom`).

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 `gtkRecentChooserAddFilter`, but it is also possible to manually use a filter on a file with `gtkRecentFilterFilter`.

Recently used files are supported since GTK+ 2.10.

### Structures

`GtkRecentFilter`

  The `GtkRecentFilter` struct contains only private fields and should not be directly accessed.

`GtkRecentFilterInfo`

  A `GtkRecentFilterInfo` struct is used to pass information about the tested file to `gtkRecentFilterFilter`. `GtkRecentFilterInfo` is a transparent-type.

  `contains`

    [`GtkRecentFilterFlags`] Flags indicating which of the following fields need are filled

  `uri`

    [character] the URI of the file being tested

  `displayName`

    [character] the string that will be used to display the file in the recent chooser

  `mimeType`

    [character] the mime type of the file

  `applications`

    [character] the list of applications that have registered the file

  `groups`

    [character] the groups to which the file belongs to

  `age`

    [integer] the number of days elapsed since the file has been registered

### Convenient Construction

`gtkRecentFilter` is the equivalent of `gtkRecentFilterNew`.

### Enums and Flags

`GtkRecentFilterFlags`

  These flags indicate what parts of a `GtkRecentFilterInfo` struct are filled or need to be filled.

  `uri`

    the URI of the file being tested

  `display-name`

    the string that will be used to display the file in the recent chooser

  `mime-type`

    the mime type of the file

  `application`

    the list of applications that have registered the file

  `group`

    the groups to which the file belongs to

  `age`

    the number of days elapsed since the file has been registered

### User Functions

`GtkRecentFilterFunc(filter.info, user.data)`

  The type of function that is used with custom filters, see `gtkRecentFilterAddCustom`.

  `filter.info`

    a `GtkRecentFilterInfo` that is filled according to the `needed` flags passed to `gtkRecentFilterAddCustom`

  `user.data`

    user data passed to `gtkRecentFilterAddCustom`

  Returns: [logical] `TRUE` if the file should be displayed

### Author(s)

Derived by RGtkGen from GTK+ documentation

### References

https://developer.gnome.org/gtk2/stable/GtkRecentFilter.html

### See Also

`GtkRecentChooser`

[Package RGtk2 version 2.20.36.3 Index]