Struct gtk4::RecentInfo

source ·
#[repr(transparent)]
pub struct RecentInfo { /* private fields */ }
Expand description

RecentInfo contains the metadata associated with an item in the recently used files list.

Implementations§

Return the inner pointer to the underlying C value.

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

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

Returns

true if the resource exists

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

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

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

Retrieves the list of applications that have registered this resource.

Returns

a newly allocated None-terminated array of strings. Use g_strfreev() to free it.

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.

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.

Retrieves the icon associated to the resource MIME type.

Returns

a GIcon containing the icon

Returns all groups registered for the recently used item @self.

The array of returned group names will be None terminated, so length might optionally be None.

Returns

a newly allocated None terminated array of strings. Use g_strfreev() to free it.

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.

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

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.

Returns

true if the private flag was found, false otherwise

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()

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.

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 uri().

Returns

a newly allocated UTF-8 string containing the resource’s URI or None. Use g_free() when done using it.

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

Checks whether an application registered this resource using @app_name.

app_name

a string containing an application name

Returns

true if an application with name @app_name was found, false otherwise

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

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

Returns

true if the resource is local

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.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Returns the type identifier of Self.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Ensures that the type has been registered with the type system.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.