Struct gtk::RecentInfo
source · [−]#[repr(transparent)]pub struct RecentInfo { /* private fields */ }
Expand description
RecentInfo
-struct contains private data only, and should
be accessed using the provided API.
RecentInfo
constains all the meta-data
associated with an entry in the recently used files list.
Implementations
sourceimpl RecentInfo
impl RecentInfo
sourcepub fn create_app_info(
&self,
app_name: Option<&str>
) -> Result<Option<AppInfo>, Error>
pub fn create_app_info(
&self,
app_name: Option<&str>
) -> Result<Option<AppInfo>, Error>
Creates a gio::AppInfo
for the specified RecentInfo
app_name
the name of the application that should
be mapped to a gio::AppInfo
; if None
is used then the default
application for the MIME type is used
Returns
the newly created gio::AppInfo
, or None
.
In case of error, error
will be set either with a
GTK_RECENT_MANAGER_ERROR
or a G_IO_ERROR
sourcepub fn added(&self) -> c_long
pub fn added(&self) -> c_long
Gets the timestamp (seconds from system’s Epoch) when the resource was added to the recently used resources list.
Returns
the number of seconds elapsed from system’s Epoch when the resource was added to the list, or -1 on failure.
sourcepub fn age(&self) -> i32
pub fn age(&self) -> i32
Gets the number of days elapsed since the last update
of the resource pointed by self
.
Returns
a positive integer containing the number of days elapsed since the time this resource was last modified
sourcepub fn application_info(&self, app_name: &str) -> Option<(GString, u32, c_long)>
pub fn application_info(&self, app_name: &str) -> Option<(GString, u32, c_long)>
Gets the data regarding the application that has registered the resource
pointed by self
.
If the command line contains any escape characters defined inside the storage specification, they will be expanded.
app_name
the name of the application that has registered this item
Returns
true
if an application with app_name
has registered this
resource inside the recently used list, or false
otherwise. The
app_exec
string is owned by the RecentInfo
and should not be
modified or freed
app_exec
return location for the string containing the command line
count
return location for the number of times this item was registered
time_
return location for the timestamp this item was last registered for this application
sourcepub fn applications(&self) -> Vec<GString>
pub fn applications(&self) -> Vec<GString>
sourcepub fn description(&self) -> Option<GString>
pub fn description(&self) -> Option<GString>
Gets the (short) description of the resource.
Returns
the description of the resource. The returned string is owned by the recent manager, and should not be freed.
sourcepub fn display_name(&self) -> Option<GString>
pub fn display_name(&self) -> Option<GString>
Gets the name of the resource. If none has been defined, the basename of the resource is obtained.
Returns
the display name of the resource. The returned string is owned by the recent manager, and should not be freed.
sourcepub fn icon(&self, size: i32) -> Option<Pixbuf>
pub fn icon(&self, size: i32) -> Option<Pixbuf>
Retrieves the icon of size size
associated to the resource MIME type.
size
the size of the icon in pixels
Returns
a gdk_pixbuf::Pixbuf
containing the icon,
or None
. Use g_object_unref()
when finished using the icon.
sourcepub fn mime_type(&self) -> Option<GString>
pub fn mime_type(&self) -> Option<GString>
Gets the MIME type of the resource.
Returns
the MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.
sourcepub fn modified(&self) -> c_long
pub fn modified(&self) -> c_long
Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last modified.
Returns
the number of seconds elapsed from system’s Epoch when the resource was last modified, or -1 on failure.
sourcepub fn is_private_hint(&self) -> bool
pub fn is_private_hint(&self) -> bool
sourcepub fn short_name(&self) -> Option<GString>
pub fn short_name(&self) -> Option<GString>
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”.
Returns
A newly-allocated string in UTF-8 encoding
free it with g_free()
sourcepub fn uri(&self) -> Option<GString>
pub fn uri(&self) -> Option<GString>
Gets the URI of the resource.
Returns
the URI of the resource. The returned string is owned by the recent manager, and should not be freed.
sourcepub fn uri_display(&self) -> Option<GString>
pub fn uri_display(&self) -> Option<GString>
sourcepub fn visited(&self) -> c_long
pub fn visited(&self) -> c_long
Gets the timestamp (seconds from system’s Epoch) when the meta-data for the resource was last visited.
Returns
the number of seconds elapsed from system’s Epoch when the resource was last visited, or -1 on failure.
sourcepub fn has_application(&self, app_name: &str) -> bool
pub fn has_application(&self, app_name: &str) -> bool
sourcepub fn has_group(&self, group_name: &str) -> bool
pub fn has_group(&self, group_name: &str) -> bool
Checks whether group_name
appears inside the groups
registered for the recently used item self
.
group_name
name of a group
Returns
true
if the group was found
sourcepub fn last_application(&self) -> Option<GString>
pub fn last_application(&self) -> Option<GString>
Gets the name of the last application that have registered the
recently used resource represented by self
.
Returns
an application name. Use g_free()
to free it.
pub fn match_(&self, info_b: &RecentInfo) -> bool
Trait Implementations
sourceimpl Clone for RecentInfo
impl Clone for RecentInfo
sourceimpl Debug for RecentInfo
impl Debug for RecentInfo
sourceimpl Hash for RecentInfo
impl Hash for RecentInfo
sourceimpl Ord for RecentInfo
impl Ord for RecentInfo
sourceimpl PartialEq<RecentInfo> for RecentInfo
impl PartialEq<RecentInfo> for RecentInfo
sourcefn eq(&self, other: &RecentInfo) -> bool
fn eq(&self, other: &RecentInfo) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RecentInfo) -> bool
fn ne(&self, other: &RecentInfo) -> bool
This method tests for !=
.
sourceimpl PartialOrd<RecentInfo> for RecentInfo
impl PartialOrd<RecentInfo> for RecentInfo
sourcefn partial_cmp(&self, other: &RecentInfo) -> Option<Ordering>
fn partial_cmp(&self, other: &RecentInfo) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl StaticType for RecentInfo
impl StaticType for RecentInfo
sourcefn static_type() -> Type
fn static_type() -> Type
Returns the type identifier of Self
.
impl Eq for RecentInfo
impl StructuralEq for RecentInfo
impl StructuralPartialEq for RecentInfo
Auto Trait Implementations
impl RefUnwindSafe for RecentInfo
impl !Send for RecentInfo
impl !Sync for RecentInfo
impl Unpin for RecentInfo
impl UnwindSafe for RecentInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> StaticTypeExt for T where
T: StaticType,
impl<T> StaticTypeExt for T where
T: StaticType,
sourcefn ensure_type()
fn ensure_type()
Ensures that the type has been registered with the type system.
sourceimpl<T> ToClosureReturnValue for T where
T: ToValue,
impl<T> ToClosureReturnValue for T where
T: ToValue,
fn to_closure_return_value(&self) -> Option<Value>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more