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 |
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
- fileLauncherGetFile :: (HasCallStack, MonadIO m, IsFileLauncher a) => a -> m (Maybe File)
- 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 ()
- fileLauncherSetFile :: (HasCallStack, MonadIO m, IsFileLauncher a, IsFile b) => a -> Maybe b -> 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 ()
Exported types
newtype FileLauncher Source #
Memory-managed wrapper type.
FileLauncher (ManagedPtr FileLauncher) |
Instances
Eq FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher (==) :: FileLauncher -> FileLauncher -> Bool # (/=) :: FileLauncher -> FileLauncher -> Bool # | |
GObject FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher | |
ManagedPtrNewtype FileLauncher Source # | |
Defined in GI.Gtk.Objects.FileLauncher 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 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
getData, getFile, getProperty, getQdata.
Setters
getFile
:: (HasCallStack, MonadIO m, IsFileLauncher a) | |
=> a |
|
-> m (Maybe File) | Returns: the file |
Gets the file that will be opened.
Since: 4.10
launch
:: (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 #
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes the fileLauncherLaunch
call and
returns the result.
Since: 4.10
new
:: (HasCallStack, MonadIO m, IsFile a) | |
=> Maybe a |
|
-> m FileLauncher | Returns: the new |
Creates a new GtkFileLauncher
object.
Since: 4.10
openContainingFolder
fileLauncherOpenContainingFolder Source #
:: (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 #
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes the fileLauncherOpenContainingFolder
call and returns the result.
Since: 4.10
setFile
:: (HasCallStack, MonadIO m, IsFileLauncher a, IsFile b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the file that will be opened.
Since: 4.10
Properties
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 ]