ColorChooserRequest

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 #GtkColorChooser (which might be not desirable in some cases, which could prefer to use their own color chooser dialog), WebKit will fire the #WebKitWebView::run-color-chooser signal with a #WebKitColorChooserRequest 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 #GtkColorChooserDialog for the user to interact with.

Constructors

this
this(WebKitColorChooserRequest* webKitColorChooserRequest, bool ownedRef)

Sets our main struct and passes it to the parent class.

Members

Functions

addOnFinished
gulong addOnFinished(void delegate(ColorChooserRequest) dlg, ConnectFlags connectFlags)

Emitted when the @request finishes. This signal can be emitted because the user completed the @request calling webkit_color_chooser_request_finish(), or cancelled it with webkit_color_chooser_request_cancel() or because the color input element is removed from the DOM.

cancel
void cancel()

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

finish
void finish()

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

getColorChooserRequestStruct
WebKitColorChooserRequest* getColorChooserRequestStruct(bool transferOwnership)

Get the main Gtk struct

getElementRectangle
void getElementRectangle(GdkRectangle rect)

Gets the bounding box of the color input element.

getRgba
void getRgba(RGBA rgba)

Gets the current #GdkRGBA color of @request

getStruct
void* getStruct()

the main Gtk struct as a void*

setRgba
void setRgba(RGBA rgba)

Sets the current #GdkRGBA color of @request

Static functions

getType
GType getType()

Variables

webKitColorChooserRequest
WebKitColorChooserRequest* webKitColorChooserRequest;

the main Gtk struct

Meta