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.Gio.Interfaces.AppInfo
Contents
- Exported types
- Methods
- addSupportsType
- canDelete
- canRemoveSupportsType
- createFromCommandline
- delete
- dup
- equal
- getAll
- getAllForType
- getCommandline
- getDefaultForType
- getDefaultForTypeAsync
- getDefaultForTypeFinish
- getDefaultForUriScheme
- getDefaultForUriSchemeAsync
- getDefaultForUriSchemeFinish
- getDescription
- getDisplayName
- getExecutable
- getFallbackForType
- getIcon
- getId
- getName
- getRecommendedForType
- getSupportedTypes
- launch
- launchDefaultForUri
- launchDefaultForUriAsync
- launchDefaultForUriFinish
- launchUris
- launchUrisAsync
- launchUrisFinish
- removeSupportsType
- resetTypeAssociations
- setAsDefaultForExtension
- setAsDefaultForType
- setAsLastUsedForType
- shouldShow
- supportsFiles
- supportsUris
Description
Information about an installed application and methods to launch it (with file arguments).
GAppInfo
and GAppLaunchContext
are used for describing and launching
applications installed on the system.
As of GLib 2.20, URIs will always be converted to POSIX paths
(using fileGetPath
) when using appInfoLaunch
even if the application requested an URI and not a POSIX path. For example
for a desktop-file based application with the following Exec key:
Exec=totem %U
and a single URI, sftp://foo/file.avi
, then
/home/user/.gvfs/sftp on foo/file.avi
will be passed. This will only work
if a set of suitable GIO extensions (such as GVfs 2.26 compiled with FUSE
support), is available and operational; if this is not the case, the URI
will be passed unmodified to the application. Some URIs, such as mailto:
,
of course cannot be mapped to a POSIX path (in GVfs there’s no FUSE mount
for it); such URIs will be passed unmodified to the application.
Specifically for GVfs 2.26 and later, the POSIX URI will be mapped
back to the GIO URI in the File
constructors (since GVfs
implements the GVfs extension point). As such, if the application
needs to examine the URI, it needs to use fileGetUri
or similar on File
. In other words, an application cannot
assume that the URI passed to e.g. fileNewForCommandlineArg
is equal to the result of fileGetUri
. The following snippet
illustrates this:
c code
GFile *f; char *uri; file = g_file_new_for_commandline_arg (uri_from_commandline); uri = g_file_get_uri (file); strcmp (uri, uri_from_commandline) == 0; g_free (uri); if (g_file_has_uri_scheme (file, "cdda")) { // do something special with uri } g_object_unref (file);
This code will work when both cdda://sr0/Track 1.wav
and
/home/user/.gvfs/cdda on sr0/Track 1.wav
is passed to the
application. It should be noted that it’s generally not safe
for applications to rely on the format of a particular URIs.
Different launcher applications (e.g. file managers) may have
different ideas of what a given URI means.
Synopsis
- newtype AppInfo = AppInfo (ManagedPtr AppInfo)
- class (GObject o, IsDescendantOf AppInfo o) => IsAppInfo o
- toAppInfo :: (MonadIO m, IsAppInfo o) => o -> m AppInfo
- type family ResolveAppInfoMethod (t :: Symbol) o where ...
- data AppInfoAddSupportsTypeMethodInfo
- appInfoAddSupportsType :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> Text -> m ()
- data AppInfoCanDeleteMethodInfo
- appInfoCanDelete :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
- data AppInfoCanRemoveSupportsTypeMethodInfo
- appInfoCanRemoveSupportsType :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
- appInfoCreateFromCommandline :: (HasCallStack, MonadIO m) => [Char] -> Maybe Text -> [AppInfoCreateFlags] -> m AppInfo
- data AppInfoDeleteMethodInfo
- appInfoDelete :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
- data AppInfoDupMethodInfo
- appInfoDup :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m AppInfo
- data AppInfoEqualMethodInfo
- appInfoEqual :: (HasCallStack, MonadIO m, IsAppInfo a, IsAppInfo b) => a -> b -> m Bool
- appInfoGetAll :: (HasCallStack, MonadIO m) => m [AppInfo]
- appInfoGetAllForType :: (HasCallStack, MonadIO m) => Text -> m [AppInfo]
- data AppInfoGetCommandlineMethodInfo
- appInfoGetCommandline :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m (Maybe [Char])
- appInfoGetDefaultForType :: (HasCallStack, MonadIO m) => Text -> Bool -> m (Maybe AppInfo)
- appInfoGetDefaultForTypeAsync :: (HasCallStack, MonadIO m, IsCancellable a) => Text -> Bool -> Maybe a -> Maybe AsyncReadyCallback -> m ()
- appInfoGetDefaultForTypeFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m AppInfo
- appInfoGetDefaultForUriScheme :: (HasCallStack, MonadIO m) => Text -> m (Maybe AppInfo)
- appInfoGetDefaultForUriSchemeAsync :: (HasCallStack, MonadIO m, IsCancellable a) => Text -> Maybe a -> Maybe AsyncReadyCallback -> m ()
- appInfoGetDefaultForUriSchemeFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m AppInfo
- data AppInfoGetDescriptionMethodInfo
- appInfoGetDescription :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m (Maybe Text)
- data AppInfoGetDisplayNameMethodInfo
- appInfoGetDisplayName :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Text
- data AppInfoGetExecutableMethodInfo
- appInfoGetExecutable :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m [Char]
- appInfoGetFallbackForType :: (HasCallStack, MonadIO m) => Text -> m [AppInfo]
- data AppInfoGetIconMethodInfo
- appInfoGetIcon :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m (Maybe Icon)
- data AppInfoGetIdMethodInfo
- appInfoGetId :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m (Maybe Text)
- data AppInfoGetNameMethodInfo
- appInfoGetName :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Text
- appInfoGetRecommendedForType :: (HasCallStack, MonadIO m) => Text -> m [AppInfo]
- data AppInfoGetSupportedTypesMethodInfo
- appInfoGetSupportedTypes :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m [Text]
- data AppInfoLaunchMethodInfo
- appInfoLaunch :: (HasCallStack, MonadIO m, IsAppInfo a, IsFile b, IsAppLaunchContext c) => a -> [b] -> Maybe c -> m ()
- appInfoLaunchDefaultForUri :: (HasCallStack, MonadIO m, IsAppLaunchContext a) => Text -> Maybe a -> m ()
- appInfoLaunchDefaultForUriAsync :: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsCancellable b) => Text -> Maybe a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- appInfoLaunchDefaultForUriFinish :: (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m ()
- data AppInfoLaunchUrisMethodInfo
- appInfoLaunchUris :: (HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b) => a -> [Text] -> Maybe b -> m ()
- data AppInfoLaunchUrisAsyncMethodInfo
- appInfoLaunchUrisAsync :: (HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b, IsCancellable c) => a -> [Text] -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- data AppInfoLaunchUrisFinishMethodInfo
- appInfoLaunchUrisFinish :: (HasCallStack, MonadIO m, IsAppInfo a, IsAsyncResult b) => a -> b -> m ()
- data AppInfoRemoveSupportsTypeMethodInfo
- appInfoRemoveSupportsType :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> Text -> m ()
- appInfoResetTypeAssociations :: (HasCallStack, MonadIO m) => Text -> m ()
- data AppInfoSetAsDefaultForExtensionMethodInfo
- appInfoSetAsDefaultForExtension :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> [Char] -> m ()
- data AppInfoSetAsDefaultForTypeMethodInfo
- appInfoSetAsDefaultForType :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> Text -> m ()
- data AppInfoSetAsLastUsedForTypeMethodInfo
- appInfoSetAsLastUsedForType :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> Text -> m ()
- data AppInfoShouldShowMethodInfo
- appInfoShouldShow :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
- data AppInfoSupportsFilesMethodInfo
- appInfoSupportsFiles :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
- data AppInfoSupportsUrisMethodInfo
- appInfoSupportsUris :: (HasCallStack, MonadIO m, IsAppInfo a) => a -> m Bool
Exported types
Memory-managed wrapper type.
Constructors
AppInfo (ManagedPtr AppInfo) |
Instances
class (GObject o, IsDescendantOf AppInfo o) => IsAppInfo o Source #
Instances
(GObject o, IsDescendantOf AppInfo o) => IsAppInfo o Source # | |
Defined in GI.Gio.Interfaces.AppInfo |
Methods
Click to display all available methods, including inherited ones
Methods
addSupportsType, bindProperty, bindPropertyFull, canDelete, canRemoveSupportsType, delete, dup, equal, forceFloating, freezeNotify, getv, isFloating, launch, launchUris, launchUrisAsync, launchUrisFinish, notify, notifyByPspec, ref, refSink, removeSupportsType, runDispose, shouldShow, stealData, stealQdata, supportsFiles, supportsUris, thawNotify, unref, watchClosure.
Getters
getCommandline, getData, getDescription, getDisplayName, getExecutable, getIcon, getId, getName, getProperty, getQdata, getSupportedTypes.
Setters
setAsDefaultForExtension, setAsDefaultForType, setAsLastUsedForType, setData, setDataFull, setProperty.
type family ResolveAppInfoMethod (t :: Symbol) o where ... Source #
Equations
addSupportsType
data AppInfoAddSupportsTypeMethodInfo Source #
Instances
(signature ~ (Text -> m ()), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoAddSupportsTypeMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoAddSupportsTypeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoAddSupportsType Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Adds a content type to the application information to indicate the application is capable of opening files with the given content type.
canDelete
data AppInfoCanDeleteMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoCanDeleteMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoCanDeleteMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Obtains the information whether the AppInfo
can be deleted.
See appInfoDelete
.
Since: 2.20
canRemoveSupportsType
data AppInfoCanRemoveSupportsTypeMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoCanRemoveSupportsTypeMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoCanRemoveSupportsTypeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoCanRemoveSupportsType Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Checks if a supported content type can be removed from an application.
createFromCommandline
appInfoCreateFromCommandline Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> [Char] |
|
-> Maybe Text |
|
-> [AppInfoCreateFlags] |
|
-> m AppInfo |
Creates a new AppInfo
from the given information.
Note that for commandline
, the quoting rules of the Exec
key of the
freedesktop.org Desktop Entry Specification
are applied. For example, if the commandline
contains
percent-encoded URIs, the percent-character must be doubled in order to prevent it from
being swallowed by Exec
key unquoting. See
the specification
for exact quoting rules.
delete
data AppInfoDeleteMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoDeleteMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoDeleteMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Tries to delete a AppInfo
.
On some platforms, there may be a difference between user-defined
AppInfo
s which can be deleted, and system-wide ones which cannot.
See appInfoCanDelete
.
Since: 2.20
dup
data AppInfoDupMethodInfo Source #
Instances
(signature ~ m AppInfo, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoDupMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoDupMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m AppInfo | Returns: a duplicate of |
Creates a duplicate of a AppInfo
.
equal
data AppInfoEqualMethodInfo Source #
Instances
(signature ~ (b -> m Bool), MonadIO m, IsAppInfo a, IsAppInfo b) => OverloadedMethod AppInfoEqualMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoEqualMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a, IsAppInfo b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Checks if two AppInfo
s are equal.
Note that the check *may not* compare each individual field, and only does an identity check. In case detecting changes in the contents is needed, program code must additionally compare relevant fields.
getAll
Arguments
:: (HasCallStack, MonadIO m) | |
=> m [AppInfo] | Returns: a newly allocated
list of references to |
Gets a list of all of the applications currently registered on this system.
For desktop files, this includes applications that have
`NoDisplay=true`
set or are excluded from display by means of
`OnlyShowIn`
or `NotShowIn`.
See appInfoShouldShow
.
The returned list does not include applications which have the `Hidden` key set.
getAllForType
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m [AppInfo] | Returns: list of
|
Gets a list of all AppInfo
s for a given content type,
including the recommended and fallback AppInfo
s. See
appInfoGetRecommendedForType
and
appInfoGetFallbackForType
.
getCommandline
data AppInfoGetCommandlineMethodInfo Source #
Instances
(signature ~ m (Maybe [Char]), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetCommandlineMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetCommandlineMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoGetCommandline Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m (Maybe [Char]) | Returns: a string containing the |
Gets the commandline with which the application will be started.
Since: 2.20
getDefaultForType
appInfoGetDefaultForType Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Bool |
|
-> m (Maybe AppInfo) | Returns: |
Gets the default AppInfo
for a given content type.
getDefaultForTypeAsync
appInfoGetDefaultForTypeAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsCancellable a) | |
=> Text |
|
-> Bool |
|
-> Maybe a |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously gets the default AppInfo
for a given content
type.
Since: 2.74
getDefaultForTypeFinish
appInfoGetDefaultForTypeFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m AppInfo | Returns: |
Finishes a default AppInfo
lookup started by
appInfoGetDefaultForTypeAsync
.
If no #AppInfo
is found, then error
will be set to
[errorgio
.IOErrorEnum.NOT_FOUND].
Since: 2.74
getDefaultForUriScheme
appInfoGetDefaultForUriScheme Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe AppInfo) | Returns: |
Gets the default application for handling URIs with the given URI scheme.
A URI scheme is the initial part of the URI, up to but not including the :
.
For example, http
, ftp
or sip
.
getDefaultForUriSchemeAsync
appInfoGetDefaultForUriSchemeAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsCancellable a) | |
=> Text |
|
-> Maybe a |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Asynchronously gets the default application for handling URIs with
the given URI scheme. A URI scheme is the initial part
of the URI, up to but not including the :
, e.g. http
,
ftp
or sip
.
Since: 2.74
getDefaultForUriSchemeFinish
appInfoGetDefaultForUriSchemeFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m AppInfo | Returns: |
Finishes a default AppInfo
lookup started by
appInfoGetDefaultForUriSchemeAsync
.
If no AppInfo
is found, then error
will be set to
[errorgio
.IOErrorEnum.NOT_FOUND].
Since: 2.74
getDescription
data AppInfoGetDescriptionMethodInfo Source #
Instances
(signature ~ m (Maybe Text), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetDescriptionMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetDescriptionMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoGetDescription Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m (Maybe Text) | Returns: a string containing a description of the
application |
Gets a human-readable description of an installed application.
getDisplayName
data AppInfoGetDisplayNameMethodInfo Source #
Instances
(signature ~ m Text, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetDisplayNameMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetDisplayNameMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoGetDisplayName Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Text | Returns: the display name of the application for |
Gets the display name of the application. The display name is often more descriptive to the user than the name itself.
Since: 2.24
getExecutable
data AppInfoGetExecutableMethodInfo Source #
Instances
(signature ~ m [Char], MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetExecutableMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetExecutableMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m [Char] | Returns: a string containing the |
Gets the executable’s name for the installed application.
This is intended to be used for debugging or labelling what program is going
to be run. To launch the executable, use appInfoLaunch
and related
functions, rather than spawning the return value from this function.
getFallbackForType
appInfoGetFallbackForType Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m [AppInfo] | Returns: list of |
Gets a list of fallback AppInfo
s for a given content type, i.e.
those applications which claim to support the given content type by MIME
type subclassing and not directly.
Since: 2.28
getIcon
data AppInfoGetIconMethodInfo Source #
Instances
(signature ~ m (Maybe Icon), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetIconMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetIconMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m (Maybe Icon) | Returns: the default |
Gets the icon for the application.
getId
data AppInfoGetIdMethodInfo Source #
Instances
(signature ~ m (Maybe Text), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetIdMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetIdMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m (Maybe Text) | Returns: a string containing the application’s ID. |
Gets the ID of an application. An id is a string that identifies the application. The exact format of the id is platform dependent. For instance, on Unix this is the desktop file id from the xdg menu specification.
Note that the returned ID may be NULL
, depending on how the appinfo
has
been constructed.
getName
data AppInfoGetNameMethodInfo Source #
Instances
(signature ~ m Text, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetNameMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetNameMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Text | Returns: the name of the application for |
Gets the installed name of the application.
getRecommendedForType
appInfoGetRecommendedForType Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m [AppInfo] | Returns: list of
|
Gets a list of recommended AppInfo
s for a given content type,
i.e. those applications which claim to support the given content type
exactly, and not by MIME type subclassing.
Note that the first application of the list is the last used one, i.e.
the last one for which appInfoSetAsLastUsedForType
has
been called.
Since: 2.28
getSupportedTypes
data AppInfoGetSupportedTypesMethodInfo Source #
Instances
(signature ~ m [Text], MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoGetSupportedTypesMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoGetSupportedTypesMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoGetSupportedTypes Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m [Text] | Returns: a list of content types. |
Retrieves the list of content types that appInfo
claims to support.
If this information is not provided by the environment, this function
will return NULL
.
This function does not take in consideration associations added with
appInfoAddSupportsType
, but only those exported directly by
the application.
Since: 2.34
launch
data AppInfoLaunchMethodInfo Source #
Instances
(signature ~ ([b] -> Maybe c -> m ()), MonadIO m, IsAppInfo a, IsFile b, IsAppLaunchContext c) => OverloadedMethod AppInfoLaunchMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoLaunchMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a, IsFile b, IsAppLaunchContext c) | |
=> a |
|
-> [b] |
|
-> Maybe c |
|
-> m () | (Can throw |
Launches the application. Passes files
to the launched application
as arguments, using the optional context
to get information
about the details of the launcher (like what screen it is on).
On error, error
will be set accordingly.
To launch the application without arguments pass a NULL
files
list.
Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.
Some URIs can be changed when passed through a GFile (for instance
unsupported URIs with strange formats like mailto:), so if you have
a textual URI you want to pass in as argument, consider using
appInfoLaunchUris
instead.
The launched application inherits the environment of the launching
process, but it can be modified with appLaunchContextSetenv
and appLaunchContextUnsetenv
.
On UNIX, this function sets the GIO_LAUNCHED_DESKTOP_FILE
environment variable with the path of the launched desktop file and
GIO_LAUNCHED_DESKTOP_FILE_PID
to the process id of the launched
process. This can be used to ignore GIO_LAUNCHED_DESKTOP_FILE
,
should it be inherited by further processes. The DISPLAY
,
XDG_ACTIVATION_TOKEN
and DESKTOP_STARTUP_ID
environment
variables are also set, based on information provided in context
.
launchDefaultForUri
appInfoLaunchDefaultForUri Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppLaunchContext a) | |
=> Text |
|
-> Maybe a |
|
-> m () | (Can throw |
Utility function that launches the default application registered to handle the specified uri. Synchronous I/O is done on the uri to detect the type of the file if required.
The D-Bus–activated applications don’t have to be started if your application
terminates too soon after this function. To prevent this, use
appInfoLaunchDefaultForUriAsync
instead.
launchDefaultForUriAsync
appInfoLaunchDefaultForUriAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppLaunchContext a, IsCancellable b) | |
=> Text |
|
-> Maybe a |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Async version of appInfoLaunchDefaultForUri
.
This version is useful if you are interested in receiving error information in the case where the application is sandboxed and the portal may present an application chooser dialog to the user.
This is also useful if you want to be sure that the D-Bus–activated applications are really started before termination and if you are interested in receiving error information from their activation.
Since: 2.50
launchDefaultForUriFinish
appInfoLaunchDefaultForUriFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsAsyncResult a) | |
=> a |
|
-> m () | (Can throw |
Finishes an asynchronous launch-default-for-uri operation.
Since: 2.50
launchUris
data AppInfoLaunchUrisMethodInfo Source #
Instances
(signature ~ ([Text] -> Maybe b -> m ()), MonadIO m, IsAppInfo a, IsAppLaunchContext b) => OverloadedMethod AppInfoLaunchUrisMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoLaunchUrisMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b) | |
=> a |
|
-> [Text] |
|
-> Maybe b |
|
-> m () | (Can throw |
Launches the application. This passes the uris
to the launched application
as arguments, using the optional context
to get information
about the details of the launcher (like what screen it is on).
On error, error
will be set accordingly. If the application only supports
one URI per invocation as part of their command-line, multiple instances
of the application will be spawned.
To launch the application without arguments pass a NULL
uris
list.
Note that even if the launch is successful the application launched can fail to start if it runs into problems during startup. There is no way to detect this.
launchUrisAsync
data AppInfoLaunchUrisAsyncMethodInfo Source #
Instances
(signature ~ ([Text] -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()), MonadIO m, IsAppInfo a, IsAppLaunchContext b, IsCancellable c) => OverloadedMethod AppInfoLaunchUrisAsyncMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoLaunchUrisAsyncMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoLaunchUrisAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b, IsCancellable c) | |
=> a |
|
-> [Text] |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Async version of appInfoLaunchUris
.
The callback
is invoked immediately after the application launch, but it
waits for activation in case of D-Bus–activated applications and also provides
extended error information for sandboxed applications, see notes for
appInfoLaunchDefaultForUriAsync
.
Since: 2.60
launchUrisFinish
data AppInfoLaunchUrisFinishMethodInfo Source #
Instances
(signature ~ (b -> m ()), MonadIO m, IsAppInfo a, IsAsyncResult b) => OverloadedMethod AppInfoLaunchUrisFinishMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoLaunchUrisFinishMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoLaunchUrisFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes a appInfoLaunchUrisAsync
operation.
Since: 2.60
removeSupportsType
data AppInfoRemoveSupportsTypeMethodInfo Source #
Instances
(signature ~ (Text -> m ()), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoRemoveSupportsTypeMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoRemoveSupportsTypeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoRemoveSupportsType Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Removes a supported type from an application, if possible.
resetTypeAssociations
appInfoResetTypeAssociations Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m () |
Removes all changes to the type associations done by
appInfoSetAsDefaultForType
,
appInfoSetAsDefaultForExtension
,
appInfoAddSupportsType
or
appInfoRemoveSupportsType
.
Since: 2.20
setAsDefaultForExtension
data AppInfoSetAsDefaultForExtensionMethodInfo Source #
Instances
(signature ~ ([Char] -> m ()), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoSetAsDefaultForExtensionMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoSetAsDefaultForExtensionMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoSetAsDefaultForExtension Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> [Char] |
|
-> m () | (Can throw |
Sets the application as the default handler for the given file extension.
setAsDefaultForType
data AppInfoSetAsDefaultForTypeMethodInfo Source #
Instances
(signature ~ (Text -> m ()), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoSetAsDefaultForTypeMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoSetAsDefaultForTypeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoSetAsDefaultForType Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Sets the application as the default handler for a given type.
setAsLastUsedForType
data AppInfoSetAsLastUsedForTypeMethodInfo Source #
Instances
(signature ~ (Text -> m ()), MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoSetAsLastUsedForTypeMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoSetAsLastUsedForTypeMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
appInfoSetAsLastUsedForType Source #
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Sets the application as the last used application for a given type. This
will make the application appear as first in the list returned by
appInfoGetRecommendedForType
, regardless of the default
application for that content type.
shouldShow
data AppInfoShouldShowMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoShouldShowMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoShouldShowMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Checks if the application info should be shown in menus that list available applications.
supportsFiles
data AppInfoSupportsFilesMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoSupportsFilesMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoSupportsFilesMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Checks if the application accepts files as arguments.
supportsUris
data AppInfoSupportsUrisMethodInfo Source #
Instances
(signature ~ m Bool, MonadIO m, IsAppInfo a) => OverloadedMethod AppInfoSupportsUrisMethodInfo a signature Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods overloadedMethod :: a -> signature # | |
OverloadedMethodInfo AppInfoSupportsUrisMethodInfo (a :: Type) Source # | |
Defined in GI.Gio.Interfaces.AppInfo Methods |
Arguments
:: (HasCallStack, MonadIO m, IsAppInfo a) | |
=> a |
|
-> m Bool | Returns: |
Checks if the application supports reading files and directories from URIs.