Maintainer | gtk2hs-devel@lists.sourceforge.net |
---|---|
Stability | alpha |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
- data AppInfo
- class GObjectClass o => AppInfoClass o
- data AppLaunchContext
- class FileInfoClass o => AppLaunchContextClass o
- data AppInfoCreateFlags
- appInfoCreateFromCommandline :: GlibString string => string -> Maybe string -> [AppInfoCreateFlags] -> IO AppInfo
- appInfoDup :: AppInfoClass appinfo => appinfo -> IO AppInfo
- appInfoEqual :: (AppInfoClass info1, AppInfoClass info2) => info1 -> info2 -> Bool
- appInfoGetId :: (AppInfoClass appinfo, GlibString string) => appinfo -> IO (Maybe string)
- appInfoGetName :: AppInfoClass appinfo => appinfo -> String
- appInfoGetDisplayName :: (AppInfoClass appinfo, GlibString string) => appinfo -> string
- appInfoGetDescription :: (AppInfoClass appinfo, GlibString string) => appinfo -> Maybe string
- appInfoGetExecutable :: (AppInfoClass appinfo, GlibString string) => appinfo -> string
- appInfoGetCommandline :: AppInfoClass appinfo => appinfo -> Maybe ByteString
- appInfoGetIcon :: AppInfoClass appinfo => appinfo -> IO (Maybe Icon)
- appInfoLaunch :: AppInfoClass appinfo => appinfo -> [File] -> Maybe AppLaunchContext -> IO ()
- appInfoSupportsFiles :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoSupportsUris :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoLaunchUris :: (AppInfoClass appinfo, GlibString string) => appinfo -> [string] -> Maybe AppLaunchContext -> IO ()
- appInfoShouldShow :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoCanDelete :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoDelete :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoResetTypeAssociations :: GlibString string => string -> IO ()
- appInfoSetAsDefaultForType :: (AppInfoClass appinfo, GlibString string) => appinfo -> string -> IO ()
- appInfoSetAsDefaultForExtension :: (AppInfoClass appinfo, GlibString string) => appinfo -> string -> IO ()
- appInfoAddSupportsType :: (AppInfoClass appinfo, GlibString string) => appinfo -> string -> IO ()
- appInfoCanRemoveSupportsType :: AppInfoClass appinfo => appinfo -> IO Bool
- appInfoRemoveSupportsType :: (AppInfoClass appinfo, GlibString string) => appinfo -> string -> IO ()
- appInfoGetAll :: IO [AppInfo]
- appInfoGetAllForType :: GlibString string => string -> IO [AppInfo]
- appInfoGetDefaultForType :: GlibString string => string -> Bool -> IO (Maybe AppInfo)
- appInfoGetDefaultForUriScheme :: GlibString string => string -> IO (Maybe AppInfo)
- appInfoLaunchDefaultForUri :: GlibString string => string -> AppLaunchContext -> IO ()
- appLaunchContextGetDisplay :: (AppInfoClass appinfo, GlibString string) => AppLaunchContext -> appinfo -> [File] -> IO string
- appLaunchContextGetStartupNotifyId :: (AppInfoClass appinfo, GlibString string) => AppLaunchContext -> appinfo -> [File] -> IO (Maybe string)
- appLaunchContextLaunchFailed :: GlibString string => AppLaunchContext -> string -> IO ()
- appLaunchContextNew :: IO AppLaunchContext
Details
AppInfo
and AppLaunchContext
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
an desktop-file based application with Exec key totem %U and a single URI, sftp:
homeuser.gvfssftp 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
.
Types
class GObjectClass o => AppInfoClass o Source #
data AppLaunchContext Source #
class FileInfoClass o => AppLaunchContextClass o Source #
Enums
data AppInfoCreateFlags Source #
Flags used when creating a AppInfo
.
Methods
appInfoCreateFromCommandline Source #
:: GlibString string | |
=> string |
|
-> Maybe string |
|
-> [AppInfoCreateFlags] |
|
-> IO AppInfo | returns new |
Creates a new AppInfo
from the given information.
appInfoDup :: AppInfoClass appinfo => appinfo -> IO AppInfo Source #
Creates a duplicate of a AppInfo
.
:: (AppInfoClass info1, AppInfoClass info2) | |
=> info1 | |
-> info2 | |
-> Bool | returns |
Checks if two AppInfo
s are equal.
appInfoGetId :: (AppInfoClass appinfo, GlibString string) => appinfo -> IO (Maybe string) Source #
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 Nothing
, depending on how the appinfo has been constructed.
:: AppInfoClass appinfo | |
=> appinfo | |
-> String | returns the name of the application for appinfo. |
Gets the installed name of the application.
appInfoGetDisplayName Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string | returns the display name of the application for appinfo, or the name if no display name is available. |
Gets the installed name of the application.
appInfoGetDescription Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> Maybe string | returns a string containing a description of the application appinfo, or |
Gets a human-readable description of an installed application.
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string | returns the executable of the application for appinfo. |
Gets the executable's name for the installed application.
appInfoGetCommandline Source #
:: AppInfoClass appinfo | |
=> appinfo | |
-> Maybe ByteString | returns a string containing the appinfo's commandline, or |
Gets the commandline with which the application will be started.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO (Maybe Icon) |
Gets the icon for the application.
:: AppInfoClass appinfo | |
=> appinfo | |
-> [File] |
|
-> Maybe AppLaunchContext |
|
-> IO () |
Launches the application. Passes files to the launched application as arguments, using the optional
launchContext
to get information about the details of the launcher (like what screen it is on).
Throws a GError
if an error occurs
To lauch the application without arguments pass a emtpy 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 File
(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.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO Bool | returns |
Checks if the application accepts files as arguments.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO Bool | returns |
Checks if the application accepts uris as arguments.
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> [string] |
|
-> Maybe AppLaunchContext |
|
-> IO () |
Launches the application. Passes uris to the launched application as arguments, using the optional
launchContext
to get information about the details of the launcher (like what screen it is on).
Throws a GError
if an error occurs.
To lauch the application without arguments pass a empty 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.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO Bool | returns |
Checks if the application info should be shown in menus that list available applications.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO Bool | returns |
Obtains the information whether the AppInfo
can be deleted. See appInfoDelete
.
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO 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
.
appInfoResetTypeAssociations Source #
:: GlibString string | |
=> string |
|
-> IO () |
Removes all changes to the type associations done by appInfoSetAsDefaultForType
,
appInfoSetAsDefaultForExtension
or
appInfoRemoveSupportsType
.
appInfoSetAsDefaultForType Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string |
|
-> IO () |
Sets the application as the default handler for a given type.
Throws a GError
if an error occurs.
appInfoSetAsDefaultForExtension Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string |
|
-> IO () |
Sets the application as the default handler for a given extension.
Throws a GError
if an error occurs.
appInfoAddSupportsType Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string |
|
-> IO () |
Adds a content type to the application information to indicate the application is capable of opening
files with the given content type.
Throws a GError
if an error occurs.
appInfoCanRemoveSupportsType Source #
:: AppInfoClass appinfo | |
=> appinfo | |
-> IO Bool | returns |
Checks if a supported content type can be removed from an application.
appInfoRemoveSupportsType Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> appinfo | |
-> string |
|
-> IO () |
Removes a supported type from an application, if possible.
Throws a GError
if an error occurs.
appInfoGetAll :: IO [AppInfo] Source #
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.
:: GlibString string | |
=> string |
|
-> IO [AppInfo] | returns list of |
Gets a list of all AppInfo
s for a given content type.
appInfoGetDefaultForType Source #
:: GlibString string | |
=> string |
|
-> Bool |
|
-> IO (Maybe AppInfo) | returns list of |
Gets the AppInfo
that corresponds to a given content type.
appInfoGetDefaultForUriScheme Source #
:: GlibString string | |
=> string |
|
-> IO (Maybe AppInfo) | returns list of |
Gets the default application for launching applications using this URI scheme. A URI scheme is the
initial part of the URI, up to but not including the :
, e.g. "http", "ftp" or "sip".
appInfoLaunchDefaultForUri Source #
:: GlibString string | |
=> string |
|
-> AppLaunchContext |
|
-> IO () |
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.
Throws a GError
if an error occurs.
appLaunchContextGetDisplay Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> AppLaunchContext | |
-> appinfo | |
-> [File] |
|
-> IO string | returns a display string for the display. |
Gets the display string for the display. This is used to ensure new applications are started on the same display as the launching application.
appLaunchContextGetStartupNotifyId Source #
:: (AppInfoClass appinfo, GlibString string) | |
=> AppLaunchContext | |
-> appinfo | |
-> [File] |
|
-> IO (Maybe string) | returns a startup notification ID for the application, or |
Initiates startup notification for the application and returns the DesktopStartupId for the launched operation, if supported.
Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard.
appLaunchContextLaunchFailed Source #
:: GlibString string | |
=> AppLaunchContext | |
-> string |
|
-> IO () |
Called when an application has failed to launch, so that it can cancel the application startup
notification started in appLaunchContextGetStartupNotifyId
.
appLaunchContextNew :: IO AppLaunchContext Source #
Creates a new application launch context. This is not normally used, instead you instantiate a
subclass of this, such as AppLaunchContext
.