Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Gtk.Objects.FileLauncher
Description
A GtkFileLauncher
object collects the arguments that are needed to open a
file with an application.
Depending on system configuration, user preferences and available APIs, this may or may not show an app chooser dialog or launch the default application right away.
The operation is started with the fileLauncherLaunch
function.
This API follows the GIO async pattern, and the result can be obtained by
calling fileLauncherLaunchFinish
.
To launch uris that don't represent files, use UriLauncher
.
Since: 4.10
Synopsis
- newtype FileLauncher = FileLauncher (ManagedPtr FileLauncher)
- class (GObject o, IsDescendantOf FileLauncher o) => IsFileLauncher o
- toFileLauncher :: (MonadIO m, IsFileLauncher o) => o -> m FileLauncher
- fileLauncherGetAlwaysAsk :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> m Bool
- fileLauncherGetFile :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> m (Maybe File)
- fileLauncherGetWritable :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> m Bool
- fileLauncherLaunch :: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileLauncherLaunchFinish :: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) => a -> b -> m ()
- fileLauncherNew :: (HasCallStack, MonadIO m, IsFile a) => Maybe a -> m FileLauncher
- fileLauncherOpenContainingFolder :: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- fileLauncherOpenContainingFolderFinish :: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) => a -> b -> m ()
- fileLauncherSetAlwaysAsk :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> Bool -> m ()
- fileLauncherSetFile :: (HasCallStack, MonadIO m, IsFileLauncher a, IsFile b) => a -> Maybe b -> m ()
- fileLauncherSetWritable :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> Bool -> m ()
- constructFileLauncherAlwaysAsk :: (IsFileLauncher o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFileLauncherAlwaysAsk :: (MonadIO m, IsFileLauncher o) => o -> m Bool
- setFileLauncherAlwaysAsk :: (MonadIO m, IsFileLauncher o) => o -> Bool -> m ()
- clearFileLauncherFile :: (MonadIO m, IsFileLauncher o) => o -> m ()
- constructFileLauncherFile :: (IsFileLauncher o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileLauncherFile :: (MonadIO m, IsFileLauncher o) => o -> m (Maybe File)
- setFileLauncherFile :: (MonadIO m, IsFileLauncher o, IsFile a) => o -> a -> m ()
- constructFileLauncherWritable :: (IsFileLauncher o, MonadIO m) => Bool -> m (GValueConstruct o)
- getFileLauncherWritable :: (MonadIO m, IsFileLauncher o) => o -> m Bool
- setFileLauncherWritable :: (MonadIO m, IsFileLauncher o) => o -> Bool -> m ()
Exported types
newtype FileLauncher Source #
Memory-managed wrapper type.
Constructors
FileLauncher (ManagedPtr FileLauncher) |
Instances
Eq FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher | |
GObject FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher | |
ManagedPtrNewtype FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher Methods toManagedPtr :: FileLauncher -> ManagedPtr FileLauncher | |
TypedObject FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher | |
HasParentTypes FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher | |
IsGValue (Maybe FileLauncher) Source # | Convert |
Defined in GI.Gtk.Objects.FileLauncher Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe FileLauncher -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe FileLauncher) | |
type ParentTypes FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher type ParentTypes FileLauncher = '[Object] |
class (GObject o, IsDescendantOf FileLauncher o) => IsFileLauncher o Source #
Type class for types which can be safely cast to FileLauncher
, for instance with toFileLauncher
.
Instances
(GObject o, IsDescendantOf FileLauncher o) => IsFileLauncher o Source # | |
Defined in GI.Gtk.Objects.FileLauncher |
toFileLauncher :: (MonadIO m, IsFileLauncher o) => o -> m FileLauncher Source #
Cast to FileLauncher
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, launch, launchFinish, notify, notifyByPspec, openContainingFolder, openContainingFolderFinish, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAlwaysAsk, getData, getFile, getProperty, getQdata, getWritable.
Setters
setAlwaysAsk, setData, setDataFull, setFile, setProperty, setWritable.
getAlwaysAsk
fileLauncherGetAlwaysAsk Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether to ask the user to choose an app for opening the file.
Since: 4.12
getFile
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> m (Maybe File) | Returns: the file |
Gets the file that will be opened.
Since: 4.10
getWritable
fileLauncherGetWritable Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether to make the file writable for the handler.
Since: 4.14
launch
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Launch an application to open the file.
This may present an app chooser dialog to the user.
The callback
will be called when the operation is completed.
It should call fileLauncherLaunchFinish
to obtain
the result.
Since: 4.10
launchFinish
fileLauncherLaunchFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes the fileLauncherLaunch
call and
returns the result.
Since: 4.10
new
Arguments
:: (HasCallStack, MonadIO m, IsFile a) | |
=> Maybe a |
|
-> m FileLauncher | Returns: the new |
Creates a new GtkFileLauncher
object.
Since: 4.10
openContainingFolder
fileLauncherOpenContainingFolder Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Launch a file manager to show the file in its parent directory.
This is only supported native files. It will fail if file
is e.g. a http:// uri.
The callback
will be called when the operation is completed.
It should call fileLauncherOpenContainingFolderFinish
to obtain the result.
Since: 4.10
openContainingFolderFinish
fileLauncherOpenContainingFolderFinish Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes the fileLauncherOpenContainingFolder
call and returns the result.
Since: 4.10
setAlwaysAsk
fileLauncherSetAlwaysAsk Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to awlays ask the user to choose an app for opening the file.
If FALSE
, the file might be opened with a default app or the previous choice.
Since: 4.12
setFile
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsFile b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the file that will be opened.
Since: 4.10
setWritable
fileLauncherSetWritable Source #
Arguments
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether to make the file writable for the handler.
Since: 4.14
Properties
alwaysAsk
Whether to ask the user to choose an app for opening the file. If FALSE
,
the file might be opened with a default app or the previous choice.
Since: 4.12
constructFileLauncherAlwaysAsk :: (IsFileLauncher o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “always-ask
” property. This is rarely needed directly, but it is used by new
.
getFileLauncherAlwaysAsk :: (MonadIO m, IsFileLauncher o) => o -> m Bool Source #
Get the value of the “always-ask
” property.
When overloading is enabled, this is equivalent to
get
fileLauncher #alwaysAsk
setFileLauncherAlwaysAsk :: (MonadIO m, IsFileLauncher o) => o -> Bool -> m () Source #
Set the value of the “always-ask
” property.
When overloading is enabled, this is equivalent to
set
fileLauncher [ #alwaysAsk:=
value ]
file
The file to launch.
Since: 4.10
clearFileLauncherFile :: (MonadIO m, IsFileLauncher o) => o -> m () Source #
Set the value of the “file
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#file
constructFileLauncherFile :: (IsFileLauncher o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “file
” property. This is rarely needed directly, but it is used by new
.
getFileLauncherFile :: (MonadIO m, IsFileLauncher o) => o -> m (Maybe File) Source #
Get the value of the “file
” property.
When overloading is enabled, this is equivalent to
get
fileLauncher #file
setFileLauncherFile :: (MonadIO m, IsFileLauncher o, IsFile a) => o -> a -> m () Source #
Set the value of the “file
” property.
When overloading is enabled, this is equivalent to
set
fileLauncher [ #file:=
value ]
writable
Whether to make the file writable for the handler.
Since: 4.14
constructFileLauncherWritable :: (IsFileLauncher o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “writable
” property. This is rarely needed directly, but it is used by new
.
getFileLauncherWritable :: (MonadIO m, IsFileLauncher o) => o -> m Bool Source #
Get the value of the “writable
” property.
When overloading is enabled, this is equivalent to
get
fileLauncher #writable
setFileLauncherWritable :: (MonadIO m, IsFileLauncher o) => o -> Bool -> m () Source #
Set the value of the “writable
” property.
When overloading is enabled, this is equivalent to
set
fileLauncher [ #writable:=
value ]