gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Structs.RecentInfo

Contents

- Exported types
- Methods
  - createAppInfo
  - exists
  - getAdded
  - getAge
  - getApplicationInfo
  - getApplications
  - getDescription
  - getDisplayName
  - getGicon
  - getGroups
  - getMimeType
  - getModified
  - getPrivateHint
  - getShortName
  - getUri
  - getUriDisplay
  - getVisited
  - hasApplication
  - hasGroup
  - isLocal
  - lastApplication
  - match
  - ref
  - unref

Description

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

Synopsis

- newtype RecentInfo = RecentInfo (ManagedPtr RecentInfo)
- recentInfoCreateAppInfo :: (HasCallStack, MonadIO m) => RecentInfo -> Maybe Text -> m (Maybe AppInfo)
- recentInfoExists :: (HasCallStack, MonadIO m) => RecentInfo -> m Bool
- recentInfoGetAdded :: (HasCallStack, MonadIO m) => RecentInfo -> m DateTime
- recentInfoGetAge :: (HasCallStack, MonadIO m) => RecentInfo -> m Int32
- recentInfoGetApplicationInfo :: (HasCallStack, MonadIO m) => RecentInfo -> Text -> m (Bool, Text, Word32, DateTime)
- recentInfoGetApplications :: (HasCallStack, MonadIO m) => RecentInfo -> m ([Text], CSize)
- recentInfoGetDescription :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoGetDisplayName :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoGetGicon :: (HasCallStack, MonadIO m) => RecentInfo -> m (Maybe Icon)
- recentInfoGetGroups :: (HasCallStack, MonadIO m) => RecentInfo -> m ([Text], CSize)
- recentInfoGetMimeType :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoGetModified :: (HasCallStack, MonadIO m) => RecentInfo -> m DateTime
- recentInfoGetPrivateHint :: (HasCallStack, MonadIO m) => RecentInfo -> m Bool
- recentInfoGetShortName :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoGetUri :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoGetUriDisplay :: (HasCallStack, MonadIO m) => RecentInfo -> m (Maybe Text)
- recentInfoGetVisited :: (HasCallStack, MonadIO m) => RecentInfo -> m DateTime
- recentInfoHasApplication :: (HasCallStack, MonadIO m) => RecentInfo -> Text -> m Bool
- recentInfoHasGroup :: (HasCallStack, MonadIO m) => RecentInfo -> Text -> m Bool
- recentInfoIsLocal :: (HasCallStack, MonadIO m) => RecentInfo -> m Bool
- recentInfoLastApplication :: (HasCallStack, MonadIO m) => RecentInfo -> m Text
- recentInfoMatch :: (HasCallStack, MonadIO m) => RecentInfo -> RecentInfo -> m Bool
- recentInfoRef :: (HasCallStack, MonadIO m) => RecentInfo -> m RecentInfo
- recentInfoUnref :: (HasCallStack, MonadIO m) => RecentInfo -> m ()

# Exported types

newtype RecentInfo Source #

Memory-managed wrapper type.

Constructors

RecentInfo (ManagedPtr RecentInfo) |

#### Instances

Instances details

Eq RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo Methods (==) :: RecentInfo -> RecentInfo -> Bool Source # (/=) :: RecentInfo -> RecentInfo -> Bool Source #
GBoxed RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo
ManagedPtrNewtype RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo Methods toManagedPtr :: RecentInfo -> ManagedPtr RecentInfo Source #
TypedObject RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo Methods glibType :: IO GType Source #
HasParentTypes RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo
IsGValue (Maybe RecentInfo) Source # | Convert `RecentInfo` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Structs.RecentInfo Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe RecentInfo -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe RecentInfo) Source #
type ParentTypes RecentInfo Source # |
Instance details Defined in GI.Gtk.Structs.RecentInfo type ParentTypes RecentInfo = '[] :: [Type]

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

createAppInfo, exists, hasApplication, hasGroup, isLocal, lastApplication, match, ref, unref.

#### Getters

getAdded, getAge, getApplicationInfo, getApplications, getDescription, getDisplayName, getGicon, getGroups, getMimeType, getModified, getPrivateHint, getShortName, getUri, getUriDisplay, getVisited.

#### Setters

None.

## createAppInfo

