Class ColorChooserRequest
- All Implemented Interfaces:
Proxy
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class implementing a builder pattern to construct a GObject with properties.static classstatic interfaceFunctional interface declaration of theFinishedCallbackcallback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ColorChooserRequest.ColorChooserRequest(MemorySegment address) Create a ColorChooserRequest proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColorChooserRequestasParent()Returns this instance as if it were its parent type.static ColorChooserRequest.Builder<? extends ColorChooserRequest.Builder> builder()AColorChooserRequest.Builderobject constructs aColorChooserRequestwith the specified properties.voidcancel()Cancels this ColorChooserRequest and the input element changes to use the initial color.voidEmits the "finished" signal.voidfinish()Finishes this ColorChooserRequest and the input element keeps the current value ofWebKitColorChooserRequest:rgba.voidgetElementRectangle(Rectangle rect) Gets the bounding box of the color input element.voidGets the currentGdkRGBAcolor of this ColorChooserRequeststatic @Nullable TypegetType()Get the GType of the ColorChooserRequest classEmitted when therequestfinishes.voidSets the currentGdkRGBAcolor of this ColorChooserRequestMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ColorChooserRequest
Create a ColorChooserRequest proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ColorChooserRequest
public ColorChooserRequest()Creates a new ColorChooserRequest.
-
-
Method Details
-
getType
Get the GType of the ColorChooserRequest class- Returns:
- the GType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
cancel
public void cancel()Cancels this ColorChooserRequest and the input element changes to use the initial color.Cancels this ColorChooserRequest 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.- Since:
- 2.8
-
finish
public void finish()Finishes this ColorChooserRequest and the input element keeps the current value ofWebKitColorChooserRequest:rgba.Finishes this ColorChooserRequest and the input element keeps the current value of
WebKitColorChooserRequest:rgba. The signalWebKitColorChooserRequest::finished is emitted to notify that the request has finished.- Since:
- 2.8
-
getElementRectangle
Gets the bounding box of the color input element.- Parameters:
rect- aGdkRectangleto fill in with the element area- Since:
- 2.8
-
getRgba
Gets the currentGdkRGBAcolor of this ColorChooserRequest- Parameters:
rgba- aGdkRGBAto fill in with the current color.- Since:
- 2.8
-
setRgba
Sets the currentGdkRGBAcolor of this ColorChooserRequest- Parameters:
rgba- a pointerGdkRGBA- Since:
- 2.8
-
onFinished
public SignalConnection<ColorChooserRequest.FinishedCallback> onFinished(ColorChooserRequest.FinishedCallback handler) Emitted when therequestfinishes. This signal can be emitted because the user completed therequestcalling 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.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- Since:
- 2.8
- See Also:
-
emitFinished
public void emitFinished()Emits the "finished" signal. SeeonFinished(org.webkitgtk.ColorChooserRequest.FinishedCallback). -
builder
AColorChooserRequest.Builderobject constructs aColorChooserRequestwith the specified properties. Use the variousset...()methods to set properties, and finish construction withColorChooserRequest.Builder.build().- Returns:
- the builder object
-