Class RecentInfo
- All Implemented Interfaces:
Proxy
-
Constructor Summary
ConstructorsConstructorDescriptionRecentInfo(MemorySegment address) Create a RecentInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescription@Nullable AppInfocreateAppInfo(@Nullable String appName) Creates aGAppInfofor the specifiedGtkRecentInfobooleanexists()Checks whether the resource pointed by this RecentInfo still exists.getAdded()Gets the time when the resource was added to the recently used resources list.intgetAge()Gets the number of days elapsed since the last update of the resource pointed byinfo.booleanGets the data regarding the application that has registered the resource pointed byinfo.String[]Retrieves the list of applications that have registered this resource.Gets the (short) description of the resource.Gets the name of the resource.@Nullable IcongetGicon()Retrieves the icon associated to the resource MIME type.String[]Returns all groups registered for the recently used iteminfo.Gets the MIME type of the resource.Gets the time when the meta-data for the resource was last modified.booleanGets the value of the “private” flag.Computes a valid UTF-8 string that can be used as the name of the item in a menu or list.static @Nullable TypegetType()Get the GType of the RecentInfo classgetUri()Gets the URI of the resource.@Nullable StringGets a displayable version of the resource’s URI.Gets the time when the meta-data for the resource was last visited.booleanhasApplication(String appName) Checks whether an application registered this resource usingappName.booleanChecks whethergroupNameappears inside the groups registered for the recently used iteminfo.booleanisLocal()Checks whether the resource is local or not by looking at the scheme of its URI.Gets the name of the last application that have registered the recently used resource represented byinfo.booleanmatch(RecentInfo infoB) Checks whether twoGtkRecentInfopoint to the same resource.ref()Increases the reference count ofrecentInfoby one.voidunref()Decreases the reference count of this RecentInfo by one.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
RecentInfo
Create a RecentInfo proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
createAppInfo
Creates aGAppInfofor the specifiedGtkRecentInfoIn case of error,
errorwill be set either with aGTK_RECENT_MANAGER_ERRORor aG_IO_ERROR- Parameters:
appName- the name of the application that should be mapped to aGAppInfo; ifnullis used then the default application for the MIME type is used- Returns:
- the newly created
GAppInfo - Throws:
GErrorException- seeGError
-
exists
public boolean exists()Checks whether the resource pointed by this RecentInfo still exists. At the moment this check is done only on resources pointing to local files.- Returns:
trueif the resource exists
-
getAdded
Gets the time when the resource was added to the recently used resources list.- Returns:
- a
GDateTimefor the time when the resource was added
-
getAge
public int getAge()Gets the number of days elapsed since the last update of the resource pointed byinfo.- Returns:
- a positive integer containing the number of days elapsed since the time this resource was last modified
-
getApplicationInfo
public boolean getApplicationInfo(String appName, Out<String> appExec, Out<Integer> count, Out<DateTime> stamp) Gets the data regarding the application that has registered the resource pointed byinfo.If the command line contains any escape characters defined inside the storage specification, they will be expanded.
- Parameters:
appName- the name of the application that has registered this itemappExec- return location for the string containing the command linecount- return location for the number of times this item was registeredstamp- return location for the time this item was last registered for this application- Returns:
trueif an application withappNamehas registered this resource inside the recently used list, orfalseotherwise. TheappExecstring is owned by theGtkRecentInfoand should not be modified or freed
-
getApplications
Retrieves the list of applications that have registered this resource.- Returns:
- a newly
allocated
null-terminated array of strings. Use g_strfreev() to free it.
-
getDescription
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.
-
getDisplayName
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.
-
getGicon
Retrieves the icon associated to the resource MIME type.- Returns:
- a
GIconcontaining the icon
-
getGroups
Returns all groups registered for the recently used iteminfo.The array of returned group names will be
nullterminated, so length might optionally benull.- Returns:
- a newly allocated
nullterminated array of strings. Use g_strfreev() to free it.
-
getMimeType
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.
-
getModified
Gets the time when the meta-data for the resource was last modified.- Returns:
- a
GDateTimefor the time when the resource was last modified
-
getPrivateHint
public boolean getPrivateHint()Gets the value of the “private” flag.Resources in the recently used list that have this flag set to
trueshould only be displayed by the applications that have registered them.- Returns:
trueif the private flag was found,falseotherwise
-
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”.
- Returns:
- A newly-allocated string in UTF-8 encoding free it with g_free()
-
getUri
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.
-
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
getUri().- Returns:
- a newly allocated UTF-8 string containing the
resource’s URI or
null. Use g_free() when done using it.
-
getVisited
Gets the time when the meta-data for the resource was last visited.- Returns:
- a
GDateTimefor the time when the resource was last visited
-
hasApplication
Checks whether an application registered this resource usingappName.- Parameters:
appName- a string containing an application name- Returns:
trueif an application with nameappNamewas found,falseotherwise
-
hasGroup
Checks whethergroupNameappears inside the groups registered for the recently used iteminfo.- Parameters:
groupName- name of a group- Returns:
trueif the group was found
-
isLocal
public boolean isLocal()Checks whether the resource is local or not by looking at the scheme of its URI.- Returns:
trueif the resource is local
-
lastApplication
Gets the name of the last application that have registered the recently used resource represented byinfo.- Returns:
- an application name. Use g_free() to free it.
-
match
Checks whether twoGtkRecentInfopoint to the same resource.- Parameters:
infoB- aGtkRecentInfo- Returns:
trueif bothGtkRecentInfopoint to the same resource,falseotherwise
-
ref
Increases the reference count ofrecentInfoby one.- Returns:
- the recent info object with its reference count increased by one
-
unref
public void unref()Decreases the reference count of this RecentInfo by one.If the reference count reaches zero, this RecentInfo is deallocated, and the memory freed.
-