gtk.file_launcher

Module for [FileLauncher] class

Types 3

A gtk.file_launcher.FileLauncher 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 gtk.file_launcher.FileLauncher.launch function. This API follows the GIO async pattern, and the result can be obtained by calling gtk.file_launcher.FileLauncher.launchFinish.

To launch uris that don't represent files, use gtk.uri_launcher.UriLauncher.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
FileLauncher self() nothrowReturns `this`, for use in `with` statements.
FileLauncherGidBuilder builder() static nothrowGet builder for [gtk.file_launcher.FileLauncher] Returns: New builder object
bool alwaysAsk() @property nothrowGet `alwaysAsk` property. Returns: 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.
void alwaysAsk(bool propval) @property nothrowSet `alwaysAsk` property. Params: propval = 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.
gio.file.File file() @property nothrowGet `file` property. Returns: The file to launch.
void file(gio.file.File propval) @property nothrowSet `file` property. Params: propval = The file to launch.
bool writable() @property nothrowGet `writable` property. Returns: Whether to make the file writable for the handler.
void writable(bool propval) @property nothrowSet `writable` property. Params: propval = Whether to make the file writable for the handler.
bool getAlwaysAsk() nothrowReturns whether to ask the user to choose an app for opening the file. Returns: `TRUE` if always asking for app
gio.file.File getFile() nothrowGets the file that will be opened. Returns: the file
bool getWritable() nothrowReturns whether to make the file writable for the handler. Returns: `TRUE` if the file will be made writable
void launch(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowLaunch an application to open the file.
bool launchFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_launcher.FileLauncher.launch] call and returns the result.
void openContainingFolder(gtk.window.Window parent = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null) nothrowLaunch a file manager to show the file in its parent directory.
bool openContainingFolderFinish(gio.async_result.AsyncResult result)Finishes the [gtk.file_launcher.FileLauncher.openContainingFolder] call and returns the result.
void setAlwaysAsk(bool alwaysAsk) nothrowSets 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.
void setFile(gio.file.File file = null) nothrowSets the file that will be opened.
void setWritable(bool writable) nothrowSets whether to make the file writable for the handler.
Constructors
this(void * ptr, Flag!"Take" take)
this(gio.file.File file = null)Creates a new [gtk.file_launcher.FileLauncher] object.

Fluent builder implementation template for gtk.file_launcher.FileLauncher

Methods
T alwaysAsk(bool propval) nothrowSet `alwaysAsk` property. Params: propval = 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. Returns: B...
T file(gio.file.File propval) nothrowSet `file` property. Params: propval = The file to launch. Returns: Builder instance for fluent chaining
T writable(bool propval) nothrowSet `writable` property. Params: propval = Whether to make the file writable for the handler. Returns: Builder instance for fluent chaining
Methods
FileLauncher build() nothrowCreate object from builder. Returns: New object