gi-webkit2-4.0.30: WebKit2 bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit2.Objects.ColorChooserRequest

Description

A request to open a color chooser.

Whenever the user interacts with an <input type='color' /> HTML element, WebKit will need to show a dialog to choose a color. For that to happen in a general way, instead of just opening a ColorChooser (which might be not desirable in some cases, which could prefer to use their own color chooser dialog), WebKit will fire the WebView::runColorChooser signal with a ColorChooserRequest object, which will allow the client application to specify the color to be selected, to inspect the details of the request (e.g. to get initial color) and to cancel the request, in case nothing was selected.

In case the client application does not wish to handle this signal, WebKit will provide a default handler which will asynchronously run a regular ColorChooserDialog for the user to interact with.

Synopsis

Exported types

newtype ColorChooserRequest Source #

Memory-managed wrapper type.

Constructors

ColorChooserRequest (ManagedPtr ColorChooserRequest) 

Instances

Instances details
Eq ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

GObject ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

ManagedPtrNewtype ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

TypedObject ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

Methods

glibType :: IO GType

HasParentTypes ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

IsGValue (Maybe ColorChooserRequest) Source #

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

Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

type ParentTypes ColorChooserRequest Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

type ParentTypes ColorChooserRequest = '[Object]

class (GObject o, IsDescendantOf ColorChooserRequest o) => IsColorChooserRequest o Source #

Type class for types which can be safely cast to ColorChooserRequest, for instance with toColorChooserRequest.

Instances

Instances details
(GObject o, IsDescendantOf ColorChooserRequest o) => IsColorChooserRequest o Source # 
Instance details

Defined in GI.WebKit2.Objects.ColorChooserRequest

toColorChooserRequest :: (MonadIO m, IsColorChooserRequest o) => o -> m ColorChooserRequest Source #

Cast to ColorChooserRequest, for types for which this is known to be safe. For general casts, use castTo.

Methods

cancel

colorChooserRequestCancel Source #

Arguments

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

request: a ColorChooserRequest

-> m () 

Cancels request and the input element changes to use the initial color.

Cancels request and the input element changes to use the initial color it has before the request started. The signal ColorChooserRequest::finished is emitted to notify that the request has finished.

Since: 2.8

finish

colorChooserRequestFinish Source #

Arguments

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

request: a ColorChooserRequest

-> m () 

Finishes request and the input element keeps the current value of ColorChooserRequest:rgba.

Finishes request and the input element keeps the current value of ColorChooserRequest:rgba. The signal ColorChooserRequest::finished is emitted to notify that the request has finished.

Since: 2.8

getElementRectangle

colorChooserRequestGetElementRectangle Source #

Arguments

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

request: a ColorChooserRequest

-> m Rectangle 

Gets the bounding box of the color input element.

Since: 2.8

getRgba

colorChooserRequestGetRgba Source #

Arguments

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

request: a ColorChooserRequest

-> m RGBA 

Gets the current RGBA color of request

Since: 2.8

setRgba

colorChooserRequestSetRgba Source #

Arguments

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

request: a FileChooserRequest

-> RGBA

rgba: a pointer RGBA

-> m () 

Sets the current RGBA color of request

Since: 2.8

Properties

rgba

The RGBA color of the request

Since: 2.8

constructColorChooserRequestRgba :: (IsColorChooserRequest o, MonadIO m) => RGBA -> m (GValueConstruct o) Source #

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

getColorChooserRequestRgba :: (MonadIO m, IsColorChooserRequest o) => o -> m (Maybe RGBA) Source #

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

get colorChooserRequest #rgba

setColorChooserRequestRgba :: (MonadIO m, IsColorChooserRequest o) => o -> RGBA -> m () Source #

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

set colorChooserRequest [ #rgba := value ]

Signals

finished

type ColorChooserRequestFinishedCallback = IO () Source #

Emitted when the request finishes. This signal can be emitted because the user completed the request calling colorChooserRequestFinish, or cancelled it with colorChooserRequestCancel or because the color input element is removed from the DOM.

Since: 2.8

afterColorChooserRequestFinished :: (IsColorChooserRequest a, MonadIO m) => a -> ((?self :: a) => ColorChooserRequestFinishedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the finished signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after colorChooserRequest #finished callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onColorChooserRequestFinished :: (IsColorChooserRequest a, MonadIO m) => a -> ((?self :: a) => ColorChooserRequestFinishedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the finished signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on colorChooserRequest #finished callback