pub struct RecentInfo { /* private fields */ }
Expand description
RecentInfo
contains the metadata associated with an item in the
recently used files list.
GLib type: Shared boxed type with reference counted clone semantics.
Implementations§
Source§impl RecentInfo
impl RecentInfo
Sourcepub fn as_ptr(&self) -> *mut GtkRecentInfo
pub fn as_ptr(&self) -> *mut GtkRecentInfo
Return the inner pointer to the underlying C value.
Sourcepub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkRecentInfo) -> &Self
pub unsafe fn from_glib_ptr_borrow(ptr: &*mut GtkRecentInfo) -> &Self
Borrows the underlying C value.
Source§impl 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 GAppInfo
for the specified RecentInfo
In case of error, @error will be set either with a
GTK_RECENT_MANAGER_ERROR
or a G_IO_ERROR
§app_name
the name of the application that should
be mapped to a GAppInfo
; if None
is used then the default
application for the MIME type is used
§Returns
the newly created GAppInfo
Sourcepub fn added(&self) -> DateTime
pub fn added(&self) -> DateTime
Gets the time when the resource was added to the recently used resources list.
§Returns
a GDateTime
for the time
when the resource was added
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, DateTime)>
pub fn application_info( &self, app_name: &str, ) -> Option<(GString, u32, DateTime)>
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
§stamp
return location for the time this item was last registered for this application
Sourcepub fn applications(&self) -> Vec<GString>
pub fn applications(&self) -> Vec<GString>
Sourcepub fn description(&self) -> GString
pub fn description(&self) -> 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) -> GString
pub fn display_name(&self) -> 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 mime_type(&self) -> GString
pub fn mime_type(&self) -> 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) -> DateTime
pub fn modified(&self) -> DateTime
Gets the time when the meta-data for the resource was last modified.
§Returns
a GDateTime
for the time
when the resource was last modified
Sourcepub fn is_private_hint(&self) -> bool
pub fn is_private_hint(&self) -> bool
Sourcepub fn short_name(&self) -> GString
pub fn short_name(&self) -> 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) -> GString
pub fn uri(&self) -> 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) -> DateTime
pub fn visited(&self) -> DateTime
Gets the time when the meta-data for the resource was last visited.
§Returns
a GDateTime
for the time
when the resource was last visited
Sourcepub fn has_application(&self, app_name: &str) -> bool
pub fn has_application(&self, app_name: &str) -> bool
Sourcepub fn last_application(&self) -> GString
pub fn last_application(&self) -> 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.
Sourcepub fn match_(&self, info_b: &RecentInfo) -> bool
pub fn match_(&self, info_b: &RecentInfo) -> bool
Checks whether two RecentInfo
point to the same resource.
§info_b
§Returns
true
if both RecentInfo
point to the same
resource, false
otherwise
Trait Implementations§
Source§impl Clone for RecentInfo
impl Clone for RecentInfo
Source§impl Debug for RecentInfo
impl Debug for RecentInfo
Source§impl From<RecentInfo> for Value
impl From<RecentInfo> for Value
Source§fn from(s: RecentInfo) -> Self
fn from(s: RecentInfo) -> Self
Source§impl HasParamSpec for RecentInfo
impl HasParamSpec for RecentInfo
type ParamSpec = ParamSpecBoxed
Source§type SetValue = RecentInfo
type SetValue = RecentInfo
type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, RecentInfo>
fn param_spec_builder() -> Self::BuilderFn
Source§impl Hash for RecentInfo
impl Hash for RecentInfo
Source§impl Ord for RecentInfo
impl Ord for RecentInfo
Source§fn cmp(&self, other: &RecentInfo) -> Ordering
fn cmp(&self, other: &RecentInfo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RecentInfo
impl PartialEq for RecentInfo
Source§impl PartialOrd for RecentInfo
impl PartialOrd for RecentInfo
Source§impl StaticType for RecentInfo
impl StaticType for RecentInfo
Source§fn static_type() -> Type
fn static_type() -> Type
Self
.impl Eq for RecentInfo
impl StructuralPartialEq for RecentInfo
Auto Trait Implementations§
impl Freeze for RecentInfo
impl RefUnwindSafe for RecentInfo
impl !Send for RecentInfo
impl !Sync for RecentInfo
impl Unpin for RecentInfo
impl UnwindSafe for RecentInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)