gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Recent.RecentFilter

Contents

- Detail
- Class Hierarchy
- Types
- Enums
- Constructors
- Methods

Description

A filter for selecting a subset of recently used files

- Module available since Gtk+ version 2.10

Synopsis

- data RecentFilter
- class GObjectClass o => RecentFilterClass o
- castToRecentFilter :: GObjectClass obj => obj -> RecentFilter
- toRecentFilter :: RecentFilterClass o => o -> RecentFilter
- data RecentFilterFlags
  - = RecentFilterUri
  - | RecentFilterDisplayName
  - | RecentFilterMimeType
  - | RecentFilterApplication
  - | RecentFilterGroup
  - | RecentFilterAge
- recentFilterNew :: IO RecentFilter
- recentFilterGetName :: (RecentFilterClass self, GlibString string) => self -> IO string
- recentFilterSetName :: (RecentFilterClass self, GlibString string) => self -> string -> IO ()
- recentFilterAddMimeType :: (RecentFilterClass self, GlibString string) => self -> string -> IO ()
- recentFilterAddPattern :: (RecentFilterClass self, GlibString string) => self -> string -> IO ()
- recentFilterAddPixbufFormats :: RecentFilterClass self => self -> IO ()
- recentFilterAddApplication :: (RecentFilterClass self, GlibString string) => self -> string -> IO ()
- recentFilterAddGroup :: (RecentFilterClass self, GlibString string) => self -> string -> IO ()
- recentFilterAddAge :: RecentFilterClass self => self -> Int -> IO ()

# Detail

A `RecentFilter` can be used to restrict the files being shown in a `RecentChooser`. Files can be filtered based on their name (with `recentFilterAddPattern`), on their mime type (with `fileFilterAddMimeType`), on the application that has registered them (with `recentFilterAddApplication`), or by a custom filter function (with `recentFilterAddCustom`).

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 `RecentFilter` 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 `RecentChooser`, see `recentChooserAddFilter`, but it is also possible to manually use a filter on a file with `recentFilterFilter`.

Recently used files are supported since Gtk+ 2.10.

# Class Hierarchy

    | GObject
    | +----Object
    | +----RecentFilter

# Types

data RecentFilter Source #

#### Instances

Instances details

Eq RecentFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: RecentFilter -> RecentFilter -> Bool Source # (/=) :: RecentFilter -> RecentFilter -> Bool Source #
Ord RecentFilter Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: RecentFilter -> RecentFilter -> Ordering Source #

(<) :: RecentFilter -> RecentFilter -> Bool Source #

(<=) :: RecentFilter -> RecentFilter -> Bool Source #

(>) :: RecentFilter -> RecentFilter -> Bool Source #

(>=) :: RecentFilter -> RecentFilter -> Bool Source #

max :: RecentFilter -> RecentFilter -> RecentFilter Source #

min :: RecentFilter -> RecentFilter -> RecentFilter Source #

GObjectClass RecentFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: RecentFilter -> GObject Source # unsafeCastGObject :: GObject -> RecentFilter Source #
RecentFilterClass RecentFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => RecentFilterClass o Source #

#### Instances

Instances details

RecentFilterClass RecentFilter Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToRecentFilter :: GObjectClass obj => obj -> RecentFilter Source #

toRecentFilter :: RecentFilterClass o => o -> RecentFilter Source #

# Enums

data RecentFilterFlags Source #

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

Constructors

RecentFilterUri |
RecentFilterDisplayName |
RecentFilterMimeType |
RecentFilterApplication |
RecentFilterGroup |
RecentFilterAge |

#### Instances

Instances details

Bounded RecentFilterFlags Source # |
Instance details Defined in Graphics.UI.Gtk.Recent.RecentFilter Methods minBound :: RecentFilterFlags Source # maxBound :: RecentFilterFlags Source #

Enum RecentFilterFlags Source #

Creates a new `RecentFilter` 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 `recentFilterAddPattern`, `recentFilterAddMimeType`, `recentFilterAddApplication`, `recentFilterAddAge`. To create a filter that accepts any recently used resource, use:

    filter <- recentFilterNew
    recentFilterAddPattern filter "*"

- Available since Gtk+ version 2.10

Instance details

Defined in Graphics.UI.Gtk.Recent.RecentFilter

Methods

succ :: RecentFilterFlags -> RecentFilterFlags Source #

pred :: RecentFilterFlags -> RecentFilterFlags Source #

toEnum :: Int -> RecentFilterFlags Source #

fromEnum :: RecentFilterFlags -> Int Source #

enumFrom :: RecentFilterFlags -> [RecentFilterFlags] Source #

enumFromThen :: RecentFilterFlags -> RecentFilterFlags -> [RecentFilterFlags] Source #

enumFromTo :: RecentFilterFlags -> RecentFilterFlags -> [RecentFilterFlags] Source #

enumFromThenTo :: RecentFilterFlags -> RecentFilterFlags -> RecentFilterFlags -> [RecentFilterFlags] Source #

Show RecentFilterFlags Source # |
Instance details Defined in Graphics.UI.Gtk.Recent.RecentFilter Methods showsPrec :: Int -> RecentFilterFlags -> ShowS Source # show :: RecentFilterFlags -> String Source # showList :: [RecentFilterFlags] -> ShowS Source #
Eq RecentFilterFlags Source # |
Instance details Defined in Graphics.UI.Gtk.Recent.RecentFilter Methods (==) :: RecentFilterFlags -> RecentFilterFlags -> Bool Source # (/=) :: RecentFilterFlags -> RecentFilterFlags -> Bool Source #

# Constructors

recentFilterNew :: IO RecentFilter Source #

# Methods

recentFilterGetName Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> IO string | returns the name of the filter

Gets the human-readable name for the filter. See `recentFilterSetName`.

- Available since Gtk+ version 2.10

recentFilterSetName Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> string | `name` - then human readable name of `filter`
-> IO () |

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.

- Available since Gtk+ version 2.10

recentFilterAddMimeType Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> string | `mimeType` - a MIME type
-> IO () |

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

- Available since Gtk+ version 2.10

recentFilterAddPattern Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> string | `pattern` - a file pattern
-> IO () |

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

- Available since Gtk+ version 2.10

recentFilterAddPixbufFormats :: RecentFilterClass self => self -> IO () Source #

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

recentFilterAddApplication Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> string | `application` - an application name
-> IO () |

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

- Available since Gtk+ version 2.10

recentFilterAddGroup Source #

Arguments

:: (RecentFilterClass self, GlibString string) |
=> self |
-> string | `group` - a group name
-> IO () |

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

- Available since Gtk+ version 2.10

recentFilterAddAge Source #

Arguments

:: RecentFilterClass self |
=> self |
-> Int | `days` - number of days
-> IO () |

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

- Available since Gtk+ version 2.10