Class PolicyDecision
- All Implemented Interfaces:
Proxy
- Direct Known Subclasses:
NavigationPolicyDecision, PolicyDecision.PolicyDecision$Impl, ResponsePolicyDecision
A pending policy decision.
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
Nested ClassesModifier and TypeClassDescriptionstatic classPolicyDecision.Builder<B extends PolicyDecision.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classThe PolicyDecision$Impl type represents a native instance of the abstract PolicyDecision class.static classNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new PolicyDecision.PolicyDecision(MemorySegment address) Create a PolicyDecision instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected PolicyDecisionasParent()Return this instance as if it were its parent type.voiddownload()Spawn a download from this decision.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the PolicyDecision class.voidignore()WebKitResponsePolicyDecision, this would cancel the request.voiduse()Accept the action which triggered this decision.voiduseWithPolicies(WebsitePolicies policies) Accept the navigation action and continue with providedpolicies.Methods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, builder, 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, 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
PolicyDecision
Create a PolicyDecision instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
PolicyDecision
public PolicyDecision()Create a new PolicyDecision.
-
-
Method Details
-
getType
Get the GType of the PolicyDecision class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
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 provided
policies.Accept the navigation action which triggered this decision, and continue with
policiesaffecting 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- Since:
- 2.30
-