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
Modifier and TypeClassDescriptionstatic class
Inner class implementing a builder pattern to construct a GObject with properties.static class
static interface
Functional interface declaration of theFinishedCallback
callback.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionColorChooserRequest
(MemorySegment address) Create a ColorChooserRequest proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColorChooserRequest
asParent()
Returns this instance as if it were its parent type.static ColorChooserRequest.Builder
<? extends ColorChooserRequest.Builder> builder()
AColorChooserRequest.Builder
object constructs aColorChooserRequest
with the specified properties.void
cancel()
Cancels this ColorChooserRequest and the input element changes to use the initial color.void
Emits the "finished" signal.void
finish()
Finishes this ColorChooserRequest and the input element keeps the current value ofWebKitColorChooserRequest
:rgba.void
getElementRectangle
(Rectangle rect) Gets the bounding box of the color input element.void
Gets the currentGdkRGBA
color of this ColorChooserRequeststatic Type
getType()
Get the GType of the ColorChooserRequest classEmitted when therequest
finishes.void
Sets the currentGdkRGBA
color 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, 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, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.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
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, 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. -
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. -
getElementRectangle
Gets the bounding box of the color input element.- Parameters:
rect
- aGdkRectangle
to fill in with the element area
-
getRgba
Gets the currentGdkRGBA
color of this ColorChooserRequest- Parameters:
rgba
- aGdkRGBA
to fill in with the current color.
-
setRgba
Sets the currentGdkRGBA
color of this ColorChooserRequest- Parameters:
rgba
- a pointerGdkRGBA
-
onFinished
public SignalConnection<ColorChooserRequest.FinishedCallback> onFinished(ColorChooserRequest.FinishedCallback handler) Emitted when therequest
finishes. This signal can be emitted because the user completed therequest
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.- Parameters:
handler
- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitFinished
public void emitFinished()Emits the "finished" signal. SeeonFinished(org.gnome.webkit.ColorChooserRequest.FinishedCallback)
. -
builder
AColorChooserRequest.Builder
object constructs aColorChooserRequest
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withColorChooserRequest.Builder.build()
.
-