gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.UriLauncher

Contents

- Exported types
- Methods
  - canLaunch
  - getUri
  - launch
  - launchFinish
  - new
  - setUri
- Properties
  - uri

Description

Asynchronous API to open a uri with an application.

`GtkUriLauncher` collects the arguments that are needed to open the uri.

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 `uriLauncherLaunch` function.

To launch a file, use `FileLauncher`.

Since: 4.10

Synopsis

- newtype UriLauncher = UriLauncher (ManagedPtr UriLauncher)
- class (GObject o, IsDescendantOf UriLauncher o) => IsUriLauncher o
- toUriLauncher :: (MonadIO m, IsUriLauncher o) => o -> m UriLauncher
- uriLauncherCanLaunch :: (HasCallStack, MonadIO m, IsUriLauncher a, IsWindow b) => a -> Maybe b -> m Bool
- uriLauncherGetUri :: (HasCallStack, MonadIO m, IsUriLauncher a) => a -> m (Maybe Text)
- uriLauncherLaunch :: (HasCallStack, MonadIO m, IsUriLauncher a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- uriLauncherLaunchFinish :: (HasCallStack, MonadIO m, IsUriLauncher a, IsAsyncResult b) => a -> b -> m ()
- uriLauncherNew :: (HasCallStack, MonadIO m) => Maybe Text -> m UriLauncher
- uriLauncherSetUri :: (HasCallStack, MonadIO m, IsUriLauncher a) => a -> Maybe Text -> m ()
- clearUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m ()
- constructUriLauncherUri :: (IsUriLauncher o, MonadIO m) => Text -> m (GValueConstruct o)
- getUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m (Maybe Text)
- setUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> Text -> m ()

# Exported types

newtype UriLauncher Source #

Memory-managed wrapper type.

Constructors

UriLauncher (ManagedPtr UriLauncher) |

#### Instances

Instances details

Eq UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher Methods (==) :: UriLauncher -> UriLauncher -> Bool Source # (/=) :: UriLauncher -> UriLauncher -> Bool Source #
GObject UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher
ManagedPtrNewtype UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher Methods toManagedPtr :: UriLauncher -> ManagedPtr UriLauncher Source #
TypedObject UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher Methods glibType :: IO GType Source #
HasParentTypes UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher
IsGValue (Maybe UriLauncher) Source # | Convert `UriLauncher` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.UriLauncher Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe UriLauncher -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe UriLauncher) Source #
type ParentTypes UriLauncher Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher type ParentTypes UriLauncher = '[Object]

class (GObject o, IsDescendantOf UriLauncher o) => IsUriLauncher o Source #

Type class for types which can be safely cast to `UriLauncher`, for instance with `toUriLauncher`.

#### Instances

Instances details

(GObject o, IsDescendantOf UriLauncher o) => IsUriLauncher o Source # |
Instance details Defined in GI.Gtk.Objects.UriLauncher

toUriLauncher :: (MonadIO m, IsUriLauncher o) => o -> m UriLauncher Source #

Cast to `UriLauncher`, 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

Expand

#### Methods

bindProperty, bindPropertyFull, canLaunch, forceFloating, freezeNotify, getv, isFloating, launch, launchFinish, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getProperty, getQdata, getUri.

#### Setters

setData, setDataFull, setProperty, setUri.

## canLaunch

uriLauncherCanLaunch Source #

Arguments

:: (HasCallStack, MonadIO m, IsUriLauncher a, IsWindow b) |
=> a | `self`: an uri launcher
-> Maybe b | `parent`: the parent window
-> m Bool | Returns: false if the launcher is known not to support the uri, true otherwise

Returns whether the launcher is likely to succeed in launching an application for its uri.

This can be used to disable controls that trigger the launcher when they are known not to work.

Since: 4.20

## getUri

uriLauncherGetUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsUriLauncher a) |
=> a | `self`: an uri launcher
-> m (Maybe Text) | Returns: the uri

Gets the uri that will be opened.

Since: 4.10

## launch

uriLauncherLaunch Source #

Arguments

:: (HasCallStack, MonadIO m, IsUriLauncher a, IsWindow b, IsCancellable c) |
=> a | `self`: an uri launcher
-> Maybe b | `parent`: the parent window
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Launches an application to open the uri.

This may present an app chooser dialog to the user.

Since: 4.10

## launchFinish

uriLauncherLaunchFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsUriLauncher a, IsAsyncResult b) |
=> a | `self`: an uri launcher
-> b | `result`: the result
-> m () | (Can throw `GError`)

Finishes the `uriLauncherLaunch` call and returns the result.

Since: 4.10

## new

uriLauncherNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe Text | `uri`: the uri to open
-> m UriLauncher | Returns: the new `GtkUriLauncher`

Creates a new `GtkUriLauncher` object.

Since: 4.10

## setUri

uriLauncherSetUri Source #

Arguments

:: (HasCallStack, MonadIO m, IsUriLauncher a) |
=> a | `self`: an uri launcher
-> Maybe Text | `uri`: the uri
-> m () |

Sets the uri that will be opened.

Since: 4.10

# Properties

## uri

The uri to launch.

Since: 4.10

clearUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m () Source #

Set the value of the “`uri`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #uri

constructUriLauncherUri :: (IsUriLauncher o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`uri`” property. This is rarely needed directly, but it is used by `new`.

getUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m (Maybe Text) Source #

Get the value of the “`uri`” property. When overloading is enabled, this is equivalent to

    get uriLauncher #uri

setUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> Text -> m () Source #

Set the value of the “`uri`” property. When overloading is enabled, this is equivalent to

    set uriLauncher [ #uri := value ]