[]Struct gtk::RecentManager

pub struct RecentManager(_, _);

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 recently used files list is per user.

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 default manager created by GTK+.

Adding a new recently used file is as simple as:

GtkRecentManager *manager;

manager = gtk_recent_manager_get_default ();
gtk_recent_manager_add_item (manager, file_uri);

The RecentManager 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 RecentManagerExt::lookup_item:

GtkRecentManager *manager;
GtkRecentInfo *info;
GError *error = NULL;

manager = gtk_recent_manager_get_default ();
info = gtk_recent_manager_lookup_item (manager, file_uri, &error);
if (error)
  {
    g_warning ("Could not find the file: %s", error->message);
    g_error_free (error);
  }
else
 {
   // Use the info object
   gtk_recent_info_unref (info);
 }

In order to retrieve the list of recently used files, you can use RecentManagerExt::get_items, which returns a list of RecentInfo-structs.

A RecentManager is the model used to populate the contents of one, or more RecentChooser implementations.

Note that the maximum age of the recently used files list is controllable through the Settings:gtk-recent-files-max-age property.

Recently used files are supported since GTK+ 2.10.

Implements

RecentManagerExt, glib::object::ObjectExt

Implementations

impl RecentManager[src]

pub fn new() -> RecentManager[src]

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.

RecentManager objects are expensive: be sure to create them only when needed. You should use RecentManager::get_default instead.

Returns

A newly created RecentManager object

pub fn get_default() -> Option<RecentManager>[src]

Gets a unique instance of RecentManager, that you can share in your application without caring about memory management.

Returns

A unique RecentManager. Do not ref or unref it.

Trait Implementations

impl Clone for RecentManager

impl Debug for RecentManager

impl Default for RecentManager[src]

impl Display for RecentManager[src]

impl Eq for RecentManager

impl Hash for RecentManager

impl Ord for RecentManager

impl<T: ObjectType> PartialEq<T> for RecentManager

impl<T: ObjectType> PartialOrd<T> for RecentManager

impl StaticType for RecentManager

Auto Trait Implementations

impl RefUnwindSafe for RecentManager

impl !Send for RecentManager

impl !Sync for RecentManager

impl Unpin for RecentManager

impl UnwindSafe for RecentManager

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.