Class RecentInfo

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class RecentInfo extends ProxyInstance
Contains the metadata associated with an item in the recently used files list.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a RecentInfo proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable AppInfo
    createAppInfo(@Nullable String appName)
    Creates a GAppInfo for the specified GtkRecentInfo
    boolean
    Checks whether the resource pointed by this RecentInfo still exists.
    Gets the time when the resource was added to the recently used resources list.
    int
    Gets the number of days elapsed since the last update of the resource pointed by info.
    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 by info.
    Retrieves the list of applications that have registered this resource.
    Gets the (short) description of the resource.
    Gets the name of the resource.
    @Nullable Icon
    Retrieves the icon associated to the resource MIME type.
    Returns all groups registered for the recently used item info.
    The memory layout of the native struct.
    Gets the MIME type of the resource.
    Gets the time when the meta-data for the resource was last modified.
    boolean
    Gets 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 Type
    Get the GType of the RecentInfo class.
    Gets the URI of the resource.
    @Nullable String
    Gets a displayable version of the resource’s URI.
    Gets the time when the meta-data for the resource was last visited.
    boolean
    Checks whether an application registered this resource using appName.
    boolean
    hasGroup(String groupName)
    Checks whether groupName appears inside the groups registered for the recently used item info.
    boolean
    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 by info.
    boolean
    Checks whether two GtkRecentInfo point to the same resource.
    ref()
    Increases the reference count of recentInfo by one.
    void
    Decreases the reference count of this RecentInfo by one.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecentInfo

      public RecentInfo(MemorySegment address)
      Create a RecentInfo proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the RecentInfo class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • createAppInfo

      public @Nullable AppInfo createAppInfo(@Nullable String appName) throws GErrorException

      Creates a GAppInfo for the specified GtkRecentInfo

      In case of error, error will be set either with a GTK_RECENT_MANAGER_ERROR or a G_IO_ERROR

      Parameters:
      appName - the name of the application that should be mapped to a GAppInfo; if null is used then the default application for the MIME type is used
      Returns:
      the newly created GAppInfo
      Throws:
      GErrorException - see GError
    • 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:
      true if the resource exists
    • getAdded

      public DateTime getAdded()
      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
    • getAge

      public int getAge()
      Gets the number of days elapsed since the last update of the resource pointed by info.
      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 by info.

      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 item
      appExec - 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
      Returns:
      true if an application with appName has registered this resource inside the recently used list, or false otherwise. The appExec string is owned by the GtkRecentInfo and should not be modified or freed
    • getApplications

      public String[] 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

      public String 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

      public String 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

      public @Nullable Icon getGicon()
      Retrieves the icon associated to the resource MIME type.
      Returns:
      a GIcon containing the icon
    • getGroups

      public String[] getGroups()

      Returns all groups registered for the recently used item info.

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

      Returns:
      a newly allocated null terminated array of strings. Use g_strfreev() to free it.
    • getMimeType

      public String 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

      public DateTime getModified()
      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
    • getPrivateHint

      public boolean getPrivateHint()

      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
    • getShortName

      public String 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

      public String 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

      public @Nullable String 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

      public DateTime getVisited()
      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
    • hasApplication

      public boolean hasApplication(String appName)
      Checks whether an application registered this resource using appName.
      Parameters:
      appName - a string containing an application name
      Returns:
      true if an application with name appName was found, false otherwise
    • hasGroup

      public boolean hasGroup(String groupName)
      Checks whether groupName appears inside the groups registered for the recently used item info.
      Parameters:
      groupName - name of a group
      Returns:
      true if 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:
      true if the resource is local
    • lastApplication

      public String lastApplication()
      Gets the name of the last application that have registered the recently used resource represented by info.
      Returns:
      an application name. Use g_free() to free it.
    • match

      public boolean match(RecentInfo infoB)
      Checks whether two GtkRecentInfo point to the same resource.
      Parameters:
      infoB - a GtkRecentInfo
      Returns:
      true if both GtkRecentInfo point to the same resource, false otherwise
    • ref

      public RecentInfo ref()
      Increases the reference count of recentInfo by 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.