gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype FileLauncher Source #

Memory-managed wrapper type.

Constructors

FileLauncher (ManagedPtr FileLauncher) 

Instances

Instances details
Eq FileLauncher Source # 
Instance details

Defined in GI.Gtk.Objects.FileLauncher

GObject FileLauncher Source # 
Instance details

Defined in GI.Gtk.Objects.FileLauncher

ManagedPtrNewtype FileLauncher Source # 
Instance details

Defined in GI.Gtk.Objects.FileLauncher

Methods

toManagedPtr :: FileLauncher -> ManagedPtr FileLauncher

TypedObject FileLauncher Source # 
Instance details

Defined in GI.Gtk.Objects.FileLauncher

Methods

glibType :: IO GType

HasParentTypes FileLauncher Source # 
Instance details

Defined in GI.Gtk.Objects.FileLauncher

IsGValue (Maybe FileLauncher) Source #

Convert FileLauncher to and from GValue. See toGValue and fromGValue.

Instance details

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 # 
Instance details

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

Instances details
(GObject o, IsDescendantOf FileLauncher o) => IsFileLauncher o Source # 
Instance details

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

getFile

fileLauncherGetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileLauncher a) 
=> a

self: a GtkFileLauncher

-> m (Maybe File)

Returns: the file

Gets the file that will be opened.

Since: 4.10

launch

fileLauncherLaunch Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) 
=> a

self: a GtkFileLauncher

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

self: a GtkFileLauncher

-> b

result: a GAsyncResult

-> m ()

(Can throw GError)

Finishes the fileLauncherLaunch call and returns the result.

Since: 4.10

new

fileLauncherNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) 
=> Maybe a

file: the file to open

-> m FileLauncher

Returns: the new GtkFileLauncher

Creates a new GtkFileLauncher object.

Since: 4.10

openContainingFolder

fileLauncherOpenContainingFolder Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileLauncher a, IsWindow b, IsCancellable c) 
=> a

self: a GtkFileLauncher

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

self: a GtkFileLauncher

-> b

result: a GAsyncResult

-> m ()

(Can throw GError)

Finishes the fileLauncherOpenContainingFolder call and returns the result.

Since: 4.10

setFile

fileLauncherSetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFileLauncher a, IsFile b) 
=> a

self: a GtkFileLauncher

-> Maybe b

file: a GFile

-> 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 ]