Class PolicyDecision
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
NavigationPolicyDecision
,PolicyDecision.PolicyDecisionImpl
,ResponsePolicyDecision
Often WebKit allows the client to decide the policy for certain
operations. For instance, a client may want to open a link in a new
tab, block a navigation entirely, query the user or trigger a download
instead of a navigation. In these cases WebKit will fire the
WebKitWebView
::decide-policy signal with a WebKitPolicyDecision
object. If the signal handler does nothing, WebKit will act as if
webkit_policy_decision_use() was called as soon as signal handling
completes. To make a policy decision asynchronously, simply increment
the reference count of the WebKitPolicyDecision
object.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
PolicyDecision.Builder<B extends PolicyDecision.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
static class
The PolicyDecisionImpl type represents a native instance of the abstract PolicyDecision class.Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionPolicyDecision
(MemorySegment address) Create a PolicyDecision proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected PolicyDecision
asParent()
Returns this instance as if it were its parent type.static PolicyDecision.Builder
<? extends PolicyDecision.Builder> builder()
APolicyDecision.Builder
object constructs aPolicyDecision
with the specified properties.void
download()
Spawn a download from this decision.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the PolicyDecision classvoid
ignore()
WebKitResponsePolicyDecision
, this would cancel the request.void
use()
Accept the action which triggered this decision.void
useWithPolicies
(WebsitePolicies policies) Accept the navigation action and continue with providedpolicies
.Methods 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, 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
-
PolicyDecision
Create a PolicyDecision proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
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. -
download
public void download()Spawn a download from this decision. -
ignore
public void ignore()WebKitResponsePolicyDecision
, this would cancel the request.Ignore the action which triggered this decision. For instance, for a
WebKitResponsePolicyDecision
, this would cancel the request. -
use
public void use()Accept the action which triggered this decision. -
useWithPolicies
Accept the navigation action and continue with providedpolicies
.Accept the navigation action which triggered this decision, and continue with
policies
affecting all subsequent loads of resources in the origin associated with the accepted navigation action.For example, a navigation decision to a video sharing website may be accepted under the priviso no movies are allowed to autoplay. The autoplay policy in this case would be set in the
policies
.- Parameters:
policies
- aWebKitWebsitePolicies
-
builder
APolicyDecision.Builder
object constructs aPolicyDecision
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withPolicyDecision.Builder.build()
.
-