recentInfoCreateAppInfo Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> Maybe Text | `appName`: the name of the application that should be mapped to a `GAppInfo`; if `Nothing` is used then the default application for the MIME type is used
-> m (Maybe AppInfo) | Returns: the newly created `GAppInfo` (Can throw `GError`)

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`

## exists

recentInfoExists Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Bool | Returns: `True` if the resource exists

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

## getAdded

recentInfoGetAdded Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m DateTime | Returns: a `GDateTime` for the time when the resource was added

Gets the time when the resource was added to the recently used resources list.

## getAge

recentInfoGetAge Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Int32 | Returns: a positive integer containing the number of days elapsed since the time this resource was last modified

Gets the number of days elapsed since the last update of the resource pointed by `info`.

## getApplicationInfo

recentInfoGetApplicationInfo Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> Text | `appName`: the name of the application that has registered this item
-> m (Bool, Text, Word32, DateTime) | 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

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.

## getApplications

recentInfoGetApplications Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m ([Text], CSize) | Returns: a newly allocated `Nothing`-terminated array of strings. Use `strfreev` to free it.

Retrieves the list of applications that have registered this resource.

## getDescription

recentInfoGetDescription Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Text | Returns: the description of the resource. The returned string is owned by the recent manager, and should not be freed.

Gets the (short) description of the resource.

## getDisplayName

recentInfoGetDisplayName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Text | Returns: the display name 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.

## getGicon

recentInfoGetGicon Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m (Maybe Icon) | Returns: a `GIcon` containing the icon

Retrieves the icon associated to the resource MIME type.

## getGroups

recentInfoGetGroups Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m ([Text], CSize) | Returns: a newly allocated `Nothing` terminated array of strings. Use `strfreev` to free it.

Returns all groups registered for the recently used item `info`.

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

## getMimeType

recentInfoGetMimeType Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Text | Returns: the MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.

Gets the MIME type of the resource.

## getModified

recentInfoGetModified Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m DateTime | Returns: a `GDateTime` for the time when the resource was last modified

Gets the time when the meta-data for the resource was last modified.

## getPrivateHint

recentInfoGetPrivateHint Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Bool | Returns: `True` if the private flag was found, `False` otherwise

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.

## getShortName

recentInfoGetShortName Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: an `GtkRecentInfo`
-> m Text | Returns: A newly-allocated string in UTF-8 encoding free it with `free`

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”.

## getUri

recentInfoGetUri Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `tkRecentInfo`
-> m Text | Returns: the URI of the resource. The returned string is owned by the recent manager, and should not be freed.

Gets the URI of the resource.

## getUriDisplay

recentInfoGetUriDisplay Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m (Maybe Text) | Returns: a newly allocated UTF-8 string containing the resource’s URI or `Nothing`. Use `free` when done using it.

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 `recentInfoGetUri`.

## getVisited

recentInfoGetVisited Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m DateTime | Returns: a `GDateTime` for the time when the resource was last visited

Gets the time when the meta-data for the resource was last visited.

## hasApplication

recentInfoHasApplication Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> Text | `appName`: a string containing an application name
-> m Bool | Returns: `True` if an application with name `appName` was found, `False` otherwise

Checks whether an application registered this resource using `appName`.

## hasGroup

recentInfoHasGroup Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> Text | `groupName`: name of a group
-> m Bool | Returns: `True` if the group was found

Checks whether `groupName` appears inside the groups registered for the recently used item `info`.

## isLocal

recentInfoIsLocal Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Bool | Returns: `True` if the resource is local

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

## lastApplication

recentInfoLastApplication Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m Text | Returns: an application name. Use `free` to free it.

Gets the name of the last application that have registered the recently used resource represented by `info`.

## match

recentInfoMatch Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `infoA`: a `GtkRecentInfo`
-> RecentInfo | `infoB`: a `GtkRecentInfo`
-> m Bool | Returns: `True` if both `GtkRecentInfo` point to the same resource, `False` otherwise

Checks whether two `GtkRecentInfo` point to the same resource.

## ref

recentInfoRef Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m RecentInfo | Returns: the recent info object with its reference count increased by one

Increases the reference count of `recentInfo` by one.

## unref

recentInfoUnref Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> RecentInfo | `info`: a `GtkRecentInfo`
-> m () |

Decreases the reference count of `info` by one.

If the reference count reaches zero, `info` is deallocated, and the memory freed.