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 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
- newtype ColorChooserRequest = ColorChooserRequest (ManagedPtr ColorChooserRequest)
- class (GObject o, IsDescendantOf ColorChooserRequest o) => IsColorChooserRequest o
- toColorChooserRequest :: (MonadIO m, IsColorChooserRequest o) => o -> m ColorChooserRequest
- colorChooserRequestCancel :: (HasCallStack, MonadIO m, IsColorChooserRequest a) => a -> m ()
- colorChooserRequestFinish :: (HasCallStack, MonadIO m, IsColorChooserRequest a) => a -> m ()
- colorChooserRequestGetElementRectangle :: (HasCallStack, MonadIO m, IsColorChooserRequest a) => a -> m Rectangle
- colorChooserRequestGetRgba :: (HasCallStack, MonadIO m, IsColorChooserRequest a) => a -> m RGBA
- colorChooserRequestSetRgba :: (HasCallStack, MonadIO m, IsColorChooserRequest a) => a -> RGBA -> m ()
- constructColorChooserRequestRgba :: (IsColorChooserRequest o, MonadIO m) => RGBA -> m (GValueConstruct o)
- getColorChooserRequestRgba :: (MonadIO m, IsColorChooserRequest o) => o -> m (Maybe RGBA)
- setColorChooserRequestRgba :: (MonadIO m, IsColorChooserRequest o) => o -> RGBA -> m ()
- type ColorChooserRequestFinishedCallback = IO ()
- afterColorChooserRequestFinished :: (IsColorChooserRequest a, MonadIO m) => a -> ((?self :: a) => ColorChooserRequestFinishedCallback) -> m SignalHandlerId
- onColorChooserRequestFinished :: (IsColorChooserRequest a, MonadIO m) => a -> ((?self :: a) => ColorChooserRequestFinishedCallback) -> m SignalHandlerId
Exported types
newtype ColorChooserRequest Source #
Memory-managed wrapper type.
ColorChooserRequest (ManagedPtr ColorChooserRequest) |
Instances
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
(GObject o, IsDescendantOf ColorChooserRequest o) => IsColorChooserRequest o Source # | |
Defined in GI.WebKit.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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, cancel, finish, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getElementRectangle, getProperty, getQdata, getRgba.
Setters
cancel
colorChooserRequestCancel Source #
:: (HasCallStack, MonadIO m, IsColorChooserRequest a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsColorChooserRequest a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsColorChooserRequest a) | |
=> a |
|
-> m Rectangle |
Gets the bounding box of the color input element.
Since: 2.8
getRgba
colorChooserRequestGetRgba Source #
:: (HasCallStack, MonadIO m, IsColorChooserRequest a) | |
=> a |
|
-> m RGBA |
Gets the current RGBA
color of request
Since: 2.8
setRgba
colorChooserRequestSetRgba Source #
:: (HasCallStack, MonadIO m, IsColorChooserRequest a) | |
=> a |
|
-> 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