///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://WebKit?version=6.0' {
// Module dependencies
import type Soup from 'gi://Soup?version=3.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type JavaScriptCore from 'gi://JavaScriptCore?version=6.0';
import type Gtk from 'gi://Gtk?version=4.0';
import type Gsk from 'gi://Gsk?version=4.0';
import type Graphene from 'gi://Graphene?version=1.0';
import type Gdk from 'gi://Gdk?version=4.0';
import type cairo from 'gi://cairo?version=1.0';
import type PangoCairo from 'gi://PangoCairo?version=1.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
export namespace WebKit {
/**
* WebKit-6.0
*/
/**
* Enum values representing the authentication scheme.
*/
/**
* Enum values representing the authentication scheme.
*/
export namespace AuthenticationScheme {
export const $gtype: GObject.GType;
}
enum AuthenticationScheme {
/**
* The default authentication scheme of WebKit.
*/
DEFAULT,
/**
* Basic authentication scheme as defined in RFC 2617.
*/
HTTP_BASIC,
/**
* Digest authentication scheme as defined in RFC 2617.
*/
HTTP_DIGEST,
/**
* HTML Form authentication.
*/
HTML_FORM,
/**
* NTLM Microsoft proprietary authentication scheme.
*/
NTLM,
/**
* Negotiate (or SPNEGO) authentication scheme as defined in RFC 4559.
*/
NEGOTIATE,
/**
* Client Certificate Authentication (see RFC 2246).
*/
CLIENT_CERTIFICATE_REQUESTED,
/**
* Server Trust Authentication.
*/
SERVER_TRUST_EVALUATION_REQUESTED,
/**
* Client certificate PIN required for use. Since: 2.34
*/
CLIENT_CERTIFICATE_PIN_REQUESTED,
/**
* Authentication scheme unknown.
*/
UNKNOWN,
}
/**
* Enum values used for determining the automation browsing context presentation.
*/
/**
* Enum values used for determining the automation browsing context presentation.
*/
export namespace AutomationBrowsingContextPresentation {
export const $gtype: GObject.GType;
}
enum AutomationBrowsingContextPresentation {
/**
* a window
*/
WINDOW,
/**
* a tab
*/
TAB,
}
/**
* Enum values used to specify autoplay policies.
*/
/**
* Enum values used to specify autoplay policies.
*/
export namespace AutoplayPolicy {
export const $gtype: GObject.GType;
}
enum AutoplayPolicy {
/**
* Do not restrict autoplay.
*/
ALLOW,
/**
* Allow videos to autoplay if
* they have no audio track, or if their audio track is muted.
*/
ALLOW_WITHOUT_SOUND,
/**
* Never allow autoplay.
*/
DENY,
}
/**
* Enum values used for determining the #WebKitWebContext cache model.
*/
/**
* Enum values used for determining the #WebKitWebContext cache model.
*/
export namespace CacheModel {
export const $gtype: GObject.GType;
}
enum CacheModel {
/**
* Disable the cache completely, which
* substantially reduces memory usage. Useful for applications that only
* access a single local file, with no navigation to other pages. No remote
* resources will be cached.
*/
DOCUMENT_VIEWER,
/**
* Improve document load speed substantially
* by caching a very large number of resources and previously viewed content.
*/
WEB_BROWSER,
/**
* A cache model optimized for viewing
* a series of local files -- for example, a documentation viewer or a website
* designer. WebKit will cache a moderate number of resources.
*/
DOCUMENT_BROWSER,
}
/**
* Enum values used to denote the stock actions for
* #WebKitContextMenuItems
*/
/**
* Enum values used to denote the stock actions for
* #WebKitContextMenuItems
*/
export namespace ContextMenuAction {
export const $gtype: GObject.GType;
}
enum ContextMenuAction {
/**
* No action, used by separator menu items.
*/
NO_ACTION,
/**
* Open current link.
*/
OPEN_LINK,
/**
* Open current link in a new window.
*/
OPEN_LINK_IN_NEW_WINDOW,
/**
* Download link destination.
*/
DOWNLOAD_LINK_TO_DISK,
/**
* Copy link location to the clipboard.
*/
COPY_LINK_TO_CLIPBOARD,
/**
* Open current image in a new window.
*/
OPEN_IMAGE_IN_NEW_WINDOW,
/**
* Download current image.
*/
DOWNLOAD_IMAGE_TO_DISK,
/**
* Copy current image to the clipboard.
*/
COPY_IMAGE_TO_CLIPBOARD,
/**
* Copy current image location to the clipboard.
*/
COPY_IMAGE_URL_TO_CLIPBOARD,
/**
* Open current frame in a new window.
*/
OPEN_FRAME_IN_NEW_WINDOW,
/**
* Load the previous history item.
*/
GO_BACK,
/**
* Load the next history item.
*/
GO_FORWARD,
/**
* Stop any ongoing loading operation.
*/
STOP,
/**
* Reload the contents of current view.
*/
RELOAD,
/**
* Copy current selection the clipboard.
*/
COPY,
/**
* Cut current selection to the clipboard.
*/
CUT,
/**
* Paste clipboard contents.
*/
PASTE,
/**
* Delete current selection.
*/
DELETE,
/**
* Select all text.
*/
SELECT_ALL,
/**
* Input methods menu.
*/
INPUT_METHODS,
/**
* Unicode menu.
*/
UNICODE,
/**
* A proposed replacement for a misspelled word.
*/
SPELLING_GUESS,
/**
* An indicator that spellchecking found no proposed replacements.
*/
NO_GUESSES_FOUND,
/**
* Causes the spellchecker to ignore the word for this session.
*/
IGNORE_SPELLING,
/**
* Causes the spellchecker to add the word to the dictionary.
*/
LEARN_SPELLING,
/**
* Ignore grammar.
*/
IGNORE_GRAMMAR,
/**
* Font options menu.
*/
FONT_MENU,
/**
* Bold.
*/
BOLD,
/**
* Italic.
*/
ITALIC,
/**
* Underline.
*/
UNDERLINE,
/**
* Outline.
*/
OUTLINE,
/**
* Open current element in the inspector.
*/
INSPECT_ELEMENT,
/**
* Open current video element in a new window.
*/
OPEN_VIDEO_IN_NEW_WINDOW,
/**
* Open current audio element in a new window.
*/
OPEN_AUDIO_IN_NEW_WINDOW,
/**
* Copy video link location in to the clipboard.
*/
COPY_VIDEO_LINK_TO_CLIPBOARD,
/**
* Copy audio link location in to the clipboard.
*/
COPY_AUDIO_LINK_TO_CLIPBOARD,
/**
* Enable or disable media controls.
*/
TOGGLE_MEDIA_CONTROLS,
/**
* Enable or disable media loop.
*/
TOGGLE_MEDIA_LOOP,
/**
* Show current video element in fullscreen mode.
*/
ENTER_VIDEO_FULLSCREEN,
/**
* Play current media element.
*/
MEDIA_PLAY,
/**
* Pause current media element.
*/
MEDIA_PAUSE,
/**
* Mute current media element.
*/
MEDIA_MUTE,
/**
* Download video to disk. Since 2.2
*/
DOWNLOAD_VIDEO_TO_DISK,
/**
* Download audio to disk. Since 2.2
*/
DOWNLOAD_AUDIO_TO_DISK,
/**
* Insert an emoji. Since 2.26
*/
INSERT_EMOJI,
/**
* Paste clipboard contents as plain text. Since 2.30
*/
PASTE_AS_PLAIN_TEXT,
/**
* Custom action defined by applications.
*/
CUSTOM,
}
/**
* Enum values used to denote the cookie acceptance policies.
*/
/**
* Enum values used to denote the cookie acceptance policies.
*/
export namespace CookieAcceptPolicy {
export const $gtype: GObject.GType;
}
enum CookieAcceptPolicy {
/**
* Accept all cookies unconditionally.
*/
ALWAYS,
/**
* Reject all cookies unconditionally.
*/
NEVER,
/**
* Accept only cookies set by the main document loaded.
*/
NO_THIRD_PARTY,
}
/**
* Enum values used to denote the cookie persistent storage types.
*/
/**
* Enum values used to denote the cookie persistent storage types.
*/
export namespace CookiePersistentStorage {
export const $gtype: GObject.GType;
}
enum CookiePersistentStorage {
/**
* Cookies are stored in a text
* file in the Mozilla "cookies.txt" format.
*/
TEXT,
/**
* Cookies are stored in a SQLite
* file in the current Mozilla format.
*/
SQLITE,
}
/**
* Enum values representing the duration for which a credential persists.
*/
/**
* Enum values representing the duration for which a credential persists.
*/
export namespace CredentialPersistence {
export const $gtype: GObject.GType;
}
enum CredentialPersistence {
/**
* Credential does not persist
*/
NONE,
/**
* Credential persists for session only
*/
FOR_SESSION,
/**
* Credential persists permanently
*/
PERMANENT,
}
/**
* Enum values used to denote the various download errors.
*/
class DownloadError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Download failure due to network error
*/
static NETWORK: number;
/**
* Download was cancelled by user
*/
static CANCELLED_BY_USER: number;
/**
* Download failure due to destination error
*/
static DESTINATION: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of download errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the various errors related to the #WebKitFaviconDatabase.
*/
class FaviconDatabaseError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The #WebKitFaviconDatabase is closed
*/
static NOT_INITIALIZED: number;
/**
* There is not an icon available for the requested URL
*/
static FAVICON_NOT_FOUND: number;
/**
* There might be an icon for the requested URL, but its data is unknown at the moment
*/
static FAVICON_UNKNOWN: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of favicon database errors.
*/
static quark(): GLib.Quark;
}
/**
* Describes the status of a [struct`WebKitFeature]`.
*
* The status for a given feature can be obtained with
* [id`webkit_feature_get_status]`.
*/
/**
* Describes the status of a [struct`WebKitFeature]`.
*
* The status for a given feature can be obtained with
* [id`webkit_feature_get_status]`.
*/
export namespace FeatureStatus {
export const $gtype: GObject.GType;
}
enum FeatureStatus {
/**
* Feature that adjust behaviour for
* specific application needs. The feature is not part of a Web platform
* feature, not a mature feature intended to be always on.
*/
EMBEDDER,
/**
* Feature in development. The feature
* may be unfinished, and there are no guarantees about its safety and
* stability.
*/
UNSTABLE,
/**
* Feature for debugging the WebKit engine.
* The feature is not generally useful for user or web developers, and
* always disabled by default.
*/
INTERNAL,
/**
* Feature for web developers. The feature
* is not generally useful for end users, and always disabled by default.
*/
DEVELOPER,
/**
* Feature in active development and
* complete enough for testing. The feature may not be yet ready to
* ship and is disabled by default.
*/
TESTABLE,
/**
* Feature ready to be tested by users.
* The feature is disabled by default, but may be enabled by applications
* automatically e.g. in their “technology preview” or “beta” versions.
*/
PREVIEW,
/**
* Feature ready for general use. The
* feature is enabled by default, but it may still be toggled to support
* debugging and testing.
*/
STABLE,
/**
* Feature in general use. The feature is
* always enabled and in general there should be no user-facing interface
* to toggle it.
*/
MATURE,
}
/**
* Enum values used for determining the hardware acceleration policy.
*/
/**
* Enum values used for determining the hardware acceleration policy.
*/
export namespace HardwareAccelerationPolicy {
export const $gtype: GObject.GType;
}
enum HardwareAccelerationPolicy {
/**
* Hardware acceleration is always enabled, even for websites not requesting it.
*/
ALWAYS,
/**
* Hardware acceleration is always disabled, even for websites requesting it.
*/
NEVER,
}
/**
* Enum values used to describe the primary purpose of the active editable element.
*/
/**
* Enum values used to describe the primary purpose of the active editable element.
*/
export namespace InputPurpose {
export const $gtype: GObject.GType;
}
enum InputPurpose {
/**
* Editable element expects any characters
*/
FREE_FORM,
/**
* Editable element expects digits
*/
DIGITS,
/**
* Editable element expects a number
*/
NUMBER,
/**
* Editable element expects a telephone
*/
PHONE,
/**
* Editable element expects a URL
*/
URL,
/**
* Editable element expects an email
*/
EMAIL,
/**
* Editable element expects a password
*/
PASSWORD,
}
/**
* Enum values previously used to denote the different events which can trigger
* the detection of insecure content. Since 2.46, WebKit generally no longer
* loads insecure content in secure contexts.
*/
/**
* Enum values previously used to denote the different events which can trigger
* the detection of insecure content. Since 2.46, WebKit generally no longer
* loads insecure content in secure contexts.
*/
export namespace InsecureContentEvent {
export const $gtype: GObject.GType;
}
enum InsecureContentEvent {
/**
* Insecure content has been detected by
* trying to execute any kind of logic (e.g. a script) from an
* untrusted source.
*/
RUN,
/**
* Insecure content has been
* detected by trying to display any kind of resource (e.g. an image)
* from an untrusted source.
*/
DISPLAYED,
}
/**
* Enum values used to denote errors happening when executing JavaScript
*/
class JavascriptError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* An exception was raised in JavaScript execution
*/
static SCRIPT_FAILED: number;
/**
* An unsupported parameter has been used to call and async function from API. Since 2.40
*/
static INVALID_PARAMETER: number;
/**
* The result of JavaScript execution could not be returned. Since 2.40
*/
static INVALID_RESULT: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of JavaScript errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the different events that happen during a
* #WebKitWebView load operation.
*/
/**
* Enum values used to denote the different events that happen during a
* #WebKitWebView load operation.
*/
export namespace LoadEvent {
export const $gtype: GObject.GType;
}
enum LoadEvent {
/**
* A new load request has been made.
* No data has been received yet, empty structures have
* been allocated to perform the load; the load may still
* fail due to transport issues such as not being able to
* resolve a name, or connect to a port.
*/
STARTED,
/**
* A provisional data source received
* a server redirect.
*/
REDIRECTED,
/**
* The content started arriving for a page load.
* The necessary transport requirements are established, and the
* load is being performed.
*/
COMMITTED,
/**
* Load completed. All resources are done loading
* or there was an error during the load operation.
*/
FINISHED,
}
/**
* Enum values used to specify the capture state of a media device.
*/
/**
* Enum values used to specify the capture state of a media device.
*/
export namespace MediaCaptureState {
export const $gtype: GObject.GType;
}
enum MediaCaptureState {
/**
* Media capture is disabled.
*/
NONE,
/**
* Media capture is active.
*/
ACTIVE,
/**
* Media capture is muted.
*/
MUTED,
}
/**
* Enum values used to denote the various media errors.
*/
class MediaError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Preliminary load failure for media content types. A new load will be started to perform the media load. Since: 2.40
*/
static LOAD: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of media errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the various navigation types.
*/
/**
* Enum values used to denote the various navigation types.
*/
export namespace NavigationType {
export const $gtype: GObject.GType;
}
enum NavigationType {
/**
* The navigation was triggered by clicking a link.
*/
LINK_CLICKED,
/**
* The navigation was triggered by submitting a form.
*/
FORM_SUBMITTED,
/**
* The navigation was triggered by navigating forward or backward.
*/
BACK_FORWARD,
/**
* The navigation was triggered by reloading.
*/
RELOAD,
/**
* The navigation was triggered by resubmitting a form.
*/
FORM_RESUBMITTED,
/**
* The navigation was triggered by some other action.
*/
OTHER,
}
/**
* Enum values used to denote the various network errors.
*/
class NetworkError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Generic load failure
*/
static FAILED: number;
/**
* Load failure due to transport error
*/
static TRANSPORT: number;
/**
* Load failure due to unknown protocol
*/
static UNKNOWN_PROTOCOL: number;
/**
* Load failure due to cancellation
*/
static CANCELLED: number;
/**
* Load failure due to missing file
*/
static FILE_DOES_NOT_EXIST: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of networking errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to set the network proxy mode.
*/
/**
* Enum values used to set the network proxy mode.
*/
export namespace NetworkProxyMode {
export const $gtype: GObject.GType;
}
enum NetworkProxyMode {
/**
* Use the default proxy of the system.
*/
DEFAULT,
/**
* Do not use any proxy.
*/
NO_PROXY,
/**
* Use custom proxy settings.
*/
CUSTOM,
}
/**
* Enum values representing query permission results.
*/
/**
* Enum values representing query permission results.
*/
export namespace PermissionState {
export const $gtype: GObject.GType;
}
enum PermissionState {
/**
* Access to the feature is granted.
*/
GRANTED,
/**
* Access to the feature is denied.
*/
DENIED,
/**
* Access to the feature has to be requested via user prompt.
*/
PROMPT,
}
/**
* Enum values used for determining the type of a policy decision during
* #WebKitWebView::decide-policy.
*/
/**
* Enum values used for determining the type of a policy decision during
* #WebKitWebView::decide-policy.
*/
export namespace PolicyDecisionType {
export const $gtype: GObject.GType;
}
enum PolicyDecisionType {
/**
* This type of policy decision
* is requested when WebKit is about to navigate to a new page in either the
* main frame or a subframe. Acceptable policy decisions are either
* webkit_policy_decision_use() or webkit_policy_decision_ignore(). This
* type of policy decision is always a #WebKitNavigationPolicyDecision.
*/
NAVIGATION_ACTION,
/**
* This type of policy decision
* is requested when WebKit is about to create a new window. Acceptable policy
* decisions are either webkit_policy_decision_use() or
* webkit_policy_decision_ignore(). This type of policy decision is always
* a #WebKitNavigationPolicyDecision. These decisions are useful for implementing
* special actions for new windows, such as forcing the new window to open
* in a tab when a keyboard modifier is active or handling a special
* target attribute on elements.
*/
NEW_WINDOW_ACTION,
/**
* This type of decision is used when WebKit has
* received a response for a network resource and is about to start the load.
* Note that these resources include all subresources of a page such as images
* and stylesheets as well as main documents. Appropriate policy responses to
* this decision are webkit_policy_decision_use(), webkit_policy_decision_ignore(),
* or webkit_policy_decision_download(). This type of policy decision is always
* a #WebKitResponsePolicyDecision. This decision is useful for forcing
* some types of resources to be downloaded rather than rendered in the WebView
* or to block the transfer of resources entirely.
*/
RESPONSE,
}
/**
* Enum values used to denote the various policy errors.
*/
class PolicyError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Generic load failure due to policy error
*/
static FAILED: number;
/**
* Load failure due to unsupported mime type
*/
static CANNOT_SHOW_MIME_TYPE: number;
/**
* Load failure due to URI that can not be shown
*/
static CANNOT_SHOW_URI: number;
/**
* Load failure due to frame load interruption by policy change
*/
static FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: number;
/**
* Load failure due to port restriction
*/
static CANNOT_USE_RESTRICTED_PORT: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of policy errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the various print errors.
*/
class PrintError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Unspecified error during a print operation
*/
static GENERAL: number;
/**
* Selected printer cannot be found
*/
static PRINTER_NOT_FOUND: number;
/**
* Invalid page range
*/
static INVALID_PAGE_RANGE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of printing errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values representing the response of the print dialog shown with
* webkit_print_operation_run_dialog().
*/
/**
* Enum values representing the response of the print dialog shown with
* webkit_print_operation_run_dialog().
*/
export namespace PrintOperationResponse {
export const $gtype: GObject.GType;
}
enum PrintOperationResponse {
/**
* Print button was clicked in print dialog
*/
PRINT,
/**
* Print dialog was cancelled
*/
CANCEL,
}
/**
* Enum values to specify the different ways in which a #WebKitWebView
* can save its current web page into a self-contained file.
*/
/**
* Enum values to specify the different ways in which a #WebKitWebView
* can save its current web page into a self-contained file.
*/
export namespace SaveMode {
export const $gtype: GObject.GType;
}
enum SaveMode {
/**
* Save the current page using the MHTML format.
*/
MHTML,
}
/**
* Enum values used for determining the type of #WebKitScriptDialog
*/
/**
* Enum values used for determining the type of #WebKitScriptDialog
*/
export namespace ScriptDialogType {
export const $gtype: GObject.GType;
}
enum ScriptDialogType {
/**
* Alert script dialog, used to show a
* message to the user.
*/
ALERT,
/**
* Confirm script dialog, used to ask
* confirmation to the user.
*/
CONFIRM,
/**
* Prompt script dialog, used to ask
* information to the user.
*/
PROMPT,
/**
* Before unload confirm dialog,
* used to ask confirmation to leave the current page to the user. Since 2.12
*/
BEFORE_UNLOAD_CONFIRM,
}
/**
* Enum values used to denote errors happening when creating snapshots of #WebKitWebView
*/
class SnapshotError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* An error occurred when creating a webpage snapshot.
*/
static CREATE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of page snapshot errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to specify the region from which to get a #WebKitWebView
* snapshot
*/
/**
* Enum values used to specify the region from which to get a #WebKitWebView
* snapshot
*/
export namespace SnapshotRegion {
export const $gtype: GObject.GType;
}
enum SnapshotRegion {
/**
* Specifies a snapshot only for the area that is
* visible in the webview
*/
VISIBLE,
/**
* A snapshot of the entire document.
*/
FULL_DOCUMENT,
}
/**
* Enum values used to denote the TLS errors policy.
*/
/**
* Enum values used to denote the TLS errors policy.
*/
export namespace TLSErrorsPolicy {
export const $gtype: GObject.GType;
}
enum TLSErrorsPolicy {
/**
* Ignore TLS errors.
*/
IGNORE,
/**
* TLS errors will emit
* #WebKitWebView::load-failed-with-tls-errors and, if the signal is handled,
* finish the load. In case the signal is not handled,
* #WebKitWebView::load-failed is emitted before the load finishes.
*/
FAIL,
}
/**
* Errors that can occur while compiling content filters.
*/
class UserContentFilterError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The JSON source for a content filter is invalid.
*/
static INVALID_SOURCE: number;
/**
* The requested content filter could not be found.
*/
static NOT_FOUND: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of user content filter errors.
*/
static quark(): GLib.Quark;
}
/**
* Specifies in which frames user style sheets are to be inserted in.
*/
/**
* Specifies in which frames user style sheets are to be inserted in.
*/
export namespace UserContentInjectedFrames {
export const $gtype: GObject.GType;
}
enum UserContentInjectedFrames {
/**
* Insert the user style
* sheet in all the frames loaded by the web view, including
* nested frames. This is the default.
*/
ALL_FRAMES,
/**
* Insert the user style
* sheet *only* in the top-level frame loaded by the web view,
* and *not* in the nested frames.
*/
TOP_FRAME,
}
/**
* Enum values used to denote errors happening when sending user messages.
*/
class UserMessageError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The message was not handled by the receiver.
*/
static MESSAGE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of user message errors.
*/
static quark(): GLib.Quark;
}
/**
* Specifies at which place of documents an user script will be inserted.
*/
/**
* Specifies at which place of documents an user script will be inserted.
*/
export namespace UserScriptInjectionTime {
export const $gtype: GObject.GType;
}
enum UserScriptInjectionTime {
/**
* Insert the code of the user
* script at the beginning of loaded documents. This is the default.
*/
START,
/**
* Insert the code of the user
* script at the end of the loaded documents.
*/
END,
}
/**
* Specifies how to treat an user style sheet.
*/
/**
* Specifies how to treat an user style sheet.
*/
export namespace UserStyleLevel {
export const $gtype: GObject.GType;
}
enum UserStyleLevel {
/**
* The style sheet is an user style sheet,
* its contents always override other style sheets. This is the default.
*/
USER,
/**
* The style sheet will be treated as if
* it was provided by the loaded documents. That means other user style
* sheets may still override it.
*/
AUTHOR,
}
/**
* Enum values used for setting if a #WebKitWebView is intended for
* WebExtensions.
*/
/**
* Enum values used for setting if a #WebKitWebView is intended for
* WebExtensions.
*/
export namespace WebExtensionMode {
export const $gtype: GObject.GType;
}
enum WebExtensionMode {
/**
* Not for an extension.
*/
NONE,
/**
* For a ManifestV2 extension.
*/
MANIFESTV2,
/**
* For a ManifestV3 extension.
*/
MANIFESTV3,
}
/**
* Enum values used to specify the reason why the web process terminated abnormally.
*/
/**
* Enum values used to specify the reason why the web process terminated abnormally.
*/
export namespace WebProcessTerminationReason {
export const $gtype: GObject.GType;
}
enum WebProcessTerminationReason {
/**
* the web process crashed.
*/
CRASHED,
/**
* the web process exceeded the memory limit.
*/
EXCEEDED_MEMORY_LIMIT,
/**
* the web process termination was requested by an API call. Since: 2.34
*/
TERMINATED_BY_API,
}
/**
* The copy clipboard command. Copies the current selection inside
* a #WebKitWebView to the clipboard.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's
* possible to copy to the clipboard when there is an active selection
* inside the #WebKitWebView.
*/
const EDITING_COMMAND_COPY: string;
/**
* The create link command. Creates a link element that is inserted at
* the current cursor position. If there's a selection, the selected text
* will be used as the link text, otherwise the URL itself will be used.
* It receives the link URL as argument. This command should be executed
* with webkit_web_view_execute_editing_command_with_argument()
*/
const EDITING_COMMAND_CREATE_LINK: string;
/**
* The cut clipboard command. Copies the current selection inside
* a #WebKitWebView to the clipboard and deletes the selected content.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's
* possible to cut to the clipboard when the #WebKitWebView content is
* editable and there is an active selection.
*/
const EDITING_COMMAND_CUT: string;
/**
* The insert image command. Creates an image element that is inserted at
* the current cursor position. It receives an URI as argument,
* that is used as the image source. This command should be executed with
* webkit_web_view_execute_editing_command_with_argument().
*/
const EDITING_COMMAND_INSERT_IMAGE: string;
/**
* The paste clipboard command. Pastes the contents of the clipboard to
* a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's possible
* to paste from the clipboard when the #WebKitWebView content is editable
* and clipboard is not empty.
*/
const EDITING_COMMAND_PASTE: string;
/**
* The paste as plaintext clipboard command. Pastes the contents of the
* clipboard to a #WebKitWebView, with formatting removed.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's possible
* to paste from the clipboard when the #WebKitWebView content is editable
* and clipboard is not empty.
*/
const EDITING_COMMAND_PASTE_AS_PLAIN_TEXT: string;
/**
* The redo command. Redoes a previously undone editing command in
* a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). It's only possible
* to redo a command when it has been previously undone.
*/
const EDITING_COMMAND_REDO: string;
/**
* The select all command. Selects all the content of the current text field in
* a #WebKitWebView.
* It is always possible to select all text, no matter whether the
* #WebKitWebView content is editable or not. You can still check it
* with webkit_web_view_can_execute_editing_command().
*/
const EDITING_COMMAND_SELECT_ALL: string;
/**
* The undo command. Undoes the last editing command in a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). It's only possible
* to undo a command after a previously executed editing operation.
*/
const EDITING_COMMAND_UNDO: string;
/**
* Like webkit_get_major_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MAJOR_VERSION: number;
/**
* Like webkit_get_micro_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MICRO_VERSION: number;
/**
* Like webkit_get_minor_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MINOR_VERSION: number;
/**
* Gets the quark for the domain of download errors.
* @returns download error domain.
*/
function download_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of favicon database errors.
* @returns favicon database error domain.
*/
function favicon_database_error_quark(): GLib.Quark;
/**
* Returns the major version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 1.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MAJOR_VERSION
* macro, which represents the major version of the WebKit headers you
* have included when compiling your code.
* @returns the major version number of the WebKit library
*/
function get_major_version(): number;
/**
* Returns the micro version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 3.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MICRO_VERSION
* macro, which represents the micro version of the WebKit headers you
* have included when compiling your code.
* @returns the micro version number of the WebKit library
*/
function get_micro_version(): number;
/**
* Returns the minor version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 8.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MINOR_VERSION
* macro, which represents the minor version of the WebKit headers you
* have included when compiling your code.
* @returns the minor version number of the WebKit library
*/
function get_minor_version(): number;
/**
* Gets the quark for the domain of JavaScript errors.
* @returns JavaScript error domain.
*/
function javascript_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of media errors.
* @returns media error domin.
*/
function media_error_quark(): GLib.Quark;
/**
* Get the key system for which access permission is being requested.
* @param request a #WebKitMediaKeySystemPermissionRequest
* @returns the key system name for @request
*/
function media_key_system_permission_get_name(request: MediaKeySystemPermissionRequest): string;
/**
* Gets the quark for the domain of networking errors.
* @returns network error domain.
*/
function network_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of policy errors.
* @returns policy error domain.
*/
function policy_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of printing errors.
* @returns print error domain.
*/
function print_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of page snapshot errors.
* @returns snapshot error domain.
*/
function snapshot_error_quark(): GLib.Quark;
/**
* Use this function to format a URI for display.
*
* The URIs used internally by
* WebKit may contain percent-encoded characters or Punycode, which are not
* generally suitable to display to users. This function provides protection
* against IDN homograph attacks, so in some cases the host part of the returned
* URI may be in Punycode if the safety check fails.
* @param uri the URI to be converted
* @returns @uri suitable for display, or %NULL in case of error.
*/
function uri_for_display(uri: string): string | null;
/**
* Gets the quark for the domain of user content filter errors.
* @returns user content filter error domain.
*/
function user_content_filter_error_quark(): GLib.Quark;
/**
* Check whether the permission request is for an audio device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to an audio device was requested.
*/
function user_media_permission_is_for_audio_device(request: UserMediaPermissionRequest): boolean;
/**
* Check whether the permission request is for a display device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to a display device was requested.
*/
function user_media_permission_is_for_display_device(request: UserMediaPermissionRequest): boolean;
/**
* Check whether the permission request is for a video device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to a video device was requested.
*/
function user_media_permission_is_for_video_device(request: UserMediaPermissionRequest): boolean;
/**
* Gets the quark for the domain of user message errors.
* @returns user message error domain.
*/
function user_message_error_quark(): GLib.Quark;
interface URISchemeRequestCallback {
(request: URISchemeRequest): void;
}
/**
* Enum values with flags representing typing attributes.
*/
/**
* Enum values with flags representing typing attributes.
*/
export namespace EditorTypingAttributes {
export const $gtype: GObject.GType;
}
enum EditorTypingAttributes {
/**
* No typing attributes.
*/
NONE,
/**
* Bold typing attribute.
*/
BOLD,
/**
* Italic typing attribute.
*/
ITALIC,
/**
* Underline typing attribute.
*/
UNDERLINE,
/**
* Strikethrough typing attribute.
*/
STRIKETHROUGH,
}
/**
* Enum values used to specify search options.
*/
/**
* Enum values used to specify search options.
*/
export namespace FindOptions {
export const $gtype: GObject.GType;
}
enum FindOptions {
/**
* no search flags, this means a case
* sensitive, no wrap, forward only search.
*/
NONE,
/**
* case insensitive search.
*/
CASE_INSENSITIVE,
/**
* search text only at the
* begining of the words.
*/
AT_WORD_STARTS,
/**
* treat
* capital letters in the middle of words as word start.
*/
TREAT_MEDIAL_CAPITAL_AS_WORD_START,
/**
* search backwards.
*/
BACKWARDS,
/**
* if not present search will stop
* at the end of the document.
*/
WRAP_AROUND,
}
/**
* Enum values with flags representing the context of a #WebKitHitTestResult.
*/
/**
* Enum values with flags representing the context of a #WebKitHitTestResult.
*/
export namespace HitTestResultContext {
export const $gtype: GObject.GType;
}
enum HitTestResultContext {
/**
* anywhere in the document.
*/
DOCUMENT,
/**
* a hyperlink element.
*/
LINK,
/**
* an image element.
*/
IMAGE,
/**
* a video or audio element.
*/
MEDIA,
/**
* an editable element
*/
EDITABLE,
/**
* a scrollbar element.
*/
SCROLLBAR,
/**
* a selected element. Since 2.8
*/
SELECTION,
}
/**
* Enum values used to describe hints that might be taken into account by input methods.
*/
/**
* Enum values used to describe hints that might be taken into account by input methods.
*/
export namespace InputHints {
export const $gtype: GObject.GType;
}
enum InputHints {
/**
* No special behavior suggested
*/
NONE,
/**
* Suggest spell checking
*/
SPELLCHECK,
/**
* Suggest to not autocapitlize
*/
LOWERCASE,
/**
* Suggest to capitalize all text
*/
UPPERCASE_CHARS,
/**
* Suggest to capitalize the first character of each word
*/
UPPERCASE_WORDS,
/**
* Suggest to capitalize the first word of each sentence
*/
UPPERCASE_SENTENCES,
/**
* Suggest to not show an onscreen keyboard
*/
INHIBIT_OSK,
}
/**
* Enum values used to specify options when taking a snapshot
* from a #WebKitWebView.
*/
/**
* Enum values used to specify options when taking a snapshot
* from a #WebKitWebView.
*/
export namespace SnapshotOptions {
export const $gtype: GObject.GType;
}
enum SnapshotOptions {
/**
* Do not include any special options.
*/
NONE,
/**
* Whether to include in the
* snapshot the highlight of the selected content.
*/
INCLUDE_SELECTION_HIGHLIGHTING,
/**
* Do not fill the background with white before
* rendering the snapshot. Since 2.8
*/
TRANSPARENT_BACKGROUND,
}
/**
* Enum values with flags representing types of Website data.
*/
/**
* Enum values with flags representing types of Website data.
*/
export namespace WebsiteDataTypes {
export const $gtype: GObject.GType;
}
enum WebsiteDataTypes {
/**
* Memory cache.
*/
MEMORY_CACHE,
/**
* HTTP disk cache.
*/
DISK_CACHE,
/**
* Offline web application cache.
*/
OFFLINE_APPLICATION_CACHE,
/**
* Session storage data.
*/
SESSION_STORAGE,
/**
* Local storage data.
*/
LOCAL_STORAGE,
/**
* IndexedDB databases.
*/
INDEXEDDB_DATABASES,
/**
* Cookies.
*/
COOKIES,
/**
* Hash salt used to generate the device ids used by webpages.
*/
DEVICE_ID_HASH_SALT,
/**
* HSTS cache.
*/
HSTS_CACHE,
/**
* Intelligent Tracking Prevention data.
*/
ITP,
/**
* Service worker registrations.
*/
SERVICE_WORKER_REGISTRATIONS,
/**
* DOM (CacheStorage) cache.
*/
DOM_CACHE,
/**
* All types.
*/
ALL,
}
module AuthenticationRequest {
// Signal callback interfaces
interface Authenticated {
(credential: Credential): void;
}
interface Cancelled {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents an authentication request.
*
* Whenever a client attempts to load a page protected by HTTP
* authentication, credentials will need to be provided to authorize access.
* To allow the client to decide how it wishes to handle authentication,
* WebKit will fire a #WebKitWebView::authenticate signal with a
* WebKitAuthenticationRequest object to provide client side
* authentication support. Credentials are exposed through the
* #WebKitCredential object.
*
* In case the client application does not wish
* to handle this signal WebKit will provide a default handler. To handle
* authentication asynchronously, simply increase the reference count of the
* WebKitAuthenticationRequest object.
*/
class AuthenticationRequest extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'authenticated', callback: (_source: this, credential: Credential) => void): number;
connect_after(signal: 'authenticated', callback: (_source: this, credential: Credential) => void): number;
emit(signal: 'authenticated', credential: Credential): void;
connect(signal: 'cancelled', callback: (_source: this) => void): number;
connect_after(signal: 'cancelled', callback: (_source: this) => void): number;
emit(signal: 'cancelled'): void;
// Methods
/**
* Authenticate the #WebKitAuthenticationRequest.
*
* Authenticate the #WebKitAuthenticationRequest using the #WebKitCredential
* supplied. To continue without credentials, pass %NULL as `credential`.
* @param credential A #WebKitCredential, or %NULL
*/
authenticate(credential?: Credential | null): void;
/**
* Determine whether this #WebKitAuthenticationRequest should allow the storage of credentials.
*
* Determine whether the authentication method associated with this
* #WebKitAuthenticationRequest should allow the storage of credentials.
* This will return %FALSE if WebKit doesn't support credential storing,
* if private browsing is enabled, or if persistent credential storage has been
* disabled in #WebKitWebsiteDataManager, unless credentials saving has been
* explicitly enabled with webkit_authentication_request_set_can_save_credentials().
* @returns %TRUE if WebKit can store credentials or %FALSE otherwise.
*/
can_save_credentials(): boolean;
/**
* Cancel the authentication challenge.
*
* This will also cancel the page loading and result in a
* #WebKitWebView::load-failed signal with a #WebKitNetworkError of type %WEBKIT_NETWORK_ERROR_CANCELLED being emitted.
*/
cancel(): void;
/**
* Get the #GTlsPasswordFlags of the %WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_PIN_REQUESTED authentication challenge.
* @returns a #GTlsPasswordFlags
*/
get_certificate_pin_flags(): Gio.TlsPasswordFlags;
/**
* Get the host that this authentication challenge is applicable to.
* @returns The host of @request.
*/
get_host(): string;
/**
* Get the port that this authentication challenge is applicable to.
* @returns The port of @request.
*/
get_port(): number;
/**
* Get the #WebKitCredential of the proposed authentication challenge.
*
* Get the #WebKitCredential of the proposed authentication challenge that was
* stored from a previous session. The client can use this directly for
* authentication or construct their own #WebKitCredential.
* @returns A #WebKitCredential encapsulating credential details or %NULL if there is no stored credential.
*/
get_proposed_credential(): Credential;
/**
* Get the realm that this authentication challenge is applicable to.
* @returns The realm of @request.
*/
get_realm(): string;
/**
* Get the authentication scheme of the authentication challenge.
* @returns The #WebKitAuthenticationScheme of @request.
*/
get_scheme(): AuthenticationScheme;
/**
* Get the #WebKitSecurityOrigin that this authentication challenge is applicable to.
* @returns a newly created #WebKitSecurityOrigin.
*/
get_security_origin(): SecurityOrigin;
/**
* Determine whether the authentication challenge is associated with a proxy server.
*
* Determine whether the authentication challenge is associated with a proxy server rather than an "origin" server.
* @returns %TRUE if authentication is for a proxy or %FALSE otherwise.
*/
is_for_proxy(): boolean;
/**
* Determine whether this this is a first attempt or a retry for this authentication challenge.
* @returns %TRUE if authentication attempt is a retry or %FALSE otherwise.
*/
is_retry(): boolean;
/**
* Set whether the authentication method associated with `request`
* should allow the storage of credentials.
*
* Set whether the authentication method associated with `request`
* should allow the storage of credentials.
* This should be used by applications handling their own credentials
* storage to indicate that it should be supported even when internal
* credential storage is disabled or unsupported.
* Note that storing of credentials will not be allowed on ephemeral
* sessions in any case.
* @param enabled value to set
*/
set_can_save_credentials(enabled: boolean): void;
/**
* Set the #WebKitCredential of the proposed authentication challenge.
*
* Set the #WebKitCredential of the proposed authentication challenge that was
* stored from a previous session. This should only be used by applications handling
* their own credential storage. (When using the default WebKit credential storage,
* webkit_authentication_request_get_proposed_credential() already contains previously-stored
* credentials.)
* Passing a %NULL `credential` will clear the proposed credential.
* @param credential a #WebKitCredential, or %NULL
*/
set_proposed_credential(credential: Credential): void;
}
module AutomationSession {
// Signal callback interfaces
interface CreateWebView {
(): WebView;
}
interface WillClose {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: string;
}
}
/**
* Automation Session.
*
* WebKitAutomationSession represents an automation session of a WebKitWebContext.
* When a new session is requested, a WebKitAutomationSession is created and the signal
* WebKitWebContext::automation-started is emitted with the WebKitAutomationSession as
* argument. Then, the automation client can request the session to create a new
* #WebKitWebView to interact with it. When this happens the signal #WebKitAutomationSession::create-web-view
* is emitted.
*/
class AutomationSession extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The session unique identifier.
*/
get id(): string;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'create-web-view', callback: (_source: this) => WebView): number;
connect_after(signal: 'create-web-view', callback: (_source: this) => WebView): number;
emit(signal: 'create-web-view'): void;
connect(signal: 'will-close', callback: (_source: this) => void): number;
connect_after(signal: 'will-close', callback: (_source: this) => void): number;
emit(signal: 'will-close'): void;
// Methods
/**
* Get the the previously set #WebKitAutomationSession.
*
* Get the #WebKitAutomationSession previously set with webkit_automation_session_set_application_info().
* @returns the #WebKitAutomationSession of @session, or %NULL if no one has been set.
*/
get_application_info(): ApplicationInfo;
/**
* Get the unique identifier of a #WebKitAutomationSession
* @returns the unique identifier of @session
*/
get_id(): string;
/**
* Set the application information to `session`.
*
* This information will be used by the driver service
* to match the requested capabilities with the actual application information. If this information
* is not provided to the session when a new automation session is requested, the creation might fail
* if the client requested a specific browser name or version. This will not have any effect when called
* after the automation session has been fully created, so this must be called in the callback of
* #WebKitWebContext::automation-started signal.
* @param info a #WebKitApplicationInfo
*/
set_application_info(info: ApplicationInfo): void;
}
module BackForwardList {
// Signal callback interfaces
interface Changed {
(item_added?: BackForwardListItem | null, items_removed?: any | null): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* List of visited pages.
*
* WebKitBackForwardList maintains a list of visited pages used to
* navigate to recent pages. Items are inserted in the list in the
* order they are visited.
*
* WebKitBackForwardList also maintains the notion of the current item
* (which is always at index 0), the preceding item (which is at index -1),
* and the following item (which is at index 1).
* Methods webkit_web_view_go_back() and webkit_web_view_go_forward() move
* the current item backward or forward by one. Method
* webkit_web_view_go_to_back_forward_list_item() sets the current item to the
* specified item. All other methods returning #WebKitBackForwardListItems
* do not change the value of the current item, they just return the requested
* item or items.
*/
class BackForwardList extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'changed',
callback: (_source: this, item_added: BackForwardListItem | null, items_removed: any | null) => void,
): number;
connect_after(
signal: 'changed',
callback: (_source: this, item_added: BackForwardListItem | null, items_removed: any | null) => void,
): number;
emit(signal: 'changed', item_added?: BackForwardListItem | null, items_removed?: any | null): void;
// Methods
/**
* Returns the item that precedes the current item.
* @returns the #WebKitBackForwardListItem preceding the current item or %NULL.
*/
get_back_item(): BackForwardListItem | null;
/**
* Obtain the list of items preceding the current one.
* @returns a #GList of items preceding the current item.
*/
get_back_list(): BackForwardListItem[];
/**
* Obtain a list up to some number of items preceding the current one.
* @param limit the number of items to retrieve
* @returns a #GList of items preceding the current item limited by @limit.
*/
get_back_list_with_limit(limit: number): BackForwardListItem[];
/**
* Returns the current item in `back_forward_list`.
* @returns a #WebKitBackForwardListItem or %NULL if @back_forward_list is empty.
*/
get_current_item(): BackForwardListItem | null;
/**
* Returns the item that follows the current item.
* @returns the #WebKitBackForwardListItem following the current item or %NULL.
*/
get_forward_item(): BackForwardListItem | null;
/**
* Obtain the list of items following the current one.
* @returns a #GList of items following the current item.
*/
get_forward_list(): BackForwardListItem[];
/**
* Obtain a list up to some number of items following the current one.
* @param limit the number of items to retrieve
* @returns a #GList of items following the current item limited by @limit.
*/
get_forward_list_with_limit(limit: number): BackForwardListItem[];
/**
* Obtain the amount of items in the list.
* @returns the length of @back_forward_list.
*/
get_length(): number;
/**
* Returns the item at a given index relative to the current item.
* @param index the index of the item
* @returns the #WebKitBackForwardListItem located at the specified index relative to the current item or %NULL.
*/
get_nth_item(index: number): BackForwardListItem | null;
}
module BackForwardListItem {
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {}
}
/**
* One item of the #WebKitBackForwardList.
*
* A history item is part of the #WebKitBackForwardList and consists
* out of a title and a URI.
*/
class BackForwardListItem extends GObject.InitiallyUnowned {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Obtain the original URI of the item.
*
* See also webkit_back_forward_list_item_get_uri().
* @returns the original URI of @list_item or %NULL when the original URI is empty.
*/
get_original_uri(): string;
/**
* Obtain the title of the item.
* @returns the page title of @list_item or %NULL when the title is empty.
*/
get_title(): string;
/**
* Obtain the URI of the item.
*
* This URI may differ from the original URI if the page was,
* for example, redirected to a new location.
* See also webkit_back_forward_list_item_get_original_uri().
* @returns the URI of @list_item or %NULL when the URI is empty.
*/
get_uri(): string;
}
module ClipboardPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for reading clipboard contents.
*
* WebKitClipboardPermissionRequest represents a request for
* permission to decide whether WebKit can access the clipboard to read
* its contents through the Async Clipboard API.
*
* When a WebKitClipboardPermissionRequest is not handled by the user,
* it is denied by default.
*/
class ClipboardPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module ColorChooserRequest {
// Signal callback interfaces
interface Finished {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
rgba: Gdk.RGBA;
}
}
/**
* A request to open a color chooser.
*
* Whenever the user interacts with an
* 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.
*/
class ColorChooserRequest extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The #GdkRGBA color of the request
*/
get rgba(): Gdk.RGBA;
set rgba(val: Gdk.RGBA);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'finished', callback: (_source: this) => void): number;
connect_after(signal: 'finished', callback: (_source: this) => void): number;
emit(signal: 'finished'): void;
// Methods
/**
* Cancels `request` and the input element changes to use the initial color.
*
* 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.
*/
cancel(): void;
/**
* Finishes `request` and the input element keeps the current value of
* #WebKitColorChooserRequest:rgba.
*
* 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.
*/
finish(): void;
/**
* Gets the bounding box of the color input element.
*/
get_element_rectangle(): Gdk.Rectangle;
/**
* Gets the current #GdkRGBA color of `request`
*/
get_rgba(): Gdk.RGBA;
/**
* Sets the current #GdkRGBA color of `request`
* @param rgba a pointer #GdkRGBA
*/
set_rgba(rgba: Gdk.RGBA): void;
}
module ContextMenu {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents the context menu in a #WebKitWebView.
*
* #WebKitContextMenu represents a context menu containing
* #WebKitContextMenuItems in a #WebKitWebView.
*
* When a #WebKitWebView is about to display the context menu, it
* emits the #WebKitWebView::context-menu signal, which has the
* #WebKitContextMenu as an argument. You can modify it, adding new
* submenus that you can create with webkit_context_menu_new(), adding
* new #WebKitContextMenuItems with
* webkit_context_menu_prepend(), webkit_context_menu_append() or
* webkit_context_menu_insert(), maybe after having removed the
* existing ones with webkit_context_menu_remove_all().
*/
class ContextMenu extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ContextMenu;
static new_with_items(items: ContextMenuItem[]): ContextMenu;
// Methods
/**
* Adds `item` at the end of the `menu`.
* @param item the #WebKitContextMenuItem to add
*/
append(item: ContextMenuItem): void;
/**
* Gets the first item in the `menu`.
* @returns the first #WebKitContextMenuItem of @menu, or %NULL if the #WebKitContextMenu is empty.
*/
first(): ContextMenuItem;
/**
* Gets the #GdkEvent that triggered the context menu. This function only returns a valid
* #GdkEvent when called for a #WebKitContextMenu passed to #WebKitWebView::context-menu
* signal; in all other cases, %NULL is returned.
*
* The returned #GdkEvent is expected to be one of the following types:
*
*
* a #GdkEventButton of type %GDK_BUTTON_PRESS when the context menu was triggered with mouse.
*
*
* a #GdkEventKey of type %GDK_KEY_PRESS if the keyboard was used to show the menu.
*
*
* a generic #GdkEvent of type %GDK_NOTHING when the #GtkWidget::popup-menu signal was used to show the context menu.
*
*
* @returns the menu event or %NULL.
*/
get_event(): Gdk.Event;
/**
* Gets the item at the given position in the `menu`.
* @param position the position of the item, counting from 0
* @returns the #WebKitContextMenuItem at position @position in @menu, or %NULL if the position is off the end of the @menu.
*/
get_item_at_position(position: number): ContextMenuItem;
/**
* Returns the item list of `menu`.
* @returns a #GList of #WebKitContextMenuItems
*/
get_items(): ContextMenuItem[];
/**
* Gets the length of the `menu`.
* @returns the number of #WebKitContextMenuItems in @menu
*/
get_n_items(): number;
/**
* Gets the user data of `menu`.
*
* This function can be used from the UI Process to get user data previously set
* from the Web Process with webkit_context_menu_set_user_data().
* @returns the user data of @menu, or %NULL if @menu doesn't have user data
*/
get_user_data(): GLib.Variant;
/**
* Inserts `item` into the `menu` at the given position.
*
* If `position` is negative, or is larger than the number of items
* in the #WebKitContextMenu, the item is added on to the end of
* the `menu`. The first position is 0.
* @param item the #WebKitContextMenuItem to add
* @param position the position to insert the item
*/
insert(item: ContextMenuItem, position: number): void;
/**
* Gets the last item in the `menu`.
* @returns the last #WebKitContextMenuItem of @menu, or %NULL if the #WebKitContextMenu is empty.
*/
last(): ContextMenuItem;
/**
* Moves `item` to the given position in the `menu`.
*
* If `position` is negative, or is larger than the number of items
* in the #WebKitContextMenu, the item is added on to the end of
* the `menu`.
* The first position is 0.
* @param item the #WebKitContextMenuItem to add
* @param position the new position to move the item
*/
move_item(item: ContextMenuItem, position: number): void;
/**
* Adds `item` at the beginning of the `menu`.
* @param item the #WebKitContextMenuItem to add
*/
prepend(item: ContextMenuItem): void;
/**
* Removes `item` from the `menu`.
*
* See also webkit_context_menu_remove_all() to remove all items.
* @param item the #WebKitContextMenuItem to remove
*/
remove(item: ContextMenuItem): void;
/**
* Removes all items of the `menu`.
*/
remove_all(): void;
/**
* Sets user data to `menu`.
*
* This function can be used from a Web Process extension to set user data
* that can be retrieved from the UI Process using webkit_context_menu_get_user_data().
* If the `user_data` #GVariant is floating, it is consumed.
* @param user_data a #GVariant
*/
set_user_data(user_data: GLib.Variant): void;
}
module ContextMenuItem {
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {}
}
/**
* One item of a #WebKitContextMenu.
*
* The #WebKitContextMenu is composed of #WebKitContextMenuItems. These items can be created from a #GtkAction, from a
* #WebKitContextMenuAction or from a #WebKitContextMenuAction and a
* label. These #WebKitContextMenuActions denote stock actions
* for the items. You can also create separators and submenus.
*/
class ContextMenuItem extends GObject.InitiallyUnowned {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static new_from_gaction(action: Gio.Action, label: string, target?: GLib.Variant | null): ContextMenuItem;
static new_from_stock_action(action: ContextMenuAction): ContextMenuItem;
static new_from_stock_action_with_label(action: ContextMenuAction, label: string): ContextMenuItem;
static new_separator(): ContextMenuItem;
static new_with_submenu(label: string, submenu: ContextMenu): ContextMenuItem;
// Methods
/**
* Gets the action associated to `item` as a #GAction.
* @returns the #GAction associated to the #WebKitContextMenuItem, or %NULL if @item is a separator.
*/
get_gaction(): Gio.Action;
/**
* Gets the #WebKitContextMenuAction of `item`.
*
* If the #WebKitContextMenuItem was not
* created for a stock action %WEBKIT_CONTEXT_MENU_ACTION_CUSTOM will be
* returned. If the #WebKitContextMenuItem is a separator %WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION
* will be returned.
* @returns the #WebKitContextMenuAction of @item
*/
get_stock_action(): ContextMenuAction;
/**
* Gets the submenu of `item`.
* @returns the #WebKitContextMenu representing the submenu of @item or %NULL if @item doesn't have a submenu.
*/
get_submenu(): ContextMenu;
/**
* Checks whether `item` is a separator.
* @returns %TRUE is @item is a separator or %FALSE otherwise
*/
is_separator(): boolean;
/**
* Sets or replaces the `item` submenu.
*
* If `submenu` is %NULL the current
* submenu of `item` is removed.
* @param submenu a #WebKitContextMenu
*/
set_submenu(submenu?: ContextMenu | null): void;
}
module CookieManager {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Defines how to handle cookies in a #WebKitWebContext.
*
* The WebKitCookieManager defines how to set up and handle cookies.
* You can get it from a #WebKitWebsiteDataManager with
* webkit_website_data_manager_get_cookie_manager(), and use it to set where to
* store cookies with webkit_cookie_manager_set_persistent_storage(),
* or to set the acceptance policy, with webkit_cookie_manager_get_accept_policy().
*/
class CookieManager extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Methods
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
*/
add_cookie(cookie: Soup.Cookie, cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
add_cookie(
cookie: Soup.Cookie,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
add_cookie(
cookie: Soup.Cookie,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_add_cookie().
* @param result a #GAsyncResult
* @returns %TRUE if the cookie was added or %FALSE in case of error.
*/
add_cookie_finish(result: Gio.AsyncResult): boolean;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
*/
delete_cookie(cookie: Soup.Cookie, cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_cookie(
cookie: Soup.Cookie,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_cookie(
cookie: Soup.Cookie,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_delete_cookie().
* @param result a #GAsyncResult
* @returns %TRUE if the cookie was deleted or %FALSE in case of error.
*/
delete_cookie_finish(result: Gio.AsyncResult): boolean;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_accept_policy(cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_accept_policy(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_accept_policy(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_accept_policy().
* @param result a #GAsyncResult
* @returns the cookie acceptance policy of @cookie_manager as a #WebKitCookieAcceptPolicy.
*/
get_accept_policy_finish(result: Gio.AsyncResult): CookieAcceptPolicy;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_all_cookies(cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
get_all_cookies(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
get_all_cookies(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_all_cookies().
*
* The return value is a #GList of #SoupCookie instances which should be released
* with g_list_free_full() and soup_cookie_free().
* @param result a #GAsyncResult
* @returns A #GList of #SoupCookie instances.
*/
get_all_cookies_finish(result: Gio.AsyncResult): Soup.Cookie[];
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_cookies(uri: string, cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_cookies(
uri: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_cookies(
uri: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_cookies().
*
* The return value is a #GList of #SoupCookie instances which should be released
* with g_list_free_full() and soup_cookie_free().
* @param result a #GAsyncResult
* @returns A #GList of #SoupCookie instances.
*/
get_cookies_finish(result: Gio.AsyncResult): Soup.Cookie[];
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
*/
replace_cookies(cookies: Soup.Cookie[], cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
replace_cookies(
cookies: Soup.Cookie[],
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
replace_cookies(
cookies: Soup.Cookie[],
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_replace_cookies().
* @param result a #GAsyncResult
* @returns %TRUE if the cookies were added or %FALSE in case of error.
*/
replace_cookies_finish(result: Gio.AsyncResult): boolean;
/**
* Set the cookie acceptance policy of `cookie_manager` as `policy`.
*
* Note that ITP has its own way to handle third-party cookies, so when it's enabled,
* and `policy` is set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS
* will be used instead. Once disabled, the policy will be set back to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY.
* See also webkit_website_data_manager_set_itp_enabled().
* @param policy a #WebKitCookieAcceptPolicy
*/
set_accept_policy(policy: CookieAcceptPolicy | null): void;
/**
* Set non-session cookies.
*
* Set the `filename` where non-session cookies are stored persistently using
* `storage` as the format to read/write the cookies.
* Cookies are initially read from `filename` to create an initial set of cookies.
* Then, non-session cookies will be written to `filename` when the WebKitCookieManager::changed
* signal is emitted.
* By default, `cookie_manager` doesn't store the cookies persistently, so you need to call this
* method to keep cookies saved across sessions.
*
* This method should never be called on a #WebKitCookieManager associated to an ephemeral #WebKitWebsiteDataManager.
* @param filename the filename to read to/write from
* @param storage a #WebKitCookiePersistentStorage
*/
set_persistent_storage(filename: string, storage: CookiePersistentStorage | null): void;
}
module DeviceInfoPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for accessing user's audio/video devices.
*
* WebKitUserMediaPermissionRequest represents a request for
* permission to whether WebKit should be allowed to access the user's
* devices information when requested through the enumerateDevices API.
*
* When a WebKitDeviceInfoPermissionRequest is not handled by the user,
* it is denied by default.
*/
class DeviceInfoPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module Download {
// Signal callback interfaces
interface CreatedDestination {
(destination: string): void;
}
interface DecideDestination {
(suggested_filename: string): boolean;
}
interface Failed {
(error: GLib.Error): void;
}
interface Finished {
(): void;
}
interface ReceivedData {
(data_length: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
allow_overwrite: boolean;
allowOverwrite: boolean;
destination: string;
estimated_progress: number;
estimatedProgress: number;
response: URIResponse;
}
}
/**
* Object used to communicate with the application when downloading.
*
* #WebKitDownload carries information about a download request and
* response, including a #WebKitURIRequest and a #WebKitURIResponse
* objects. The application may use this object to control the
* download process, or to simply figure out what is to be downloaded,
* and handle the download process itself.
*/
class Download extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether or not the download is allowed to overwrite an existing file on
* disk. If this property is %FALSE and the destination already exists,
* the download will fail.
*/
get allow_overwrite(): boolean;
set allow_overwrite(val: boolean);
/**
* Whether or not the download is allowed to overwrite an existing file on
* disk. If this property is %FALSE and the destination already exists,
* the download will fail.
*/
get allowOverwrite(): boolean;
set allowOverwrite(val: boolean);
/**
* The local path to where the download will be saved.
*/
get destination(): string;
/**
* An estimate of the percent completion for the download operation.
* This value will range from 0.0 to 1.0. The value is an estimate
* based on the total number of bytes expected to be received for
* a download.
* If you need a more accurate progress information you can connect to
* #WebKitDownload::received-data signal to track the progress.
*/
get estimated_progress(): number;
/**
* An estimate of the percent completion for the download operation.
* This value will range from 0.0 to 1.0. The value is an estimate
* based on the total number of bytes expected to be received for
* a download.
* If you need a more accurate progress information you can connect to
* #WebKitDownload::received-data signal to track the progress.
*/
get estimatedProgress(): number;
/**
* The #WebKitURIResponse associated with this download.
*/
get response(): URIResponse;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'created-destination', callback: (_source: this, destination: string) => void): number;
connect_after(
signal: 'created-destination',
callback: (_source: this, destination: string) => void,
): number;
emit(signal: 'created-destination', destination: string): void;
connect(
signal: 'decide-destination',
callback: (_source: this, suggested_filename: string) => boolean,
): number;
connect_after(
signal: 'decide-destination',
callback: (_source: this, suggested_filename: string) => boolean,
): number;
emit(signal: 'decide-destination', suggested_filename: string): void;
connect(signal: 'failed', callback: (_source: this, error: GLib.Error) => void): number;
connect_after(signal: 'failed', callback: (_source: this, error: GLib.Error) => void): number;
emit(signal: 'failed', error: GLib.Error): void;
connect(signal: 'finished', callback: (_source: this) => void): number;
connect_after(signal: 'finished', callback: (_source: this) => void): number;
emit(signal: 'finished'): void;
connect(signal: 'received-data', callback: (_source: this, data_length: number) => void): number;
connect_after(signal: 'received-data', callback: (_source: this, data_length: number) => void): number;
emit(signal: 'received-data', data_length: number): void;
// Methods
/**
* Cancels the download.
*
* When the ongoing download
* operation is effectively cancelled the signal
* #WebKitDownload::failed is emitted with
* %WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER error.
*/
cancel(): void;
/**
* Returns the current value of the #WebKitDownload:allow-overwrite property.
*
* Returns the current value of the #WebKitDownload:allow-overwrite property,
* which determines whether the download will overwrite an existing file on
* disk, or if it will fail if the destination already exists.
* @returns the current value of the #WebKitDownload:allow-overwrite property
*/
get_allow_overwrite(): boolean;
/**
* Obtains the destination to which the downloaded file will be written.
*
* You can connect to #WebKitDownload::created-destination to make
* sure this method returns a valid destination.
* @returns the destination or %NULL
*/
get_destination(): string | null;
/**
* Gets the elapsed time in seconds, including any fractional part.
*
* If the download finished, had an error or was cancelled this is
* the time between its start and the event.
* @returns seconds since the download was started
*/
get_elapsed_time(): number;
/**
* Gets the value of the #WebKitDownload:estimated-progress property.
* Gets the value of the #WebKitDownload:estimated-progress property.
* You can monitor the estimated progress of the download operation by
* connecting to the notify::estimated-progress signal of `download`.
* @returns an estimate of the of the percent complete for a download as a range from 0.0 to 1.0.
*/
get_estimated_progress(): number;
/**
* Gets the length of the data already downloaded for `download`.
*
* Gets the length of the data already downloaded for `download`
* in bytes.
* @returns the amount of bytes already downloaded.
*/
get_received_data_length(): number;
/**
* Retrieves the #WebKitURIRequest object that backs the download
* process.
* @returns the #WebKitURIRequest of @download
*/
get_request(): URIRequest;
/**
* Retrieves the #WebKitURIResponse object that backs the download process.
*
* Retrieves the #WebKitURIResponse object that backs the download
* process. This method returns %NULL if called before the response
* is received from the server. You can connect to notify::response
* signal to be notified when the response is received.
* @returns the #WebKitURIResponse, or %NULL if the response hasn't been received yet.
*/
get_response(): URIResponse;
/**
* Get the #WebKitWebView that initiated the download.
* @returns the #WebKitWebView that initiated @download, or %NULL if @download was not initiated by a #WebKitWebView.
*/
get_web_view(): WebView;
/**
* Sets the #WebKitDownload:allow-overwrite property.
*
* Sets the #WebKitDownload:allow-overwrite property, which determines whether
* the download may overwrite an existing file on disk, or if it will fail if
* the destination already exists.
* @param allowed the new value for the #WebKitDownload:allow-overwrite property
*/
set_allow_overwrite(allowed: boolean): void;
/**
* Sets the destination to which the downloaded file will be written.
*
* This method should be called before the download transfer
* starts or it will not have any effect on the ongoing download
* operation. To set the destination using the filename suggested
* by the server connect to #WebKitDownload::decide-destination
* signal and call webkit_download_set_destination(). If you want to
* set a fixed destination that doesn't depend on the suggested
* filename you can connect to notify::response signal and call
* webkit_download_set_destination().
*
* If #WebKitDownload::decide-destination signal is not handled
* and destination is not set when the download transfer starts,
* the file will be saved with the filename suggested by the server in
* %G_USER_DIRECTORY_DOWNLOAD directory.
* @param destination the destination
*/
set_destination(destination: string): void;
}
module EditorState {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
typing_attributes: number;
typingAttributes: number;
}
}
/**
* Web editor state.
*
* WebKitEditorState represents the state of a #WebKitWebView editor.
* Use webkit_web_view_get_editor_state() to get the WebKitEditorState
* of a #WebKitWebView.
*/
class EditorState extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Bitmask of #WebKitEditorTypingAttributes flags.
* See webkit_editor_state_get_typing_attributes() for more information.
*/
get typing_attributes(): number;
/**
* Bitmask of #WebKitEditorTypingAttributes flags.
* See webkit_editor_state_get_typing_attributes() for more information.
*/
get typingAttributes(): number;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Methods
/**
* Gets the typing attributes at the current cursor position.
*
* If there is a selection, this returns the typing attributes
* of the selected text. Note that in case of a selection,
* typing attributes are considered active only when they are
* present throughout the selection.
* @returns a bitmask of #WebKitEditorTypingAttributes flags
*/
get_typing_attributes(): number;
/**
* Gets whether a copy command can be issued.
* @returns %TRUE if copy is currently available
*/
is_copy_available(): boolean;
/**
* Gets whether a cut command can be issued.
* @returns %TRUE if cut is currently available
*/
is_cut_available(): boolean;
/**
* Gets whether a paste command can be issued.
* @returns %TRUE if paste is currently available
*/
is_paste_available(): boolean;
/**
* Gets whether a redo command can be issued.
* @returns %TRUE if redo is currently available
*/
is_redo_available(): boolean;
/**
* Gets whether an undo command can be issued.
* @returns %TRUE if undo is currently available
*/
is_undo_available(): boolean;
}
module FaviconDatabase {
// Signal callback interfaces
interface FaviconChanged {
(page_uri: string, favicon_uri: string): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Provides access to the icons associated with web sites.
*
* WebKit will automatically look for available icons in
* elements on opened pages as well as an existing favicon.ico and
* load the images found into a memory cache if possible. That cache
* is frozen to an on-disk database for persistence.
*
* If #WebKitSettings:enable-private-browsing is %TRUE, new icons
* won't be added to the on-disk database and no existing icons will
* be deleted from it. Nevertheless, WebKit will still store them in
* the in-memory cache during the current execution.
*/
class FaviconDatabase extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'favicon-changed',
callback: (_source: this, page_uri: string, favicon_uri: string) => void,
): number;
connect_after(
signal: 'favicon-changed',
callback: (_source: this, page_uri: string, favicon_uri: string) => void,
): number;
emit(signal: 'favicon-changed', page_uri: string, favicon_uri: string): void;
// Methods
/**
* Clears all icons from the database.
*/
clear(): void;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
*/
get_favicon(page_uri: string, cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
*/
get_favicon(
page_uri: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
*/
get_favicon(
page_uri: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finishes an operation started with webkit_favicon_database_get_favicon().
* @param result A #GAsyncResult obtained from the #GAsyncReadyCallback passed to webkit_favicon_database_get_favicon()
* @returns a new favicon image, or %NULL in case of error.
*/
get_favicon_finish(result: Gio.AsyncResult): Gdk.Texture;
/**
* Obtains the URI of the favicon for the given `page_uri`.
* @param page_uri URI of the page containing the icon
* @returns a newly allocated URI for the favicon, or %NULL if the database doesn't have a favicon for @page_uri.
*/
get_favicon_uri(page_uri: string): string;
}
module FileChooserRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
filter: Gtk.FileFilter;
mime_types: string[];
mimeTypes: string[];
select_multiple: boolean;
selectMultiple: boolean;
selected_files: string[];
selectedFiles: string[];
}
}
/**
* A request to open a file chooser.
*
* Whenever the user interacts with an HTML input element with
* file type, WebKit will need to show a dialog to choose one or
* more files to be uploaded to the server along with the rest of the
* form data. For that to happen in a general way, instead of just
* opening a #GtkFileChooserDialog (which might be not desirable in
* some cases, which could prefer to use their own file chooser
* dialog), WebKit will fire the #WebKitWebView::run-file-chooser
* signal with a #WebKitFileChooserRequest object, which will allow
* the client application to specify the files to be selected, to
* inspect the details of the request (e.g. if multiple selection
* should be allowed) 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 #GtkFileChooserDialog for the user to interact with.
*/
class FileChooserRequest extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The filter currently associated with the request. See
* webkit_file_chooser_request_get_mime_types_filter() for more
* details.
*/
get filter(): Gtk.FileFilter;
/**
* A %NULL-terminated array of strings containing the list of MIME
* types the file chooser dialog should handle. See
* webkit_file_chooser_request_get_mime_types() for more details.
*/
get mime_types(): string[];
/**
* A %NULL-terminated array of strings containing the list of MIME
* types the file chooser dialog should handle. See
* webkit_file_chooser_request_get_mime_types() for more details.
*/
get mimeTypes(): string[];
/**
* Whether the file chooser should allow selecting multiple
* files. See
* webkit_file_chooser_request_get_select_multiple() for
* more details.
*/
get select_multiple(): boolean;
/**
* Whether the file chooser should allow selecting multiple
* files. See
* webkit_file_chooser_request_get_select_multiple() for
* more details.
*/
get selectMultiple(): boolean;
/**
* A %NULL-terminated array of strings containing the list of
* selected files associated to the current request. See
* webkit_file_chooser_request_get_selected_files() for more details.
*/
get selected_files(): string[];
/**
* A %NULL-terminated array of strings containing the list of
* selected files associated to the current request. See
* webkit_file_chooser_request_get_selected_files() for more details.
*/
get selectedFiles(): string[];
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Ask WebKit to cancel the request.
*
* It's important to do this in case
* no selection has been made in the client, otherwise the request
* won't be properly completed and the browser will keep the request
* pending forever, which might cause the browser to hang.
*/
cancel(): void;
/**
* Get the list of MIME types the file chooser dialog should handle.
*
* Get the list of MIME types the file chooser dialog should handle,
* in the format specified in RFC 2046 for "media types". Its contents
* depend on the value of the 'accept' attribute for HTML input
* elements. This function should normally be called before presenting
* the file chooser dialog to the user, to decide whether to allow the
* user to select multiple files at once or only one.
* @returns a %NULL-terminated array of strings if a list of accepted MIME types is defined or %NULL otherwise, meaning that any MIME type should be accepted. This array and its contents are owned by WebKit and should not be modified or freed.
*/
get_mime_types(): string[];
/**
* Get the filter currently associated with the request.
*
* Get the filter currently associated with the request, ready to be
* used by #GtkFileChooser. This function should normally be called
* before presenting the file chooser dialog to the user, to decide
* whether to apply a filter so the user would not be allowed to
* select files with other MIME types.
*
* See webkit_file_chooser_request_get_mime_types() if you are
* interested in getting the list of accepted MIME types.
* @returns a #GtkFileFilter if a list of accepted MIME types is defined or %NULL otherwise. The returned object is owned by WebKit should not be modified or freed.
*/
get_mime_types_filter(): Gtk.FileFilter;
/**
* Whether the file chooser should allow selecting multiple files.
*
* Determine whether the file chooser associated to this
* #WebKitFileChooserRequest should allow selecting multiple files,
* which depends on the HTML input element having a 'multiple'
* attribute defined.
* @returns %TRUE if the file chooser should allow selecting multiple files or %FALSE otherwise.
*/
get_select_multiple(): boolean;
/**
* Get the list of selected files associated to the request.
*
* Get the list of selected files currently associated to the
* request. Initially, the return value of this method contains any
* files selected in previous file chooser requests for this HTML
* input element. Once webkit_file_chooser_request_select_files, the
* value will reflect whatever files are given.
*
* This function should normally be called only before presenting the
* file chooser dialog to the user, to decide whether to perform some
* extra action, like pre-selecting the files from a previous request.
* @returns a %NULL-terminated array of strings if there are selected files associated with the request or %NULL otherwise. This array and its contents are owned by WebKit and should not be modified or freed.
*/
get_selected_files(): string[];
/**
* Ask WebKit to select local files for upload and complete the
* request.
* @param files a %NULL-terminated array of strings, containing paths to local files.
*/
select_files(files: string[]): void;
}
module FindController {
// Signal callback interfaces
interface CountedMatches {
(match_count: number): void;
}
interface FailedToFindText {
(): void;
}
interface FoundText {
(match_count: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
max_match_count: number;
maxMatchCount: number;
options: FindOptions;
text: string;
web_view: WebView;
webView: WebView;
}
}
/**
* Controls text search in a #WebKitWebView.
*
* A #WebKitFindController is used to search text in a #WebKitWebView. You
* can get a #WebKitWebView's #WebKitFindController with
* webkit_web_view_get_find_controller(), and later use it to search
* for text using webkit_find_controller_search(), or get the
* number of matches using webkit_find_controller_count_matches(). The
* operations are asynchronous and trigger signals when ready, such as
* #WebKitFindController::found-text,
* #WebKitFindController::failed-to-find-text or
* #WebKitFindController::counted-matches.
*/
class FindController extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The maximum number of matches to report for a given search.
*/
get max_match_count(): number;
/**
* The maximum number of matches to report for a given search.
*/
get maxMatchCount(): number;
/**
* The options to be used in the search operation.
*/
get options(): FindOptions;
/**
* The current search text for this #WebKitFindController.
*/
get text(): string;
/**
* The #WebKitWebView this controller is associated to.
*/
get web_view(): WebView;
/**
* The #WebKitWebView this controller is associated to.
*/
get webView(): WebView;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'counted-matches', callback: (_source: this, match_count: number) => void): number;
connect_after(signal: 'counted-matches', callback: (_source: this, match_count: number) => void): number;
emit(signal: 'counted-matches', match_count: number): void;
connect(signal: 'failed-to-find-text', callback: (_source: this) => void): number;
connect_after(signal: 'failed-to-find-text', callback: (_source: this) => void): number;
emit(signal: 'failed-to-find-text'): void;
connect(signal: 'found-text', callback: (_source: this, match_count: number) => void): number;
connect_after(signal: 'found-text', callback: (_source: this, match_count: number) => void): number;
emit(signal: 'found-text', match_count: number): void;
// Methods
/**
* Counts the number of matches for `search_text`.
*
* Counts the number of matches for `search_text` found in the
* #WebKitWebView with the provided `find_options`. The number of
* matches will be provided by the
* #WebKitFindController::counted-matches signal.
* @param search_text the text to look for
* @param find_options a bitmask with the #WebKitFindOptions used in the search
* @param max_match_count the maximum number of matches allowed in the search
*/
count_matches(search_text: string, find_options: number, max_match_count: number): void;
/**
* Gets the maximum number of matches to report.
*
* Gets the maximum number of matches to report during a text
* lookup. This number is passed as the last argument of
* webkit_find_controller_search() or
* webkit_find_controller_count_matches().
* @returns the maximum number of matches to report.
*/
get_max_match_count(): number;
/**
* Gets the #WebKitFindOptions for the current search.
*
* Gets a bitmask containing the #WebKitFindOptions associated with
* the current search.
* @returns a bitmask containing the #WebKitFindOptions associated with the current search.
*/
get_options(): number;
/**
* Gets the text that `find_controller` is searching for.
*
* Gets the text that `find_controller` is currently searching
* for. This text is passed to either
* webkit_find_controller_search() or
* webkit_find_controller_count_matches().
* @returns the text to look for in the #WebKitWebView.
*/
get_search_text(): string;
/**
* Gets the #WebKitWebView this find controller is associated to.
*
* Do
* not dereference the returned instance as it belongs to the
* #WebKitFindController.
* @returns the #WebKitWebView.
*/
get_web_view(): WebView;
/**
* Looks for `search_text` associated with `find_controller`.
*
* Looks for `search_text` in the #WebKitWebView associated with
* `find_controller` since the beginning of the document highlighting
* up to `max_match_count` matches. The outcome of the search will be
* asynchronously provided by the #WebKitFindController::found-text
* and #WebKitFindController::failed-to-find-text signals.
*
* To look for the next or previous occurrences of the same text
* with the same find options use webkit_find_controller_search_next()
* and/or webkit_find_controller_search_previous(). The
* #WebKitFindController will use the same text and options for the
* following searches unless they are modified by another call to this
* method.
*
* Note that if the number of matches is higher than `max_match_count`
* then #WebKitFindController::found-text will report %G_MAXUINT matches
* instead of the actual number.
*
* Callers should call webkit_find_controller_search_finish() to
* finish the current search operation.
* @param search_text the text to look for
* @param find_options a bitmask with the #WebKitFindOptions used in the search
* @param max_match_count the maximum number of matches allowed in the search
*/
search(search_text: string, find_options: number, max_match_count: number): void;
/**
* Finishes a find operation.
*
* Finishes a find operation started by
* webkit_find_controller_search(). It will basically unhighlight
* every text match found.
*
* This method will be typically called when the search UI is
* closed/hidden by the client application.
*/
search_finish(): void;
/**
* Looks for the next occurrence of the search text.
*
* Calling this method before webkit_find_controller_search() or
* webkit_find_controller_count_matches() is a programming error.
*/
search_next(): void;
/**
* Looks for the previous occurrence of the search text.
*
* Calling this method before webkit_find_controller_search() or
* webkit_find_controller_count_matches() is a programming error.
*/
search_previous(): void;
}
module FormSubmissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents a form submission request.
*
* When a form is about to be submitted in a #WebKitWebView, the
* #WebKitWebView::submit-form signal is emitted. Its request argument
* contains information about the text fields of the form, that are
* typically used to store login information, returned as lists by
* webkit_form_submission_request_list_text_fields(). You can submit the
* form with webkit_form_submission_request_submit().
*/
class FormSubmissionRequest extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Get lists of the text fields contained in the form associated to `request`.
*
* Get lists with the names and values of the text fields contained in
* the form associated to `request`. Note that names and values may be
* %NULL.
*
* If this function returns %FALSE, then both `field_names` and
* `field_values` will be empty.
* @returns %TRUE if the form contains text fields, or %FALSE otherwise
*/
list_text_fields(): [boolean, string[] | null, string[] | null];
/**
* Continue the form submission.
*/
submit(): void;
}
module GeolocationManager {
// Signal callback interfaces
interface Start {
(): boolean;
}
interface Stop {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
enable_high_accuracy: boolean;
enableHighAccuracy: boolean;
}
}
/**
* Geolocation manager.
*
* WebKitGeolocationManager provides API to get the geographical position of the user.
* Once a #WebKitGeolocationPermissionRequest is allowed, when WebKit needs to know the
* user location #WebKitGeolocationManager::start signal is emitted. If the signal is handled
* and returns %TRUE, the application is responsible for providing the position every time it's
* updated by calling webkit_geolocation_manager_update_position(). The signal #WebKitGeolocationManager::stop
* will be emitted when location updates are no longer needed.
*/
class GeolocationManager extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether high accuracy is enabled. This is a read-only property that will be
* set to %TRUE when a #WebKitGeolocationManager needs to get accurate position updates.
* You can connect to notify::enable-high-accuracy signal to monitor it.
*/
get enable_high_accuracy(): boolean;
/**
* Whether high accuracy is enabled. This is a read-only property that will be
* set to %TRUE when a #WebKitGeolocationManager needs to get accurate position updates.
* You can connect to notify::enable-high-accuracy signal to monitor it.
*/
get enableHighAccuracy(): boolean;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'start', callback: (_source: this) => boolean): number;
connect_after(signal: 'start', callback: (_source: this) => boolean): number;
emit(signal: 'start'): void;
connect(signal: 'stop', callback: (_source: this) => void): number;
connect_after(signal: 'stop', callback: (_source: this) => void): number;
emit(signal: 'stop'): void;
// Methods
/**
* Notify `manager` that determining the position failed.
* @param error_message the error message
*/
failed(error_message: string): void;
/**
* Get whether high accuracy is enabled.
* @returns Whether the setting is enabled.
*/
get_enable_high_accuracy(): boolean;
/**
* Notify `manager` that position has been updated to `position`.
* @param position a #WebKitGeolocationPosition
*/
update_position(position: GeolocationPosition): void;
}
module GeolocationPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for sharing the user's location.
*
* WebKitGeolocationPermissionRequest represents a request for
* permission to decide whether WebKit should provide the user's
* location to a website when requested through the Geolocation API.
*
* When a WebKitGeolocationPermissionRequest is not handled by the user,
* it is denied by default.
*
* When embedding web views in your application, you *must* configure an
* application identifier to allow web content to use geolocation services.
* The identifier *must* match the name of the `.desktop` file which describes
* the application, sans the suffix.
*
* If your application uses #GApplication (or any subclass like
* #GtkApplication), WebKit will automatically use the identifier returned by
* g_application_get_application_id(). This is the recommended approach for
* enabling geolocation in applications.
*
* If an identifier cannot be obtained through #GApplication, the value
* returned by g_get_prgname() will be used instead as a fallback. For
* programs which cannot use #GApplication, calling g_set_prgname() early
* during initialization is needed when the name of the executable on disk
* does not match the name of a valid `.desktop` file.
*/
class GeolocationPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module HitTestResult {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
context: number;
image_uri: string;
imageUri: string;
link_label: string;
linkLabel: string;
link_title: string;
linkTitle: string;
link_uri: string;
linkUri: string;
media_uri: string;
mediaUri: string;
}
}
/**
* Result of a Hit Test.
*
* A Hit Test is an operation to get context information about a given
* point in a #WebKitWebView. #WebKitHitTestResult represents the
* result of a Hit Test. It provides context information about what is
* at the coordinates of the Hit Test, such as if there's a link,
* an image or a media.
*
* You can get the context of the HitTestResult with
* webkit_hit_test_result_get_context() that returns a bitmask of
* #WebKitHitTestResultContext flags. You can also use
* webkit_hit_test_result_context_is_link(), webkit_hit_test_result_context_is_image() and
* webkit_hit_test_result_context_is_media() to determine whether there's
* a link, image or a media element at the coordinates of the Hit Test.
* Note that it's possible that several #WebKitHitTestResultContext flags
* are active at the same time, for example if there's a link containing an image.
*
* When the mouse is moved over a #WebKitWebView a Hit Test is performed
* for the mouse coordinates and #WebKitWebView::mouse-target-changed
* signal is emitted with a #WebKitHitTestResult.
*/
class HitTestResult extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Bitmask of #WebKitHitTestResultContext flags representing
* the context of the #WebKitHitTestResult.
*/
get context(): number;
/**
* The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
* is present in #WebKitHitTestResult:context
*/
get image_uri(): string;
/**
* The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
* is present in #WebKitHitTestResult:context
*/
get imageUri(): string;
/**
* The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_label(): string;
/**
* The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkLabel(): string;
/**
* The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_title(): string;
/**
* The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkTitle(): string;
/**
* The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_uri(): string;
/**
* The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkUri(): string;
/**
* The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
* is present in #WebKitHitTestResult:context
*/
get media_uri(): string;
/**
* The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
* is present in #WebKitHitTestResult:context
*/
get mediaUri(): string;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's an editable element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_editable(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's an image element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_image(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a link element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_link(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a media element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_media(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a scrollbar element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_scrollbar(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a selected element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_selection(): boolean;
/**
* Gets the value of the #WebKitHitTestResult:context property.
* @returns a bitmask of #WebKitHitTestResultContext flags
*/
get_context(): number;
/**
* Gets the value of the #WebKitHitTestResult:image-uri property.
* @returns the URI of the image element in the coordinates of the Hit Test, or %NULL if there isn't an image element in @hit_test_result context
*/
get_image_uri(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-label property.
* @returns the label of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context or the link element doesn't have a label
*/
get_link_label(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-title property.
* @returns the title of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context or the link element doesn't have a title
*/
get_link_title(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-uri property.
* @returns the URI of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context
*/
get_link_uri(): string;
/**
* Gets the value of the #WebKitHitTestResult:media-uri property.
* @returns the URI of the media element in the coordinates of the Hit Test, or %NULL if there isn't a media element in @hit_test_result context
*/
get_media_uri(): string;
}
module InputMethodContext {
// Signal callback interfaces
interface Committed {
(text: string): void;
}
interface DeleteSurrounding {
(offset: number, n_chars: number): void;
}
interface PreeditChanged {
(): void;
}
interface PreeditFinished {
(): void;
}
interface PreeditStarted {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
input_hints: InputHints;
inputHints: InputHints;
input_purpose: InputPurpose;
inputPurpose: InputPurpose;
}
}
/**
* Base class for input method contexts.
*
* WebKitInputMethodContext defines the interface to implement WebKit input methods.
* The input methods are used by WebKit, when editable content is focused, to map from
* key events to Unicode character strings.
*
* An input method may consume multiple key events in sequence and finally
* output the composed result. This is called preediting, and an input method
* may provide feedback about this process by displaying the intermediate
* composition states as preedit text.
*/
abstract class InputMethodContext extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The #WebKitInputHints of the input associated with this context.
*/
get input_hints(): InputHints;
set input_hints(val: InputHints);
/**
* The #WebKitInputHints of the input associated with this context.
*/
get inputHints(): InputHints;
set inputHints(val: InputHints);
/**
* The #WebKitInputPurpose of the input associated with this context.
*/
get input_purpose(): InputPurpose;
set input_purpose(val: InputPurpose);
/**
* The #WebKitInputPurpose of the input associated with this context.
*/
get inputPurpose(): InputPurpose;
set inputPurpose(val: InputPurpose);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'committed', callback: (_source: this, text: string) => void): number;
connect_after(signal: 'committed', callback: (_source: this, text: string) => void): number;
emit(signal: 'committed', text: string): void;
connect(
signal: 'delete-surrounding',
callback: (_source: this, offset: number, n_chars: number) => void,
): number;
connect_after(
signal: 'delete-surrounding',
callback: (_source: this, offset: number, n_chars: number) => void,
): number;
emit(signal: 'delete-surrounding', offset: number, n_chars: number): void;
connect(signal: 'preedit-changed', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-changed', callback: (_source: this) => void): number;
emit(signal: 'preedit-changed'): void;
connect(signal: 'preedit-finished', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-finished', callback: (_source: this) => void): number;
emit(signal: 'preedit-finished'): void;
connect(signal: 'preedit-started', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-started', callback: (_source: this) => void): number;
emit(signal: 'preedit-started'): void;
// Virtual methods
vfunc_committed(text: string): void;
vfunc_delete_surrounding(offset: number, n_chars: number): void;
/**
* Allow `key_event` to be handled by the input method.
*
* If %TRUE is returned, then no further processing should be
* done for the key event.
* @param key_event the key event to filter
*/
vfunc_filter_key_event(key_event: Gdk.Event): boolean;
/**
* Get the pre-edit string and a list of WebKitInputMethodUnderline.
*
* Get the current pre-edit string for the `context,` and a list of WebKitInputMethodUnderline to apply to the string.
* The string will be displayed inserted at `cursor_offset`.
*/
vfunc_get_preedit(): [string, InputMethodUnderline[] | null, number];
/**
* Notify `context` that cursor area changed in input associated.
* @param x the x coordinate of cursor location
* @param y the y coordinate of cursor location
* @param width the width of cursor area
* @param height the height of cursor area
*/
vfunc_notify_cursor_area(x: number, y: number, width: number, height: number): void;
/**
* Notify `context` that input associated has gained focus.
*/
vfunc_notify_focus_in(): void;
/**
* Notify `context` that input associated has lost focus.
*/
vfunc_notify_focus_out(): void;
/**
* Notify `context` that the context surrounding the cursor has changed.
*
* If there's no selection `selection_index` is the same as `cursor_index`.
* @param text text surrounding the insertion point
* @param length the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
* @param selection_index the byte index of the selection cursor within @text.
*/
vfunc_notify_surrounding(text: string, length: number, cursor_index: number, selection_index: number): void;
vfunc_preedit_changed(): void;
vfunc_preedit_finished(): void;
vfunc_preedit_started(): void;
/**
* Reset the `context`.
*
* This will typically cause the input to clear the preedit state.
*/
vfunc_reset(): void;
/**
* Set whether `context` should enable preedit to display feedback.
* @param enabled whether to enable preedit
*/
vfunc_set_enable_preedit(enabled: boolean): void;
// Methods
/**
* Allow `key_event` to be handled by the input method.
*
* If %TRUE is returned, then no further processing should be
* done for the key event.
* @param key_event the key event to filter
* @returns %TRUE if the key event was handled, or %FALSE otherwise
*/
filter_key_event(key_event: Gdk.Event): boolean;
/**
* Get the value of the #WebKitInputMethodContext:input-hints property.
* @returns the #WebKitInputHints of the input associated with @context
*/
get_input_hints(): InputHints;
/**
* Get the value of the #WebKitInputMethodContext:input-purpose property.
* @returns the #WebKitInputPurpose of the input associated with @context
*/
get_input_purpose(): InputPurpose;
/**
* Get the pre-edit string and a list of WebKitInputMethodUnderline.
*
* Get the current pre-edit string for the `context,` and a list of WebKitInputMethodUnderline to apply to the string.
* The string will be displayed inserted at `cursor_offset`.
*/
get_preedit(): [string, InputMethodUnderline[] | null, number];
/**
* Notify `context` that cursor area changed in input associated.
* @param x the x coordinate of cursor location
* @param y the y coordinate of cursor location
* @param width the width of cursor area
* @param height the height of cursor area
*/
notify_cursor_area(x: number, y: number, width: number, height: number): void;
/**
* Notify `context` that input associated has gained focus.
*/
notify_focus_in(): void;
/**
* Notify `context` that input associated has lost focus.
*/
notify_focus_out(): void;
/**
* Notify `context` that the context surrounding the cursor has changed.
*
* If there's no selection `selection_index` is the same as `cursor_index`.
* @param text text surrounding the insertion point
* @param length the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
* @param selection_index the byte index of the selection cursor within @text.
*/
notify_surrounding(text: string, length: number, cursor_index: number, selection_index: number): void;
/**
* Reset the `context`.
*
* This will typically cause the input to clear the preedit state.
*/
reset(): void;
/**
* Set whether `context` should enable preedit to display feedback.
* @param enabled whether to enable preedit
*/
set_enable_preedit(enabled: boolean): void;
/**
* Set the value of the #WebKitInputMethodContext:input-hints property.
* @param hints a #WebKitInputHints
*/
set_input_hints(hints: InputHints | null): void;
/**
* Set the value of the #WebKitInputMethodContext:input-purpose property.
* @param purpose a #WebKitInputPurpose
*/
set_input_purpose(purpose: InputPurpose | null): void;
}
module MediaKeySystemPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for using an EME Content Decryption Module.
*
* WebKitMediaKeySystemPermissionRequest represents a request for permission to decide whether
* WebKit should use the given CDM to access protected media when requested through the
* MediaKeySystem API.
*
* When a WebKitMediaKeySystemPermissionRequest is not handled by the user,
* it is denied by default.
*
* When handling this permission request the application may perform additional installation of the
* requested CDM, unless it is already present on the host system.
*/
class MediaKeySystemPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module NavigationPolicyDecision {
// Constructor properties interface
interface ConstructorProps extends PolicyDecision.ConstructorProps {
navigation_action: NavigationAction;
navigationAction: NavigationAction;
}
}
/**
* A policy decision for navigation actions.
*
* WebKitNavigationPolicyDecision represents a policy decision for events associated with
* navigations. If the value of #WebKitNavigationPolicyDecision:mouse-button is not 0, then
* the navigation was triggered by a mouse event.
*/
class NavigationPolicyDecision extends PolicyDecision {
static $gtype: GObject.GType;
// Properties
/**
* The #WebKitNavigationAction that triggered this policy decision.
*/
get navigation_action(): NavigationAction;
/**
* The #WebKitNavigationAction that triggered this policy decision.
*/
get navigationAction(): NavigationAction;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the value of the #WebKitNavigationPolicyDecision:navigation-action property.
* @returns The #WebKitNavigationAction triggering this policy decision.
*/
get_navigation_action(): NavigationAction;
}
module NetworkSession {
// Signal callback interfaces
interface DownloadStarted {
(download: Download): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
cache_directory: string;
cacheDirectory: string;
data_directory: string;
dataDirectory: string;
is_ephemeral: boolean;
isEphemeral: boolean;
}
}
/**
* Manages network configuration.
*/
class NetworkSession extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The base caches directory used to create the #WebKitWebsiteDataManager. If %NULL, a default location will be used.
*/
set cache_directory(val: string);
/**
* The base caches directory used to create the #WebKitWebsiteDataManager. If %NULL, a default location will be used.
*/
set cacheDirectory(val: string);
/**
* The base data directory used to create the #WebKitWebsiteDataManager. If %NULL, a default location will be used.
*/
set data_directory(val: string);
/**
* The base data directory used to create the #WebKitWebsiteDataManager. If %NULL, a default location will be used.
*/
set dataDirectory(val: string);
/**
* Whether to create an ephermeral #WebKitWebsiteDataManager for the session.
*/
get is_ephemeral(): boolean;
/**
* Whether to create an ephermeral #WebKitWebsiteDataManager for the session.
*/
get isEphemeral(): boolean;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](data_directory?: string | null, cache_directory?: string | null): NetworkSession;
static new_ephemeral(): NetworkSession;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'download-started', callback: (_source: this, download: Download) => void): number;
connect_after(signal: 'download-started', callback: (_source: this, download: Download) => void): number;
emit(signal: 'download-started', download: Download): void;
// Static methods
/**
* Get the default network session.
* The default network session is created using webkit_network_session_new() and passing
* %NULL as data and cache directories.
*/
static get_default(): NetworkSession;
/**
* Sets `settings` as the #WebKitMemoryPressureSettings.
*
* Sets `settings` as the #WebKitMemoryPressureSettings to be used by the network
* process created by any instance of #WebKitNetworkSession after this function
* is called.
*
* Be sure to call this function before creating any #WebKitNetworkSession.
*
* The periodic check for used memory is disabled by default on network processes. This will
* be enabled only if custom settings have been set using this function. After that, in order
* to remove the custom settings and disable the periodic check, this function must be called
* passing %NULL as the value of `settings`.
* @param settings a WebKitMemoryPressureSettings.
*/
static set_memory_pressure_settings(settings: MemoryPressureSettings): void;
// Methods
/**
* Ignore further TLS errors on the `host` for the certificate present in `info`.
*
* If `host` is an IPv6 address, it should not be surrounded by brackets. This
* expectation matches g_uri_get_host().
* @param certificate a #GTlsCertificate
* @param host the host for which a certificate is to be allowed
*/
allow_tls_certificate_for_host(certificate: Gio.TlsCertificate, host: string): void;
/**
* Requests downloading of the specified URI string.
*
* The download operation will not be associated to any #WebKitWebView,
* if you are interested in starting a download from a particular #WebKitWebView use
* webkit_web_view_download_uri() instead.
* @param uri the URI to download
* @returns a new #WebKitDownload representing the download operation.
*/
download_uri(uri: string): Download;
/**
* Get the #WebKitCookieManager of `session`.
* @returns a #WebKitCookieManager
*/
get_cookie_manager(): CookieManager;
/**
* Get whether Intelligent Tracking Prevention (ITP) is enabled or not.
* @returns %TRUE if ITP is enabled, or %FALSE otherwise.
*/
get_itp_enabled(): boolean;
/**
* Asynchronously get the list of #WebKitITPThirdParty seen for `session`.
*
* Every #WebKitITPThirdParty
* contains the list of #WebKitITPFirstParty under which it has been seen.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_network_session_get_itp_summary_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_itp_summary(cancellable?: Gio.Cancellable | null): Promise;
/**
* Asynchronously get the list of #WebKitITPThirdParty seen for `session`.
*
* Every #WebKitITPThirdParty
* contains the list of #WebKitITPFirstParty under which it has been seen.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_network_session_get_itp_summary_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_itp_summary(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously get the list of #WebKitITPThirdParty seen for `session`.
*
* Every #WebKitITPThirdParty
* contains the list of #WebKitITPFirstParty under which it has been seen.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_network_session_get_itp_summary_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_itp_summary(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Finish an asynchronous operation started with webkit_network_session_get_itp_summary().
* @param result a #GAsyncResult
* @returns a #GList of #WebKitITPThirdParty. You must free the #GList with g_list_free() and unref the #WebKitITPThirdPartys with webkit_itp_third_party_unref() when you're done with them.
*/
get_itp_summary_finish(result: Gio.AsyncResult): ITPThirdParty[];
/**
* Get whether persistent credential storage is enabled or not.
*
* See also webkit_network_session_set_persistent_credential_storage_enabled().
* @returns %TRUE if persistent credential storage is enabled, or %FALSE otherwise.
*/
get_persistent_credential_storage_enabled(): boolean;
/**
* Get the TLS errors policy of `session`.
* @returns a #WebKitTLSErrorsPolicy
*/
get_tls_errors_policy(): TLSErrorsPolicy;
/**
* Get the #WebKitWebsiteDataManager of `session`.
* @returns a #WebKitWebsiteDataManager
*/
get_website_data_manager(): WebsiteDataManager;
/**
* Resolve the domain name of the given `hostname` in advance, so that if a URI
* of `hostname` is requested the load will be performed more quickly.
* @param hostname a hostname to be resolved
*/
prefetch_dns(hostname: string): void;
/**
* Enable or disable Intelligent Tracking Prevention (ITP).
*
* When ITP is enabled resource load statistics
* are collected and used to decide whether to allow or block third-party cookies and prevent user tracking.
* Note that while ITP is enabled the accept policy %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY is ignored and
* %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS is used instead. See also webkit_cookie_session_set_accept_policy().
* @param enabled value to set
*/
set_itp_enabled(enabled: boolean): void;
/**
* Enable or disable persistent credential storage.
*
* When enabled, which is the default for
* non-ephemeral sessions, the network process will try to read and write HTTP authentiacation
* credentials from persistent storage.
* @param enabled value to set
*/
set_persistent_credential_storage_enabled(enabled: boolean): void;
/**
* Set the network proxy settings to be used by connections started in `session` session.
*
* By default %WEBKIT_NETWORK_PROXY_MODE_DEFAULT is used, which means that the
* system settings will be used (g_proxy_resolver_get_default()).
* If you want to override the system default settings, you can either use
* %WEBKIT_NETWORK_PROXY_MODE_NO_PROXY to make sure no proxies are used at all,
* or %WEBKIT_NETWORK_PROXY_MODE_CUSTOM to provide your own proxy settings.
* When `proxy_mode` is %WEBKIT_NETWORK_PROXY_MODE_CUSTOM `proxy_settings` must be
* a valid #WebKitNetworkProxySettings; otherwise, `proxy_settings` must be %NULL.
* @param proxy_mode a #WebKitNetworkProxyMode
* @param proxy_settings a #WebKitNetworkProxySettings, or %NULL
*/
set_proxy_settings(proxy_mode: NetworkProxyMode | null, proxy_settings?: NetworkProxySettings | null): void;
/**
* Set the TLS errors policy of `session` as `policy`.
* @param policy a #WebKitTLSErrorsPolicy
*/
set_tls_errors_policy(policy: TLSErrorsPolicy | null): void;
}
module Notification {
// Signal callback interfaces
interface Clicked {
(): void;
}
interface Closed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
body: string;
id: number;
tag: string;
title: string;
}
}
/**
* Holds information about a notification that should be shown to the user.
*/
class Notification extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The body for the notification.
*/
get body(): string;
/**
* The unique id for the notification.
*/
get id(): number;
/**
* The tag identifier for the notification.
*/
get tag(): string;
/**
* The title for the notification.
*/
get title(): string;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'clicked', callback: (_source: this) => void): number;
connect_after(signal: 'clicked', callback: (_source: this) => void): number;
emit(signal: 'clicked'): void;
connect(signal: 'closed', callback: (_source: this) => void): number;
connect_after(signal: 'closed', callback: (_source: this) => void): number;
emit(signal: 'closed'): void;
// Methods
/**
* Tells WebKit the notification has been clicked.
*
* This will emit the
* #WebKitNotification::clicked signal.
*/
clicked(): void;
/**
* Closes the notification.
*/
close(): void;
/**
* Obtains the body for the notification.
* @returns the body for the notification
*/
get_body(): string;
/**
* Obtains the unique id for the notification.
* @returns the unique id for the notification
*/
get_id(): number;
/**
* Obtains the tag identifier for the notification.
* @returns the tag for the notification
*/
get_tag(): string | null;
/**
* Obtains the title for the notification.
* @returns the title for the notification
*/
get_title(): string;
}
module NotificationPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for displaying web notifications.
*
* WebKitNotificationPermissionRequest represents a request for
* permission to decide whether WebKit should provide the user with
* notifications through the Web Notification API.
*
* When a WebKitNotificationPermissionRequest is not handled by the user,
* it is denied by default.
*/
class NotificationPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module OptionMenu {
// Signal callback interfaces
interface Close {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents the dropdown menu of a `select` element in a #WebKitWebView.
*
* When a select element in a #WebKitWebView needs to display a dropdown menu, the signal
* #WebKitWebView::show-option-menu is emitted, providing a WebKitOptionMenu with the
* #WebKitOptionMenuItems that should be displayed.
*/
class OptionMenu extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'close', callback: (_source: this) => void): number;
connect_after(signal: 'close', callback: (_source: this) => void): number;
emit(signal: 'close'): void;
// Methods
/**
* Activates the #WebKitOptionMenuItem at `index` in `menu`.
*
* Activating an item changes the value
* of the element making the item the active one. You are expected to close the menu with
* webkit_option_menu_close() after activating an item, calling this function again will have no
* effect.
* @param index the index of the item
*/
activate_item(index: number): void;
/**
* Request to close a #WebKitOptionMenu.
*
* This emits WebKitOptionMenu::close signal.
* This function should always be called to notify WebKit that the associated
* menu has been closed. If the menu is closed and neither webkit_option_menu_select_item()
* nor webkit_option_menu_activate_item() have been called, the element value remains
* unchanged.
*/
close(): void;
/**
* Gets the #GdkEvent that triggered the dropdown menu.
* If `menu` was not triggered by a user interaction, like a mouse click,
* %NULL is returned.
* @returns the menu event or %NULL.
*/
get_event(): Gdk.Event;
/**
* Returns the #WebKitOptionMenuItem at `index` in `menu`.
* @param index the index of the item
* @returns a #WebKitOptionMenuItem of @menu.
*/
get_item(index: number): OptionMenuItem;
/**
* Gets the length of the `menu`.
* @returns the number of #WebKitOptionMenuItems in @menu
*/
get_n_items(): number;
/**
* Selects the #WebKitOptionMenuItem at `index` in `menu`.
*
* Selecting an item changes the
* text shown by the combo button, but it doesn't change the value of the element. You need to
* explicitly activate the item with webkit_option_menu_select_item() or close the menu with
* webkit_option_menu_close() in which case the currently selected item will be activated.
* @param index the index of the item
*/
select_item(index: number): void;
}
module PointerLockPermissionRequest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for locking the pointer.
*
* WebKitPointerLockPermissionRequest represents a request for
* permission to decide whether WebKit can lock the pointer device when
* requested by web content.
*
* When a WebKitPointerLockPermissionRequest is not handled by the user,
* it is allowed by default.
*/
class PointerLockPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
get_property(property_name: string): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
set_property(property_name: string, value: any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
disconnect(id: number): void;
set(properties: { [key: string]: any }): void;
block_signal_handler(id: number): any;
unblock_signal_handler(id: number): any;
stop_emission_by_name(detailedName: string): any;
}
module PolicyDecision {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* 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.
*/
abstract class PolicyDecision extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Spawn a download from this decision.
*/
download(): void;
/**
* #WebKitResponsePolicyDecision, this would cancel the request.
*
* Ignore the action which triggered this decision. For instance, for a
* #WebKitResponsePolicyDecision, this would cancel the request.
*/
ignore(): void;
/**
* Accept the action which triggered this decision.
*/
use(): void;
/**
* Accept the navigation action and continue with provided `policies`.
*
* 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`.
* @param policies a #WebKitWebsitePolicies
*/
use_with_policies(policies: WebsitePolicies): void;
}
module PrintOperation {
// Signal callback interfaces
interface Failed {
(error: GLib.Error): void;
}
interface Finished {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
page_setup: Gtk.PageSetup;
pageSetup: Gtk.PageSetup;
print_settings: Gtk.PrintSettings;
printSettings: Gtk.PrintSettings;
web_view: WebView;
webView: WebView;
}
}
/**
* Controls a print operation.
*
* A #WebKitPrintOperation controls a print operation in WebKit. With
* a similar API to #GtkPrintOperation, it lets you set the print
* settings with webkit_print_operation_set_print_settings() or
* display the print dialog with webkit_print_operation_run_dialog().
*/
class PrintOperation extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The initial #GtkPageSetup for the print operation.
*/
get page_setup(): Gtk.PageSetup;
set page_setup(val: Gtk.PageSetup);
/**
* The initial #GtkPageSetup for the print operation.
*/
get pageSetup(): Gtk.PageSetup;
set pageSetup(val: Gtk.PageSetup);
/**
* The initial #GtkPrintSettings for the print operation.
*/
get print_settings(): Gtk.PrintSettings;
set print_settings(val: Gtk.PrintSettings);
/**
* The initial #GtkPrintSettings for the print operation.
*/
get printSettings(): Gtk.PrintSettings;
set printSettings(val: Gtk.PrintSettings);
/**
* The #WebKitWebView that will be printed.
*/
get web_view(): WebView;
/**
* The #WebKitWebView that will be printed.
*/
get webView(): WebView;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](web_view: WebView): PrintOperation;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'failed', callback: (_source: this, error: GLib.Error) => void): number;
connect_after(signal: 'failed', callback: (_source: this, error: GLib.Error) => void): number;
emit(signal: 'failed', error: GLib.Error): void;
connect(signal: 'finished', callback: (_source: this) => void): number;
connect_after(signal: 'finished', callback: (_source: this) => void): number;
emit(signal: 'finished'): void;
// Methods
/**
* Return the current page setup of `print_operation`.
*
* It returns %NULL until
* either webkit_print_operation_set_page_setup() or webkit_print_operation_run_dialog()
* have been called.
* @returns the current #GtkPageSetup of @print_operation.
*/
get_page_setup(): Gtk.PageSetup;
/**
* Return the current print settings of `print_operation`.
*
* It returns %NULL until
* either webkit_print_operation_set_print_settings() or webkit_print_operation_run_dialog()
* have been called.
* @returns the current #GtkPrintSettings of @print_operation.
*/
get_print_settings(): Gtk.PrintSettings;
/**
* Start a print operation using current print settings and page setup.
*
* Start a print operation using current print settings and page setup
* without showing the print dialog. If either print settings or page setup
* are not set with webkit_print_operation_set_print_settings() and
* webkit_print_operation_set_page_setup(), the default options will be used
* and the print job will be sent to the default printer.
* The #WebKitPrintOperation::finished signal is emitted when the printing
* operation finishes. If an error occurs while printing the signal
* #WebKitPrintOperation::failed is emitted before #WebKitPrintOperation::finished.
*
* If the app is running in a sandbox, this function only works if printing to
* a file that is in a location accessible to the sandbox, usually acquired
* through the File Chooser portal. This function will not work for physical
* printers when running in a sandbox.
*/
print(): void;
/**
* Run the print dialog and start printing.
*
* Run the print dialog and start printing using the options selected by
* the user. This method returns when the print dialog is closed.
* If the print dialog is cancelled %WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL
* is returned. If the user clicks on the print button, %WEBKIT_PRINT_OPERATION_RESPONSE_PRINT
* is returned and the print operation starts. In this case, the #WebKitPrintOperation::finished
* signal is emitted when the operation finishes. If an error occurs while printing, the signal
* #WebKitPrintOperation::failed is emitted before #WebKitPrintOperation::finished.
* If the print dialog is not cancelled current print settings and page setup of `print_operation`
* are updated with options selected by the user when Print button is pressed in print dialog.
* You can get the updated print settings and page setup by calling
* webkit_print_operation_get_print_settings() and webkit_print_operation_get_page_setup()
* after this method.
* @param parent transient parent of the print dialog
* @returns the #WebKitPrintOperationResponse of the print dialog
*/
run_dialog(parent?: Gtk.Window | null): PrintOperationResponse;
/**
* Set the current page setup of `print_operation`.
*
* Current page setup is used for the
* initial values of the print dialog when webkit_print_operation_run_dialog() is called.
* @param page_setup a #GtkPageSetup to set
*/
set_page_setup(page_setup: Gtk.PageSetup): void;
/**
* Set the current print settings of `print_operation`.
*
* Set the current print settings of `print_operation`. Current print settings are used for
* the initial values of the print dialog when webkit_print_operation_run_dialog() is called.
* @param print_settings a #GtkPrintSettings to set
*/
set_print_settings(print_settings: Gtk.PrintSettings): void;
}
module ResponsePolicyDecision {
// Constructor properties interface
interface ConstructorProps extends PolicyDecision.ConstructorProps {
request: URIRequest;
response: URIResponse;
}
}
/**
* A policy decision for resource responses.
*
* WebKitResponsePolicyDecision represents a policy decision for a
* resource response, whether from the network or the local system.
* A very common use case for these types of decision is deciding
* whether or not to download a particular resource or to load it
* normally.
*/
class ResponsePolicyDecision extends PolicyDecision {
static $gtype: GObject.GType;
// Properties
/**
* This property contains the #WebKitURIRequest associated with this
* policy decision.
*/
get request(): URIRequest;
/**
* This property contains the #WebKitURIResponse associated with this
* policy decision.
*/
get response(): URIResponse;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Return the #WebKitURIRequest associated with the response decision.
*
* Modifications to the returned object are not taken
* into account when the request is sent over the network, and is intended
* only to aid in evaluating whether a response decision should be taken or
* not. To modify requests before they are sent over the network the
* #WebKitPage::send-request signal can be used instead.
* @returns The URI request that is associated with this policy decision.
*/
get_request(): URIRequest;
/**
* Gets the value of the #WebKitResponsePolicyDecision:response property.
* @returns The URI response that is associated with this policy decision.
*/
get_response(): URIResponse;
/**
* Gets whether the request is the main frame main resource
* @returns %TRUE if the request is the main frame main resouce or %FALSE otherwise
*/
is_main_frame_main_resource(): boolean;
/**
* Gets whether the MIME type of the response can be displayed in the #WebKitWebView.
*
* Gets whether the MIME type of the response can be displayed in the #WebKitWebView
* that triggered this policy decision request. See also webkit_web_view_can_show_mime_type().
* @returns %TRUE if the MIME type of the response is supported or %FALSE otherwise
*/
is_mime_type_supported(): boolean;
}
module SecurityManager {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Controls security settings in a #WebKitWebContext.
*
* The #WebKitSecurityManager defines security settings for URI
* schemes in a #WebKitWebContext. Get it from the context with
* webkit_web_context_get_security_manager(), and use it to register a
* URI scheme with a certain security level, or to check if it already
* has it.
*/
class SecurityManager extends GObject.Object {
static $gtype: GObject.GType;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Register `scheme` as a CORS (Cross-origin resource sharing) enabled scheme.
*
* This means that CORS requests are allowed. See W3C CORS specification
* http://www.w3.org/TR/cors/.
* @param scheme a URI scheme
*/
register_uri_scheme_as_cors_enabled(scheme: string): void;
/**
* Register `scheme` as a display isolated scheme.
*
* This means that pages cannot
* display these URIs unless they are from the same scheme.
* @param scheme a URI scheme
*/
register_uri_scheme_as_display_isolated(scheme: string): void;
/**
* Register `scheme` as an empty document scheme.
*
* This means that
* they are allowed to commit synchronously.
* @param scheme a URI scheme
*/
register_uri_scheme_as_empty_document(scheme: string): void;
/**
* Register `scheme` as a local scheme.
*
* This means that other non-local pages
* cannot link to or access URIs of this scheme.
* @param scheme a URI scheme
*/
register_uri_scheme_as_local(scheme: string): void;
/**
* Register `scheme` as a no-access scheme.
*
* This means that pages loaded
* with this URI scheme cannot access pages loaded with any other URI scheme.
* @param scheme a URI scheme
*/
register_uri_scheme_as_no_access(scheme: string): void;
/**
* Register `scheme` as a secure scheme.
*
* This means that mixed
* content warnings won't be generated for this scheme when
* included by an HTTPS page.
* @param scheme a URI scheme
*/
register_uri_scheme_as_secure(scheme: string): void;
/**
* Whether `scheme` is considered as a CORS enabled scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_cors_enabled().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is a CORS enabled scheme or %FALSE otherwise.
*/
uri_scheme_is_cors_enabled(scheme: string): boolean;
/**
* Whether `scheme` is considered as a display isolated scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_display_isolated().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is a display isolated scheme or %FALSE otherwise.
*/
uri_scheme_is_display_isolated(scheme: string): boolean;
/**
* Whether `scheme` is considered as an empty document scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_empty_document().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is an empty document scheme or %FALSE otherwise.
*/
uri_scheme_is_empty_document(scheme: string): boolean;
/**
* Whether `scheme` is considered as a local scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_local().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is a local scheme or %FALSE otherwise.
*/
uri_scheme_is_local(scheme: string): boolean;
/**
* Whether `scheme` is considered as a no-access scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_no_access().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is a no-access scheme or %FALSE otherwise.
*/
uri_scheme_is_no_access(scheme: string): boolean;
/**
* Whether `scheme` is considered as a secure scheme.
*
* See also webkit_security_manager_register_uri_scheme_as_secure().
* @param scheme a URI scheme
* @returns %TRUE if @scheme is a secure scheme or %FALSE otherwise.
*/
uri_scheme_is_secure(scheme: string): boolean;
}
module Settings {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
allow_file_access_from_file_urls: boolean;
allowFileAccessFromFileUrls: boolean;
allow_modal_dialogs: boolean;
allowModalDialogs: boolean;
allow_top_navigation_to_data_urls: boolean;
allowTopNavigationToDataUrls: boolean;
allow_universal_access_from_file_urls: boolean;
allowUniversalAccessFromFileUrls: boolean;
auto_load_images: boolean;
autoLoadImages: boolean;
cursive_font_family: string;
cursiveFontFamily: string;
default_charset: string;
defaultCharset: string;
default_font_family: string;
defaultFontFamily: string;
default_font_size: number;
defaultFontSize: number;
default_monospace_font_size: number;
defaultMonospaceFontSize: number;
disable_web_security: boolean;
disableWebSecurity: boolean;
draw_compositing_indicators: boolean;
drawCompositingIndicators: boolean;
enable_2d_canvas_acceleration: boolean;
enable2dCanvasAcceleration: boolean;
enable_back_forward_navigation_gestures: boolean;
enableBackForwardNavigationGestures: boolean;
enable_caret_browsing: boolean;
enableCaretBrowsing: boolean;
enable_developer_extras: boolean;
enableDeveloperExtras: boolean;
enable_dns_prefetching: boolean;
enableDnsPrefetching: boolean;
enable_encrypted_media: boolean;
enableEncryptedMedia: boolean;
enable_fullscreen: boolean;
enableFullscreen: boolean;
enable_html5_database: boolean;
enableHtml5Database: boolean;
enable_html5_local_storage: boolean;
enableHtml5LocalStorage: boolean;
enable_hyperlink_auditing: boolean;
enableHyperlinkAuditing: boolean;
enable_javascript: boolean;
enableJavascript: boolean;
enable_javascript_markup: boolean;
enableJavascriptMarkup: boolean;
enable_media: boolean;
enableMedia: boolean;
enable_media_capabilities: boolean;
enableMediaCapabilities: boolean;
enable_media_stream: boolean;
enableMediaStream: boolean;
enable_mediasource: boolean;
enableMediasource: boolean;
enable_mock_capture_devices: boolean;
enableMockCaptureDevices: boolean;
enable_offline_web_application_cache: boolean;
enableOfflineWebApplicationCache: boolean;
enable_page_cache: boolean;
enablePageCache: boolean;
enable_resizable_text_areas: boolean;
enableResizableTextAreas: boolean;
enable_site_specific_quirks: boolean;
enableSiteSpecificQuirks: boolean;
enable_smooth_scrolling: boolean;
enableSmoothScrolling: boolean;
enable_spatial_navigation: boolean;
enableSpatialNavigation: boolean;
enable_tabs_to_links: boolean;
enableTabsToLinks: boolean;
enable_webaudio: boolean;
enableWebaudio: boolean;
enable_webgl: boolean;
enableWebgl: boolean;
enable_webrtc: boolean;
enableWebrtc: boolean;
enable_write_console_messages_to_stdout: boolean;
enableWriteConsoleMessagesToStdout: boolean;
fantasy_font_family: string;
fantasyFontFamily: string;
hardware_acceleration_policy: HardwareAccelerationPolicy;
hardwareAccelerationPolicy: HardwareAccelerationPolicy;
javascript_can_access_clipboard: boolean;
javascriptCanAccessClipboard: boolean;
javascript_can_open_windows_automatically: boolean;
javascriptCanOpenWindowsAutomatically: boolean;
load_icons_ignoring_image_load_setting: boolean;
loadIconsIgnoringImageLoadSetting: boolean;
media_content_types_requiring_hardware_support: string;
mediaContentTypesRequiringHardwareSupport: string;
media_playback_allows_inline: boolean;
mediaPlaybackAllowsInline: boolean;
media_playback_requires_user_gesture: boolean;
mediaPlaybackRequiresUserGesture: boolean;
minimum_font_size: number;
minimumFontSize: number;
monospace_font_family: string;
monospaceFontFamily: string;
pictograph_font_family: string;
pictographFontFamily: string;
print_backgrounds: boolean;
printBackgrounds: boolean;
sans_serif_font_family: string;
sansSerifFontFamily: string;
serif_font_family: string;
serifFontFamily: string;
user_agent: string;
userAgent: string;
zoom_text_only: boolean;
zoomTextOnly: boolean;
}
}
/**
* Control the behaviour of a #WebKitWebView.
*
* #WebKitSettings can be applied to a #WebKitWebView to control text charset,
* color, font sizes, printing mode, script support, loading of images and various
* other things on a #WebKitWebView. After creation, a #WebKitSettings object
* contains default settings.
*
* ```c
* // Disable JavaScript
* WebKitSettings *settings = webkit_web_view_group_get_settings (my_view_group);
* webkit_settings_set_enable_javascript (settings, FALSE);
* ```
*/
class Settings extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether file access is allowed from file URLs. By default, when
* something is loaded in a #WebKitWebView using a file URI, cross
* origin requests to other file resources are not allowed. This
* setting allows you to change that behaviour, so that it would be
* possible to do a XMLHttpRequest of a local file, for example.
*/
get allow_file_access_from_file_urls(): boolean;
set allow_file_access_from_file_urls(val: boolean);
/**
* Whether file access is allowed from file URLs. By default, when
* something is loaded in a #WebKitWebView using a file URI, cross
* origin requests to other file resources are not allowed. This
* setting allows you to change that behaviour, so that it would be
* possible to do a XMLHttpRequest of a local file, for example.
*/
get allowFileAccessFromFileUrls(): boolean;
set allowFileAccessFromFileUrls(val: boolean);
/**
* Determine whether it's allowed to create and run modal dialogs
* from a #WebKitWebView through JavaScript with
* window.showModalDialog. If it's set to
* %FALSE, the associated #WebKitWebView won't be able to create
* new modal dialogs, so not even the #WebKitWebView::create
* signal will be emitted.
*/
get allow_modal_dialogs(): boolean;
set allow_modal_dialogs(val: boolean);
/**
* Determine whether it's allowed to create and run modal dialogs
* from a #WebKitWebView through JavaScript with
* window.showModalDialog. If it's set to
* %FALSE, the associated #WebKitWebView won't be able to create
* new modal dialogs, so not even the #WebKitWebView::create
* signal will be emitted.
*/
get allowModalDialogs(): boolean;
set allowModalDialogs(val: boolean);
/**
* Whether or not the top frame is allowed to navigate to data URLs. It is disabled by default
* due to the risk it poses when loading untrusted URLs, with data URLs being used in scamming
* and phishing attacks. In contrast, a scenario where it could be enabled could be an app that
* embeds a WebView and you have control of the pages being show instead of a generic browser.
*/
get allow_top_navigation_to_data_urls(): boolean;
set allow_top_navigation_to_data_urls(val: boolean);
/**
* Whether or not the top frame is allowed to navigate to data URLs. It is disabled by default
* due to the risk it poses when loading untrusted URLs, with data URLs being used in scamming
* and phishing attacks. In contrast, a scenario where it could be enabled could be an app that
* embeds a WebView and you have control of the pages being show instead of a generic browser.
*/
get allowTopNavigationToDataUrls(): boolean;
set allowTopNavigationToDataUrls(val: boolean);
/**
* Whether or not JavaScript running in the context of a file scheme URL
* should be allowed to access content from any origin. By default, when
* something is loaded in a #WebKitWebView using a file scheme URL,
* access to the local file system and arbitrary local storage is not
* allowed. This setting allows you to change that behaviour, so that
* it would be possible to use local storage, for example.
*/
get allow_universal_access_from_file_urls(): boolean;
set allow_universal_access_from_file_urls(val: boolean);
/**
* Whether or not JavaScript running in the context of a file scheme URL
* should be allowed to access content from any origin. By default, when
* something is loaded in a #WebKitWebView using a file scheme URL,
* access to the local file system and arbitrary local storage is not
* allowed. This setting allows you to change that behaviour, so that
* it would be possible to use local storage, for example.
*/
get allowUniversalAccessFromFileUrls(): boolean;
set allowUniversalAccessFromFileUrls(val: boolean);
/**
* Determines whether images should be automatically loaded or not.
* On devices where network bandwidth is of concern, it might be
* useful to turn this property off.
*/
get auto_load_images(): boolean;
set auto_load_images(val: boolean);
/**
* Determines whether images should be automatically loaded or not.
* On devices where network bandwidth is of concern, it might be
* useful to turn this property off.
*/
get autoLoadImages(): boolean;
set autoLoadImages(val: boolean);
/**
* The font family used as the default for content using a cursive font.
*/
get cursive_font_family(): string;
set cursive_font_family(val: string);
/**
* The font family used as the default for content using a cursive font.
*/
get cursiveFontFamily(): string;
set cursiveFontFamily(val: string);
/**
* The default text charset used when interpreting content with an unspecified charset.
*/
get default_charset(): string;
set default_charset(val: string);
/**
* The default text charset used when interpreting content with an unspecified charset.
*/
get defaultCharset(): string;
set defaultCharset(val: string);
/**
* The font family to use as the default for content that does not specify a font.
*/
get default_font_family(): string;
set default_font_family(val: string);
/**
* The font family to use as the default for content that does not specify a font.
*/
get defaultFontFamily(): string;
set defaultFontFamily(val: string);
/**
* The default font size in pixels to use for content displayed if
* no font size is specified.
*/
get default_font_size(): number;
set default_font_size(val: number);
/**
* The default font size in pixels to use for content displayed if
* no font size is specified.
*/
get defaultFontSize(): number;
set defaultFontSize(val: number);
/**
* The default font size in pixels to use for content displayed in
* monospace font if no font size is specified.
*/
get default_monospace_font_size(): number;
set default_monospace_font_size(val: number);
/**
* The default font size in pixels to use for content displayed in
* monospace font if no font size is specified.
*/
get defaultMonospaceFontSize(): number;
set defaultMonospaceFontSize(val: number);
/**
* Enable or disable support for Web Security on pages.
*
* This setting disables the same-origin policy, allowing every website full control over
* all other websites. This is for use in special environments where you wish to disable
* all security and allow websites to hack each other. It is impossible to use this setting
* securely.
*/
get disable_web_security(): boolean;
set disable_web_security(val: boolean);
/**
* Enable or disable support for Web Security on pages.
*
* This setting disables the same-origin policy, allowing every website full control over
* all other websites. This is for use in special environments where you wish to disable
* all security and allow websites to hack each other. It is impossible to use this setting
* securely.
*/
get disableWebSecurity(): boolean;
set disableWebSecurity(val: boolean);
/**
* Whether to draw compositing borders and repaint counters on layers drawn
* with accelerated compositing. This is useful for debugging issues related
* to web content that is composited with the GPU.
*/
get draw_compositing_indicators(): boolean;
set draw_compositing_indicators(val: boolean);
/**
* Whether to draw compositing borders and repaint counters on layers drawn
* with accelerated compositing. This is useful for debugging issues related
* to web content that is composited with the GPU.
*/
get drawCompositingIndicators(): boolean;
set drawCompositingIndicators(val: boolean);
/**
* Enable or disable 2D canvas acceleration.
* If this setting is enabled, the 2D canvas will be accelerated even if Skia CPU
* is used for rendering. However, the canvas can be unaccelerated even when this setting
* is enabled, for other reasons like its size or when willReadFrequently property is used.
*/
get enable_2d_canvas_acceleration(): boolean;
set enable_2d_canvas_acceleration(val: boolean);
/**
* Enable or disable 2D canvas acceleration.
* If this setting is enabled, the 2D canvas will be accelerated even if Skia CPU
* is used for rendering. However, the canvas can be unaccelerated even when this setting
* is enabled, for other reasons like its size or when willReadFrequently property is used.
*/
get enable2dCanvasAcceleration(): boolean;
set enable2dCanvasAcceleration(val: boolean);
/**
* Enable or disable horizontal swipe gesture for back-forward navigation.
*/
get enable_back_forward_navigation_gestures(): boolean;
set enable_back_forward_navigation_gestures(val: boolean);
/**
* Enable or disable horizontal swipe gesture for back-forward navigation.
*/
get enableBackForwardNavigationGestures(): boolean;
set enableBackForwardNavigationGestures(val: boolean);
/**
* Whether to enable accessibility enhanced keyboard navigation.
*/
get enable_caret_browsing(): boolean;
set enable_caret_browsing(val: boolean);
/**
* Whether to enable accessibility enhanced keyboard navigation.
*/
get enableCaretBrowsing(): boolean;
set enableCaretBrowsing(val: boolean);
/**
* Determines whether or not developer tools, such as the Web Inspector, are enabled.
*/
get enable_developer_extras(): boolean;
set enable_developer_extras(val: boolean);
/**
* Determines whether or not developer tools, such as the Web Inspector, are enabled.
*/
get enableDeveloperExtras(): boolean;
set enableDeveloperExtras(val: boolean);
/**
* Determines whether or not to prefetch domain names. DNS prefetching attempts
* to resolve domain names before a user tries to follow a link.
*/
get enable_dns_prefetching(): boolean;
set enable_dns_prefetching(val: boolean);
/**
* Determines whether or not to prefetch domain names. DNS prefetching attempts
* to resolve domain names before a user tries to follow a link.
*/
get enableDnsPrefetching(): boolean;
set enableDnsPrefetching(val: boolean);
/**
* Enable or disable support for Encrypted Media API on pages.
* EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
* This property will only work as intended if the EncryptedMedia feature is enabled at build time
* with the ENABLE_ENCRYPTED_MEDIA flag.
*
* See https://www.w3.org/TR/encrypted-media/
*/
get enable_encrypted_media(): boolean;
set enable_encrypted_media(val: boolean);
/**
* Enable or disable support for Encrypted Media API on pages.
* EncryptedMedia is an experimental JavaScript API for playing encrypted media in HTML.
* This property will only work as intended if the EncryptedMedia feature is enabled at build time
* with the ENABLE_ENCRYPTED_MEDIA flag.
*
* See https://www.w3.org/TR/encrypted-media/
*/
get enableEncryptedMedia(): boolean;
set enableEncryptedMedia(val: boolean);
/**
* Whether to enable the Javascript Fullscreen API. The API
* allows any HTML element to request fullscreen display. See also
* the current draft of the spec:
* http://www.w3.org/TR/fullscreen/
*/
get enable_fullscreen(): boolean;
set enable_fullscreen(val: boolean);
/**
* Whether to enable the Javascript Fullscreen API. The API
* allows any HTML element to request fullscreen display. See also
* the current draft of the spec:
* http://www.w3.org/TR/fullscreen/
*/
get enableFullscreen(): boolean;
set enableFullscreen(val: boolean);
/**
* Whether to enable HTML5 client-side SQL database support (IndexedDB).
*/
get enable_html5_database(): boolean;
set enable_html5_database(val: boolean);
/**
* Whether to enable HTML5 client-side SQL database support (IndexedDB).
*/
get enableHtml5Database(): boolean;
set enableHtml5Database(val: boolean);
/**
* Whether to enable HTML5 local storage support. Local storage provides
* simple synchronous storage access.
*
* HTML5 local storage specification is available at
* http://dev.w3.org/html5/webstorage/.
*/
get enable_html5_local_storage(): boolean;
set enable_html5_local_storage(val: boolean);
/**
* Whether to enable HTML5 local storage support. Local storage provides
* simple synchronous storage access.
*
* HTML5 local storage specification is available at
* http://dev.w3.org/html5/webstorage/.
*/
get enableHtml5LocalStorage(): boolean;
set enableHtml5LocalStorage(val: boolean);
/**
* Determines whether or not hyperlink auditing is enabled.
*
* The hyperlink auditing specification is available at
* http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing.
*/
get enable_hyperlink_auditing(): boolean;
set enable_hyperlink_auditing(val: boolean);
/**
* Determines whether or not hyperlink auditing is enabled.
*
* The hyperlink auditing specification is available at
* http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#hyperlink-auditing.
*/
get enableHyperlinkAuditing(): boolean;
set enableHyperlinkAuditing(val: boolean);
/**
* Determines whether or not JavaScript executes within a page.
*/
get enable_javascript(): boolean;
set enable_javascript(val: boolean);
/**
* Determines whether or not JavaScript executes within a page.
*/
get enableJavascript(): boolean;
set enableJavascript(val: boolean);
/**
* Determines whether or not JavaScript markup is allowed in document. When this setting is disabled,
* all JavaScript-related elements and attributes are removed from the document during parsing. Note that
* executing JavaScript is still allowed if #WebKitSettings:enable-javascript is %TRUE.
*/
get enable_javascript_markup(): boolean;
set enable_javascript_markup(val: boolean);
/**
* Determines whether or not JavaScript markup is allowed in document. When this setting is disabled,
* all JavaScript-related elements and attributes are removed from the document during parsing. Note that
* executing JavaScript is still allowed if #WebKitSettings:enable-javascript is %TRUE.
*/
get enableJavascriptMarkup(): boolean;
set enableJavascriptMarkup(val: boolean);
/**
* Enable or disable support for media playback on pages. This setting is enabled by
* default. Disabling it means `