RecentInfo

GtkRecentManager 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.

Note

The recently used files list is per user.

The GtkRecentManager acts like a database of all the recently used files. You can create new GtkRecentManager objects, but it is more efficient to use the default manager created by GTK+.

Adding a new recently used file is as simple as:

The GtkRecentManager will try to gather all the needed information from the file itself through GIO.

Looking up the meta-data associated with a recently used file given its URI requires calling gtk_recent_manager_lookup_item():

In order to retrieve the list of recently used files, you can use gtk_recent_manager_get_items(), which returns a list of GtkRecentInfo structures.

A GtkRecentManager is the model used to populate the contents of one, or more GtkRecentChooser implementations.

Note

The maximum age of the recently used files list is controllable through the "gtk-recent-files-max-age" property.

Recently used files are supported since GTK+ 2.10.

Constructors

this
this(GtkRecentInfo* gtkRecentInfo)

Sets our main struct and passes it to the parent class

Destructor

~this
~this()
Undocumented in source.

Members

Functions

createAppInfo
AppInfo createAppInfo(string appName)

Creates a GAppInfo for the specified GtkRecentInfo

doref
RecentInfo doref()

Increases the reference count of recent_info by one. Since 2.10

exists
int exists()

Checks whether the resource pointed by info still exists. At the moment this check is done only on resources pointing to local files. Since 2.10

getAdded
uint getAdded()

Gets the timestamp (seconds from system's Epoch) when the resource was added to the recently used resources list. Since 2.10

getAge
int getAge()

Gets the number of days elapsed since the last update of the resource pointed by info. Since 2.10

getApplicationInfo
int getApplicationInfo(string appName, string appExec, uint count, uint time)

Gets the data regarding the application that has registered the resource pointed by info. If the command line contains any escape characters defined inside the storage specification, they will be expanded. Since 2.10

getApplications
string[] getApplications()

Retrieves the list of applications that have registered this resource. Since 2.10

getDescription
string getDescription()

Gets the (short) description of the resource. Since 2.10

getDisplayName
string getDisplayName()

Gets the name of the resource. If none has been defined, the basename of the resource is obtained. Since 2.10

getGicon
IconIF getGicon()

Retrieves the icon associated to the resource MIME type. Since 2.22

getGroups
string[] getGroups()

Returns all groups registered for the recently used item info. The array of returned group names will be NULL terminated, so length might optionally be NULL. Since 2.10

getIcon
Pixbuf getIcon(int size)

Retrieves the icon of size size associated to the resource MIME type. Since 2.10

getMimeType
string getMimeType()

Gets the MIME type of the resource. Since 2.10

getModified
uint getModified()

Gets the timestamp (seconds from system's Epoch) when the meta-data for the resource was last modified. Since 2.10

getPrivateHint
int getPrivateHint()

Gets the value of the "private" flag. Resources in the recently used list that have this flag set to TRUE should only be displayed by the applications that have registered them. Since 2.10

getRecentInfoStruct
GtkRecentInfo* getRecentInfoStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getShortName
string getShortName()

Computes a valid UTF-8 string that can be used as the name of the item in a menu or list. For example, calling this function on an item that refers to "file:///foo/bar.txt" will yield "bar.txt". Since 2.10

getStruct
void* getStruct()

the main Gtk struct as a void*

getUri
string getUri()

Gets the URI of the resource. Since 2.10

getUriDisplay
string getUriDisplay()

Gets a displayable version of the resource's URI. If the resource is local, it returns a local path; if the resource is not local, it returns the UTF-8 encoded content of gtk_recent_info_get_uri(). Since 2.10

getVisited
uint getVisited()

Gets the timestamp (seconds from system's Epoch) when the meta-data for the resource was last visited. Since 2.10

hasApplication
int hasApplication(string appName)

Checks whether an application registered this resource using app_name. Since 2.10

hasGroup
int hasGroup(string groupName)

Checks whether group_name appears inside the groups registered for the recently used item info. Since 2.10

isLocal
int isLocal()

Checks whether the resource is local or not by looking at the scheme of its URI. Since 2.10

lastApplication
string lastApplication()

Gets the name of the last application that have registered the recently used resource represented by info. Since 2.10

match
int match(RecentInfo infoB)

Checks whether two GtkRecentInfo structures point to the same resource. Since 2.10

unref
void unref()

Decreases the reference count of info by one. If the reference count reaches zero, info is deallocated, and the memory freed. Since 2.10

Variables

gtkRecentInfo
GtkRecentInfo* gtkRecentInfo;

the main Gtk struct

Meta