Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
Managing Recently Used Files
- Module available since Gtk+ version 2.10
TODO: GtkRecentData gtk_recent_manager_add_full
- data RecentManager
- class GObjectClass o => RecentManagerClass o
- castToRecentManager :: GObjectClass obj => obj -> RecentManager
- toRecentManager :: RecentManagerClass o => o -> RecentManager
- recentManagerNew :: IO RecentManager
- recentManagerGetDefault :: IO RecentManager
- recentManagerAddItem :: (RecentManagerClass self, GlibString string) => self -> string -> IO Bool
- recentManagerRemoveItem :: (RecentManagerClass self, GlibString string) => self -> string -> IO Bool
- recentManagerLookupItem :: (RecentManagerClass self, GlibString string) => self -> string -> IO RecentInfo
- recentManagerHasItem :: (RecentManagerClass self, GlibString string) => self -> string -> IO Bool
- recentManagerMoveItem :: (RecentManagerClass self, GlibString string) => self -> string -> string -> IO Bool
- recentManagerGetItems :: RecentManagerClass self => self -> IO [RecentInfo]
- recentManagerPurgeItems :: RecentManagerClass self => self -> IO Int
- recentManagerFilename :: (RecentManagerClass self, GlibString string) => ReadAttr self string
- recentManagerLimit :: RecentManagerClass self => Attr self Int
- recentManagerSize :: RecentManagerClass self => ReadAttr self Int
- recentManagerChanged :: RecentManagerClass self => Signal self (IO ())
Detail
RecentManager
provides a facility for adding, removing and looking up
recently used files. Each recently used file is identified by its URI, and
has meta-data associated to it, like the names and command lines of the
applications that have registered it, the number of time each application
has registered the same file, the mime type of the file and whether the file
should be displayed only by the applications that have registered it.
The RecentManager
acts like a database of all the recently used files.
You can create new RecentManager
objects, but it is more efficient to use
the standard recent manager for the Screen
so that informations about the
recently used files is shared with other people using them. In case the
default screen is being used, adding a new recently used file is as simple
as:
Recently used files are supported since Gtk+ 2.10.
Class Hierarchy
| GObject
| +----RecentManager
Types
data RecentManager Source
castToRecentManager :: GObjectClass obj => obj -> RecentManager Source
toRecentManager :: RecentManagerClass o => o -> RecentManager Source
Constructors
recentManagerNew :: IO RecentManager Source
Creates a new recent manager object. Recent manager objects are used to
handle the list of recently used resources. A RecentManager
object
monitors the recently used resources list, and emits the "changed" signal
each time something inside the list changes.
- Available since Gtk+ version 2.10
Methods
recentManagerGetDefault Source
:: IO RecentManager | returns A unique |
Gets a unique instance of RecentManager
.
- Available since Gtk+ version 2.10
:: (RecentManagerClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO Bool | returns |
Adds a new resource, pointed by uri
, into the recently used resources
list.
This function automatically retrieves some of the needed metadata and
setting other metadata to common default values; it then feeds the data to
recentManagerAddFull
.
See recentManagerAddFull
if you want to explicitly define the metadata
for the resource pointed by uri
.
- Available since Gtk+ version 2.10
recentManagerRemoveItem Source
:: (RecentManagerClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO Bool | returns |
Removes a resource pointed by uri
from the recently used resources list
handled by a recent manager.
- Available since Gtk+ version 2.10
recentManagerLookupItem Source
:: (RecentManagerClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO RecentInfo | returns a |
Searches for a URI inside the recently used resources list, and returns a structure containing informations about the resource like its MIME type, or its display name.
- Available since Gtk+ version 2.10
:: (RecentManagerClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO Bool | returns |
Checks whether there is a recently used resource registered with uri
inside the recent manager.
- Available since Gtk+ version 2.10
:: (RecentManagerClass self, GlibString string) | |
=> self | |
-> string |
|
-> string |
|
-> IO Bool | returns |
Changes the location of a recently used resource from uri
to newUri
.
Please note that this function will not affect the resource pointed by the URIs, but only the URI used in the recently used resources list.
- Available since Gtk+ version 2.10
:: RecentManagerClass self | |
=> self | |
-> IO [RecentInfo] | returns a list of newly allocated
|
Gets the list of recently used resources.
- Available since Gtk+ version 2.10
recentManagerPurgeItems Source
:: RecentManagerClass self | |
=> self | |
-> IO Int | returns the number of items that have been removed from the recently used resources list. |
Purges every item from the recently used resources list.
- Available since Gtk+ version 2.10
Attributes
recentManagerFilename :: (RecentManagerClass self, GlibString string) => ReadAttr self string Source
The full path to the file to be used to store and read the recently used resources list
Default value: Nothing
- Available since Gtk+ version 2.10
recentManagerLimit :: RecentManagerClass self => Attr self Int Source
The maximum number of items to be returned by the recentManagerGetItems
function.
Allowed values: >= GMaxulong
Default value: -1
- Available since Gtk+ version 2.10
recentManagerSize :: RecentManagerClass self => ReadAttr self Int Source
The size of the recently used resources list.
Allowed values: >= GMaxulong
Default value: 0
- Available since Gtk+ version 2.10
Signals
recentManagerChanged :: RecentManagerClass self => Signal self (IO ()) Source
Emitted when the current recently used resources manager changes its contents.
- Available since Gtk+ version 2.10