2018-05-12 14:50:54 +02:00
unit uCEFInterfaces;
{$IFDEF FPC}
{$MODE OBJFPC} {$H+}
{$ENDIF}
{$I cef.inc}
2022-02-19 18:56:41 +01:00
{$IFNDEF TARGET_64BITS} {$ALIGN ON} {$ENDIF}
{$MINENUMSIZE 4}
2018-05-12 14:50:54 +02:00
interface
uses
{$IFDEF DELPHI16_UP}
2018-06-03 17:18:54 +02:00
{$IFDEF MSWINDOWS} WinApi . Windows, {$ENDIF} System. Classes,
2018-05-12 14:50:54 +02:00
{$ELSE}
2018-06-03 17:18:54 +02:00
{$IFDEF MSWINDOWS} Windows, {$ENDIF} Classes,
2018-05-12 14:50:54 +02:00
{$ENDIF}
uCEFTypes, uCEFSchemeRegistrar;
type
ICefBrowser = interface ;
ICefFrame = interface ;
2021-07-29 16:20:34 +02:00
ICefFrameHandler = interface ;
2018-05-12 14:50:54 +02:00
ICefRequest = interface ;
ICefv8Value = interface ;
ICefV8Exception = interface ;
ICefV8StackTrace = interface ;
ICefDomVisitor = interface ;
ICefDomDocument = interface ;
ICefDomNode = interface ;
ICefv8Context = interface ;
ICefListValue = interface ;
ICefBinaryValue = interface ;
ICefDictionaryValue = interface ;
ICefClient = interface ;
ICefUrlrequestClient = interface ;
ICefBrowserHost = interface ;
ICefTask = interface ;
ICefTaskRunner = interface ;
ICefFileDialogCallback = interface ;
2024-05-01 18:19:19 +02:00
ICefUnresponsiveProcessCallback = interface ;
2018-05-12 14:50:54 +02:00
ICefPrintHandler = interface ;
ICefPrintDialogCallback = interface ;
ICefPrintJobCallback = interface ;
ICefRequestContext = interface ;
ICefAccessibilityHandler = interface ;
ICefDragData = interface ;
ICefNavigationEntry = interface ;
ICefSslInfo = interface ;
ICefSSLStatus = interface ;
ICefImage = interface ;
IChromiumEvents = interface ;
ICefThread = interface ;
ICefWaitableEvent = interface ;
ICefX509CertPrincipal = interface ;
ICefX509Certificate = interface ;
ICefSelectClientCertificateCallback = interface ;
ICefCommandLine = interface ;
ICefRequestHandler = interface ;
2019-06-16 10:31:13 +02:00
ICefResourceRequestHandler = interface ;
ICefCookieAccessFilter = interface ;
2018-05-12 14:50:54 +02:00
ICefResourceBundleHandler = interface ;
ICefBrowserProcessHandler = interface ;
ICefRenderProcessHandler = interface ;
ICefProcessMessage = interface ;
ICefLifeSpanHandler = interface ;
2022-05-03 12:43:16 +02:00
ICefCommandHandler = interface ;
2018-05-12 14:50:54 +02:00
ICefGetExtensionResourceCallback = interface ;
ICefExtensionHandler = interface ;
ICefExtension = interface ;
ICefStreamReader = interface ;
ICefLoadHandler = interface ;
ICefServer = interface ;
ICefServerHandler = interface ;
ICefContextMenuParams = interface ;
ICefMenuModel = interface ;
ICefRunContextMenuCallback = interface ;
2022-08-06 12:00:28 +02:00
ICefRunQuickMenuCallback = interface ;
2018-05-12 14:50:54 +02:00
ICefDownloadItem = interface ;
ICefBeforeDownloadCallback = interface ;
ICefJsDialogCallback = interface ;
ICefDownloadItemCallback = interface ;
2019-06-16 10:31:13 +02:00
ICefResourceSkipCallback = interface ;
ICefResourceReadCallback = interface ;
2018-05-12 14:50:54 +02:00
ICefResourceHandler = interface ;
ICefResponse = interface ;
ICefResponseFilter = interface ;
ICefAuthCallback = interface ;
ICefCallback = interface ;
ICefDragHandler = interface ;
ICefFindHandler = interface ;
ICefCookieManager = interface ;
2018-05-24 19:15:41 +02:00
ICefDisplay = interface ;
ICefLayout = interface ;
ICefBoxLayout = interface ;
ICefFillLayout = interface ;
ICefView = interface ;
ICefBrowserView = interface ;
ICefButton = interface ;
ICefPanel = interface ;
ICefScrollView = interface ;
ICefTextfield = interface ;
ICefViewDelegate = interface ;
ICefWindow = interface ;
ICefLabelButton = interface ;
ICefMenuButton = interface ;
2018-11-17 11:50:34 +01:00
ICefUrlRequest = interface ;
2019-09-25 17:23:16 +02:00
ICefPostDataElement = interface ;
2020-03-29 17:31:42 +02:00
ICefRegistration = interface ;
ICefMediaRouter = interface ;
ICefMediaObserver = interface ;
ICefMediaRoute = interface ;
ICefMediaRouteCreateCallback = interface ;
ICefMediaSink = interface ;
2020-07-15 14:56:41 +02:00
ICefMediaSinkDeviceInfoCallback = interface ;
2020-03-29 17:31:42 +02:00
ICefMediaSource = interface ;
2020-05-23 15:00:44 +02:00
ICefAudioHandler = interface ;
2020-06-21 21:27:55 +02:00
ICefDevToolsMessageObserver = interface ;
ICefValue = interface ;
2021-01-01 17:51:09 +01:00
ICefPrintSettings = interface ;
2022-08-06 12:00:28 +02:00
ICefMediaAccessCallback = interface ;
ICefMediaAccessHandler = interface ;
ICefPermissionPromptCallback = interface ;
ICefPermissionHandler = interface ;
ICefSharedMemoryRegion = interface ;
ICefSharedProcessMessageBuilder = interface ;
2023-08-07 20:21:42 +02:00
ICefBrowserViewDelegate = interface ;
ICefMenuButtonPressedLock = interface ;
2024-02-24 12:01:31 +01:00
ICefRequestContextHandler = interface ;
2018-05-12 14:50:54 +02:00
TCefv8ValueArray = array of ICefv8Value;
TCefX509CertificateArray = array of ICefX509Certificate;
TCefBinaryValueArray = array of ICefBinaryValue;
2019-09-25 17:23:16 +02:00
TCefPostDataElementArray = array of ICefPostDataElement;
2020-03-29 17:31:42 +02:00
TCefMediaRouteArray = array of ICefMediaRoute;
TCefMediaSinkArray = array of ICefMediaSink;
2020-04-29 19:14:44 +02:00
TCefDisplayArray = array of ICefDisplay;
2018-05-12 14:50:54 +02:00
2023-08-09 19:38:57 +02:00
/// <summary>
/// Custom record with media sink information.
/// </summary>
2020-04-19 22:47:20 +02:00
TCefMediaSinkInfo = record
ID : ustring;
Name : ustring;
2020-04-30 17:28:41 +02:00
IconType : TCefMediaSinkIconType;
2020-04-19 22:47:20 +02:00
SinkType : TCefMediaType;
SinkIntf : ICefMediaSink;
end ;
TCefMediaSinkInfoArray = array of TCefMediaSinkInfo;
2018-05-12 14:50:54 +02:00
2023-08-09 19:38:57 +02:00
/// <summary>
/// Custom record with media route information.
/// </summary>
2020-04-19 22:47:20 +02:00
TCefMediaRouteInfo = record
ID : ustring;
SourceID : ustring;
SinkID : ustring;
RouteIntf : ICefMediaRoute;
end ;
TCefMediaRouteInfoArray = array of TCefMediaRouteInfo;
2023-08-09 19:38:57 +02:00
/// <summary>
/// Custom record with media source information.
/// </summary>
2020-04-19 22:47:20 +02:00
TCefMediaSourceInfo = record
ID : ustring;
Valid : boolean ;
SourceType : TCefMediaType;
SourceIntf : ICefMediaSource;
end ;
TCefMediaSourceInfoArray = array of TCefMediaSourceInfo;
2018-05-12 14:50:54 +02:00
2023-08-09 19:38:57 +02:00
{ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * Callback procedures and functions * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* }
2018-05-12 14:50:54 +02:00
TCefEndTracingCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const tracingFile: ustring) ;
TCefFastTaskProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( ) ;
TCefv8ArrayBufferReleaseCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( buffer : Pointer ) ;
TCefWebPluginIsUnstableProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const path: ustring; unstable: Boolean ) ;
2019-11-24 18:19:49 +01:00
TCefV8AccessorGetterProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const name : ustring; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring) : Boolean ;
TCefV8AccessorSetterProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const name : ustring; const object_, value: ICefv8Value; var exception: ustring) : Boolean ;
TCefV8InterceptorGetterByNameProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const name : ustring; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring) : Boolean ;
TCefV8InterceptorSetterByNameProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const name : ustring; const object_, value: ICefv8Value; var exception: ustring) : Boolean ;
TCefV8InterceptorGetterByIndexProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( index : integer ; const object_: ICefv8Value; var value: ICefv8Value; var exception: ustring) : Boolean ;
TCefV8InterceptorSetterByIndexProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( index : integer ; const object_, value: ICefv8Value; var exception: ustring) : Boolean ;
2018-05-12 14:50:54 +02:00
TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const path: ustring; ok: Boolean ) ;
TCefDomVisitorProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const document: ICefDomDocument) ;
2019-06-16 10:31:13 +02:00
TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument) ;
2020-06-20 16:10:29 +02:00
TCefDomVisitorProc3 = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument; const aValue : ustring) ;
2018-05-12 14:50:54 +02:00
TCefStringVisitorProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const str: ustring) ;
2022-05-26 13:08:20 +02:00
TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const filePaths: TStrings) ;
2018-05-12 14:50:54 +02:00
TCefCompletionCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( ) ;
TCefSetCookieCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( success: Boolean ) ;
TCefDeleteCookiesCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( numDeleted: Integer ) ;
TCefNavigationEntryVisitorProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const entry: ICefNavigationEntry; current: Boolean ; index , total: Integer ) : Boolean ;
TOnDownloadImageFinishedProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const imageUrl: ustring; httpStatusCode: Integer ; const image: ICefImage) ;
2020-05-23 15:00:44 +02:00
TCefCookieVisitorProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} function( const name , value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; count, total: Integer ; same_site : TCefCookieSameSite; priority : TCefCookiePriority; out deleteCookie: Boolean ) : Boolean ;
2020-04-19 22:47:20 +02:00
TCefMediaRouteCreateCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( result : TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute) ;
2020-07-15 14:56:41 +02:00
TCefMediaSinkDeviceInfoCallbackProc = {$IFDEF DELPHI12_UP} reference to {$ENDIF} procedure( const ip_address: ustring; port: integer ; const model_name: ustring) ;
2018-05-12 14:50:54 +02:00
2022-08-06 12:00:28 +02:00
2023-08-09 19:38:57 +02:00
{ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * Custom interfaces * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* }
2018-05-12 14:50:54 +02:00
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the CEF functions related to CefStringList.
/// </summary>
2018-05-12 14:50:54 +02:00
ICefStringList = interface
[ '{DB24F301-2F64-48D6-A72E-33697748147E}' ]
function GetHandle: TCefStringList;
function GetSize: NativeUInt ;
function GetValue( Index : NativeUInt ) : ustring;
procedure Append( const Value: ustring) ;
procedure Clear;
function Copy : TCefStringList;
procedure CopyToStrings( const aStrings : TStrings) ;
procedure AddStrings( const aStrings : TStrings) ;
property Handle : TCefStringList read GetHandle;
property Size : NativeUInt read GetSize;
property Value[ index : NativeUInt ] : ustring read GetValue;
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the CEF functions related to CefStringMap.
/// </summary>
2018-05-12 14:50:54 +02:00
ICefStringMap = interface
[ '{A33EBC01-B23A-4918-86A4-E24A243B342F}' ]
function GetHandle: TCefStringMap;
function GetSize: NativeUInt ;
function Find( const Key: ustring) : ustring;
function GetKey( Index : NativeUInt ) : ustring;
function GetValue( Index : NativeUInt ) : ustring;
function Append( const Key, Value: ustring) : boolean ;
procedure Clear;
property Handle : TCefStringMap read GetHandle;
property Size : NativeUInt read GetSize;
property Key[ index : NativeUInt ] : ustring read GetKey;
property Value[ index : NativeUInt ] : ustring read GetValue;
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the CEF functions related to CefStringMultimap.
/// </summary>
2018-05-12 14:50:54 +02:00
ICefStringMultimap = interface
[ '{583ED0C2-A9D6-4034-A7C9-20EC7E47F0C7}' ]
function GetHandle: TCefStringMultimap;
function GetSize: NativeUInt ;
function FindCount( const Key: ustring) : NativeUInt ;
function GetEnumerate( const Key: ustring; ValueIndex: NativeUInt ) : ustring;
function GetKey( Index : NativeUInt ) : ustring;
function GetValue( Index : NativeUInt ) : ustring;
function Append( const Key, Value: ustring) : boolean ;
procedure Clear;
property Handle : TCefStringMultimap read GetHandle;
property Size : NativeUInt read GetSize;
property Key[ index : NativeUInt ] : ustring read GetKey;
property Value[ index : NativeUInt ] : ustring read GetValue;
property Enumerate[ const aKey: ustring; aValueIndex: NativeUInt ] : ustring read GetEnumerate;
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the TCefApplicationCore events.
/// </summary>
2023-08-03 15:58:57 +02:00
IApplicationCoreEvents = interface
2023-08-03 15:50:13 +02:00
[ '{55E99E25-A05D-46D5-B3A4-C8C2E71C1F4D}' ]
// ICefApp
procedure doOnBeforeCommandLineProcessing( const processType: ustring; const commandLine: ICefCommandLine) ;
procedure doOnRegisterCustomSchemes( const registrar: TCefSchemeRegistrarRef) ;
// ICefBrowserProcessHandler
procedure doOnRegisterCustomPreferences( type_: TCefPreferencesType; registrar: PCefPreferenceRegistrar) ;
procedure doOnContextInitialized;
procedure doOnBeforeChildProcessLaunch( const commandLine: ICefCommandLine) ;
2023-12-15 18:06:46 +01:00
procedure doOnAlreadyRunningAppRelaunch( const commandLine: ICefCommandLine; const current_directory: ustring; var aResult: boolean ) ;
2023-08-03 15:50:13 +02:00
procedure doOnScheduleMessagePumpWork( const delayMs: Int64 ) ;
procedure doGetDefaultClient( var aClient : ICefClient) ;
2024-02-24 12:01:31 +01:00
procedure doGetDefaultRequestContextHandler( var aRequestContextHandler : ICefRequestContextHandler) ;
2023-08-03 15:50:13 +02:00
// ICefResourceBundleHandler
function doGetLocalizedString( stringid: Integer ; var stringVal: ustring) : Boolean ;
function doGetDataResource( resourceId: Integer ; var data: Pointer ; var dataSize: NativeUInt ) : Boolean ;
function doGetDataResourceForScale( resourceId: Integer ; scaleFactor: TCefScaleFactor; var data: Pointer ; var dataSize: NativeUInt ) : Boolean ;
// ICefRenderProcessHandler
procedure doOnWebKitInitialized;
procedure doOnBrowserCreated( const browser: ICefBrowser; const extra_info: ICefDictionaryValue) ;
procedure doOnBrowserDestroyed( const browser: ICefBrowser) ;
procedure doOnContextCreated( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) ;
procedure doOnContextReleased( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) ;
procedure doOnUncaughtException( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const V8Exception: ICefV8Exception; const stackTrace: ICefV8StackTrace) ;
procedure doOnFocusedNodeChanged( const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode) ;
procedure doOnProcessMessageReceived( const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage; var aHandled : boolean ) ;
// ICefLoadHandler
procedure doOnLoadingStateChange( const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean ) ;
procedure doOnLoadStart( const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType) ;
procedure doOnLoadEnd( const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer ) ;
procedure doOnLoadError( const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring) ;
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the TChromiumCore events.
/// </summary>
2018-05-12 14:50:54 +02:00
IChromiumEvents = interface
[ '{0C139DB1-0349-4D7F-8155-76FEA6A0126D}' ]
procedure GetSettings( var settings: TCefBrowserSettings) ;
// ICefClient
2019-06-16 10:31:13 +02:00
function doOnProcessMessageReceived( const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message : ICefProcessMessage) : Boolean ;
2018-05-12 14:50:54 +02:00
// ICefLoadHandler
procedure doOnLoadingStateChange( const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean ) ;
procedure doOnLoadStart( const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType) ;
procedure doOnLoadEnd( const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer ) ;
procedure doOnLoadError( const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring) ;
// ICefFocusHandler
procedure doOnTakeFocus( const browser: ICefBrowser; next: Boolean ) ;
function doOnSetFocus( const browser: ICefBrowser; source: TCefFocusSource) : Boolean ;
procedure doOnGotFocus( const browser: ICefBrowser) ;
// ICefContextMenuHandler
procedure doOnBeforeContextMenu( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel) ;
function doRunContextMenu( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback) : Boolean ;
function doOnContextMenuCommand( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer ; eventFlags: TCefEventFlags) : Boolean ;
procedure doOnContextMenuDismissed( const browser: ICefBrowser; const frame: ICefFrame) ;
2022-08-06 12:00:28 +02:00
function doRunQuickMenu( const browser: ICefBrowser; const frame: ICefFrame; location: PCefPoint; size: PCefSize; edit_state_flags: TCefQuickMenuEditStateFlags; const callback: ICefRunQuickMenuCallback) : boolean ;
function doOnQuickMenuCommand( const browser: ICefBrowser; const frame: ICefFrame; command_id: integer ; event_flags: TCefEventFlags) : boolean ;
procedure doOnQuickMenuDismissed( const browser: ICefBrowser; const frame: ICefFrame) ;
2018-05-12 14:50:54 +02:00
// ICefKeyboardHandler
function doOnPreKeyEvent( const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean ) : Boolean ;
function doOnKeyEvent( const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle) : Boolean ;
// ICefDisplayHandler
procedure doOnAddressChange( const browser: ICefBrowser; const frame: ICefFrame; const url: ustring) ;
procedure doOnTitleChange( const browser: ICefBrowser; const title: ustring) ;
procedure doOnFaviconUrlChange( const browser: ICefBrowser; const iconUrls: TStrings) ;
procedure doOnFullScreenModeChange( const browser: ICefBrowser; fullscreen: Boolean ) ;
function doOnTooltip( const browser: ICefBrowser; var text : ustring) : Boolean ;
procedure doOnStatusMessage( const browser: ICefBrowser; const value: ustring) ;
function doOnConsoleMessage( const browser: ICefBrowser; level: TCefLogSeverity; const message , source: ustring; line: Integer ) : Boolean ;
function doOnAutoResize( const browser: ICefBrowser; const new_size: PCefSize) : Boolean ;
procedure doOnLoadingProgressChange( const browser: ICefBrowser; const progress: double ) ;
2021-01-26 18:26:24 +01:00
procedure doOnCursorChange( const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean ) ;
2022-08-06 12:00:28 +02:00
procedure doOnMediaAccessChange( const browser: ICefBrowser; has_video_access, has_audio_access: boolean ) ;
2018-05-12 14:50:54 +02:00
// ICefDownloadHandler
2022-05-03 12:43:16 +02:00
function doOnCanDownload( const browser: ICefBrowser; const url, request_method: ustring) : boolean ;
2024-05-28 15:50:48 +02:00
function doOnBeforeDownload( const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback) : boolean ;
2018-05-12 14:50:54 +02:00
procedure doOnDownloadUpdated( const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback) ;
// ICefJsDialogHandler
function doOnJsdialog( const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean ) : Boolean ;
function doOnBeforeUnloadDialog( const browser: ICefBrowser; const messageText: ustring; isReload: Boolean ; const callback: ICefJsDialogCallback) : Boolean ;
procedure doOnResetDialogState( const browser: ICefBrowser) ;
procedure doOnDialogClosed( const browser: ICefBrowser) ;
// ICefLifeSpanHandler
2019-06-16 10:31:13 +02:00
function doOnBeforePopup( const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean ; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean ) : Boolean ;
2023-11-16 16:58:47 +01:00
procedure doOnBeforeDevToolsPopup( const browser: ICefBrowser; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var use_default_window: boolean ) ;
2018-05-12 14:50:54 +02:00
procedure doOnAfterCreated( const browser: ICefBrowser) ;
procedure doOnBeforeClose( const browser: ICefBrowser) ;
function doOnClose( const browser: ICefBrowser) : Boolean ;
// ICefRequestHandler
function doOnBeforeBrowse( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; user_gesture, isRedirect: Boolean ) : Boolean ;
function doOnOpenUrlFromTab( const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean ) : Boolean ;
2019-11-08 14:32:03 +01:00
procedure doGetResourceRequestHandler_ReqHdlr( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean ; const request_initiator: ustring; var disable_default_handling: boolean ; var aResourceRequestHandler : ICefResourceRequestHandler) ;
2019-07-18 11:48:11 +02:00
function doOnGetAuthCredentials( const browser: ICefBrowser; const originUrl: ustring; isProxy: Boolean ; const host: ustring; port: Integer ; const realm, scheme: ustring; const callback: ICefAuthCallback) : Boolean ;
2021-10-22 19:19:57 +02:00
function doOnCertificateError( const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback) : Boolean ;
2018-05-12 14:50:54 +02:00
function doOnSelectClientCertificate( const browser: ICefBrowser; isProxy: boolean ; const host: ustring; port: integer ; certificatesCount: NativeUInt ; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback) : boolean ;
procedure doOnRenderViewReady( const browser: ICefBrowser) ;
2024-05-01 18:19:19 +02:00
function doOnRenderProcessUnresponsive( const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback) : boolean ;
procedure doOnRenderProcessResponsive( const browser: ICefBrowser) ;
procedure doOnRenderProcessTerminated( const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer ; const error_string: ustring) ;
2020-06-21 21:27:55 +02:00
procedure doOnDocumentAvailableInMainFrame( const browser: ICefBrowser) ;
2018-05-12 14:50:54 +02:00
2019-06-16 10:31:13 +02:00
// ICefResourceRequestHandler
2021-10-22 19:19:57 +02:00
function doOnBeforeResourceLoad( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback) : TCefReturnValue;
2019-06-16 10:31:13 +02:00
procedure doOnGetResourceHandler( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var aResourceHandler: ICefResourceHandler) ;
procedure doOnResourceRedirect( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var newUrl: ustring) ;
function doOnResourceResponse( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse) : Boolean ;
procedure doOnGetResourceResponseFilter( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var aResponseFilter: ICefResponseFilter) ;
procedure doOnResourceLoadComplete( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; status: TCefUrlRequestStatus; receivedContentLength: Int64 ) ;
procedure doOnProtocolExecution( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var allowOsExecution: Boolean ) ;
// ICefCookieAccessFilter
function doCanSendCookie( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const cookie: PCefCookie) : boolean ;
function doCanSaveCookie( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie) : boolean ;
2018-05-12 14:50:54 +02:00
// ICefDialogHandler
2024-06-14 19:17:43 +02:00
function doOnFileDialog( const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters, accept_extensions, accept_descriptions: TStrings; const callback: ICefFileDialogCallback) : Boolean ;
2018-05-12 14:50:54 +02:00
// ICefRenderHandler
procedure doOnGetAccessibilityHandler( var aAccessibilityHandler : ICefAccessibilityHandler) ;
function doOnGetRootScreenRect( const browser: ICefBrowser; var rect: TCefRect) : Boolean ;
2018-12-12 17:13:23 +01:00
procedure doOnGetViewRect( const browser: ICefBrowser; var rect: TCefRect) ;
2018-05-12 14:50:54 +02:00
function doOnGetScreenPoint( const browser: ICefBrowser; viewX, viewY: Integer ; var screenX, screenY: Integer ) : Boolean ;
function doOnGetScreenInfo( const browser: ICefBrowser; var screenInfo: TCefScreenInfo) : Boolean ;
procedure doOnPopupShow( const browser: ICefBrowser; show: Boolean ) ;
procedure doOnPopupSize( const browser: ICefBrowser; const rect: PCefRect) ;
2019-11-20 10:45:46 +01:00
procedure doOnPaint( const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt ; const dirtyRects: PCefRectArray; const buffer: Pointer ; width, height: Integer ) ;
2024-05-01 18:19:19 +02:00
procedure doOnAcceleratedPaint( const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt ; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo) ;
2022-08-06 12:00:28 +02:00
procedure doGetTouchHandleSize( const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize) ;
procedure doOnTouchHandleStateChanged( const browser: ICefBrowser; const state: TCefTouchHandleState) ;
2018-05-12 14:50:54 +02:00
function doOnStartDragging( const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer ) : Boolean ;
procedure doOnUpdateDragCursor( const browser: ICefBrowser; operation: TCefDragOperation) ;
procedure doOnScrollOffsetChanged( const browser: ICefBrowser; x, y: Double ) ;
procedure doOnIMECompositionRangeChanged( const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt ; const character_bounds: PCefRect) ;
procedure doOnTextSelectionChanged( const browser: ICefBrowser; const selected_text: ustring; const selected_range: PCefRange) ;
2019-03-15 17:17:14 +01:00
procedure doOnVirtualKeyboardRequested( const browser: ICefBrowser; input_mode: TCefTextInpuMode) ;
2018-05-12 14:50:54 +02:00
// ICefDragHandler
function doOnDragEnter( const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations) : Boolean ;
2019-11-20 10:45:46 +01:00
procedure doOnDraggableRegionsChanged( const browser: ICefBrowser; const frame: ICefFrame; regionsCount: NativeUInt ; const regions: PCefDraggableRegionArray) ;
2018-05-12 14:50:54 +02:00
// ICefFindHandler
procedure doOnFindResult( const browser: ICefBrowser; identifier, count: Integer ; const selectionRect: PCefRect; activeMatchOrdinal: Integer ; finalUpdate: Boolean ) ;
2019-10-11 17:51:16 +02:00
// ICefRequestContextHandler
procedure doOnRequestContextInitialized( const request_context: ICefRequestContext) ;
2019-11-08 14:32:03 +01:00
procedure doGetResourceRequestHandler_ReqCtxHdlr( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean ; const request_initiator: ustring; var disable_default_handling: boolean ; var aResourceRequestHandler : ICefResourceRequestHandler) ;
2019-10-11 17:51:16 +02:00
2020-04-19 22:47:20 +02:00
// ICefMediaObserver
procedure doOnSinks( const sinks: TCefMediaSinkArray) ;
procedure doOnRoutes( const routes: TCefMediaRouteArray) ;
procedure doOnRouteStateChanged( const route: ICefMediaRoute; state: TCefMediaRouteConnectionState) ;
procedure doOnRouteMessageReceived( const route: ICefMediaRoute; const message_: ustring) ;
2020-05-23 15:00:44 +02:00
// ICefAudioHandler
procedure doOnGetAudioParameters( const browser: ICefBrowser; var params: TCefAudioParameters; var aResult: boolean ) ;
procedure doOnAudioStreamStarted( const browser: ICefBrowser; const params: TCefAudioParameters; channels: integer ) ;
procedure doOnAudioStreamPacket( const browser: ICefBrowser; const data : PPSingle; frames: integer ; pts: int64 ) ;
procedure doOnAudioStreamStopped( const browser: ICefBrowser) ;
procedure doOnAudioStreamError( const browser: ICefBrowser; const message_: ustring) ;
2020-06-21 21:27:55 +02:00
// ICefDevToolsMessageObserver
2021-01-16 14:35:01 +01:00
procedure doOnDevToolsMessage( const browser: ICefBrowser; const message_: Pointer ; message_size: NativeUInt ; var aHandled: boolean ) ;
procedure doOnDevToolsMethodResult( const browser: ICefBrowser; message_id: integer ; success: boolean ; const result : Pointer ; result_size: NativeUInt ) ;
procedure doOnDevToolsEvent( const browser: ICefBrowser; const method: ustring; const params: Pointer ; params_size: NativeUInt ) ;
2020-06-21 21:27:55 +02:00
procedure doOnDevToolsAgentAttached( const browser: ICefBrowser) ;
procedure doOnDevToolsAgentDetached( const browser: ICefBrowser) ;
2020-08-04 17:52:09 +02:00
// ICefExtensionHandler
procedure doOnExtensionLoadFailed( result : TCefErrorcode) ;
procedure doOnExtensionLoaded( const extension: ICefExtension) ;
procedure doOnExtensionUnloaded( const extension: ICefExtension) ;
function doOnExtensionBeforeBackgroundBrowser( const extension: ICefExtension; const url: ustring; var client: ICefClient; var settings: TCefBrowserSettings) : boolean ;
function doOnExtensionBeforeBrowser( const extension: ICefExtension; const browser, active_browser: ICefBrowser; index : Integer ; const url: ustring; active: boolean ; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings) : boolean ;
procedure doOnExtensionGetActiveBrowser( const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean ; var aRsltBrowser: ICefBrowser) ;
function doOnExtensionCanAccessBrowser( const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean ; const target_browser: ICefBrowser) : boolean ;
function doOnExtensionGetExtensionResource( const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback) : boolean ;
2021-04-18 19:36:20 +02:00
// ICefPrintHandler
procedure doOnPrintStart( const browser: ICefBrowser) ;
procedure doOnPrintSettings( const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean ) ;
procedure doOnPrintDialog( const browser: ICefBrowser; hasSelection: boolean ; const callback: ICefPrintDialogCallback; var aResult : boolean ) ;
procedure doOnPrintJob( const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult : boolean ) ;
procedure doOnPrintReset( const browser: ICefBrowser) ;
procedure doOnGetPDFPaperSize( const browser: ICefBrowser; deviceUnitsPerInch: Integer ; var aResult : TCefSize) ;
2021-07-29 16:20:34 +02:00
// ICefFrameHandler
procedure doOnFrameCreated( const browser: ICefBrowser; const frame: ICefFrame) ;
2021-09-27 12:04:33 +02:00
procedure doOnFrameAttached( const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean ) ;
2021-07-29 16:20:34 +02:00
procedure doOnFrameDetached( const browser: ICefBrowser; const frame: ICefFrame) ;
procedure doOnMainFrameChanged( const browser: ICefBrowser; const old_frame, new_frame: ICefFrame) ;
2022-05-03 12:43:16 +02:00
// ICefCommandHandler
function doOnChromeCommand( const browser: ICefBrowser; command_id: integer ; disposition: TCefWindowOpenDisposition) : boolean ;
2023-04-08 19:00:33 +02:00
function doOnIsChromeAppMenuItemVisible( const browser: ICefBrowser; command_id: integer ) : boolean ;
function doOnIsChromeAppMenuItemEnabled( const browser: ICefBrowser; command_id: integer ) : boolean ;
function doOnIsChromePageActionIconVisible( icon_type: TCefChromePageActionIconType) : boolean ;
function doOnIsChromeToolbarButtonVisible( button_type: TCefChromeToolbarButtonType) : boolean ;
2022-05-03 12:43:16 +02:00
2022-08-06 12:00:28 +02:00
// ICefPermissionHandler
function doOnRequestMediaAccessPermission( const browser: ICefBrowser; const frame: ICefFrame; const requesting_origin: ustring; requested_permissions: cardinal ; const callback: ICefMediaAccessCallback) : boolean ;
function doOnShowPermissionPrompt( const browser: ICefBrowser; prompt_id: uint64 ; const requesting_origin: ustring; requested_permissions: cardinal ; const callback: ICefPermissionPromptCallback) : boolean ;
procedure doOnDismissPermissionPrompt( const browser: ICefBrowser; prompt_id: uint64 ; result : TCefPermissionRequestResult) ;
2018-05-12 14:50:54 +02:00
// Custom
procedure doCookiesDeleted( numDeleted : integer ) ;
procedure doPdfPrintFinished( aResultOK : boolean ) ;
procedure doTextResultAvailable( const aText : ustring) ;
procedure doUpdatePreferences( const aBrowser: ICefBrowser) ;
procedure doUpdateOwnPreferences;
function doSavePreferences : boolean ;
procedure doResolvedHostAvailable( result : TCefErrorCode; const resolvedIps: TStrings) ;
2019-02-03 15:34:21 +01:00
function doNavigationVisitorResultAvailable( const entry: ICefNavigationEntry; current: Boolean ; index , total: Integer ) : boolean ;
2019-05-11 15:40:19 +02:00
procedure doDownloadImageFinished( const imageUrl: ustring; httpStatusCode: Integer ; const image: ICefImage) ;
2019-09-16 11:28:48 +02:00
procedure doOnCookiesStoreFlushed;
2019-10-08 15:03:22 +02:00
procedure doCertificateExceptionsCleared;
procedure doHttpAuthCredentialsCleared;
procedure doAllConnectionsClosed;
2019-10-18 17:15:55 +02:00
procedure doOnExecuteTaskOnCefThread( aTaskID : cardinal ) ;
2020-05-23 15:00:44 +02:00
procedure doOnCookiesVisited( const name_, value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; count, total, aID : Integer ; same_site : TCefCookieSameSite; priority : TCefCookiePriority; var aDeleteCookie, aResult : Boolean ) ;
2019-11-08 14:32:03 +01:00
procedure doOnCookieVisitorDestroyed( aID : integer ) ;
2019-10-29 16:13:35 +01:00
procedure doOnCookieSet( aSuccess : boolean ; aID : integer ) ;
2019-12-10 16:49:07 +01:00
procedure doUpdateZoomStep( aInc : boolean ) ;
procedure doUpdateZoomPct( aInc : boolean ) ;
procedure doSetZoomLevel( const aValue : double ) ;
procedure doSetZoomPct( const aValue : double ) ;
procedure doSetZoomStep( aValue : byte ) ;
procedure doReadZoom;
2020-04-19 22:47:20 +02:00
procedure doMediaRouteCreateFinished( result : TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute) ;
2020-07-15 14:56:41 +02:00
procedure doOnMediaSinkDeviceInfo( const ip_address: ustring; port: integer ; const model_name: ustring) ;
2020-11-22 16:42:52 +01:00
procedure doBrowserNavigation( aTask : TCefBrowserNavigation) ;
2022-08-29 22:45:28 +02:00
procedure doSetAudioMuted( aValue : boolean ) ;
procedure doToggleAudioMuted;
2023-03-11 17:29:30 +01:00
procedure doEnableFocus;
2020-05-23 15:00:44 +02:00
function MustCreateAudioHandler : boolean ;
2022-05-03 12:43:16 +02:00
function MustCreateCommandHandler : boolean ;
2019-06-19 16:53:26 +02:00
function MustCreateLoadHandler : boolean ;
function MustCreateFocusHandler : boolean ;
function MustCreateContextMenuHandler : boolean ;
function MustCreateDialogHandler : boolean ;
function MustCreateKeyboardHandler : boolean ;
function MustCreateDisplayHandler : boolean ;
function MustCreateDownloadHandler : boolean ;
function MustCreateJsDialogHandler : boolean ;
function MustCreateLifeSpanHandler : boolean ;
function MustCreateRenderHandler : boolean ;
function MustCreateRequestHandler : boolean ;
function MustCreateDragHandler : boolean ;
function MustCreateFindHandler : boolean ;
function MustCreateResourceRequestHandler : boolean ;
function MustCreateCookieAccessFilter : boolean ;
2020-04-19 22:47:20 +02:00
function MustCreateMediaObserver : boolean ;
2021-04-18 19:36:20 +02:00
function MustCreatePrintHandler : boolean ;
2021-07-29 16:20:34 +02:00
function MustCreateFrameHandler : boolean ;
2022-08-06 12:00:28 +02:00
function MustCreatePermissionHandler : boolean ;
2023-11-29 13:04:33 +01:00
function GetComponentID : integer ;
property ComponentID : integer read GetComponentID;
2018-05-12 14:50:54 +02:00
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the TCEFServerComponent events.
/// </summary>
2018-05-12 14:50:54 +02:00
IServerEvents = interface
[ '{06A1B3C6-0967-4F6C-A751-8AA3A29E2FF5}' ]
2023-08-07 20:21:42 +02:00
// ICefServerHandler
2018-05-12 14:50:54 +02:00
procedure doOnServerCreated( const server: ICefServer) ;
2018-03-29 20:02:04 +02:00
procedure doOnServerDestroyed( const server: ICefServer) ;
procedure doOnClientConnected( const server: ICefServer; connection_id: Integer ) ;
procedure doOnClientDisconnected( const server: ICefServer; connection_id: Integer ) ;
procedure doOnHttpRequest( const server: ICefServer; connection_id: Integer ; const client_address: ustring; const request: ICefRequest) ;
procedure doOnWebSocketRequest( const server: ICefServer; connection_id: Integer ; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback) ;
procedure doOnWebSocketConnected( const server: ICefServer; connection_id: Integer ) ;
procedure doOnWebSocketMessage( const server: ICefServer; connection_id: Integer ; const data: Pointer ; data_size: NativeUInt ) ;
2018-05-12 14:50:54 +02:00
end ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle all the TCEFUrlRequestClientComponent events.
/// </summary>
2018-11-17 11:50:34 +01:00
ICEFUrlRequestClientEvents = interface
2018-11-17 12:33:28 +01:00
[ '{1AA800A7-56A1-43CA-A224-49368F18BDD8}' ]
2018-11-17 11:50:34 +01:00
// ICefUrlrequestClient
procedure doOnRequestComplete( const request: ICefUrlRequest) ;
procedure doOnUploadProgress( const request: ICefUrlRequest; current, total: Int64 ) ;
procedure doOnDownloadProgress( const request: ICefUrlRequest; current, total: Int64 ) ;
procedure doOnDownloadData( const request: ICefUrlRequest; data: Pointer ; dataLength: NativeUInt ) ;
function doOnGetAuthCredentials( isProxy: Boolean ; const host: ustring; port: Integer ; const realm, scheme: ustring; const callback: ICefAuthCallback) : Boolean ;
// Custom
procedure doOnCreateURLRequest;
2023-11-29 13:04:33 +01:00
function GetComponentID : integer ;
property ComponentID : integer read GetComponentID;
2018-11-17 11:50:34 +01:00
end ;
2018-05-12 14:50:54 +02:00
2023-08-07 20:21:42 +02:00
/// <summary>
/// Custom interface used to handle the ICefViewDelegate events.
/// </summary>
ICefViewDelegateEvents = interface
[ '{74DDDB37-8F08-4672-BDB6-55CA2CD374ED}' ]
// ICefViewDelegate
procedure doOnGetPreferredSize( const view: ICefView; var aResult : TCefSize) ;
procedure doOnGetMinimumSize( const view: ICefView; var aResult : TCefSize) ;
procedure doOnGetMaximumSize( const view: ICefView; var aResult : TCefSize) ;
procedure doOnGetHeightForWidth( const view: ICefView; width: Integer ; var aResult: Integer ) ;
procedure doOnParentViewChanged( const view: ICefView; added: boolean ; const parent: ICefView) ;
procedure doOnChildViewChanged( const view: ICefView; added: boolean ; const child: ICefView) ;
procedure doOnWindowChanged( const view: ICefView; added: boolean ) ;
procedure doOnLayoutChanged( const view: ICefView; new_bounds: TCefRect) ;
procedure doOnFocus( const view: ICefView) ;
procedure doOnBlur( const view: ICefView) ;
2024-05-01 18:19:19 +02:00
procedure doOnThemeChanged( const view: ICefView) ;
2023-08-07 20:21:42 +02:00
// Custom
procedure doCreateCustomView;
2023-11-29 13:04:33 +01:00
function GetComponentID : integer ;
property ComponentID : integer read GetComponentID;
2023-08-07 20:21:42 +02:00
end ;
/// <summary>
/// Custom interface used to handle all the ICefTextfieldDelegate events.
/// </summary>
ICefTextfieldDelegateEvents = interface( ICefViewDelegateEvents)
[ '{682480E0-C786-4E65-B950-4FF2B13B97B9}' ]
procedure doOnKeyEvent( const textfield: ICefTextfield; const event: TCefKeyEvent; var aResult : boolean ) ;
procedure doOnAfterUserAction( const textfield: ICefTextfield) ;
end ;
/// <summary>
/// Custom interface used to handle all the ICefBrowserViewDelegate events.
/// </summary>
ICefBrowserViewDelegateEvents = interface( ICefViewDelegateEvents)
[ '{AB94B875-63C6-4FEF-BB30-0816402ABA1C}' ]
procedure doOnBrowserCreated( const browser_view: ICefBrowserView; const browser: ICefBrowser) ;
procedure doOnBrowserDestroyed( const browser_view: ICefBrowserView; const browser: ICefBrowser) ;
procedure doOnGetDelegateForPopupBrowserView( const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean ; var aResult : ICefBrowserViewDelegate) ;
procedure doOnPopupBrowserViewCreated( const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean ; var aResult : boolean ) ;
2023-09-26 19:06:38 +02:00
procedure doOnGetChromeToolbarType( const browser_view: ICefBrowserView; var aChromeToolbarType: TCefChromeToolbarType) ;
2023-09-24 11:21:05 +02:00
procedure doOnUseFramelessWindowForPictureInPicture( const browser_view: ICefBrowserView; var aResult: boolean ) ;
2023-08-07 20:21:42 +02:00
procedure doOnGestureCommand( const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean ) ;
2024-05-28 15:50:48 +02:00
procedure doOnGetBrowserRuntimeStyle( var aResult : TCefRuntimeStyle) ;
2023-08-07 20:21:42 +02:00
end ;
/// <summary>
/// Custom interface used to handle all the ICefButtonDelegate events.
/// </summary>
ICefButtonDelegateEvents = interface( ICefViewDelegateEvents)
[ '{E8DF70BE-5DEB-42CF-AF86-B0FF1040498E}' ]
procedure doOnButtonPressed( const button: ICefButton) ;
procedure doOnButtonStateChanged( const button: ICefButton) ;
end ;
/// <summary>
/// Custom interface used to handle all the ICefMenuButtonDelegate events.
/// </summary>
ICefMenuButtonDelegateEvents = interface( ICefButtonDelegateEvents)
[ '{DA36DD60-7609-4576-BB8E-6A55FD48C680}' ]
procedure doOnMenuButtonPressed( const menu_button: ICefMenuButton; const screen_point: TCefPoint; const button_pressed_lock: ICefMenuButtonPressedLock) ;
end ;
/// <summary>
/// Custom interface used to handle all the ICefPanelDelegate events.
/// </summary>
ICefPanelDelegateEvents = interface( ICefViewDelegateEvents)
[ '{F1F2963F-82C3-48F0-9B9C-7C213BACB96B}' ]
end ;
/// <summary>
/// Custom interface used to handle all the ICefWindowDelegate events.
/// </summary>
ICefWindowDelegateEvents = interface( ICefPanelDelegateEvents)
[ '{05C19A41-E75D-459E-AD4D-C8A0CA4A49D3}' ]
procedure doOnWindowCreated( const window_: ICefWindow) ;
procedure doOnWindowClosing( const window_: ICefWindow) ;
procedure doOnWindowDestroyed( const window_: ICefWindow) ;
procedure doOnWindowActivationChanged( const window_: ICefWindow; active: boolean ) ;
procedure doOnWindowBoundsChanged( const window_: ICefWindow; const new_bounds: TCefRect) ;
2024-05-01 18:19:19 +02:00
procedure doOnWindowFullscreenTransition( const window_: ICefWindow; is_completed: boolean ) ;
2023-08-07 20:21:42 +02:00
procedure doOnGetParentWindow( const window_: ICefWindow; var is_menu, can_activate_menu: boolean ; var aResult : ICefWindow) ;
procedure doOnIsWindowModalDialog( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnGetInitialBounds( const window_: ICefWindow; var aResult : TCefRect) ;
procedure doOnGetInitialShowState( const window_: ICefWindow; var aResult : TCefShowState) ;
procedure doOnIsFrameless( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnWithStandardWindowButtons( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnGetTitlebarHeight( const window_: ICefWindow; var titlebar_height: Single ; var aResult : boolean ) ;
2024-05-01 18:19:19 +02:00
procedure doOnAcceptsFirstMouse( const window_: ICefWindow; var aResult: TCefState) ;
2023-08-07 20:21:42 +02:00
procedure doOnCanResize( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnCanMaximize( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnCanMinimize( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnCanClose( const window_: ICefWindow; var aResult : boolean ) ;
procedure doOnAccelerator( const window_: ICefWindow; command_id: Integer ; var aResult : boolean ) ;
procedure doOnKeyEvent( const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean ) ;
2024-05-01 18:19:19 +02:00
procedure doOnThemeColorsChanged( const window_: ICefWindow; chrome_theme: Integer ) ;
2024-05-28 15:50:48 +02:00
procedure doOnGetWindowRuntimeStyle( var aResult: TCefRuntimeStyle) ;
2023-08-07 20:21:42 +02:00
end ;
2018-05-12 14:50:54 +02:00
2023-08-09 19:38:57 +02:00
{ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * CEF interfaces * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* }
2018-05-12 14:50:54 +02:00
2023-07-30 18:47:35 +02:00
/// <summary>
/// All ref-counted framework interfaces must inherit from this interface.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBaseRefCounted">Implements TCefBaseRefCounted</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_base_capi.h">CEF source file: /include/capi/cef_base_capi.h (cef_base_ref_counted_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBaseRefCounted = interface
[ '{1F9A7B44-DCDC-4477-9180-3ADD44BDEB7B}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called to increment the reference count for the object. Should be called
/// for every new copy of a pointer to a given object.
/// </summary>
2018-05-12 14:50:54 +02:00
function Wrap: Pointer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Compares the aData pointer with the FData field if the current instance.
/// </summary>
2019-08-27 09:52:33 +02:00
function SameAs( aData : Pointer ) : boolean ; overload ;
function SameAs( const aBaseRefCounted : ICefBaseRefCounted) : boolean ; overload ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the current reference count is 1.
/// </summary>
2018-10-26 10:32:10 +02:00
function HasOneRef : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the current reference count is at least 1.
/// </summary>
2018-10-26 10:32:10 +02:00
function HasAtLeastOneRef : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Releases all other instances.
/// </summary>
2020-05-05 18:10:33 +02:00
procedure DestroyOtherRefs;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefBrowserHost.RunFileDialog. The functions of
/// this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRunFileDialogCallback">Implements TCefRunFileDialogCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_run_file_dialog_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRunFileDialogCallback = interface( ICefBaseRefCounted)
[ '{59FCECC6-E897-45BA-873B-F09586C4BE47}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called asynchronously after the file dialog is dismissed. |file_paths|
/// will be a single value or a list of values depending on the dialog mode.
/// If the selection was cancelled |file_paths| will be NULL.
/// </summary>
2022-05-26 13:08:20 +02:00
procedure OnFileDialogDismissed( const filePaths: TStrings) ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefBrowserHost.GetNavigationEntries. The
/// functions of this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefNavigationEntryVisitor">Implements TCefNavigationEntryVisitor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_navigation_entry_visitor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefNavigationEntryVisitor = interface( ICefBaseRefCounted)
[ '{CC4D6BC9-0168-4C2C-98BA-45E9AA9CD619}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be executed. Do not keep a reference to |entry| outside
/// of this callback. Return true (1) to continue visiting entries or false
/// (0) to stop. |current| is true (1) if this entry is the currently loaded
/// navigation entry. |index| is the 0-based index of this entry and |total|
/// is the total number of entries.
/// </summary>
2018-05-12 14:50:54 +02:00
function Visit( const entry: ICefNavigationEntry; current: Boolean ; index , total: Integer ) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefBrowserHost.PrintToPDF. The functions of this
/// interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPdfPrintCallback">Implements TCefPdfPrintCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_pdf_print_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPdfPrintCallback = interface( ICefBaseRefCounted)
[ '{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be executed when the PDF printing has completed. |path|
/// is the output path. |ok| will be true (1) if the printing completed
/// successfully or false (0) otherwise.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPdfPrintFinished( const path: ustring; ok: Boolean ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefBrowserHost.DownloadImage. The functions of
/// this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDownloadImageCallback">Implements TCefDownloadImageCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_download_image_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDownloadImageCallback = interface( ICefBaseRefCounted)
[ '{0C6E9032-27DF-4584-95C6-DC3C7CB63727}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be executed when the image download has completed.
/// |image_url| is the URL that was downloaded and |http_status_code| is the
/// resulting HTTP status code. |image| is the resulting image, possibly at
/// multiple scale factors, or NULL if the download failed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnDownloadImageFinished( const imageUrl: ustring; httpStatusCode: Integer ; const image: ICefImage) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent the browser process aspects of a browser. The
/// functions of this interface can only be called in the browser process. They
/// may be called on any thread in that process unless otherwise indicated in
/// the comments.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBrowserHost">Implements TCefBrowserHost</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_browser_host_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBrowserHost = interface( ICefBaseRefCounted)
[ '{53AE02FF-EF5D-48C3-A43E-069DA9535424}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the hosted browser object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBrowser: ICefBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Request that the browser close. The JavaScript 'onbeforeunload' event will
/// be fired. If |force_close| is false (0) the event handler, if any, will be
/// allowed to prompt the user and the user can optionally cancel the close.
/// If |force_close| is true (1) the prompt will not be displayed and the
/// close will proceed. Results in a call to
/// ICefLifeSpanHandler.DoClose() if the event handler allows the close
/// or if |force_close| is true (1). See ICefLifeSpanHandler.DoClose()
/// documentation for additional usage information.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure CloseBrowser( forceClose: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Helper for closing a browser. Call this function from the top-level window
/// close handler (if any). Internally this calls CloseBrowser(false (0)) if
/// the close has not yet been initiated. This function returns false (0)
/// while the close is pending and true (1) after the close has completed. See
/// CloseBrowser() and ICefLifeSpanHandler.DoClose() documentation for
/// additional usage information. This function must be called on the browser
/// process UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function TryCloseBrowser: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set whether the browser is focused.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFocus( focus: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the window handle (if any) for this browser. If this browser is
2023-08-08 18:55:10 +02:00
/// wrapped in a ICefBrowserView this function should be called on the
2023-08-07 20:21:42 +02:00
/// browser process UI thread and it will return the handle for the top-level
/// native window.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetWindowHandle: TCefWindowHandle;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the window handle (if any) of the browser that opened this
/// browser. Will return NULL for non-popup browsers or if this browser is
2023-08-08 18:55:10 +02:00
/// wrapped in a ICefBrowserView. This function can be used in combination
2023-08-07 20:21:42 +02:00
/// with custom handling of modal windows.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetOpenerWindowHandle: TCefWindowHandle;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns true (1) if this browser is wrapped in a ICefBrowserView.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function HasView: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the client for this browser.
/// </summary>
function GetClient: ICefClient;
/// <summary>
/// Returns the request context for this browser.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetRequestContext: ICefRequestContext;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-10-22 19:09:51 +02:00
/// Returns true (1) if this browser can execute the specified zoom command.
/// This function can only be called on the UI thread.
/// </summary>
function CanZoom( command: TCefZoomCommand) : boolean ;
/// <summary>
/// Execute a zoom command in this browser. If called on the UI thread the
/// change will be applied immediately. Otherwise, the change will be applied
/// asynchronously on the UI thread.
/// </summary>
procedure Zoom( command: TCefZoomCommand) ;
/// <summary>
/// Get the default zoom level. This value will be 0.0 by default but can be
/// configured with the Chrome runtime. This function can only be called on
/// the UI thread.
/// </summary>
function GetDefaultZoomLevel: Double ;
/// <summary>
/// Get the current zoom level. This function can only be called on the UI
/// thread.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetZoomLevel: Double ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Change the zoom level to the specified value. Specify 0.0 to reset the
2023-10-22 19:09:51 +02:00
/// zoom level to the default. If called on the UI thread the change will be
/// applied immediately. Otherwise, the change will be applied asynchronously
/// on the UI thread.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetZoomLevel( const zoomLevel: Double ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call to run a file chooser dialog. Only a single file chooser dialog may
/// be pending at any given time. |mode| represents the type of dialog to
/// display. |title| to the title to be used for the dialog and may be NULL to
/// show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that will be initially selected in the dialog. |accept_filters|
/// are used to restrict the selectable file types and may any combination of
/// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
/// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
/// description and file extension delimited using "|" and ";" (e.g. "Image
/// Types|.png;.gif;.jpg"). |callback| will be executed after the dialog is
/// dismissed or immediately if another dialog is already pending. The dialog
/// will be initiated asynchronously on the UI thread.
/// </summary>
2022-05-26 13:08:20 +02:00
procedure RunFileDialog( mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefRunFileDialogCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call to run a file chooser dialog. Only a single file chooser dialog may
/// be pending at any given time. |mode| represents the type of dialog to
/// display. |title| to the title to be used for the dialog and may be NULL to
/// show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that will be initially selected in the dialog. |accept_filters|
/// are used to restrict the selectable file types and may any combination of
/// (a) valid lower-cased MIME types (e.g. "text/*" or "image/*"), (b)
/// individual file extensions (e.g. ".txt" or ".png"), or (c) combined
/// description and file extension delimited using "|" and ";" (e.g. "Image
/// Types|.png;.gif;.jpg"). |callback| will be executed after the dialog is
/// dismissed or immediately if another dialog is already pending. The dialog
/// will be initiated asynchronously on the UI thread.
/// </summary>
2022-05-26 13:08:20 +02:00
procedure RunFileDialogProc( mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: TCefRunFileDialogCallbackProc) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Download the file at |url| using ICefDownloadHandler.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure StartDownload( const url: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Download |image_url| and execute |callback| on completion with the images
/// received from the renderer. If |is_favicon| is true (1) then cookies are
/// not sent and not accepted during download. Images with density independent
/// pixel (DIP) sizes larger than |max_image_size| are filtered out from the
/// image results. Versions of the image at different scale factors may be
/// downloaded up to the maximum scale factor supported by the system. If
/// there are no image results <= |max_image_size| then the smallest image is
/// resized to |max_image_size| and is the only result. A |max_image_size| of
/// 0 means unlimited. If |bypass_cache| is true (1) then |image_url| is
/// requested from the server even if it is present in the browser cache.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DownloadImage( const imageUrl: ustring; isFavicon: Boolean ; maxImageSize: cardinal ; bypassCache: Boolean ; const callback: ICefDownloadImageCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Print the current browser contents.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Print;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Print the current browser contents to the PDF file specified by |path| and
/// execute |callback| on completion. The caller is responsible for deleting
/// |path| when done. For PDF printing to work on Linux you must implement the
/// ICefPrintHandler.GetPdfPaperSize function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure PrintToPdf( const path: ustring; settings: PCefPdfPrintSettings; const callback: ICefPdfPrintCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Print the current browser contents to the PDF file specified by |path| and
/// execute |callback| on completion. The caller is responsible for deleting
/// |path| when done. For PDF printing to work on Linux you must implement the
/// ICefPrintHandler.GetPdfPaperSize function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure PrintToPdfProc( const path: ustring; settings: PCefPdfPrintSettings; const callback: TOnPdfPrintFinishedProc) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Search for |searchText|. |forward| indicates whether to search forward or
/// backward within the page. |matchCase| indicates whether the search should
/// be case-sensitive. |findNext| indicates whether this is the first request
/// or a follow-up. The search will be restarted if |searchText| or
/// |matchCase| change. The search will be stopped if |searchText| is NULL.
/// The ICefFindHandler instance, if any, returned via
/// ICefClient.GetFindHandler will be called to report find results.
/// </summary>
2022-03-03 11:16:30 +01:00
procedure Find( const searchText: ustring; forward_, matchCase, findNext: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Cancel all searches that are currently going on.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure StopFinding( clearSelection: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Open developer tools (DevTools) in its own browser. The DevTools browser
/// will remain associated with this browser. If the DevTools browser is
/// already open then it will be focused, in which case the |windowInfo|,
/// |client| and |settings| parameters will be ignored. If
/// |inspectElementAt| is non-NULL then the element at the specified (x,y)
/// location will be inspected. The |windowInfo| parameter will be ignored if
/// this browser is wrapped in a ICefBrowserView.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ShowDevTools( const windowInfo: PCefWindowInfo; const client: ICefClient; const settings: PCefBrowserSettings; inspectElementAt: PCefPoint) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Explicitly close the associated DevTools browser, if any.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure CloseDevTools;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this browser currently has an associated DevTools
/// browser. Must be called on the browser process UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasDevTools: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a function call message over the DevTools protocol. |message| must be
/// a UTF8-encoded JSON dictionary that contains "id" (int), "function"
/// (string) and "params" (dictionary, optional) values. See the DevTools
/// protocol documentation at https://chromedevtools.github.io/devtools-
/// protocol/ for details of supported functions and the expected "params"
/// dictionary contents. |message| will be copied if necessary. This function
/// will return true (1) if called on the UI thread and the message was
/// successfully submitted for validation, otherwise false (0). Validation
/// will be applied asynchronously and any messages that fail due to
/// formatting errors or missing parameters may be discarded without
/// notification. Prefer ExecuteDevToolsMethod if a more structured approach
/// to message formatting is desired.
///
/// Every valid function call will result in an asynchronous function result
/// or error message that references the sent message "id". Event messages are
/// received while notifications are enabled (for example, between function
/// calls for "Page.enable" and "Page.disable"). All received messages will be
/// delivered to the observer(s) registered with AddDevToolsMessageObserver.
/// See ICefDevToolsMessageObserver.OnDevToolsMessage documentation for
/// details of received message contents.
///
/// Usage of the SendDevToolsMessage, ExecuteDevToolsMethod and
/// AddDevToolsMessageObserver functions does not require an active DevTools
/// front-end or remote-debugging session. Other active DevTools sessions will
/// continue to function independently. However, any modification of global
/// browser state by one session may not be reflected in the UI of other
/// sessions.
///
/// Communication with the DevTools front-end (when displayed) can be logged
/// for development purposes by passing the `--devtools-protocol-log-
/// file=<path>` command-line flag.
/// </summary>
2020-06-21 21:27:55 +02:00
function SendDevToolsMessage( const message_: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute a function call over the DevTools protocol. This is a more
/// structured version of SendDevToolsMessage. |message_id| is an incremental
/// number that uniquely identifies the message (pass 0 to have the next
/// number assigned automatically based on previous values). |function| is the
/// function name. |params| are the function parameters, which may be NULL.
/// See the DevTools protocol documentation (linked above) for details of
/// supported functions and the expected |params| dictionary contents. This
/// function will return the assigned message ID if called on the UI thread
/// and the message was successfully submitted for validation, otherwise 0.
/// See the SendDevToolsMessage documentation for additional usage
/// information.
/// </summary>
2020-06-21 21:27:55 +02:00
function ExecuteDevToolsMethod( message_id: integer ; const method: ustring; const params: ICefDictionaryValue) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add an observer for DevTools protocol messages (function results and
/// events). The observer will remain registered until the returned
/// Registration object is destroyed. See the SendDevToolsMessage
/// documentation for additional usage information.
/// </summary>
2020-06-21 21:27:55 +02:00
function AddDevToolsMessageObserver( const observer: ICefDevToolsMessageObserver) : ICefRegistration;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve a snapshot of current navigation entries as values sent to the
/// specified visitor. If |current_only| is true (1) only the current
/// navigation entry will be sent, otherwise all navigation entries will be
/// sent.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetNavigationEntries( const visitor: ICefNavigationEntryVisitor; currentOnly: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve a snapshot of current navigation entries as values sent to the
/// specified visitor. If |current_only| is true (1) only the current
/// navigation entry will be sent, otherwise all navigation entries will be
/// sent.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetNavigationEntriesProc( const proc: TCefNavigationEntryVisitorProc; currentOnly: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// If a misspelled word is currently selected in an editable node calling
/// this function will replace it with the specified |word|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ReplaceMisspelling( const word : ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add the specified |word| to the spelling dictionary.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure AddWordToDictionary( const word : ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsWindowRenderingDisabled: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notify the browser that the widget has been resized. The browser will
/// first call ICefRenderHandler.GetViewRect to get the new size and then
/// call ICefRenderHandler.OnPaint asynchronously with the updated
/// regions. This function is only used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure WasResized;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notify the browser that it has been hidden or shown. Layouting and
/// ICefRenderHandler.OnPaint notification will stop when the browser is
/// hidden. This function is only used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure WasHidden( hidden: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a notification to the browser that the screen info has changed. The
/// browser will then call ICefRenderHandler.GetScreenInfo to update the
/// screen information with the new values. This simulates moving the webview
/// window from one display to another, or changing the properties of the
/// current display. This function is only used when window rendering is
/// disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure NotifyScreenInfoChanged;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Invalidate the view. The browser will call ICefRenderHandler.OnPaint
/// asynchronously. This function is only used when window rendering is
/// disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Invalidate( kind: TCefPaintElementType) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Issue a BeginFrame request to Chromium. Only valid when
/// TCefWindowInfo.external_begin_frame_enabled is set to true (1).
/// </summary>
2018-12-12 17:13:23 +01:00
procedure SendExternalBeginFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a key event to the browser.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SendKeyEvent( const event: PCefKeyEvent) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a mouse click event to the browser. The |x| and |y| coordinates are
/// relative to the upper-left corner of the view.
/// </summary>
2019-11-19 12:44:29 +01:00
procedure SendMouseClickEvent( const event: PCefMouseEvent; type_: TCefMouseButtonType; mouseUp: Boolean ; clickCount: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a mouse move event to the browser. The |x| and |y| coordinates are
/// relative to the upper-left corner of the view.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SendMouseMoveEvent( const event: PCefMouseEvent; mouseLeave: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a mouse wheel event to the browser. The |x| and |y| coordinates are
/// relative to the upper-left corner of the view. The |deltaX| and |deltaY|
/// values represent the movement delta in the X and Y directions
/// respectively. In order to scroll inside select popups with window
/// rendering disabled ICefRenderHandler.GetScreenPoint should be
/// implemented properly.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SendMouseWheelEvent( const event: PCefMouseEvent; deltaX, deltaY: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a touch event to the browser for a windowless browser.
/// </summary>
2019-03-15 17:17:14 +01:00
procedure SendTouchEvent( const event: PCefTouchEvent) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a capture lost event to the browser.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SendCaptureLostEvent;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notify the browser that the window hosting it is about to be moved or
/// resized. This function is only used on Windows and Linux.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure NotifyMoveOrResizeStarted;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the maximum rate in frames per second (fps) that
/// ICefRenderHandler.OnPaint will be called for a windowless browser. The
/// actual fps may be lower if the browser cannot generate frames at the
/// requested rate. The minimum value is 1 and the maximum value is 60
/// (default 30). This function can only be called on the UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetWindowlessFrameRate : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the maximum rate in frames per second (fps) that
/// ICefRenderHandler.OnPaint will be called for a windowless browser.
/// The actual fps may be lower if the browser cannot generate frames at the
/// requested rate. The minimum value is 1 and the maximum value is 60
/// (default 30). Can also be set at browser creation via
/// TCefBrowserSettings.windowless_frame_rate.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetWindowlessFrameRate( frameRate: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Begins a new composition or updates the existing composition. Blink has a
/// special node (a composition node) that allows the input function to change
/// text without affecting other DOM nodes. |text| is the optional text that
/// will be inserted into the composition node. |underlines| is an optional
/// set of ranges that will be underlined in the resulting text.
/// |replacement_range| is an optional range of the existing text that will be
/// replaced. |selection_range| is an optional range of the resulting text
/// that will be selected after insertion or replacement. The
/// |replacement_range| value is only used on OS X.
///
/// This function may be called multiple times as the composition changes.
/// When the client is done making changes the composition should either be
/// canceled or completed. To cancel the composition call
/// ImeCancelComposition. To complete the composition call either
/// ImeCommitText or ImeFinishComposingText. Completion is usually signaled
/// when:
///
/// 1. The client receives a WM_IME_COMPOSITION message with a GCS_RESULTSTR
/// flag (on Windows), or;
/// 2. The client receives a "commit" signal of GtkIMContext (on Linux), or;
/// 3. insertText of NSTextInput is called (on Mac).
///
/// This function is only used when window rendering is disabled.
/// </summary>
2019-01-08 19:15:25 +01:00
procedure IMESetComposition( const text : ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Completes the existing composition by optionally inserting the specified
/// |text| into the composition node. |replacement_range| is an optional range
/// of the existing text that will be replaced. |relative_cursor_pos| is where
/// the cursor will be positioned relative to the current cursor position. See
/// comments on ImeSetComposition for usage. The |replacement_range| and
/// |relative_cursor_pos| values are only used on OS X. This function is only
/// used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure IMECommitText( const text : ustring; const replacement_range : PCefRange; relative_cursor_pos : integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Completes the existing composition by applying the current composition
/// node contents. If |keep_selection| is false (0) the current selection, if
/// any, will be discarded. See comments on ImeSetComposition for usage. This
/// function is only used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure IMEFinishComposingText( keep_selection : boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Cancels the existing composition and discards the composition node
/// contents without applying them. See comments on ImeSetComposition for
/// usage. This function is only used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure IMECancelComposition;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function when the user drags the mouse into the web view (before
/// calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data|
/// should not contain file contents as this type of data is not allowed to be
/// dragged into the web view. File contents can be removed using
/// ICefDragData.ResetFileContents (for example, if |drag_data| comes from
/// ICefRenderHandler.StartDragging). This function is only used when
/// window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DragTargetDragEnter( const dragData: ICefDragData; const event: PCefMouseEvent; allowedOps: TCefDragOperations) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function each time the mouse is moved across the web view during
/// a drag operation (after calling DragTargetDragEnter and before calling
/// DragTargetDragLeave/DragTargetDrop). This function is only used when
/// window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DragTargetDragOver( const event: PCefMouseEvent; allowedOps: TCefDragOperations) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function when the user drags the mouse out of the web view
/// (after calling DragTargetDragEnter). This function is only used when
/// window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DragTargetDragLeave;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function when the user completes the drag operation by dropping
/// the object onto the web view (after calling DragTargetDragEnter). The
/// object being dropped is |drag_data|, given as an argument to the previous
/// DragTargetDragEnter call. This function is only used when window rendering
/// is disabled.
/// </summary>
2019-11-19 12:44:29 +01:00
procedure DragTargetDrop( const event: PCefMouseEvent) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function when the drag operation started by a
/// ICefRenderHandler.StartDragging call has ended either in a drop or by
/// being cancelled. |x| and |y| are mouse coordinates relative to the upper-
/// left corner of the view. If the web view is both the drag source and the
/// drag target then all DragTarget* functions should be called before
/// DragSource* mthods. This function is only used when window rendering is
/// disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DragSourceEndedAt( x, y: Integer ; op: TCefDragOperation) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Call this function when the drag operation started by a
/// ICefRenderHandler.StartDragging call has completed. This function may
/// be called immediately without first calling DragSourceEndedAt to cancel a
/// drag operation. If the web view is both the drag source and the drag
/// target then all DragTarget* functions should be called before DragSource*
/// mthods. This function is only used when window rendering is disabled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure DragSourceSystemDragEnded;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the current visible navigation entry for this browser. This
/// function can only be called on the UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetVisibleNavigationEntry : ICefNavigationEntry;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set accessibility state for all frames. |accessibility_state| may be
/// default, enabled or disabled. If |accessibility_state| is STATE_DEFAULT
/// then accessibility will be disabled by default and the state may be
/// further controlled with the "force-renderer-accessibility" and "disable-
/// renderer-accessibility" command-line switches. If |accessibility_state| is
/// STATE_ENABLED then accessibility will be enabled. If |accessibility_state|
/// is STATE_DISABLED then accessibility will be completely disabled.
///
/// For windowed browsers accessibility will be enabled in Complete mode
/// (which corresponds to kAccessibilityModeComplete in Chromium). In this
/// mode all platform accessibility objects will be created and managed by
/// Chromium's internal implementation. The client needs only to detect the
/// screen reader and call this function appropriately. For example, on macOS
/// the client can handle the @"AXEnhancedUserStructure" accessibility
/// attribute to detect VoiceOver state changes and on Windows the client can
/// handle WM_GETOBJECT with OBJID_CLIENT to detect accessibility readers.
///
/// For windowless browsers accessibility will be enabled in TreeOnly mode
/// (which corresponds to kAccessibilityModeWebContentsOnly in Chromium). In
/// this mode renderer accessibility is enabled, the full tree is computed,
/// and events are passed to CefAccessibiltyHandler, but platform
/// accessibility objects are not created. The client may implement platform
/// accessibility objects using CefAccessibiltyHandler callbacks if desired.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetAccessibilityState( accessibilityState: TCefState) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Enable notifications of auto resize via
2023-08-08 18:55:10 +02:00
/// ICefDisplayHandler.OnAutoResize. Notifications are disabled by
2023-08-07 20:21:42 +02:00
/// default. |min_size| and |max_size| define the range of allowed sizes.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetAutoResizeEnabled( enabled: boolean ; const min_size, max_size: PCefSize) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the extension hosted in this browser or NULL if no extension is
2023-08-08 18:55:10 +02:00
/// hosted. See ICefRequestContext.LoadExtension for details.
2023-08-07 20:21:42 +02:00
/// </summary>
2024-05-28 15:50:48 +02:00
/// <remarks>
/// <para>WARNING: This API is deprecated and will be removed in ~M127.</para>
/// </remarks>
2017-10-26 13:23:13 +02:00
function GetExtension : ICefExtension;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this browser is hosting an extension background
/// script. Background hosts do not have a window and are not displayable. See
/// ICefRequestContext.LoadExtension for details.
/// </summary>
2024-05-28 15:50:48 +02:00
/// <remarks>
/// <para>WARNING: This API is deprecated and will be removed in ~M127.</para>
/// </remarks>
2018-05-12 14:50:54 +02:00
function IsBackgroundHost : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set whether the browser's audio is muted.
/// </summary>
2019-03-15 17:17:14 +01:00
procedure SetAudioMuted( mute: boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the browser's audio is muted. This function can only
/// be called on the UI thread.
/// </summary>
2019-03-15 17:17:14 +01:00
function IsAudioMuted : boolean ;
2023-11-08 19:42:42 +01:00
/// <summary>
/// Returns true (1) if the renderer is currently in browser fullscreen. This
/// differs from window fullscreen in that browser fullscreen is entered using
/// the JavaScript Fullscreen API and modifies CSS attributes such as the
/// ::backdrop pseudo-element and :fullscreen pseudo-structure. This function
/// can only be called on the UI thread.
/// </summary>
function IsFullscreen : boolean ;
/// <summary>
/// Requests the renderer to exit browser fullscreen. In most cases exiting
/// window fullscreen should also exit browser fullscreen. With the Alloy
/// runtime this function should be called in response to a user action such
/// as clicking the green traffic light button on MacOS
/// (ICefWindowDelegate.OnWindowFullscreenTransition callback) or pressing
/// the "ESC" key (ICefKeyboardHandler.OnPreKeyEvent callback). With the
/// Chrome runtime these standard exit actions are handled internally but
/// new/additional user actions can use this function. Set |will_cause_resize|
/// to true (1) if exiting browser fullscreen will cause a view resize.
/// </summary>
procedure ExitFullscreen( will_cause_resize: boolean ) ;
2023-11-16 16:58:47 +01:00
/// <summary>
/// Returns true (1) if a Chrome command is supported and enabled. Values for
/// |command_id| can be found in the cef_command_ids.h file. This function can
/// only be called on the UI thread. Only used with the Chrome runtime.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFConstants">See the IDC_* constants in uCEFConstants.pas for all the |command_id| values.</see></para>
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/chrome_command_ids.h">The command_id values are also available in chrome/app/chrome_command_ids.h</see></para>
/// </remarks>
function CanExecuteChromeCommand( command_id: integer ) : boolean ;
/// <summary>
/// Execute a Chrome command. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Only used with the Chrome runtime.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFConstants">See the IDC_* constants in uCEFConstants.pas for all the |command_id| values.</see></para>
/// <para><see href="https://source.chromium.org/chromium/chromium/src/+/main:chrome/app/chrome_command_ids.h">The command_id values are also available in chrome/app/chrome_command_ids.h</see></para>
/// </remarks>
procedure ExecuteChromeCommand( command_id: integer ; disposition: TCefWindowOpenDisposition) ;
2023-08-07 20:21:42 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Returns true (1) if the render process associated with this browser is
/// currently unresponsive as indicated by a lack of input event processing
/// for at least 15 seconds. To receive associated state change notifications
/// and optionally handle an unresponsive render process implement
/// ICefRequestHandler.OnRenderProcessUnresponsive.
/// </summary>
/// <remarks>
/// <para>This function can only be called on the CEF UI thread.</para>
/// </remarks>
function IsRenderProcessUnresponsive : boolean ;
/// <summary>
2024-05-28 15:50:48 +02:00
/// Returns the runtime style for this browser (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
/// <remarks>
/// <para>This function can only be called on the CEF UI thread.</para>
/// </remarks>
function GetRuntimeStyle : TCefRuntimeStyle;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the hosted browser object.
/// </summary>
2020-04-03 17:57:52 +02:00
property Browser : ICefBrowser read GetBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the window handle (if any) for this browser. If this browser is
/// wrapped in a ICefBrowserView this function should be called on the
/// browser process UI thread and it will return the handle for the top-level
/// native window.
/// </summary>
2020-04-03 17:57:52 +02:00
property WindowHandle : TCefWindowHandle read GetWindowHandle;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the window handle (if any) of the browser that opened this
/// browser. Will return NULL for non-popup browsers or if this browser is
/// wrapped in a ICefBrowserView. This function can be used in combination
/// with custom handling of modal windows.
/// </summary>
2020-04-03 17:57:52 +02:00
property OpenerWindowHandle : TCefWindowHandle read GetOpenerWindowHandle;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the current zoom level. The default zoom level is 0.0. This function
/// can only be called on the UI thread.
/// </summary>
2020-04-03 17:57:52 +02:00
property ZoomLevel : Double read GetZoomLevel write SetZoomLevel;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-10-22 19:09:51 +02:00
/// Get the default zoom level. This value will be 0.0 by default but can be
2024-05-28 15:50:48 +02:00
/// configured with the Chrome runtime.
2023-10-22 19:09:51 +02:00
/// </summary>
2024-05-28 15:50:48 +02:00
/// <remarks>
/// <para>This property can only be used on the CEF UI thread.</para>
/// </remarks>
2023-10-22 19:09:51 +02:00
property DefaultZoomLevel : Double read GetDefaultZoomLevel;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the request context for this browser.
/// </summary>
2020-04-03 17:57:52 +02:00
property RequestContext : ICefRequestContext read GetRequestContext;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve a snapshot of current navigation entries as values sent to the
/// specified visitor. If |current_only| is true (1) only the current
/// navigation entry will be sent, otherwise all navigation entries will be
/// sent.
/// </summary>
2020-04-03 17:57:52 +02:00
property VisibleNavigationEntry : ICefNavigationEntry read GetVisibleNavigationEntry;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Returns the runtime style for this browser (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
/// <remarks>
/// <para>This property can only be used on the CEF UI thread.</para>
/// </remarks>
property RuntimeStyle : TCefRuntimeStyle read GetRuntimeStyle;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a message. Can be used on any process and thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefProcessMessage">Implements TCefProcessMessage</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_process_message_capi.h">CEF source file: /include/capi/cef_process_message_capi.h (cef_process_message_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefProcessMessage = interface( ICefBaseRefCounted)
[ '{E0B1001A-8777-425A-869B-29D40B8B93B1}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a writable copy of this object. Returns nullptr when message
/// contains a shared memory region.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy: ICefProcessMessage;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the message name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the list of arguments. Returns nullptr when message contains a
/// shared memory region.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetArgumentList: ICefListValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the shared memory region. Returns nullptr when message contains an
/// argument list.
/// </summary>
2022-08-06 12:00:28 +02:00
function GetSharedMemoryRegion: ICefSharedMemoryRegion;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the message name.
/// </summary>
2022-08-06 12:00:28 +02:00
property Name : ustring read GetName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the list of arguments. Returns nullptr when message contains a
/// shared memory region.
/// </summary>
2022-08-06 12:00:28 +02:00
property ArgumentList : ICefListValue read GetArgumentList;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the shared memory region. Returns nullptr when message contains an
/// argument list.
/// </summary>
2022-08-06 12:00:28 +02:00
property SharedMemoryRegion : ICefSharedMemoryRegion read GetSharedMemoryRegion;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a browser. When used in the browser process the
/// functions of this interface may be called on any thread unless otherwise
/// indicated in the comments. When used in the render process the functions of
/// this interface may only be called on the main thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBrowser">Implements TCefBrowser</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_capi.h">CEF source file: /include/capi/cef_browser_capi.h (cef_browser_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBrowser = interface( ICefBaseRefCounted)
[ '{BA003C2E-CF15-458F-9D4A-FE3CEFCF3EEF}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if this object is currently valid. This will return false (0) after
2023-08-08 18:55:10 +02:00
/// ICefLifeSpanHandler.OnBeforeClose is called.
2023-08-07 20:21:42 +02:00
/// </summary>
2021-07-29 16:20:34 +02:00
function IsValid: boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser host object. This function can only be called in the
/// browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHost: ICefBrowserHost;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the browser can navigate backwards.
/// </summary>
2018-05-12 14:50:54 +02:00
function CanGoBack: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Navigate backwards.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GoBack;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the browser can navigate forwards.
/// </summary>
2018-05-12 14:50:54 +02:00
function CanGoForward: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Navigate forwards.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GoForward;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the browser is currently loading.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsLoading: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reload the current page.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Reload;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reload the current page ignoring any cached data.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ReloadIgnoreCache;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Stop loading the page.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure StopLoad;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the globally unique identifier for this browser. This value is
/// also used as the tabId for extension APIs.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIdentifier: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same handle as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefBrowser) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the browser is a popup.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsPopup: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if a document has been loaded in the browser.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasDocument: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the main (top-level) frame for the browser. In the browser process
/// this will return a valid object until after
/// ICefLifeSpanHandler.OnBeforeClose is called. In the renderer process
/// this will return NULL if the main frame is hosted in a different renderer
/// process (e.g. for cross-origin sub-frames). The main frame object will
/// change during cross-origin navigation or re-navigation after renderer
/// process termination (due to crashes, etc).
2023-08-09 19:38:57 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMainFrame: ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the focused frame for the browser.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFocusedFrame: ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the frame with the specified identifier, or NULL if not found.
/// </summary>
2024-02-24 12:01:31 +01:00
function GetFrameByIdentifier( const identifier: ustring) : ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the frame with the specified name, or NULL if not found.
/// </summary>
2024-02-24 12:01:31 +01:00
function GetFrameByName( const name : ustring) : ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of frames that currently exist.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrameCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the identifiers of all existing frames.
/// </summary>
2024-02-24 12:01:31 +01:00
function GetFrameIdentifiers( var aFrameIdentifiers : TStrings) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the names of all existing frames.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrameNames( var aFrameNames : TStrings) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the main (top-level) frame for the browser. In the browser process
/// this will return a valid object until after
/// ICefLifeSpanHandler.OnBeforeClose is called. In the renderer process
/// this will return NULL if the main frame is hosted in a different renderer
/// process (e.g. for cross-origin sub-frames). The main frame object will
/// change during cross-origin navigation or re-navigation after renderer
/// process termination (due to crashes, etc).
/// </summary>
2018-05-12 14:50:54 +02:00
property MainFrame : ICefFrame read GetMainFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the focused frame for the browser.
/// </summary>
2018-05-12 14:50:54 +02:00
property FocusedFrame : ICefFrame read GetFocusedFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of frames that currently exist.
/// </summary>
2018-05-12 14:50:54 +02:00
property FrameCount : NativeUInt read GetFrameCount;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser host object. This function can only be called in the
/// browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
property Host : ICefBrowserHost read GetHost;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the globally unique identifier for this browser. This value is
/// also used as the tabId for extension APIs.
/// </summary>
2018-05-12 14:50:54 +02:00
property Identifier : Integer read GetIdentifier;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a single element in the request post data. The
/// functions of this interface may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPostDataElement">Implements TCefPostDataElement</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_capi.h">CEF source file: /include/capi/cef_request_capi.h (cef_post_data_element_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPostDataElement = interface( ICefBaseRefCounted)
[ '{3353D1B8-0300-4ADC-8D74-4FF31C77D13C}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is read-only.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Remove all contents from the post data element.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetToEmpty;
2023-08-07 20:21:42 +02:00
/// <summary>
/// The post data element will represent a file.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetToFile( const fileName: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// The post data element will represent bytes. The bytes passed in will be
/// copied.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetToBytes( size: NativeUInt ; const bytes: Pointer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the type of this post data element.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType: TCefPostDataElementType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the file name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFile: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the number of bytes.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBytesCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read up to |size| bytes into |bytes| and return the number of bytes
/// actually read.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBytes( size: NativeUInt ; bytes: Pointer ) : NativeUInt ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent post data for a web request. The functions of
/// this interface may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPostData">Implements TCefPostData</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_capi.h">CEF source file: /include/capi/cef_request_capi.h (cef_post_data_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPostData = interface( ICefBaseRefCounted)
[ '{1E677630-9339-4732-BB99-D6FE4DE4AEC0}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is read-only.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying POST data includes elements that are
/// not represented by this ICefPostData object (for example, multi-part
/// file upload data). Modifying ICefPostData objects with excluded
/// elements may result in the request failing.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasExcludedElements: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of existing post data elements.
2023-08-09 19:38:57 +02:00
/// </summary>
2019-09-25 17:23:16 +02:00
function GetElementCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the post data elements.
/// </summary>
2019-09-25 17:23:16 +02:00
procedure GetElements( elementsCount: NativeUInt ; var elements: TCefPostDataElementArray) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Remove the specified post data element. Returns true (1) if the removal
/// succeeds.
/// </summary>
2019-09-25 17:23:16 +02:00
function RemoveElement( const element: ICefPostDataElement) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add the specified post data element. Returns true (1) if the add
/// succeeds.
/// </summary>
2019-09-25 17:23:16 +02:00
function AddElement( const element: ICefPostDataElement) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Remove all existing post data elements.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure RemoveElements;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a web request. The functions of this interface
/// may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRequest">Implements TCefRequest</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_capi.h">CEF source file: /include/capi/cef_request_capi.h (cef_request_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRequest = interface( ICefBaseRefCounted)
[ '{FB4718D3-7D13-4979-9F4C-D7F6C0EC592A}' ]
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns true (1) if this object is read-only.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the fully qualified URL.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUrl: ustring;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the fully qualified URL.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetUrl( const value: ustring) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the request function type. The value will default to POST if post data
/// is provided and GET otherwise.
2024-04-18 12:25:41 +02:00
/// </summary>
2023-08-07 20:21:42 +02:00
function GetMethod: ustring;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the request function type.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetMethod( const value: ustring) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the referrer URL and policy. If non-NULL the referrer URL must be
/// fully qualified with an HTTP or HTTPS scheme component. Any username,
/// password or ref component will be removed.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetReferrer( const referrerUrl: ustring; policy: TCefReferrerPolicy) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the referrer URL.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetReferrerUrl: ustring;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the referrer policy.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetReferrerPolicy: TCefReferrerPolicy;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the post data.
2024-04-18 12:25:41 +02:00
/// </summary>
2023-08-07 20:21:42 +02:00
function GetPostData: ICefPostData;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the post data.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetPostData( const value: ICefPostData) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the header values. Will not include the Referer value if any.
2024-04-18 12:25:41 +02:00
/// </summary>
2023-08-07 20:21:42 +02:00
procedure GetHeaderMap( const HeaderMap: ICefStringMultimap) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the header values. If a Referer value exists in the header map it will
/// be removed and ignored.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetHeaderMap( const HeaderMap: ICefStringMultimap) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the first header value for |name| or an NULL string if not found.
/// Will not return the Referer value if any. Use GetHeaderMap instead if
/// |name| might have multiple values.
2024-04-18 12:25:41 +02:00
/// </summary>
2019-06-16 10:31:13 +02:00
function GetHeaderByName( const name : ustring) : ustring;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the header |name| to |value|. If |overwrite| is true (1) any existing
/// values will be replaced with the new value. If |overwrite| is false (0)
/// any existing values will not be overwritten. The Referer value cannot be
/// set using this function.
2024-04-18 12:25:41 +02:00
/// </summary>
2019-06-16 10:31:13 +02:00
procedure SetHeaderByName( const name , value: ustring; overwrite: boolean ) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the flags used in combination with ICefUrlRequest. See
/// TCefUrlRequestFlags for supported values.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFlags: TCefUrlRequestFlags;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the flags used in combination with ICefUrlRequest. See
/// TCefUrlRequestFlags for supported values.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFlags( flags: TCefUrlRequestFlags) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the URL to the first party for cookies used in combination with
/// ICefUrlRequest.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFirstPartyForCookies: ustring;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the URL to the first party for cookies used in combination with
/// ICefUrlRequest.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFirstPartyForCookies( const url: ustring) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set all values at one time. This method corresponds to TCefRequest.set_ and cef_request_t.set
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Assign( const url, method: ustring; const postData: ICefPostData; const headerMap: ICefStringMultimap) ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the resource type for this request. Only available in the browser
/// process.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetResourceType: TCefResourceType;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the transition type for this request. Only available in the browser
/// process and only applies to requests that represent a main frame or sub-
/// frame navigation.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTransitionType: TCefTransitionType;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the globally unique identifier for this request or 0 if not
/// specified. Can be used by ICefResourceRequestHandler implementations
/// in the browser process to track a single request across multiple
/// callbacks.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIdentifier: UInt64 ;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the fully qualified URL.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property Url : ustring read GetUrl write SetUrl;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the request function type. The value will default to POST if post data
/// is provided and GET otherwise.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property Method : ustring read GetMethod write SetMethod;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the referrer URL.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property ReferrerUrl : ustring read GetReferrerUrl;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the referrer policy.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property ReferrerPolicy : TCefReferrerPolicy read GetReferrerPolicy;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the post data.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property PostData : ICefPostData read GetPostData write SetPostData;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the flags used in combination with ICefUrlRequest. See
/// TCefUrlRequestFlags for supported values.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property Flags : TCefUrlRequestFlags read GetFlags write SetFlags;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the URL to the first party for cookies used in combination with
/// ICefUrlRequest.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property FirstPartyForCookies : ustring read GetFirstPartyForCookies write SetFirstPartyForCookies;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the resource type for this request. Only available in the browser
/// process.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property ResourceType : TCefResourceType read GetResourceType;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Get the transition type for this request. Only available in the browser
/// process and only applies to requests that represent a main frame or sub-
/// frame navigation.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property TransitionType : TCefTransitionType read GetTransitionType;
2024-04-18 12:25:41 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the globally unique identifier for this request or 0 if not
/// specified. Can be used by ICefResourceRequestHandler implementations
/// in the browser process to track a single request across multiple
/// callbacks.
2024-04-18 12:25:41 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property Identifier : UInt64 read GetIdentifier;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to receive string values asynchronously.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefStringVisitor">Implements TCefStringVisitor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_string_visitor_capi.h">CEF source file: /include/capi/cef_string_visitor_capi.h (cef_string_visitor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefStringVisitor = interface( ICefBaseRefCounted)
[ '{63ED4D6C-2FC8-4537-964B-B84C008F6158}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be executed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Visit( const str: ustring) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a frame in the browser window. When used in the
/// browser process the functions of this interface may be called on any thread
/// unless otherwise indicated in the comments. When used in the render process
/// the functions of this interface may only be called on the main thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFrame">Implements TCefFrame</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_frame_capi.h">CEF source file: /include/capi/cef_frame_capi.h (cef_frame_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefFrame = interface( ICefBaseRefCounted)
[ '{8FD3D3A6-EA3A-4A72-8501-0276BD5C3D1D}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if this object is currently attached to a valid frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute undo in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Undo;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute redo in this frame.
2023-08-09 19:38:57 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Redo;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute cut in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cut;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute copy in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Copy;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute paste in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Paste;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute delete in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Del;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute select all in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SelectAll;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Save this frame's HTML source to a temporary file and open it in the
/// default text viewing application. This function can only be called from
/// the browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ViewSource;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve this frame's HTML source as a string sent to the specified
/// visitor.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetSource( const visitor: ICefStringVisitor) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve this frame's HTML source as a string sent to the specified
/// visitor.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetSourceProc( const proc: TCefStringVisitorProc) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve this frame's display text as a string sent to the specified
/// visitor.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetText( const visitor: ICefStringVisitor) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve this frame's display text as a string sent to the specified
/// visitor.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetTextProc( const proc: TCefStringVisitorProc) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Load the request represented by the |request| object.
///
/// WARNING: This function will fail with "bad IPC message" reason
/// INVALID_INITIATOR_ORIGIN (213) unless you first navigate to the request
/// origin using some other mechanism (LoadURL, link click, etc).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure LoadRequest( const request: ICefRequest) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Load the specified |url|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure LoadUrl( const url: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute a string of JavaScript code in this frame. The |script_url|
/// parameter is the URL where the script in question can be found, if any.
/// The renderer may request this URL to show the developer the source of the
/// error. The |start_line| parameter is the base line number to use for
/// error reporting.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ExecuteJavaScript( const code, scriptUrl: ustring; startLine: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is the main (top-level) frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsMain: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is the focused frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsFocused: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name for this frame. If the frame has an assigned name (for
/// example, set via the iframe "name" attribute) then that value will be
/// returned. Otherwise a unique name will be constructed based on the frame
/// parent hierarchy. The main (top-level) frame will always have an NULL name
/// value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
2024-02-24 12:01:31 +01:00
/// Returns the globally unique identifier for this frame or empty if the
2023-08-07 20:21:42 +02:00
/// underlying frame does not yet exist.
/// </summary>
2024-02-24 12:01:31 +01:00
function GetIdentifier: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the parent of this frame or NULL if this is the main (top-level)
/// frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetParent: ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the URL currently loaded in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser that this frame belongs to.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBrowser: ICefBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the V8 context associated with the frame. This function can only be
/// called from the render process.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetV8Context: ICefv8Context;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Visit the DOM document. This function can only be called from the render
/// process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure VisitDom( const visitor: ICefDomVisitor) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Visit the DOM document. This function can only be called from the render
/// process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure VisitDomProc( const proc: TCefDomVisitorProc) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Create a new URL request that will be treated as originating from this
/// frame and the associated browser. Use TCustomCefUrlrequestClient.Create instead if
/// you do not want the request to have this association, in which case it may
/// be handled differently (see documentation on that function). A request
/// created with this function may only originate from the browser process,
/// and will behave as follows:
/// - It may be intercepted by the client via CefResourceRequestHandler or
/// CefSchemeHandlerFactory.
/// - POST data may only contain a single element of type PDE_TYPE_FILE or
/// PDE_TYPE_BYTES.
///
/// The |request| object will be marked as read-only after calling this
/// function.
/// </summary>
2019-06-16 10:31:13 +02:00
function CreateUrlRequest( const request: ICefRequest; const client: ICefUrlrequestClient) : ICefUrlRequest;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a message to the specified |target_process|. Ownership of the message
/// contents will be transferred and the |message| reference will be
/// invalidated. Message delivery is not guaranteed in all cases (for example,
/// if the browser is closing, navigating, or if the target process crashes).
/// Send an ACK message back from the target process if confirmation is
/// required.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure SendProcessMessage( targetProcess: TCefProcessId; const message_: ICefProcessMessage) ;
2018-05-12 14:50:54 +02:00
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name for this frame. If the frame has an assigned name (for
/// example, set via the iframe "name" attribute) then that value will be
/// returned. Otherwise a unique name will be constructed based on the frame
/// parent hierarchy. The main (top-level) frame will always have an NULL name
/// value.
/// </summary>
2018-05-12 14:50:54 +02:00
property Name : ustring read GetName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the URL currently loaded in this frame.
/// </summary>
2018-05-12 14:50:54 +02:00
property Url : ustring read GetUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser that this frame belongs to.
/// </summary>
2018-05-12 14:50:54 +02:00
property Browser : ICefBrowser read GetBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the parent of this frame or NULL if this is the main (top-level)
/// frame.
/// </summary>
2018-05-12 14:50:54 +02:00
property Parent : ICefFrame read GetParent;
2023-08-07 20:21:42 +02:00
/// <summary>
2024-02-24 12:01:31 +01:00
/// Returns the globally unique identifier for this frame or empty if the
2023-08-07 20:21:42 +02:00
/// underlying frame does not yet exist.
/// </summary>
2024-02-24 12:01:31 +01:00
property Identifier : ustring read GetIdentifier;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to ICefFrame life span.
/// The order of callbacks is:
///
/// (1) During initial ICefBrowserHost creation and navigation of the main
/// frame:
/// - ICefFrameHandler.OnFrameCreated => The initial main frame
/// object has been created. Any commands will be queued until the frame is attached.
/// - ICefFrameHandler.OnMainFrameChanged => The initial main frame object
/// has been assigned to the browser.
/// - ICefLifeSpanHandler.OnAfterCreated => The browser is now valid and
/// can be used.
/// - ICefFrameHandler.OnFrameAttached => The initial main frame object is
/// now connected to its peer in the renderer process. Commands can be routed.
///
/// (2) During further ICefBrowserHost navigation/loading of the main frame
/// and/or sub-frames:
/// - ICefFrameHandler.OnFrameCreated => A new main frame or sub-frame
/// object has been created. Any commands will be queued until the frame is attached.
/// - ICefFrameHandler.OnFrameAttached => A new main frame or sub-frame
/// object is now connected to its peer in the renderer process. Commands can be routed.
/// - ICefFrameHandler.OnFrameDetached => An existing main frame or sub-
/// frame object has lost its connection to the renderer process. If multiple
/// objects are detached at the same time then notifications will be sent for
/// any sub-frame objects before the main frame object. Commands can no longer
/// be routed and will be discarded.
/// - ICefFrameHandler.OnMainFrameChanged => A new main frame object has
/// been assigned to the browser. This will only occur with cross-origin navigation
/// or re-navigation after renderer process termination (due to crashes, etc).
///
/// (3) During final ICefBrowserHost destruction of the main frame:
/// - ICefFrameHandler.OnFrameDetached => Any sub-frame objects have lost
/// their connection to the renderer process. Commands can no longer be routed and
/// will be discarded.
/// - ICefLifeSpanHandler.OnBeforeClose => The browser has been destroyed.
/// - ICefFrameHandler.OnFrameDetached => The main frame object have lost
/// its connection to the renderer process. Notifications will be sent for any
/// sub-frame objects before the main frame object. Commands can no longer be
/// routed and will be discarded.
/// - ICefFrameHandler.OnMainFrameChanged => The final main frame object has
/// been removed from the browser.
///
/// Cross-origin navigation and/or loading receives special handling.
///
/// When the main frame navigates to a different origin the OnMainFrameChanged
/// callback (2) will be executed with the old and new main frame objects.
///
/// When a new sub-frame is loaded in, or an existing sub-frame is navigated to,
/// a different origin from the parent frame, a temporary sub-frame object will
/// first be created in the parent's renderer process. That temporary sub-frame
/// will then be discarded after the real cross-origin sub-frame is created in
/// the new/target renderer process. The client will receive cross-origin
/// navigation callbacks (2) for the transition from the temporary sub-frame to
/// the real sub-frame. The temporary sub-frame will not recieve or execute
/// commands during this transitional period (any sent commands will be
/// discarded).
///
/// When a new popup browser is created in a different origin from the parent
/// browser, a temporary main frame object for the popup will first be created
/// in the parent's renderer process. That temporary main frame will then be
/// discarded after the real cross-origin main frame is created in the
/// new/target renderer process. The client will recieve creation and initial
/// navigation callbacks (1) for the temporary main frame, followed by cross-
/// origin navigation callbacks (2) for the transition from the temporary main
/// frame to the real main frame. The temporary main frame may receive and
/// execute commands during this transitional period (any sent commands may be
/// executed, but the behavior is potentially undesirable since they execute in
/// the parent browser's renderer process and not the new/target renderer
/// process).
///
/// Callbacks will not be executed for placeholders that may be created during
/// pre-commit navigation for sub-frames that do not yet exist in the renderer
/// process. Placeholders will have ICefFrame.GetIdentifier() == -4.
///
/// The functions of this interface will be called on the UI thread unless
/// otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFrameHandler">Implements TCefFrameHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_frame_handler_capi.h">CEF source file: /include/capi/cef_frame_handler_capi.h (cef_frame_handler_t)</see></para>
/// </remarks>
2021-07-29 16:20:34 +02:00
ICefFrameHandler = interface( ICefBaseRefCounted)
[ '{B437128C-F7CB-4F75-83CF-A257B98C0B6E}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a new frame is created. This will be the first notification
/// that references |frame|. Any commands that require transport to the
/// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
/// etc.) will be queued until OnFrameAttached is called for |frame|.
/// </summary>
2021-07-29 16:20:34 +02:00
procedure OnFrameCreated( const browser: ICefBrowser; const frame: ICefFrame) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a frame can begin routing commands to/from the associated
/// renderer process. |reattached| will be true (1) if the frame was re-
/// attached after exiting the BackForwardCache. Any commands that were queued
/// have now been dispatched.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure OnFrameAttached( const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a frame loses its connection to the renderer process and will
/// be destroyed. Any pending or future commands will be discarded and
2023-08-07 20:21:42 +02:00
/// ICefFrame.IsValid() will now return false (0) for |frame|. If called
/// after ICefLifeSpanHandler.OnBeforeClose() during browser
/// destruction then ICefBrowser.IsValid() will return false (0) for
2023-08-03 22:11:42 +02:00
/// |browser|.
/// </summary>
2021-07-29 16:20:34 +02:00
procedure OnFrameDetached( const browser: ICefBrowser; const frame: ICefFrame) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the main frame changes due to (a) initial browser creation,
/// (b) final browser destruction, (c) cross-origin navigation or (d) re-
/// navigation after renderer process termination (due to crashes, etc).
/// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
/// frame is assigned to |browser| for the first time. |old_frame| will be
/// non-NULL and |new_frame| will be NULL and when a main frame is removed
/// from |browser| for the last time. Both |old_frame| and |new_frame| will be
/// non-NULL for cross-origin navigations or re-navigation after renderer
/// process termination. This function will be called after on_frame_created()
2023-08-07 20:21:42 +02:00
/// for |new_frame| and/or after OnFrameDetached() for |old_frame|. If
/// called after ICefLifeSpanHandler.OnBeforeClose() during browser
/// destruction then ICefBrowser.IsValid() will return false (0) for
2023-08-03 22:11:42 +02:00
/// |browser|.
2023-08-07 20:21:42 +02:00
/// </summary>
2021-07-29 16:20:34 +02:00
procedure OnMainFrameChanged( const browser: ICefBrowser; const old_frame, new_frame: ICefFrame) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2021-07-29 16:20:34 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to read data from a stream. The functions of this interface
/// may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefStreamReader">Implements TCefStreamReader</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_stream_capi.h">CEF source file: /include/capi/cef_stream_capi.h (cef_stream_reader_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCustomStreamReader = interface( ICefBaseRefCounted)
[ '{BBCFF23A-6FE7-4C28-B13E-6D2ACA5C83B7}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read raw binary data.
/// </summary>
2018-05-12 14:50:54 +02:00
function Read( ptr: Pointer ; size, n: NativeUInt ) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Seek to the specified offset position. |whence| may be any one of
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
/// failure.
/// </summary>
2018-05-12 14:50:54 +02:00
function Seek( offset: Int64 ; whence: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the current offset position.
/// </summary>
2018-05-12 14:50:54 +02:00
function Tell: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return non-zero if at end of file.
/// </summary>
2018-05-12 14:50:54 +02:00
function Eof: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return true (1) if this handler performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the handler from.
/// </summary>
2018-05-12 14:50:54 +02:00
function MayBlock: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to read data from a stream. The functions of this interface
/// may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefStreamReader">Implements TCefStreamReader</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_stream_capi.h">CEF source file: /include/capi/cef_stream_capi.h (cef_stream_reader_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefStreamReader = interface( ICefBaseRefCounted)
[ '{DD5361CB-E558-49C5-A4BD-D1CE84ADB277}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read raw binary data.
/// </summary>
function Read( ptr: Pointer ; size, n: NativeUInt ) : NativeUInt ;
/// <summary>
/// Seek to the specified offset position. |whence| may be any one of
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
/// failure.
/// </summary>
function Seek( offset: Int64 ; whence: Integer ) : Integer ;
/// <summary>
/// Return the current offset position.
/// </summary>
function Tell: Int64 ;
/// <summary>
/// Return non-zero if at end of file.
2023-08-09 19:38:57 +02:00
/// </summary>
2023-08-07 20:21:42 +02:00
function Eof: Boolean ;
/// <summary>
/// Return true (1) if this handler performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the handler from.
/// </summary>
function MayBlock: Boolean ;
end ;
/// <summary>
/// Structure the client can implement to provide a custom stream reader. The
/// functions of this structure may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefReadHandler">Implements TCefReadHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_stream_capi.h">CEF source file: /include/capi/cef_stream_capi.h (cef_read_handler_tcef_stream_reader_t)</see></para>
/// </remarks>
ICefReadHandler = interface( ICefBaseRefCounted)
[ '{10152506-B2F8-4765-BBBC-9CA8A85A2C87}' ]
/// <summary>
/// Read raw binary data.
/// </summary>
2018-05-12 14:50:54 +02:00
function Read( ptr: Pointer ; size, n: NativeUInt ) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Seek to the specified offset position. |whence| may be any one of
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
/// failure.
/// </summary>
2018-05-12 14:50:54 +02:00
function Seek( offset: Int64 ; whence: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the current offset position.
/// </summary>
2018-05-12 14:50:54 +02:00
function Tell: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return non-zero if at end of file.
2023-08-09 19:38:57 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function Eof: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return true (1) if this handler performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the handler from.
/// </summary>
2018-05-12 14:50:54 +02:00
function MayBlock: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface the client can implement to provide a custom stream writer. The
/// functions of this interface may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefWriteHandler">Implements TCefWriteHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_stream_capi.h">CEF source file: /include/capi/cef_stream_capi.h (cef_write_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefWriteHandler = interface( ICefBaseRefCounted)
[ '{F2431888-4EAB-421E-9EC3-320BE695AF30}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Write raw binary data.
/// </summary>
2018-05-12 14:50:54 +02:00
function Write( const ptr: Pointer ; size, n: NativeUInt ) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Seek to the specified offset position. |whence| may be any one of
/// SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on
/// failure.
/// </summary>
2018-05-12 14:50:54 +02:00
function Seek( offset: Int64 ; whence: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the current offset position.
/// </summary>
2018-05-12 14:50:54 +02:00
function Tell: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Flush the stream.
/// </summary>
2018-05-12 14:50:54 +02:00
function Flush: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return true (1) if this handler performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the handler from.
/// </summary>
2018-05-12 14:50:54 +02:00
function MayBlock: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to write data to a stream. The functions of this interface
/// may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefStreamWriter">Implements TCefStreamWriter</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_stream_capi.h">CEF source file: /include/capi/cef_stream_capi.h (cef_stream_writer_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefStreamWriter = interface( ICefBaseRefCounted)
[ '{4AA6C477-7D8A-4D5A-A704-67F900A827E7}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Write raw binary data.
/// </summary>
2018-05-12 14:50:54 +02:00
function Write( const ptr: Pointer ; size, n: NativeUInt ) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Seek to the specified offset position. |whence| may be any one of
/// SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on
/// failure.
/// </summary>
2018-05-12 14:50:54 +02:00
function Seek( offset: Int64 ; whence: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the current offset position.
/// </summary>
2018-05-12 14:50:54 +02:00
function Tell: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Flush the stream.
/// </summary>
2018-05-12 14:50:54 +02:00
function Flush: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this writer performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the writer from.
/// </summary>
2018-05-12 14:50:54 +02:00
function MayBlock: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a web response. The functions of this interface
/// may be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResponse">Implements TCefResponse</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_response_capi.h">CEF source file: /include/capi/cef_response_capi.h (cef_response_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResponse = interface( ICefBaseRefCounted)
[ '{E9C896E4-59A8-4B96-AB5E-6EA3A498B7F1}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is read-only.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response error code. Returns ERR_NONE if there was no error.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetError: TCefErrorCode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the response error code. This can be used by custom scheme handlers to
/// return errors during initial request processing.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetError( error: TCefErrorCode) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response status code.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStatus: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the response status code.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetStatus( status: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response status text.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStatusText: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the response status text.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetStatusText( const StatusText: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response mime type.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMimeType: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the response mime type.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetMimeType( const mimetype: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response charset.
/// </summary>
2019-06-16 10:31:13 +02:00
function GetCharset: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the response charset.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure SetCharset( const charset: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the value for the specified response header field.
/// </summary>
2019-10-30 10:26:48 +01:00
function GetHeaderByName( const name : ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the header |name| to |value|. If |overwrite| is true (1) any existing
/// values will be replaced with the new value. If |overwrite| is false (0)
/// any existing values will not be overwritten.
/// </summary>
2019-10-30 10:26:48 +01:00
procedure SetHeaderByName( const name , value: ustring; overwrite: boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get all response header fields.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetHeaderMap( const headerMap: ICefStringMultimap) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set all response header fields.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetHeaderMap( const headerMap: ICefStringMultimap) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the resolved URL after redirects or changed as a result of HSTS.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetURL: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the resolved URL after redirects or changed as a result of HSTS.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetURL( const url: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response status code.
/// </summary>
2018-05-12 14:50:54 +02:00
property Status : Integer read GetStatus write SetStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response status text.
/// </summary>
2018-05-12 14:50:54 +02:00
property StatusText : ustring read GetStatusText write SetStatusText;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response mime type.
/// </summary>
2018-05-12 14:50:54 +02:00
property MimeType : ustring read GetMimeType write SetMimeType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response charset.
/// </summary>
2019-06-16 10:31:13 +02:00
property Charset : ustring read GetCharset write SetCharset;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the response error code. Returns ERR_NONE if there was no error.
/// </summary>
2018-05-12 14:50:54 +02:00
property Error : TCefErrorCode read GetError write SetError;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the resolved URL after redirects or changed as a result of HSTS.
/// </summary>
2018-05-12 14:50:54 +02:00
property URL : ustring read GetURL write SetURL;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a download item.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDownloadItem">Implements TCefDownloadItem</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_download_item_capi.h">CEF source file: /include/capi/cef_download_item_capi.h (cef_download_item_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDownloadItem = interface( ICefBaseRefCounted)
[ '{B34BD320-A82E-4185-8E84-B98E5EEC803F}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the download is in progress.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsInProgress: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the download is complete.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsComplete: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the download has been canceled.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsCanceled: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the download has been interrupted.
/// </summary>
2023-06-09 15:13:45 +02:00
function IsInterrupted: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the most recent interrupt reason.
/// </summary>
2023-06-09 15:13:45 +02:00
function GetInterruptReason: TCefDownloadInterruptReason;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a simple speed estimate in bytes/s.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCurrentSpeed: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the rough percent complete or -1 if the receive total size is
/// unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPercentComplete: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the total number of bytes.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTotalBytes: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of received bytes.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetReceivedBytes: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time that the download started.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStartTime: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time that the download ended.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetEndTime: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the full path to the downloaded or downloading file.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFullPath: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the unique identifier for this download.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetId: Cardinal ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the URL.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the original URL before any redirections.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetOriginalUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the suggested file name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSuggestedFileName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the content disposition.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetContentDisposition: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the mime type.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMimeType: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a simple speed estimate in bytes/s.
/// </summary>
2023-06-09 15:13:45 +02:00
property CurrentSpeed : Int64 read GetCurrentSpeed;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the rough percent complete or -1 if the receive total size is
/// unknown.
/// </summary>
2023-06-09 15:13:45 +02:00
property PercentComplete : Integer read GetPercentComplete;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the total number of bytes.
/// </summary>
2023-06-09 15:13:45 +02:00
property TotalBytes : Int64 read GetTotalBytes;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of received bytes.
/// </summary>
2023-06-09 15:13:45 +02:00
property ReceivedBytes : Int64 read GetReceivedBytes;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time that the download started.
/// </summary>
2023-06-09 15:13:45 +02:00
property StartTime : TDateTime read GetStartTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time that the download ended.
/// </summary>
2023-06-09 15:13:45 +02:00
property EndTime : TDateTime read GetEndTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the full path to the downloaded or downloading file.
/// </summary>
2023-06-09 15:13:45 +02:00
property FullPath : ustring read GetFullPath;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the unique identifier for this download.
/// </summary>
2023-06-09 15:13:45 +02:00
property Id : Cardinal read GetId;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the URL.
/// </summary>
2023-06-09 15:13:45 +02:00
property Url : ustring read GetUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the original URL before any redirections.
/// </summary>
2023-06-09 15:13:45 +02:00
property OriginalUrl : ustring read GetOriginalUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the suggested file name.
/// </summary>
2023-06-09 15:13:45 +02:00
property SuggestedFileName : ustring read GetSuggestedFileName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the content disposition.
/// </summary>
2023-06-09 15:13:45 +02:00
property ContentDisposition : ustring read GetContentDisposition;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the mime type.
/// </summary>
2023-06-09 15:13:45 +02:00
property MimeType : ustring read GetMimeType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the most recent interrupt reason.
/// </summary>
2023-06-09 15:13:45 +02:00
property InterruptReason : TCefDownloadInterruptReason read GetInterruptReason;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used to asynchronously continue a download.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBeforeDownloadCallback">Implements TCefBeforeDownloadCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_download_handler_capi.h">CEF source file: /include/capi/cef_download_handler_capi.h (cef_before_download_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBeforeDownloadCallback = interface( ICefBaseRefCounted)
[ '{5A81AF75-CBA2-444D-AD8E-522160F36433}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Call to continue the download. Set |download_path| to the full file path
/// for the download including the file name or leave blank to use the
/// suggested name and the default temp directory. Set |show_dialog| to true
/// (1) if you do wish to show the default "Save As" dialog.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cont( const downloadPath: ustring; showDialog: Boolean ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used to asynchronously cancel a download.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDownloadItemCallback">Implements TCefDownloadItemCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_download_handler_capi.h">CEF source file: /include/capi/cef_download_handler_capi.h (cef_download_item_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDownloadItemCallback = interface( ICefBaseRefCounted)
[ '{498F103F-BE64-4D5F-86B7-B37EC69E1735}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Call to cancel the download.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Call to pause the download.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Pause;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Call to resume the download.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Resume;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to handle file downloads. The functions of this interface
/// will called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDownloadHandler">Implements TCefDownloadHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_download_handler_capi.h">CEF source file: /include/capi/cef_download_handler_capi.h (cef_download_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDownloadHandler = interface( ICefBaseRefCounted)
[ '{3137F90A-5DC5-43C1-858D-A269F28EF4F1}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called before a download begins in response to a user-initiated action
/// (e.g. alt + link click or link click that returns a `Content-Disposition:
/// attachment` response from the server). |url| is the target download URL
/// and |request_function| is the target function (GET, POST, etc). Return
/// true (1) to proceed with the download or false (0) to cancel the download.
/// </summary>
2022-05-03 12:43:16 +02:00
function CanDownload( const browser: ICefBrowser; const url, request_method: ustring) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called before a download begins. |suggested_name| is the suggested name
2024-05-28 15:50:48 +02:00
/// for the download file. Return true (1) and execute |callback| either
/// asynchronously or in this function to continue or cancel the download.
/// Return false (0) to proceed with default handling (cancel with Alloy
/// style, download shelf with Chrome style). Do not keep a reference to
/// |download_item| outside of this function.
2023-08-03 22:11:42 +02:00
/// </summary>
2024-05-28 15:50:48 +02:00
function OnBeforeDownload( const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a download's status or progress information has been updated.
2023-08-07 20:21:42 +02:00
/// This may be called multiple times before and after OnBeforeDownload.
2023-08-03 22:11:42 +02:00
/// Execute |callback| either asynchronously or in this function to cancel the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnDownloadUpdated( const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a V8 exception. The functions of this interface may
/// be called on any render process thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8Exception">Implements TCefV8Exception</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8exception_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefV8Exception = interface( ICefBaseRefCounted)
[ '{7E422CF0-05AC-4A60-A029-F45105DCE6A4}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the exception message.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMessage: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the line of source code that the exception occurred within.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSourceLine: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the resource name for the script from where the function causing
/// the error originates.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetScriptResourceName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based number of the line where the error occurred or 0 if
/// the line number is unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLineNumber: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the script of the first character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStartPosition: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the script of the last character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetEndPosition: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the line of the first character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStartColumn: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the line of the last character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetEndColumn: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the exception message.
/// </summary>
2018-05-12 14:50:54 +02:00
property Message : ustring read GetMessage;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the line of source code that the exception occurred within.
/// </summary>
2018-05-12 14:50:54 +02:00
property SourceLine : ustring read GetSourceLine;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the resource name for the script from where the function causing
/// the error originates.
/// </summary>
2018-05-12 14:50:54 +02:00
property ScriptResourceName : ustring read GetScriptResourceName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based number of the line where the error occurred or 0 if
/// the line number is unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
property LineNumber : Integer read GetLineNumber;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the script of the first character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
property StartPosition : Integer read GetStartPosition;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the script of the last character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
property EndPosition : Integer read GetEndPosition;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the line of the first character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
property StartColumn : Integer read GetStartColumn;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index within the line of the last character where the error
/// occurred.
/// </summary>
2018-05-12 14:50:54 +02:00
property EndColumn : Integer read GetEndColumn;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface that is passed to ICefV8value.CreateArrayBuffer.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefv8ArrayBufferReleaseCallback">Implements TCefv8ArrayBufferReleaseCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8array_buffer_release_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefv8ArrayBufferReleaseCallback = interface( ICefBaseRefCounted)
[ '{4EAAB422-D046-43DF-B1F0-5503116A5816}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called to release |buffer| when the ArrayBuffer JS object is garbage
/// collected. |buffer| is the value that was passed to CreateArrayBuffer
/// along with this object.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ReleaseBuffer( buffer : Pointer ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a V8 context handle. V8 handles can only be accessed
/// from the thread on which they are created. Valid threads for creating a V8
/// handle include the render process main thread (TID_RENDERER) and WebWorker
/// threads. A task runner for posting tasks on the associated thread can be
/// retrieved via the ICefV8context.GetTaskRunner() function.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8Context">Implements TCefV8Context</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8context_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefv8Context = interface( ICefBaseRefCounted)
[ '{2295A11A-8773-41F2-AD42-308C215062D9}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the task runner associated with this context. V8 handles can only
/// be accessed from the thread on which they are created. This function can
/// be called on any render process thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTaskRunner: ICefTaskRunner;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying handle is valid and it can be accessed
/// on the current thread. Do not call any other functions if this function
/// returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser for this context. This function will return an NULL
/// reference for WebWorker contexts.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBrowser: ICefBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the frame for this context. This function will return an NULL
/// reference for WebWorker contexts.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrame: ICefFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the global object for this context. The context must be entered
/// before calling this function.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetGlobal: ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Enter this context. A context must be explicitly entered before creating a
/// V8 Object, Array, Function or Date asynchronously. exit() must be called
/// the same number of times as enter() before releasing this context. V8
/// objects belong to the context in which they are created. Returns true (1)
/// if the scope was entered successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function Enter: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Exit this context. Call this function only after calling enter(). Returns
/// true (1) if the scope was exited successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function Exit: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same handle as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefv8Context) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute a string of JavaScript code in this V8 context. The |script_url|
/// parameter is the URL where the script in question can be found, if any.
/// The |start_line| parameter is the base line number to use for error
/// reporting. On success |retval| will be set to the return value, if any,
/// and the function will return true (1). On failure |exception| will be set
/// to the exception, if any, and the function will return false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function Eval( const code: ustring; const script_url: ustring; start_line: integer ; var retval: ICefv8Value; var exception: ICefV8Exception) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the browser for this context. This function will return an NULL
/// reference for WebWorker contexts.
/// </summary>
2018-05-12 14:50:54 +02:00
property Browser : ICefBrowser read GetBrowser;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the frame for this context. This function will return an NULL
/// reference for WebWorker contexts.
/// </summary>
2018-05-12 14:50:54 +02:00
property Frame : ICefFrame read GetFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the global object for this context. The context must be entered
/// before calling this function.
/// </summary>
2018-05-12 14:50:54 +02:00
property Global : ICefv8Value read GetGlobal;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that should be implemented to handle V8 function calls. The
/// functions of this interface will be called on the thread associated with the
/// V8 function.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefv8Handler">Implements TCefv8Handler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefv8Handler = interface( ICefBaseRefCounted)
[ '{F94CDC60-FDCB-422D-96D5-D2A775BD5D73}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle execution of the function identified by |name|. |object| is the
/// receiver ('this' object) of the function. |arguments| is the list of
/// arguments passed to the function. If execution succeeds set |retval| to
/// the function return value. If execution fails set |exception| to the
/// exception that will be thrown. Return true (1) if execution was handled.
/// </summary>
2019-11-24 18:19:49 +01:00
function Execute( const name : ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring) : Boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that should be implemented to handle V8 interceptor calls. The
/// functions of this interface will be called on the thread associated with the
/// V8 interceptor. Interceptor's named property handlers (with first argument
/// of type CefString) are called when object is indexed by string. Indexed
/// property handlers (with first argument of type int) are called when object
/// is indexed by integer.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8Interceptor">Implements TCefV8Interceptor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8interceptor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefV8Interceptor = interface( ICefBaseRefCounted)
[ '{B3B8FD7C-A916-4B25-93A2-2892AC324F21}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle retrieval of the interceptor value identified by |name|. |object|
/// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
/// set |retval| to the return value. If the requested value does not exist,
/// don't set either |retval| or |exception|. If retrieval fails, set
/// |exception| to the exception that will be thrown. If the property has an
/// associated accessor, it will be called only if you don't set |retval|.
/// Return true (1) if interceptor retrieval was handled, false (0) otherwise.
/// </summary>
2019-11-24 18:19:49 +01:00
function GetByName( const name : ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle retrieval of the interceptor value identified by |index|. |object|
/// is the receiver ('this' object) of the interceptor. If retrieval succeeds,
/// set |retval| to the return value. If the requested value does not exist,
/// don't set either |retval| or |exception|. If retrieval fails, set
/// |exception| to the exception that will be thrown. Return true (1) if
/// interceptor retrieval was handled, false (0) otherwise.
/// </summary>
2019-11-24 18:19:49 +01:00
function GetByIndex( index : integer ; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle assignment of the interceptor value identified by |name|. |object|
/// is the receiver ('this' object) of the interceptor. |value| is the new
/// value being assigned to the interceptor. If assignment fails, set
/// |exception| to the exception that will be thrown. This setter will always
/// be called, even when the property has an associated accessor. Return true
/// (1) if interceptor assignment was handled, false (0) otherwise.
/// </summary>
2019-11-24 18:19:49 +01:00
function SetByName( const name : ustring; const object_, value: ICefv8Value; var exception: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle assignment of the interceptor value identified by |index|. |object|
/// is the receiver ('this' object) of the interceptor. |value| is the new
/// value being assigned to the interceptor. If assignment fails, set
/// |exception| to the exception that will be thrown. Return true (1) if
/// interceptor assignment was handled, false (0) otherwise.
/// </summary>
2019-11-24 18:19:49 +01:00
function SetByIndex( index : integer ; const object_, value: ICefv8Value; var exception: ustring) : boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that should be implemented to handle V8 accessor calls. Accessor
/// identifiers are registered by calling ICefV8value.SetValue(). The
/// functions of this interface will be called on the thread associated with the
/// V8 accessor.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8Accessor">Implements TCefV8Accessor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8accessor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefV8Accessor = interface( ICefBaseRefCounted)
[ '{DCA6D4A2-726A-4E24-AA64-5E8C731D868A}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle retrieval the accessor value identified by |name|. |object| is the
/// receiver ('this' object) of the accessor. If retrieval succeeds set
/// |retval| to the return value. If retrieval fails set |exception| to the
/// exception that will be thrown. Return true (1) if accessor retrieval was
/// handled.
/// </summary>
2019-11-24 18:19:49 +01:00
function Get( const name : ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Handle assignment of the accessor value identified by |name|. |object| is
/// the receiver ('this' object) of the accessor. |value| is the new value
/// being assigned to the accessor. If assignment fails set |exception| to the
/// exception that will be thrown. Return true (1) if accessor assignment was
/// handled.
/// </summary>
2019-11-24 18:19:49 +01:00
function Set_( const name : ustring; const object_, value: ICefv8Value; var exception: ustring) : Boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface for asynchronous task execution. If the task is
/// posted successfully and if the associated message loop is still running then
/// the execute() function will be called on the target thread. If the task
/// fails to post then the task object may be destroyed on the source thread
/// instead of the target thread. For this reason be cautious when performing
/// work in the task object destructor.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefTask">Implements TCefTask</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_task_capi.h">CEF source file: /include/capi/cef_task_capi.h (cef_task_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefTask = interface( ICefBaseRefCounted)
[ '{0D965470-4A86-47CE-BD39-A8770021AD7E}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be executed on the target thread.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Execute;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that asynchronously executes tasks on the associated thread. It is
/// safe to call the functions of this interface on any thread.
///
/// CEF maintains multiple internal threads that are used for handling different
/// types of tasks in different processes. The TCefThreadId definitions in
/// cef_types.h list the common CEF threads. Task runners are also available for
/// other CEF threads as appropriate (for example, V8 WebWorker threads).
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefTaskRunner">Implements TCefTaskRunner</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_task_capi.h">CEF source file: /include/capi/cef_task_capi.h (cef_task_runner_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefTaskRunner = interface( ICefBaseRefCounted)
[ '{6A500FA3-77B7-4418-8EA8-6337EED1337B}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same task runner as
/// |that| object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefTaskRunner) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this task runner belongs to the current thread.
/// </summary>
function BelongsToCurrentThread: Boolean ;
/// <summary>
/// Returns true (1) if this task runner is for the specified CEF thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function BelongsToThread( threadId: TCefThreadId) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Post a task for execution on the thread associated with this task runner.
/// Execution will occur asynchronously.
/// </summary>
2018-05-12 14:50:54 +02:00
function PostTask( const task: ICefTask) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Post a task for delayed execution on the thread associated with this task
/// runner. Execution will occur asynchronously. Delayed tasks are not
/// supported on V8 WebWorker threads and will be executed without the
/// specified delay.
/// </summary>
2018-05-12 14:50:54 +02:00
function PostDelayedTask( const task: ICefTask; delayMs: Int64 ) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A simple thread abstraction that establishes a message loop on a new thread.
/// The consumer uses ICefTaskRunner to execute code on the thread's message
/// loop. The thread is terminated when the ICefThread object is destroyed or
/// stop() is called. All pending tasks queued on the thread's message loop will
/// run to completion before the thread is terminated. cef_thread_create() can
/// be called on any valid CEF thread in either the browser or render process.
/// This interface should only be used for tasks that require a dedicated
/// thread. In most cases you can post tasks to an existing CEF thread instead
/// of creating a new one; see cef_task.h for details.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefThread">Implements TCefThread</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_thread_capi.h">CEF source file: /include/capi/cef_thread_capi.h (cef_thread_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefThread = interface( ICefBaseRefCounted)
[ '{26B30EA5-F44A-4C40-97DF-67FD9E73A4FF}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns the ICefTaskRunner that will execute code on this thread's
2023-08-07 20:21:42 +02:00
/// message loop. This function is safe to call from any thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTaskRunner : ICefTaskRunner;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the platform thread ID. It will return the same value after stop()
/// is called. This function is safe to call from any thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPlatformThreadID : TCefPlatformThreadId;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Stop and join the thread. This function must be called from the same
/// thread that called cef_thread_create(). Do not call this function if
/// cef_thread_create() was called with a |stoppable| value of false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Stop;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the thread is currently running. This function must be
/// called from the same thread that called cef_thread_create().
/// </summary>
2018-05-12 14:50:54 +02:00
function IsRunning : boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// WaitableEvent is a thread synchronization tool that allows one thread to
/// wait for another thread to finish some work. This is equivalent to using a
/// Lock+ConditionVariable to protect a simple boolean value. However, using
/// WaitableEvent in conjunction with a Lock to wait for a more complex state
/// change (e.g., for an item to be added to a queue) is not recommended. In
/// that case consider using a ConditionVariable instead of a WaitableEvent. It
/// is safe to create and/or signal a WaitableEvent from any thread. Blocking on
/// a WaitableEvent by calling the *wait() functions is not allowed on the
/// browser process UI or IO threads.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefWaitableEvent">Implements TCefWaitableEvent</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_waitable_event_capi.h">CEF source file: /include/capi/cef_waitable_event_capi.h (cef_waitable_event_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefWaitableEvent = interface( ICefBaseRefCounted)
[ '{965C90C9-3DAE-457F-AA64-E04FF508094A}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Put the event in the un-signaled state.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Reset;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Put the event in the signaled state. This causes any thread blocked on
/// Wait to be woken up.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Signal;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the event is in the signaled state, else false (0). If
/// the event was created with |automatic_reset| set to true (1) then calling
/// this function will also cause a reset.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSignaled : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Wait indefinitely for the event to be signaled. This function will not
/// return until after the call to signal() has completed. This function
/// cannot be called on the browser process UI or IO threads.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Wait;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Wait up to |max_ms| milliseconds for the event to be signaled. Returns
/// true (1) if the event was signaled. A return value of false (0) does not
/// necessarily mean that |max_ms| was exceeded. This function will not return
/// until after the call to signal() has completed. This function cannot be
/// called on the browser process UI or IO threads.
/// </summary>
2018-05-12 14:50:54 +02:00
function TimedWait( max_ms: int64 ) : boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a V8 value handle. V8 handles can only be accessed
/// from the thread on which they are created. Valid threads for creating a V8
/// handle include the render process main thread (TID_RENDERER) and WebWorker
/// threads. A task runner for posting tasks on the associated thread can be
/// retrieved via the ICefv8context.GetTaskRunner() function.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefv8Value">Implements TCefv8Value</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8value_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefv8Value = interface( ICefBaseRefCounted)
[ '{52319B8D-75A8-422C-BD4B-16FA08CC7F42}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying handle is valid and it can be accessed
/// on the current thread. Do not call any other functions if this function
/// returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is undefined.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsUndefined: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is null.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsNull: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is bool.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsBool: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is int.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsInt: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is unsigned int.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsUInt: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is double.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsDouble: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is Date.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsDate: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is string.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsString: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsObject: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is array.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsArray: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is an ArrayBuffer.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsArrayBuffer: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is function.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsFunction: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if the value type is a Promise.
/// </summary>
2022-12-16 11:29:15 +01:00
function IsPromise: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same handle as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefv8Value) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return a bool value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBoolValue: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return an int value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIntValue: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return an unsigned int value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUIntValue: Cardinal ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return a double value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDoubleValue: Double ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return a Date value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDateValue: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return a string value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStringValue: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is a user created object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsUserCreated: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the last function call resulted in an exception. This
/// attribute exists only in the scope of the current CEF value object.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasException: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the exception resulting from the last function call. This
/// attribute exists only in the scope of the current CEF value object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetException: ICefV8Exception;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clears the last exception and returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function ClearException: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object will re-throw future exceptions. This
/// attribute exists only in the scope of the current CEF value object.
/// </summary>
2018-05-12 14:50:54 +02:00
function WillRethrowExceptions: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set whether this object will re-throw future exceptions. By default
/// exceptions are not re-thrown. If a exception is re-thrown the current
/// context should not be accessed again until after the exception has been
/// caught and not re-thrown. Returns true (1) on success. This attribute
/// exists only in the scope of the current CEF value object.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetRethrowExceptions( rethrow: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the object has a value with the specified identifier.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasValueByKey( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the object has a value with the specified identifier.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasValueByIndex( index : Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Deletes the value with the specified identifier and returns true (1) on
/// success. Returns false (0) if this function is called incorrectly or an
/// exception is thrown. For read-only and don't-delete values this function
/// will return true (1) even though deletion failed.
/// </summary>
2018-05-12 14:50:54 +02:00
function DeleteValueByKey( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Deletes the value with the specified identifier and returns true (1) on
/// success. Returns false (0) if this function is called incorrectly,
/// deletion fails or an exception is thrown. For read-only and don't-delete
/// values this function will return true (1) even though deletion failed.
/// </summary>
2018-05-12 14:50:54 +02:00
function DeleteValueByIndex( index : Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value with the specified identifier on success. Returns NULL
/// if this function is called incorrectly or an exception is thrown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValueByKey( const key: ustring) : ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value with the specified identifier on success. Returns NULL
/// if this function is called incorrectly or an exception is thrown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValueByIndex( index : Integer ) : ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Associates a value with the specified identifier and returns true (1) on
/// success. Returns false (0) if this function is called incorrectly or an
/// exception is thrown. For read-only values this function will return true
/// (1) even though assignment failed.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetValueByKey( const key: ustring; const value: ICefv8Value; attribute: TCefV8PropertyAttributes) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Associates a value with the specified identifier and returns true (1) on
/// success. Returns false (0) if this function is called incorrectly or an
/// exception is thrown. For read-only values this function will return true
/// (1) even though assignment failed.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetValueByIndex( index : Integer ; const value: ICefv8Value) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Registers an identifier and returns true (1) on success. Access to the
2023-08-08 18:55:10 +02:00
/// identifier will be forwarded to the ICefV8Accessor instance passed to
/// cef_v8value_create_object(). Returns false (0) if this
2023-08-07 20:21:42 +02:00
/// function is called incorrectly or an exception is thrown. For read-only
/// values this function will return true (1) even though assignment failed.
/// </summary>
2024-06-14 19:17:43 +02:00
function SetValueByAccessor( const key: ustring; attribute: TCefV8PropertyAttributes) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read the keys for the object's values into the specified vector. Integer-
/// based keys will also be returned as strings.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetKeys( const keys: TStrings) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the user data for this object and returns true (1) on success.
/// Returns false (0) if this function is called incorrectly. This function
/// can only be called on user created objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetUserData( const data: ICefv8Value) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the user data, if any, assigned to this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUserData: ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the amount of externally allocated memory registered for the
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetExternallyAllocatedMemory: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Adjusts the amount of registered external memory for the object. Used to
/// give V8 an indication of the amount of externally allocated memory that is
/// kept alive by JavaScript objects. V8 uses this information to decide when
2023-08-08 18:55:10 +02:00
/// to perform global garbage collection. Each ICefv8Value tracks the amount
2023-08-07 20:21:42 +02:00
/// of external memory associated with it and automatically decreases the
/// global total by the appropriate amount on its destruction.
/// |change_in_bytes| specifies the number of bytes to adjust by. This
/// function returns the number of bytes associated with the object after the
/// adjustment. This function can only be called on user created objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function AdjustExternallyAllocatedMemory( changeInBytes: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of elements in the array.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetArrayLength: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL
/// if the ArrayBuffer was not created with CreateArrayBuffer.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetArrayBufferReleaseCallback : ICefv8ArrayBufferReleaseCallback;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Prevent the ArrayBuffer from using it's memory block by setting the length
/// to zero. This operation cannot be undone. If the ArrayBuffer was created
/// with CreateArrayBuffer then
2023-08-08 18:55:10 +02:00
/// ICefv8ArrayBufferReleaseCallback.ReleaseBuffer will be called to
2023-08-07 20:21:42 +02:00
/// release the underlying buffer.
/// </summary>
2018-05-12 14:50:54 +02:00
function NeuterArrayBuffer : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-11-16 16:58:47 +01:00
/// Returns the length (in bytes) of the ArrayBuffer.
/// </summary>
function GetArrayBufferByteLength: NativeUInt ;
/// <summary>
/// Returns a pointer to the beginning of the memory block for this
/// ArrayBuffer backing store. The returned pointer is valid as long as the
/// ICefv8value is alive.
/// </summary>
function GetArrayBufferData: Pointer ;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the function name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFunctionName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the function handler or NULL if not a CEF-created function.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFunctionHandler: ICefv8Handler;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute the function using the current V8 context. This function should
2023-08-08 18:55:10 +02:00
/// only be called from within the scope of a ICefv8Handler or
/// ICefV8Accessor callback, or in combination with calling enter() and
/// exit() on a stored ICefv8Context reference. |object| is the receiver
2023-08-07 20:21:42 +02:00
/// ('this' object) of the function. If |object| is NULL the current context's
/// global object will be used. |arguments| is the list of arguments that will
/// be passed to the function. Returns the function return value on success.
/// Returns NULL if this function is called incorrectly or an exception is
/// thrown.
/// </summary>
2018-05-12 14:50:54 +02:00
function ExecuteFunction( const obj: ICefv8Value; const arguments: TCefv8ValueArray) : ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Execute the function using the specified V8 context. |object| is the
/// receiver ('this' object) of the function. If |object| is NULL the
/// specified context's global object will be used. |arguments| is the list of
/// arguments that will be passed to the function. Returns the function return
/// value on success. Returns NULL if this function is called incorrectly or
/// an exception is thrown.
/// </summary>
2018-05-12 14:50:54 +02:00
function ExecuteFunctionWithContext( const context: ICefv8Context; const obj: ICefv8Value; const arguments: TCefv8ValueArray) : ICefv8Value;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Resolve the Promise using the current V8 context. This function should
2023-08-08 18:55:10 +02:00
/// only be called from within the scope of a ICefv8Handler or
/// ICefV8Accessor callback, or in combination with calling enter() and
/// exit() on a stored ICefv8Context reference. |arg| is the argument passed
2023-08-07 20:21:42 +02:00
/// to the resolved promise. Returns true (1) on success. Returns false (0) if
/// this function is called incorrectly or an exception is thrown.
/// </summary>
2022-12-16 11:29:15 +01:00
function ResolvePromise( const arg: ICefv8Value) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reject the Promise using the current V8 context. This function should only
2023-08-08 18:55:10 +02:00
/// be called from within the scope of a ICefv8Handler or ICefV8Accessor
2023-08-07 20:21:42 +02:00
/// callback, or in combination with calling enter() and exit() on a stored
2023-08-08 18:55:10 +02:00
/// ICefv8Context reference. Returns true (1) on success. Returns false (0)
2023-08-07 20:21:42 +02:00
/// if this function is called incorrectly or an exception is thrown.
/// </summary>
2022-12-16 11:29:15 +01:00
function RejectPromise( const errorMsg: ustring) : boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a V8 stack frame handle. V8 handles can only be
/// accessed from the thread on which they are created. Valid threads for
/// creating a V8 handle include the render process main thread (TID_RENDERER)
/// and WebWorker threads. A task runner for posting tasks on the associated
/// thread can be retrieved via the ICefv8context.GetTaskRunner() function.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8StackFrame">Implements TCefV8StackFrame</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8stack_frame_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefV8StackFrame = interface( ICefBaseRefCounted)
[ '{BA1FFBF4-E9F2-4842-A827-DC220F324286}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying handle is valid and it can be accessed
/// on the current thread. Do not call any other functions if this function
/// returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the resource script that contains the function.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetScriptName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the resource script that contains the function or the
/// sourceURL value if the script name is undefined and its source ends with a
/// "//@ sourceURL=..." string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetScriptNameOrSourceUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the function.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFunctionName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based line number for the function call or 0 if unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLineNumber: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based column offset on the line for the function call or 0
/// if unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetColumn: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the function was compiled using eval().
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEval: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the function was called as a constructor via "new".
/// </summary>
2018-05-12 14:50:54 +02:00
function IsConstructor: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the resource script that contains the function.
/// </summary>
2018-05-12 14:50:54 +02:00
property ScriptName : ustring read GetScriptName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the resource script that contains the function or the
/// sourceURL value if the script name is undefined and its source ends with a
/// "//@ sourceURL=..." string.
/// </summary>
2018-05-12 14:50:54 +02:00
property ScriptNameOrSourceUrl : ustring read GetScriptNameOrSourceUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the function.
/// </summary>
2018-05-12 14:50:54 +02:00
property FunctionName : ustring read GetFunctionName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based line number for the function call or 0 if unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
property LineNumber : Integer read GetLineNumber;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the 1-based column offset on the line for the function call or 0
/// if unknown.
/// </summary>
2018-05-12 14:50:54 +02:00
property Column : Integer read GetColumn;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a V8 stack trace handle. V8 handles can only be
/// accessed from the thread on which they are created. Valid threads for
/// creating a V8 handle include the render process main thread (TID_RENDERER)
/// and WebWorker threads. A task runner for posting tasks on the associated
/// thread can be retrieved via the ICefv8context.GetTaskRunner() function.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefV8StackTrace">Implements TCefV8StackTrace</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_v8_capi.h">CEF source file: /include/capi/cef_v8_capi.h (cef_v8stack_trace_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefV8StackTrace = interface( ICefBaseRefCounted)
[ '{32111C84-B7F7-4E3A-92B9-7CA1D0ADB613}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying handle is valid and it can be accessed
/// on the current thread. Do not call any other functions if this function
/// returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of stack frames.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrameCount: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the stack frame at the specified 0-based index.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrame( index : Integer ) : ICefV8StackFrame;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of stack frames.
/// </summary>
2018-05-12 14:50:54 +02:00
property FrameCount : Integer read GetFrameCount;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the stack frame at the specified 0-based index.
/// </summary>
2018-05-12 14:50:54 +02:00
property Frame[ index : Integer ] : ICefV8StackFrame read GetFrame;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that supports the reading of XML data via the libxml streaming
/// API. The functions of this interface should only be called on the thread
/// that creates the object.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefXmlReader">Implements TCefXmlReader</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_xml_reader_capi.h">CEF source file: /include/capi/cef_xml_reader_capi.h (cef_xml_reader_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefXmlReader = interface( ICefBaseRefCounted)
[ '{0DE686C3-A8D7-45D2-82FD-92F7F4E62A90}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the next node in the document. This function must be
/// called at least once to set the current cursor position. Returns true (1)
/// if the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToNextNode: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Close the document. This should be called directly to ensure that cleanup
/// occurs on the correct thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function Close: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if an error has been reported by the XML parser.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasError: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the error string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetError: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the node type.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType: TCefXmlNodeType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the node depth. Depth starts at 0 for the root node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDepth: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT-
/// LocalPart for additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLocalName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for
/// additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPrefix: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the qualified name, equal to (Prefix:)LocalName. See
/// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetQualifiedName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the URI defining the namespace associated with the node. See
/// http://www.w3.org/TR/REC-xml-names/ for additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetNamespaceUri: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for
/// additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBaseUri: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the xml:lang scope within which the node resides. See
/// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetXmlLang: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the node represents an NULL element. "<a/>" is
/// considered NULL but "<a></a>" is not.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEmptyElement: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the node has a text value.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasValue: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the text value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValue: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the node has attributes.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasAttributes: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of attributes.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAttributeCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value of the attribute at the specified 0-based index.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAttributeByIndex( index : Integer ) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value of the attribute with the specified qualified name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAttributeByQName( const qualifiedName: ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value of the attribute with the specified local name and
/// namespace URI.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAttributeByLName( const localName, namespaceURI: ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns an XML representation of the current node's children.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetInnerXml: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns an XML representation of the current node including its children.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetOuterXml: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the line number for the current node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLineNumber: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the attribute at the specified 0-based index. Returns
/// true (1) if the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToAttributeByIndex( index : Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the attribute with the specified qualified name.
/// Returns true (1) if the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToAttributeByQName( const qualifiedName: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the attribute with the specified local name and
/// namespace URI. Returns true (1) if the cursor position was set
/// successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToAttributeByLName( const localName, namespaceURI: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the first attribute in the current element. Returns
/// true (1) if the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToFirstAttribute: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the next attribute in the current element. Returns
/// true (1) if the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToNextAttribute: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor back to the carrying element. Returns true (1) if the
/// cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToCarryingElement: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that supports the reading of zip archives via the zlib unzip API.
/// The functions of this interface should only be called on the thread that
/// creates the object.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefZipReader">Implements TCefZipReader</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_zip_reader_capi.h">CEF source file: /include/capi/cef_zip_reader_capi.h (cef_zip_reader_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefZipReader = interface( ICefBaseRefCounted)
[ '{3B6C591F-9877-42B3-8892-AA7B27DA34A8}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the first file in the archive. Returns true (1) if the
/// cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToFirstFile: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the next file in the archive. Returns true (1) if the
/// cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToNextFile: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Moves the cursor to the specified file in the archive. If |caseSensitive|
/// is true (1) then the search will be case sensitive. Returns true (1) if
/// the cursor position was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function MoveToFile( const fileName: ustring; caseSensitive: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Closes the archive. This should be called directly to ensure that cleanup
/// occurs on the correct thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function Close: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of the file.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFileName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the uncompressed size of the file.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFileSize: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the last modified timestamp for the file.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetFileLastModified: TCefBaseTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Opens the file for reading of uncompressed data. A read password may
/// optionally be specified.
/// </summary>
2018-05-12 14:50:54 +02:00
function OpenFile( const password: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Closes the file.
/// </summary>
2018-05-12 14:50:54 +02:00
function CloseFile: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read uncompressed file contents into the specified buffer. Returns < 0 if
/// an error occurred, 0 if at the end of file, or the number of bytes read.
/// </summary>
2018-05-12 14:50:54 +02:00
function ReadFile( buffer: Pointer ; bufferSize: NativeUInt ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the current offset in the uncompressed file contents.
/// </summary>
2018-05-12 14:50:54 +02:00
function Tell: Int64 ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if at end of the file contents.
/// </summary>
2018-05-12 14:50:54 +02:00
function Eof: Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a DOM node. The functions of this interface
/// should only be called on the render process main thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDomNode">Implements TCefDomNode</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_dom_capi.h">CEF source file: /include/capi/cef_dom_capi.h (cef_domnode_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDomNode = interface( ICefBaseRefCounted)
[ '{96C03C9E-9C98-491A-8DAD-1947332232D6}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the type for this node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType: TCefDomNodeType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is a text node.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsText: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is an element node.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsElement: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is an editable node.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEditable: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this is a form control element node.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsFormControlElement: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the type of this form control element node.
/// </summary>
2023-11-16 16:58:47 +01:00
function GetFormControlElementType: TCefDomFormControlType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same handle as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefDomNode) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of this node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value of this node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValue: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the value of this node. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetValue( const value: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this node as markup.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAsMarkup: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the document associated with this node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDocument: ICefDomDocument;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the parent node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetParent: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the previous sibling node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPreviousSibling: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the next sibling node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetNextSibling: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this node has child nodes.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasChildren: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the first child node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFirstChild: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the last child node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLastChild: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the tag name of this element.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetElementTagName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this element has attributes.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasElementAttributes: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this element has an attribute named |attrName|.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasElementAttribute( const attrName: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the element attribute named |attrName|.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetElementAttribute( const attrName: ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a ICefStringMap of all element attributes.
/// </summary>
2018-06-12 21:34:53 +02:00
procedure GetElementAttributes( const attrMap: ICefStringMap) ; overload ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a TStrings of all element attributes.
/// </summary>
2018-06-12 21:34:53 +02:00
procedure GetElementAttributes( var attrList: TStrings) ; overload ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the value for the element attribute named |attrName|. Returns true (1)
/// on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetElementAttribute( const attrName, value: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the inner text of the element.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetElementInnerText: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the bounds of the element in device pixels. Use
/// "window.devicePixelRatio" to convert to/from CSS pixels.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetElementBounds: TCefRect;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the type for this node.
/// </summary>
2018-05-12 14:50:54 +02:00
property NodeType : TCefDomNodeType read GetType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the name of this node.
/// </summary>
2018-05-12 14:50:54 +02:00
property Name : ustring read GetName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this node as markup.
/// </summary>
2018-05-12 14:50:54 +02:00
property AsMarkup : ustring read GetAsMarkup;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the document associated with this node.
/// </summary>
2018-05-12 14:50:54 +02:00
property Document : ICefDomDocument read GetDocument;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the parent node.
/// </summary>
2018-05-12 14:50:54 +02:00
property Parent : ICefDomNode read GetParent;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the previous sibling node.
/// </summary>
2018-05-12 14:50:54 +02:00
property PreviousSibling : ICefDomNode read GetPreviousSibling;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the next sibling node.
/// </summary>
2018-05-12 14:50:54 +02:00
property NextSibling : ICefDomNode read GetNextSibling;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the first child node.
/// </summary>
2018-05-12 14:50:54 +02:00
property FirstChild : ICefDomNode read GetFirstChild;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the last child node.
/// </summary>
2018-05-12 14:50:54 +02:00
property LastChild : ICefDomNode read GetLastChild;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the tag name of this element.
/// </summary>
2018-05-12 14:50:54 +02:00
property ElementTagName : ustring read GetElementTagName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the inner text of the element.
/// </summary>
2018-05-12 14:50:54 +02:00
property ElementInnerText : ustring read GetElementInnerText;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the bounds of the element in device pixels. Use
/// "window.devicePixelRatio" to convert to/from CSS pixels.
/// </summary>
2018-05-12 14:50:54 +02:00
property ElementBounds : TCefRect read GetElementBounds;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent a DOM document. The functions of this interface
/// should only be called on the render process main thread thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDomDocument">Implements TCefDomDocument</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_dom_capi.h">CEF source file: /include/capi/cef_dom_capi.h (cef_domdocument_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDomDocument = interface( ICefBaseRefCounted)
[ '{08E74052-45AF-4F69-A578-98A5C3959426}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the document type.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType: TCefDomDocumentType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the root document node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDocument: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the BODY node of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBody: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the HEAD node of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHead: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the title of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTitle: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the document element with the specified ID value.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetElementById( const id: ustring) : ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the node that currently has keyboard focus.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFocusedNode: ICefDomNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if a portion of the document is selected.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasSelection: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the selection offset within the start node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSelectionStartOffset: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the selection offset within the end node.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSelectionEndOffset: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this selection as markup.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSelectionAsMarkup: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this selection as text.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSelectionAsText: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the base URL for the document.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBaseUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a complete URL based on the document base URL and the specified
/// partial URL.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCompleteUrl( const partialURL: ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the document type.
/// </summary>
2018-05-12 14:50:54 +02:00
property DocType : TCefDomDocumentType read GetType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the root document node.
/// </summary>
2018-05-12 14:50:54 +02:00
property Document : ICefDomNode read GetDocument;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the BODY node of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
property Body : ICefDomNode read GetBody;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the HEAD node of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
property Head : ICefDomNode read GetHead;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the title of an HTML document.
/// </summary>
2018-05-12 14:50:54 +02:00
property Title : ustring read GetTitle;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the node that currently has keyboard focus.
/// </summary>
2018-05-12 14:50:54 +02:00
property FocusedNode : ICefDomNode read GetFocusedNode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the selection offset within the start node.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionStartOffset : Integer read GetSelectionStartOffset;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the selection offset within the end node.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionEndOffset : Integer read GetSelectionEndOffset;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this selection as markup.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionAsMarkup : ustring read GetSelectionAsMarkup;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the contents of this selection as text.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionAsText : ustring read GetSelectionAsText;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the base URL for the document.
/// </summary>
2018-05-12 14:50:54 +02:00
property BaseUrl : ustring read GetBaseUrl;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface to implement for visiting the DOM. The functions of this interface
/// will be called on the render process main thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDomVisitor">Implements TCefDomVisitor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_dom_capi.h">CEF source file: /include/capi/cef_dom_capi.h (cef_domvisitor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDomVisitor = interface( ICefBaseRefCounted)
[ '{30398428-3196-4531-B968-2DDBED36F6B0}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method executed for visiting the DOM. The document object passed to this
/// function represents a snapshot of the DOM at the time this function is
/// executed. DOM objects are only valid for the scope of this function. Do
/// not keep references to or attempt to access any DOM objects outside the
/// scope of this function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure visit( const document: ICefDomDocument) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface to implement for visiting cookie values. The functions of this
/// interface will always be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCookieVisitor">Implements TCefCookieVisitor</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_cookie_capi.h">CEF source file: /include/capi/cef_cookie_capi.h (cef_cookie_visitor_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCookieVisitor = interface( ICefBaseRefCounted)
[ '{8378CF1B-84AB-4FDB-9B86-34DDABCCC402}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be called once for each cookie. |count| is the 0-based
/// index for the current cookie. |total| is the total number of cookies. Set
/// |deleteCookie| to true (1) to delete the cookie currently being visited.
/// Return false (0) to stop visiting cookies. This function may never be
/// called if no cookies are found.
/// </summary>
2020-05-23 15:00:44 +02:00
function visit( const name , value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; count, total: Integer ; same_site : TCefCookieSameSite; priority : TCefCookiePriority; out deleteCookie: Boolean ) : Boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to create and/or parse command line arguments. Arguments with
/// "--", "-" and, on Windows, "/" prefixes are considered switches. Switches
/// will always precede any arguments without switch prefixes. Switches can
/// optionally have a value specified using the "=" delimiter (e.g.
/// "-switch=value"). An argument of "--" will terminate switch parsing with all
/// subsequent tokens, regardless of prefix, being interpreted as non-switch
/// arguments. Switch names should be lowercase ASCII and will be converted to
/// such if necessary. Switch values will retain the original case and UTF8
/// encoding. This interface can be used before cef_initialize() is called.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCommandLine">Implements TCefCommandLine</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_command_line_capi.h">CEF source file: /include/capi/cef_command_line_capi.h (cef_command_line_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCommandLine = interface( ICefBaseRefCounted)
[ '{6B43D21B-0F2C-4B94-B4E6-4AF0D7669D8E}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a writable copy of this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy: ICefCommandLine;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Initialize the command line with the specified |argc| and |argv| values.
/// The first argument must be the name of the program. This function is only
/// supported on non-Windows platforms.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure InitFromArgv( argc: Integer ; const argv: PPAnsiChar) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Initialize the command line with the string returned by calling
/// GetCommandLineW(). This function is only supported on Windows.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure InitFromString( const commandLine: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reset the command-line switches and arguments but leave the program
/// component unchanged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Reset;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Constructs and returns the represented command line string. Use this
/// function cautiously because quoting behavior is unclear.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCommandLineString: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the original command line string as a vector of strings. The argv
/// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }`
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetArgv( var args: TStrings) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the program part of the command line string (the first item).
/// </summary>
2018-05-12 14:50:54 +02:00
function GetProgram: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the program part of the command line string (the first item).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetProgram( const prog: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the command line has switches.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasSwitches: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the command line contains the given switch.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasSwitch( const name : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value associated with the given switch. If the switch has no
/// value or isn't present this function returns the NULL string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSwitchValue( const name : ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the map of switch names and values. If a switch has no value an
/// NULL string is returned.
/// </summary>
2020-07-30 10:45:12 +02:00
function GetSwitches( var switches: TStrings) : boolean ; overload ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the map of switch names and values. If a switch has no value an
/// NULL string is returned.
/// </summary>
2020-07-30 10:45:12 +02:00
function GetSwitches( var SwitchKeys, SwitchValues: TStringList) : boolean ; overload ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a switch to the end of the command line.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure AppendSwitch( const name : ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a switch with the specified value to the end of the command line. If
/// the switch has no value pass an NULL value string.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure AppendSwitchWithValue( const name , value: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// True if there are remaining command line arguments.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasArguments: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the remaining command line arguments.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetArguments( var arguments: TStrings) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add an argument to the end of the command line.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure AppendArgument( const argument: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert a command before the current command. Common for debuggers, like
/// "valgrind" or "gdb --args".
/// </summary>
2018-05-12 14:50:54 +02:00
procedure PrependWrapper( const wrapper: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Constructs and returns the represented command line string. Use this
/// function cautiously because quoting behavior is unclear.
/// </summary>
2018-05-12 14:50:54 +02:00
property CommandLineString : ustring read GetCommandLineString;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Generic callback interface used for managing the lifespan of a registration.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRegistration">Implements TCefRegistration</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_registration_capi.h">CEF source file: /include/capi/cef_registration_capi.h (cef_registration_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefRegistration = interface( ICefBaseRefCounted)
[ '{9226018F-7A56-4F2E-AF01-43268E33EE6B}' ]
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefBrowserHost.AddDevToolsMessageObserver. The
/// functions of this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDevToolsMessageObserver">Implements TCefDevToolsMessageObserver</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_devtools_message_observer_capi.h">CEF source file: /include/capi/cef_devtools_message_observer_capi.h (cef_dev_tools_message_observer_t)</see></para>
/// </remarks>
2020-06-21 21:27:55 +02:00
ICefDevToolsMessageObserver = interface( ICefBaseRefCounted)
[ '{76E5BB2B-7F69-4BC9-94C7-B55C61CE630F}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be called on receipt of a DevTools protocol message.
/// |browser| is the originating browser instance. |message| is a UTF8-encoded
/// JSON dictionary representing either a function result or an event.
/// |message| is only valid for the scope of this callback and should be
/// copied if necessary. Return true (1) if the message was handled or false
/// (0) if the message should be further processed and passed to the
/// OnDevToolsMethodResult or OnDevToolsEvent functions as appropriate.
///
/// Method result dictionaries include an "id" (int) value that identifies the
/// orginating function call sent from
2023-08-07 20:21:42 +02:00
/// ICefBrowserHost.SendDevToolsMessage, and optionally either a "result"
2023-08-03 22:11:42 +02:00
/// (dictionary) or "error" (dictionary) value. The "error" dictionary will
/// contain "code" (int) and "message" (string) values. Event dictionaries
/// include a "function" (string) value and optionally a "params" (dictionary)
/// value. See the DevTools protocol documentation at
/// https://chromedevtools.github.io/devtools-protocol/ for details of
/// supported function calls and the expected "result" or "params" dictionary
/// contents. JSON dictionaries can be parsed using the CefParseJSON function
/// if desired, however be aware of performance considerations when parsing
/// large messages (some of which may exceed 1MB in size).
/// </summary>
2021-01-16 14:35:01 +01:00
procedure OnDevToolsMessage( const browser: ICefBrowser; const message_: Pointer ; message_size: NativeUInt ; var aHandled: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be called after attempted execution of a DevTools
/// protocol function. |browser| is the originating browser instance.
/// |message_id| is the "id" value that identifies the originating function
/// call message. If the function succeeded |success| will be true (1) and
/// |result| will be the UTF8-encoded JSON "result" dictionary value (which
/// may be NULL). If the function failed |success| will be false (0) and
/// |result| will be the UTF8-encoded JSON "error" dictionary value. |result|
/// is only valid for the scope of this callback and should be copied if
/// necessary. See the OnDevToolsMessage documentation for additional details
/// on |result| contents.
/// </summary>
2021-01-16 14:35:01 +01:00
procedure OnDevToolsMethodResult( const browser: ICefBrowser; message_id: integer ; success: boolean ; const result : Pointer ; result_size: NativeUInt ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be called on receipt of a DevTools protocol event.
/// |browser| is the originating browser instance. |function| is the
/// "function" value. |params| is the UTF8-encoded JSON "params" dictionary
/// value (which may be NULL). |params| is only valid for the scope of this
/// callback and should be copied if necessary. See the OnDevToolsMessage
/// documentation for additional details on |params| contents.
/// </summary>
2021-01-16 14:35:01 +01:00
procedure OnDevToolsEvent( const browser: ICefBrowser; const method: ustring; const params: Pointer ; params_size: NativeUInt ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be called when the DevTools agent has attached. |browser|
/// is the originating browser instance. This will generally occur in response
/// to the first message sent while the agent is detached.
/// </summary>
2020-06-21 21:27:55 +02:00
procedure OnDevToolsAgentAttached( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be called when the DevTools agent has detached. |browser|
/// is the originating browser instance. Any function results that were
/// pending before the agent became detached will not be delivered, and any
/// active event subscriptions will be canceled.
/// </summary>
2020-06-21 21:27:55 +02:00
procedure OnDevToolsAgentDetached( const browser: ICefBrowser) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Supports discovery of and communication with media devices on the local
/// network via the Cast and DIAL protocols. The functions of this interface may
/// be called on any browser process thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaRouter">Implements TCefMediaRouter</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_router_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaRouter = interface( ICefBaseRefCounted)
[ '{F18C3880-CB8D-48F9-9D74-DCFF4B9E88DF}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Add an observer for MediaRouter events. The observer will remain
/// registered until the returned Registration object is destroyed.
/// </summary>
2020-03-29 17:31:42 +02:00
function AddObserver( const observer: ICefMediaObserver) : ICefRegistration;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns a MediaSource object for the specified media source URN. Supported
/// URN schemes include "cast:" and "dial:", and will be already known by the
/// client application (e.g. "cast:<appId>?clientId=<clientId>").
/// </summary>
2020-03-29 17:31:42 +02:00
function GetSource( const urn: ustring) : ICefMediaSource;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Trigger an asynchronous call to ICefMediaObserver.OnSinks on all
2023-08-03 22:11:42 +02:00
/// registered observers.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure NotifyCurrentSinks;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Create a new route between |source| and |sink|. Source and sink must be
2023-08-07 20:21:42 +02:00
/// valid, compatible (as reported by ICefMediaSink.IsCompatibleWith), and
2023-08-03 22:11:42 +02:00
/// a route between them must not already exist. |callback| will be executed
/// on success or failure. If route creation succeeds it will also trigger an
2023-08-07 20:21:42 +02:00
/// asynchronous call to ICefMediaObserver.OnRoutes on all registered
2023-08-03 22:11:42 +02:00
/// observers.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure CreateRoute( const source: ICefMediaSource; const sink: ICefMediaSink; const callback: ICefMediaRouteCreateCallback) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Trigger an asynchronous call to ICefMediaObserver.OnRoutes on all
2023-08-03 22:11:42 +02:00
/// registered observers.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure NotifyCurrentRoutes;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implemented by the client to observe MediaRouter events and registered via
/// ICefMediaRouter.AddObserver. The functions of this interface will be
/// called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaObserver">Implements TCefMediaObserver</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_observer_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaObserver = interface( ICefBaseRefCounted)
[ '{0B27C8D1-63E3-4F69-939F-DCAD518654A3}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// The list of available media sinks has changed or
2023-08-07 20:21:42 +02:00
/// ICefMediaRouter.NotifyCurrentSinks was called.
2023-08-03 22:11:42 +02:00
/// </summary>
2020-03-29 17:31:42 +02:00
procedure OnSinks( const sinks: TCefMediaSinkArray) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// The list of available media routes has changed or
2023-08-07 20:21:42 +02:00
/// ICefMediaRouter.NotifyCurrentRoutes was called.
2023-08-03 22:11:42 +02:00
/// </summary>
2020-03-29 17:31:42 +02:00
procedure OnRoutes( const routes: TCefMediaRouteArray) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// The connection state of |route| has changed.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure OnRouteStateChanged( const route: ICefMediaRoute; state: TCefMediaRouteConnectionState) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2024-02-01 15:13:22 +01:00
/// A message was received over |route|. |message| is only valid for the scope
2023-08-03 22:11:42 +02:00
/// of this callback and should be copied if necessary.
/// </summary>
2020-04-19 22:47:20 +02:00
procedure OnRouteMessageReceived( const route: ICefMediaRoute; const message_: ustring) ;
2020-03-29 17:31:42 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Represents the route between a media source and sink. Instances of this
/// object are created via ICefMediaRouter.CreateRoute and retrieved via
/// ICefMediaObserver.OnRoutes. Contains the status and metadata of a
/// routing operation. The functions of this interface may be called on any
/// browser process thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaRoute">Implements TCefMediaRoute</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_route_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaRoute = interface( ICefBaseRefCounted)
[ '{D8959122-DD19-4933-B4D9-DF829062A0D3}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the ID for this route.
/// </summary>
2020-03-29 17:31:42 +02:00
function GetId: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the source associated with this route.
/// </summary>
2020-03-29 17:31:42 +02:00
function GetSource: ICefMediaSource;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the sink associated with this route.
/// </summary>
2020-03-29 17:31:42 +02:00
function GetSink: ICefMediaSink;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a message over this route. |message_| will be copied if necessary.
/// </summary>
2020-04-19 22:47:20 +02:00
procedure SendRouteMessage( const message_: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Terminate this route. Will result in an asynchronous call to
/// ICefMediaObserver.OnRoutes on all registered observers.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure Terminate;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the ID for this route.
/// </summary>
2020-04-19 22:47:20 +02:00
property ID : ustring read GetId;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the source associated with this route.
/// </summary>
2020-04-19 22:47:20 +02:00
property Source : ICefMediaSource read GetSource;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the sink associated with this route.
/// </summary>
2020-04-19 22:47:20 +02:00
property Sink : ICefMediaSink read GetSink;
2020-03-29 17:31:42 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefMediaRouter.CreateRoute. The functions of
/// this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaRouteCreateCallback">Implements TCefMediaRouteCreateCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_route_create_callback_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaRouteCreateCallback = interface( ICefBaseRefCounted)
[ '{8848CBFE-36AC-4AC8-BC10-386B69FB27BE}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be executed when the route creation has finished.
/// |result| will be CEF_MRCR_OK if the route creation succeeded. |error| will
/// be a description of the error if the route creation failed. |route| is the
/// resulting route, or NULL if the route creation failed.
/// </summary>
2020-03-29 17:31:42 +02:00
procedure OnMediaRouteCreateFinished( result : TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefMediaSink.GetDeviceInfo. The functions of
/// this interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaSinkDeviceInfoCallback">Implements TCefMediaSinkDeviceInfoCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_sink_device_info_callback_t)</see></para>
/// </remarks>
2020-07-15 14:56:41 +02:00
ICefMediaSinkDeviceInfoCallback = interface( ICefBaseRefCounted)
[ '{633898DD-4169-45D0-ADDD-6E68B3686E0D}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Method that will be executed asyncronously once device information has
/// been retrieved.
/// </summary>
2020-07-15 14:56:41 +02:00
procedure OnMediaSinkDeviceInfo( const ip_address: ustring; port: integer ; const model_name: ustring) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Represents a sink to which media can be routed. Instances of this object are
/// retrieved via ICefMediaObserver.OnSinks. The functions of this interface
/// may be called on any browser process thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaSink">Implements TCefMediaSink</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_sink_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaSink = interface( ICefBaseRefCounted)
[ '{EDA1A4B2-2A4C-42DD-A7DF-901BF93D908D}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the ID for this sink.
/// </summary>
2020-07-15 14:56:41 +02:00
function GetId: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the name of this sink.
/// </summary>
2020-07-15 14:56:41 +02:00
function GetName: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the icon type for this sink.
/// </summary>
2020-07-15 14:56:41 +02:00
function GetIconType: TCefMediaSinkIconType;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Asynchronously retrieves device info.
/// </summary>
2020-07-15 14:56:41 +02:00
procedure GetDeviceInfo( const callback: ICefMediaSinkDeviceInfoCallback) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if this sink accepts content via Cast.
/// </summary>
2020-07-15 14:56:41 +02:00
function IsCastSink: boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if this sink accepts content via DIAL.
/// </summary>
2020-07-15 14:56:41 +02:00
function IsDialSink: boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if this sink is compatible with |source|.
/// </summary>
2020-07-15 14:56:41 +02:00
function IsCompatibleWith( const source: ICefMediaSource) : boolean ;
2020-03-29 17:31:42 +02:00
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the ID for this sink.
/// </summary>
2020-04-30 17:28:41 +02:00
property ID : ustring read GetId;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the name of this sink.
/// </summary>
2020-04-30 17:28:41 +02:00
property Name : ustring read GetName;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the icon type for this sink.
/// </summary>
2020-04-30 17:28:41 +02:00
property IconType : TCefMediaSinkIconType read GetIconType;
2020-03-29 17:31:42 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Represents a source from which media can be routed. Instances of this object
/// are retrieved via ICefMediaRouter.GetSource. The functions of this
/// interface may be called on any browser process thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaSource">Implements TCefMediaSource</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_router_capi.h">CEF source file: /include/capi/cef_media_router_capi.h (cef_media_source_t)</see></para>
/// </remarks>
2020-03-29 17:31:42 +02:00
ICefMediaSource = interface( ICefBaseRefCounted)
[ '{734ED6E4-6498-43ED-AAA4-6B993EDC30BE}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the ID (media source URN or URL) for this source.
/// </summary>
2020-03-29 17:31:42 +02:00
function GetId : ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if this source outputs its content via Cast.
/// </summary>
2020-03-29 17:31:42 +02:00
function IsCastSource : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if this source outputs its content via DIAL.
/// </summary>
2020-03-29 17:31:42 +02:00
function IsDialSource : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the ID (media source URN or URL) for this source.
/// </summary>
2020-03-29 17:31:42 +02:00
property ID : ustring read GetId;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to implement a custom resource bundle interface. See
/// TCefSettings for additional options related to resource bundle loading. The
/// functions of this interface may be called on multiple threads.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceBundleHandler">Implements TCefResourceBundleHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_bundle_handler_capi.h">CEF source file: /include/capi/cef_resource_bundle_handler_capi.h (cef_resource_bundle_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResourceBundleHandler = interface( ICefBaseRefCounted)
[ '{09C264FD-7E03-41E3-87B3-4234E82B5EA2}' ]
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called to retrieve a localized translation for the specified |string_id|.
/// To provide the translation set |string| to the translation string and
/// return true (1). To use the default translation return false (0). Include
/// cef_pack_strings.h for a listing of valid string ID values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLocalizedString( stringId: Integer ; var stringVal: ustring) : Boolean ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called to retrieve data for the specified scale independent |resource_id|.
/// To provide the resource data set |data| and |data_size| to the data
/// pointer and size respectively and return true (1). To use the default
/// resource data return false (0). The resource data will not be copied and
/// must remain resident in memory. Include cef_pack_resources.h for a listing
/// of valid resource ID values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDataResource( resourceId: Integer ; var data: Pointer ; var dataSize: NativeUInt ) : Boolean ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called to retrieve data for the specified |resource_id| nearest the scale
/// factor |scale_factor|. To provide the resource data set |data| and
/// |data_size| to the data pointer and size respectively and return true (1).
/// To use the default resource data return false (0). The resource data will
/// not be copied and must remain resident in memory. Include
/// cef_pack_resources.h for a listing of valid resource ID values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDataResourceForScale( resourceId: Integer ; scaleFactor: TCefScaleFactor; var data: Pointer ; var dataSize: NativeUInt ) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to implement browser process callbacks. The functions of this
/// interface will be called on the browser process main thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBrowserProcessHandler">Implements TCefBrowserProcessHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_browser_process_handler_capi.h">CEF source file: /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBrowserProcessHandler = interface( ICefBaseRefCounted)
[ '{27291B7A-C0AE-4EE0-9115-15C810E22F6C}' ]
2023-08-03 15:50:13 +02:00
/// <summary>
2023-12-15 18:06:46 +01:00
/// <para>Provides an opportunity to register custom preferences prior to global and
/// request context initialization.</para>
/// <para>If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be
2023-08-03 15:50:13 +02:00
/// accessed via ICefPreferenceManager.GetGlobalPreferences after
/// OnContextInitialized is called. Global preferences are registered a single
/// time at application startup. See related TCefSettings.cache_path and
2023-12-15 18:06:46 +01:00
/// TCefSettings.persist_user_preferences configuration.</para>
/// <para>If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be
2023-08-03 15:50:13 +02:00
/// accessed via the ICefRequestContext after
/// ICefRequestContextHandler.OnRequestContextInitialized is called.
/// Request context preferences are registered each time a new
/// ICefRequestContext is created. It is intended but not required that all
/// request contexts have the same registered preferences. See related
/// TCefRequestContextSettings.cache_path and
2023-12-15 18:06:46 +01:00
/// TCefRequestContextSettings.persist_user_preferences configuration.</para>
/// <para>Do not keep a reference to the |registrar| object. This function is called
/// on the browser process UI thread.</para>
2023-08-03 15:50:13 +02:00
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnRegisterCustomPreferences( type_: TCefPreferencesType; registrar: PCefPreferenceRegistrar) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called on the browser process UI thread immediately after the CEF context
/// has been initialized.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnContextInitialized;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called before a child process is launched. Will be called on the browser
/// process UI thread when launching a render process and on the browser
/// process IO thread when launching a GPU process. Provides an opportunity to
/// modify the child process command line. Do not keep a reference to
/// |command_line| outside of this function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnBeforeChildProcessLaunch( const commandLine: ICefCommandLine) ;
2023-08-03 15:50:13 +02:00
/// <summary>
2023-12-15 18:06:46 +01:00
/// <para>Implement this function to provide app-specific behavior when an already
/// running app is relaunched with the same TCefSettings.root_cache_path value.
/// For example, activate an existing app window or create a new app window.
/// |command_line| will be read-only. Do not keep a reference to
/// |command_line| outside of this function. Return true (1) if the relaunch
/// is handled or false (0) for default relaunch behavior. Default behavior
/// will create a new default styled Chrome window.</para>
/// <para>To avoid cache corruption only a single app instance is allowed to run for
/// a given TCefSettings.root_cache_path value. On relaunch the app checks a
/// process singleton lock and then forwards the new launch arguments to the
/// already running app process before exiting early. Client apps should
/// therefore check the cef_initialize() return value for early exit before
/// proceeding.</para>
/// <para>This function will be called on the browser process UI thread.</para>
/// </summary>
procedure OnAlreadyRunningAppRelaunch( const commandLine: ICefCommandLine; const current_directory: ustring; var aResult: boolean ) ;
/// <summary>
2023-08-03 15:50:13 +02:00
/// Called from any thread when work has been scheduled for the browser
/// process main (UI) thread. This callback is used in combination with
/// TCefSettings.external_message_pump and GlobalCEFApp.DoMessageLoopWork in
/// cases where the CEF message loop must be integrated into an existing
/// application message loop (see additional comments and warnings on
/// GlobalCEFApp.DoMessageLoopWork). This callback should schedule a
/// GlobalCEFApp.DoMessageLoopWork call to happen on the main (UI) thread.
/// |delay_ms| is the requested delay in milliseconds. If |delay_ms| is <= 0
/// then the call should happen reasonably soon. If |delay_ms| is > 0 then the
/// call should be scheduled to happen after the specified delay and any
/// currently pending scheduled call should be cancelled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnScheduleMessagePumpWork( const delayMs: Int64 ) ;
2023-08-03 15:50:13 +02:00
/// <summary>
2024-02-24 12:01:31 +01:00
/// Return the default client for use with a newly created browser window
/// (TCefBrowser object). If null is returned the TCefBrowser will be
/// unmanaged (no callbacks will be executed for that TCefBrowser) and
/// application shutdown will be blocked until the browser window is closed
/// manually. This function is currently only used with the Chrome runtime
/// when creating new browser windows via Chrome UI.
2023-08-03 15:50:13 +02:00
/// </summary>
2020-11-19 18:55:17 +01:00
procedure GetDefaultClient( var aClient : ICefClient) ;
2023-07-30 18:47:35 +02:00
/// <summary>
2024-02-24 12:01:31 +01:00
/// Return the default handler for use with a new user or incognito profile
/// (TCefRequestContext object). If null is returned the
/// TCefRequestContext will be unmanaged (no callbacks will be executed for
/// that TCefRequestContext). This function is currently only used with the
/// Chrome runtime when creating new browser windows via Chrome UI.
/// </summary>
procedure GetDefaultRequestContextHandler( var aRequestContextHandler : ICefRequestContextHandler) ;
/// <summary>
2023-07-30 18:47:35 +02:00
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to implement render process callbacks. The functions of this
/// interface will be called on the render process main thread (TID_RENDERER)
/// unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRenderProcessHandler">Implements TCefRenderProcessHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_render_process_handler_capi.h">CEF source file: /include/capi/cef_render_process_handler_capi.h (cef_render_process_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRenderProcessHandler = interface( ICefBaseRefCounted)
[ '{FADEE3BC-BF66-430A-BA5D-1EE3782ECC58}' ]
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called after WebKit has been initialized.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnWebKitInitialized;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called after a browser has been created. When browsing cross-origin a new
/// browser will be created before the old browser with the same identifier is
/// destroyed. |extra_info| is an optional read-only value originating from
/// cef_browser_host_create_browser(),
/// cef_browser_host_create_browser_sync(),
/// ICefLifeSpanHandler.OnBeforePopup or
/// cef_browser_view_create().
/// </summary>
2019-06-16 10:31:13 +02:00
procedure OnBrowserCreated( const browser: ICefBrowser; const extra_info: ICefDictionaryValue) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called before a browser is destroyed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnBrowserDestroyed( const browser: ICefBrowser) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Return the handler for browser load status events.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLoadHandler : ICefLoadHandler;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called immediately after the V8 context for a frame has been created. To
/// retrieve the JavaScript 'window' object use the
/// ICefv8context.GetGlobal function. V8 handles can only be accessed
/// from the thread on which they are created. A task runner for posting tasks
/// on the associated thread can be retrieved via the
/// ICefv8context.GetTaskRunner() function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnContextCreated( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called immediately before the V8 context for a frame is released. No
/// references to the context should be kept after this function is called.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnContextReleased( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called for global uncaught exceptions in a frame. Execution of this
/// callback is disabled by default. To enable set
/// TCefSettings.uncaught_exception_stack_size > 0.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnUncaughtException( const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const V8Exception: ICefV8Exception; const stackTrace: ICefV8StackTrace) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called when a new node in the the browser gets focus. The |node| value may
/// be NULL if no specific node has gained focus. The node object passed to
/// this function represents a snapshot of the DOM at the time this function
/// is executed. DOM objects are only valid for the scope of this function. Do
/// not keep references to or attempt to access any DOM objects outside the
/// scope of this function.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnFocusedNodeChanged( const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called when a new message is received from a different process. Return
/// true (1) if the message was handled or false (0) otherwise. It is safe to
/// keep a reference to |message| outside of this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
function OnProcessMessageReceived( const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to provide handler implementations. Methods will be
/// called by the process and/or thread indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefApp">Implements TCefApp</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_app_capi.h">CEF source file: /include/capi/cef_app_capi.h (cef_app_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefApp = interface( ICefBaseRefCounted)
[ '{970CA670-9070-4642-B188-7D8A22DAEED4}' ]
2023-08-03 15:50:13 +02:00
/// <summary>
/// Provides an opportunity to view and/or modify command-line arguments
/// before processing by CEF and Chromium. The |process_type| value will be
/// NULL for the browser process. Do not keep a reference to the
2023-08-08 18:55:10 +02:00
/// ICefCommandLine object passed to this function. The
/// TCefSettings.command_line_args_disabled value can be used to start with
2023-08-03 15:50:13 +02:00
/// an NULL command-line object. Any values specified in CefSettings that
/// equate to command-line arguments will be set before this function is
/// called. Be cautious when using this function to modify command-line
/// arguments for non-browser processes as this may result in undefined
/// behavior including crashes.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnBeforeCommandLineProcessing( const processType: ustring; const commandLine: ICefCommandLine) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Provides an opportunity to register custom schemes. Do not keep a
/// reference to the |registrar| object. This function is called on the main
/// thread for each process and the registered schemes should be the same
/// across all processes.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnRegisterCustomSchemes( const registrar: TCefSchemeRegistrarRef) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Return the handler for resource bundle events. If
2023-08-08 18:55:10 +02:00
/// TCefSettings.pack_loading_disabled is true (1) a handler must be
2023-08-03 15:50:13 +02:00
/// returned. If no handler is returned resources will be loaded from pack
/// files. This function is called by the browser and render processes on
/// multiple threads.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetResourceBundleHandler( var aHandler : ICefResourceBundleHandler) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Return the handler for functionality specific to the browser process. This
/// function is called on multiple threads in the browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetBrowserProcessHandler( var aHandler : ICefBrowserProcessHandler) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Return the handler for functionality specific to the render process. This
/// function is called on the render process main thread.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetRenderProcessHandler( var aHandler : ICefRenderProcessHandler) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Generic callback interface used for asynchronous completion.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCompletionCallback">Implements TCefCompletionCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_callback_capi.h">CEF source file: /include/capi/cef_callback_capi.h (cef_completion_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCompletionCallback = interface( ICefBaseRefCounted)
[ '{A8ECCFBB-FEE0-446F-AB32-AD69A7478D57}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be called once the task is complete.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnComplete;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface to implement to be notified of asynchronous completion via
/// ICefCookieManager.SetCookie.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSetCookieCallback">Implements TCefSetCookieCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_cookie_capi.h">CEF source file: /include/capi/cef_cookie_capi.h (cef_set_cookie_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefSetCookieCallback = interface( ICefBaseRefCounted)
[ '{16E14B6F-CB0A-4F9D-A008-239E0BC7B892}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be called upon completion. |success| will be true (1) if
/// the cookie was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnComplete( success: Boolean ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface to implement to be notified of asynchronous completion via
/// ICefCookieManager.DeleteCookies.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDeleteCookiesCallback">Implements TCefDeleteCookiesCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_cookie_capi.h">CEF source file: /include/capi/cef_cookie_capi.h (cef_delete_cookies_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDeleteCookiesCallback = interface( ICefBaseRefCounted)
[ '{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Method that will be called upon completion. |num_deleted| will be the
/// number of cookies that were deleted.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnComplete( numDeleted: Integer ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used for managing cookies. The functions of this interface may be
/// called on any thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCookieManager">Implements TCefCookieManager</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_cookie_capi.h">CEF source file: /include/capi/cef_cookie_capi.h (cef_cookie_manager_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCookieManager = Interface( ICefBaseRefCounted)
[ '{CC1749E6-9AD3-4283-8430-AF6CBF3E8785}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Visit all cookies on the UI thread. The returned cookies are ordered by
/// longest path, then by earliest creation date. Returns false (0) if cookies
/// cannot be accessed.
/// </summary>
2018-05-12 14:50:54 +02:00
function VisitAllCookies( const visitor: ICefCookieVisitor) : Boolean ;
function VisitAllCookiesProc( const visitor: TCefCookieVisitorProc) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Visit a subset of cookies on the UI thread. The results are filtered by
/// the given url scheme, host, domain and path. If |includeHttpOnly| is true
/// (1) HTTP-only cookies will also be included in the results. The returned
/// cookies are ordered by longest path, then by earliest creation date.
/// Returns false (0) if cookies cannot be accessed.
/// </summary>
2018-05-12 14:50:54 +02:00
function VisitUrlCookies( const url: ustring; includeHttpOnly: Boolean ; const visitor: ICefCookieVisitor) : Boolean ;
function VisitUrlCookiesProc( const url: ustring; includeHttpOnly: Boolean ; const visitor: TCefCookieVisitorProc) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets a cookie given a valid URL and explicit user-provided cookie
/// attributes. This function expects each attribute to be well-formed. It
/// will check for disallowed characters (e.g. the ';' character is disallowed
/// within the cookie value attribute) and fail without setting the cookie if
/// such characters are found. If |callback| is non-NULL it will be executed
/// asnychronously on the UI thread after the cookie has been set. Returns
/// false (0) if an invalid URL is specified or if cookies cannot be accessed.
/// </summary>
2020-05-23 15:00:44 +02:00
function SetCookie( const url, name , value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; same_site : TCefCookieSameSite; priority : TCefCookiePriority; const callback: ICefSetCookieCallback) : Boolean ;
function SetCookieProc( const url: ustring; const name , value, domain, path: ustring; secure, httponly, hasExpires: Boolean ; const creation, lastAccess, expires: TDateTime; same_site : TCefCookieSameSite; priority : TCefCookiePriority; const callback: TCefSetCookieCallbackProc) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Delete all cookies that match the specified parameters. If both |url| and
/// |cookie_name| values are specified all host and domain cookies matching
/// both will be deleted. If only |url| is specified all host cookies (but not
/// domain cookies) irrespective of path will be deleted. If |url| is NULL all
/// cookies for all hosts and domains will be deleted. If |callback| is non-
/// NULL it will be executed asnychronously on the UI thread after the cookies
/// have been deleted. Returns false (0) if a non-NULL invalid URL is
/// specified or if cookies cannot be accessed. Cookies can alternately be
/// deleted using the Visit*Cookies() functions.
/// </summary>
2018-05-12 14:50:54 +02:00
function DeleteCookies( const url, cookieName: ustring; const callback: ICefDeleteCookiesCallback) : Boolean ;
function DeleteCookiesProc( const url, cookieName: ustring; const callback: TCefDeleteCookiesCallbackProc) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Flush the backing store (if any) to disk. If |callback| is non-NULL it
/// will be executed asnychronously on the UI thread after the flush is
/// complete. Returns false (0) if cookies cannot be accessed.
/// </summary>
2019-11-20 10:45:46 +01:00
function FlushStore( const callback: ICefCompletionCallback) : Boolean ;
2018-05-12 14:50:54 +02:00
function FlushStoreProc( const proc: TCefCompletionCallbackProc) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Generic callback interface used for asynchronous continuation.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCallback">Implements TCefCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_callback_capi.h">CEF source file: /include/capi/cef_callback_capi.h (cef_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefCallback = interface( ICefBaseRefCounted)
[ '{1B8C449F-E2D6-4B78-9BBA-6F47E8BCDF37}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Continue processing.
/// </summary>
procedure Cont;
/// <summary>
/// Cancel processing.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback for asynchronous continuation of ICefResourceHandler.skip.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceSkipCallback">Implements TCefResourceSkipCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_handler_capi.h">CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_skip_callback_t)</see></para>
/// </remarks>
2019-06-16 10:31:13 +02:00
ICefResourceSkipCallback = interface( ICefBaseRefCounted)
[ '{5ADDE93E-5858-41FD-81E8-ED8BF710D92A}' ]
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback for asynchronous continuation of skip(). If |bytes_skipped| > 0
/// then either skip() will be called again until the requested number of
/// bytes have been skipped or the request will proceed. If |bytes_skipped| <=
/// 0 the request will fail with ERR_REQUEST_RANGE_NOT_SATISFIABLE.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure Cont( bytes_skipped: int64 ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback for asynchronous continuation of ICefResourceHandler.read.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceReadCallback">Implements TCefResourceReadCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_handler_capi.h">CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_read_callback_t)</see></para>
/// </remarks>
2019-06-16 10:31:13 +02:00
ICefResourceReadCallback = interface( ICefBaseRefCounted)
[ '{7669335F-7A4B-4657-86CA-C02B12369602}' ]
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback for asynchronous continuation of read(). If |bytes_read| == 0 the
/// response will be considered complete. If |bytes_read| > 0 then read() will
/// be called again until the request is complete (based on either the result
/// or the expected content length). If |bytes_read| < 0 then the request will
/// fail and the |bytes_read| value will be treated as the error code.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure Cont( bytes_read: int64 ) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to implement a custom request handler interface. The
/// functions of this interface will be called on the IO thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceHandler">Implements TCefResourceHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_handler_capi.h">CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResourceHandler = interface( ICefBaseRefCounted)
2019-06-16 10:31:13 +02:00
[ '{BD3EA208-AAAD-488C-BFF2-76993022F2B5}' ]
2023-07-30 18:47:35 +02:00
/// <summary>
/// Open the response stream. To handle the request immediately set
/// |handle_request| to true (1) and return true (1). To decide at a later
/// time set |handle_request| to false (0), return true (1), and execute
/// |callback| to continue or cancel the request. To cancel the request
/// immediately set |handle_request| to true (1) and return false (0). This
/// function will be called in sequence but not from a dedicated thread. For
/// backwards compatibility set |handle_request| to false (0) and return false
/// (0) and the ProcessRequest function will be called.
/// </summary>
2019-06-16 10:31:13 +02:00
function open( const request: ICefRequest; var handle_request: boolean ; const callback: ICefCallback) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Begin processing the request. To handle the request return true (1) and
/// call ICefCallback.cont() once the response header information is
/// available (ICefCallback.cont() can also be called from inside this
/// function if header information is available immediately). To cancel the
/// request return false (0).
/// </summary>
/// <remarks>
2024-05-28 15:50:48 +02:00
/// <para>WARNING: This function is deprecated. Use Open instead.</para>
2023-07-30 18:47:35 +02:00
/// </remarks>
function ProcessRequest( const request: ICefRequest; const callback: ICefCallback) : boolean ;
/// <summary>
/// Retrieve response header information. If the response length is not known
/// set |response_length| to -1 and read_response() will be called until it
/// returns false (0). If the response length is known set |response_length|
/// to a positive value and read_response() will be called until it returns
/// false (0) or the specified number of bytes have been read. Use the
/// |response| object to set the mime type, http status code and other
/// optional header values. To redirect the request to a new URL set
/// |redirectUrl| to the new URL. |redirectUrl| can be either a relative or
/// fully qualified URL. It is also possible to set |response| to a redirect
/// http status code and pass the new URL via a Location header. Likewise with
/// |redirectUrl| it is valid to set a relative or fully qualified URL as the
/// Location header value. If an error occured while setting up the request
/// you can call set_error() on |response| to indicate the error condition.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetResponseHeaders( const response: ICefResponse; out responseLength: Int64 ; out redirectUrl: ustring) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Skip response data when requested by a Range header. Skip over and discard
/// |bytes_to_skip| bytes of response data. If data is available immediately
/// set |bytes_skipped| to the number of bytes skipped and return true (1). To
/// read the data at a later time set |bytes_skipped| to 0, return true (1)
/// and execute |callback| when the data is available. To indicate failure set
/// |bytes_skipped| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
/// function will be called in sequence but not from a dedicated thread.
/// </summary>
2019-06-16 10:31:13 +02:00
function skip( bytes_to_skip: int64 ; var bytes_skipped: Int64 ; const callback: ICefResourceSkipCallback) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Read response data. If data is available immediately copy up to
/// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
/// bytes copied, and return true (1). To read the data at a later time keep a
/// pointer to |data_out|, set |bytes_read| to 0, return true (1) and execute
/// |callback| when the data is available (|data_out| will remain valid until
/// the callback is executed). To indicate response completion set
/// |bytes_read| to 0 and return false (0). To indicate failure set
/// |bytes_read| to < 0 (e.g. -2 for ERR_FAILED) and return false (0). This
/// function will be called in sequence but not from a dedicated thread. For
/// backwards compatibility set |bytes_read| to -1 and return false (0) and
/// the ReadResponse function will be called.
/// </summary>
2019-06-16 10:31:13 +02:00
function read( const data_out: Pointer ; bytes_to_read: Integer ; var bytes_read: Integer ; const callback: ICefResourceReadCallback) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Read response data. If data is available immediately copy up to
/// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
/// bytes copied, and return true (1). To read the data at a later time set
/// |bytes_read| to 0, return true (1) and call ICefCallback.cont() when
/// the data is available. To indicate response completion return false (0).
/// </summary>
/// <remarks>
2024-05-28 15:50:48 +02:00
/// <para>WARNING: This function is deprecated. Use Skip and Read instead.</para>
2023-07-30 18:47:35 +02:00
/// </remarks>
function ReadResponse( const dataOut: Pointer ; bytesToRead: Integer ; var bytesRead: Integer ; const callback: ICefCallback) : boolean ;
/// <summary>
/// Request processing has been canceled.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that creates ICefResourceHandler instances for handling scheme
/// requests. The functions of this interface will always be called on the IO
/// thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSchemeHandlerFactory">Implements TCefSchemeHandlerFactory</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_scheme_capi.h">CEF source file: /include/capi/cef_scheme_capi.h (cef_scheme_handler_factory_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefSchemeHandlerFactory = interface( ICefBaseRefCounted)
[ '{4D9B7960-B73B-4EBD-9ABE-6C1C43C245EB}' ]
2023-11-05 16:53:22 +01:00
/// <summary>
/// Return a new resource handler instance to handle the request or an NULL
/// reference to allow default handling of the request. |browser| and |frame|
/// will be the browser window and frame respectively that originated the
/// request or NULL if the request did not originate from a browser window
/// (for example, if the request came from ICefUrlRequest). The |request|
/// object passed to this function cannot be modified.
/// </summary>
2018-05-12 14:50:54 +02:00
function New( const browser: ICefBrowser; const frame: ICefFrame; const schemeName: ustring; const request: ICefRequest) : ICefResourceHandler;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for asynchronous continuation of authentication
/// requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefAuthCallback">Implements TCefAuthCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_auth_callback_capi.h">CEF source file: /include/capi/cef_auth_callback_capi.h (cef_auth_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefAuthCallback = interface( ICefBaseRefCounted)
[ '{500C2023-BF4D-4FF7-9C04-165E5C389131}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Continue the authentication request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cont( const username, password: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Cancel the authentication request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for asynchronous continuation of JavaScript dialog
/// requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefJsDialogCallback">Implements TCefJsDialogCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_jsdialog_handler_capi.h">CEF source file: /include/capi/cef_jsdialog_handler_capi.h (cef_jsdialog_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefJsDialogCallback = interface( ICefBaseRefCounted)
[ '{187B2156-9947-4108-87AB-32E559E1B026}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Continue the JS dialog request. Set |success| to true (1) if the OK button
/// was pressed. The |user_input| value should be specified for prompt
/// dialogs.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cont( success: Boolean ; const userInput: ustring) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Provides information about the context menu state. The functions of this
/// interface can only be accessed on browser process the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefContextMenuParams">Implements TCefContextMenuParams</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_context_menu_handler_capi.h">CEF source file: /include/capi/cef_context_menu_handler_capi.h (cef_context_menu_params_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefContextMenuParams = interface( ICefBaseRefCounted)
[ '{E31BFA9E-D4E2-49B7-A05D-20018C8794EB}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the X coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetXCoord: Integer ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the Y coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetYCoord: Integer ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns flags representing the type of node that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTypeFlags: TCefContextMenuTypeFlags;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the link, if any, that encloses the node that the
/// context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLinkUrl: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the link URL, if any, to be used ONLY for "copy link address". We
/// don't validate this field in the frontend process.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUnfilteredLinkUrl: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the source URL, if any, for the element that the context menu was
/// invoked on. Example of elements with source URLs are img, audio, and
/// video.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSourceUrl: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if the context menu was invoked on an image which has
/// non-NULL contents.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasImageContents: Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the title text or the alt text if the context menu was invoked on
/// an image.
2023-08-09 19:38:57 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTitleText: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the top level page that the context menu was invoked
/// on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPageUrl: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the subframe that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrameUrl: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the character encoding of the subframe that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFrameCharset: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the type of context node that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMediaType: TCefContextMenuMediaType;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns flags representing the actions supported by the media element, if
/// any, that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMediaStateFlags: TCefContextMenuMediaStateFlags;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the text of the selection, if any, that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSelectionText: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the text of the misspelled word, if any, that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetMisspelledWord: ustring;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if suggestions exist, false (0) otherwise. Fills in
/// |suggestions| from the spell check service for the misspelled word if
/// there is one.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDictionarySuggestions( const suggestions: TStringList) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if the context menu was invoked on an editable node.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEditable: Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if the context menu was invoked on an editable node where
/// spell-check is enabled.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSpellCheckEnabled: Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns flags representing the actions supported by the editable node, if
/// any, that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetEditStateFlags: TCefContextMenuEditStateFlags;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns true (1) if the context menu contains items specified by the
/// renderer process.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsCustomMenu: Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the X coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
/// </summary>
2018-05-12 14:50:54 +02:00
property XCoord : Integer read GetXCoord;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the Y coordinate of the mouse where the context menu was invoked.
/// Coords are relative to the associated RenderView's origin.
/// </summary>
2018-05-12 14:50:54 +02:00
property YCoord : Integer read GetYCoord;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns flags representing the type of node that the context menu was
/// invoked on.
2023-08-09 19:38:57 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
property TypeFlags : TCefContextMenuTypeFlags read GetTypeFlags;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the link, if any, that encloses the node that the
/// context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property LinkUrl : ustring read GetLinkUrl;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the link URL, if any, to be used ONLY for "copy link address". We
/// don't validate this field in the frontend process.
/// </summary>
2018-05-12 14:50:54 +02:00
property UnfilteredLinkUrl : ustring read GetUnfilteredLinkUrl;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the source URL, if any, for the element that the context menu was
/// invoked on. Example of elements with source URLs are img, audio, and
/// video.
/// </summary>
2018-05-12 14:50:54 +02:00
property SourceUrl : ustring read GetSourceUrl;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the title text or the alt text if the context menu was invoked on
/// an image.
/// </summary>
2018-05-12 14:50:54 +02:00
property TitleText : ustring read GetTitleText;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the top level page that the context menu was invoked
/// on.
/// </summary>
2018-05-12 14:50:54 +02:00
property PageUrl : ustring read GetPageUrl;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the URL of the subframe that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property FrameUrl : ustring read GetFrameUrl;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the character encoding of the subframe that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property FrameCharset : ustring read GetFrameCharset;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the type of context node that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property MediaType : TCefContextMenuMediaType read GetMediaType;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns flags representing the actions supported by the media element, if
/// any, that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property MediaStateFlags : TCefContextMenuMediaStateFlags read GetMediaStateFlags;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the text of the selection, if any, that the context menu was
/// invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionText : ustring read GetSelectionText;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Returns the text of the misspelled word, if any, that the context menu was
/// invoked on.
/// </summary>
property MisspelledWord : ustring read GetMisspelledWord;
/// <summary>
/// Returns flags representing the actions supported by the editable node, if
/// any, that the context menu was invoked on.
/// </summary>
2018-05-12 14:50:54 +02:00
property EditStateFlags : TCefContextMenuEditStateFlags read GetEditStateFlags;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Supports creation and modification of menus. See TCefMenuId for the
/// command ids that have default implementations. All user-defined command ids
/// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of
/// this interface can only be accessed on the browser process the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMenuModel">Implements TCefMenuModel</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_menu_model_capi.h">CEF source file: /include/capi/cef_menu_model_capi.h (cef_menu_model_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefMenuModel = interface( ICefBaseRefCounted)
[ '{40AF19D3-8B4E-44B8-8F89-DEB5907FC495}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this menu is a submenu.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSubMenu: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clears the menu. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function Clear: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of items in this menu.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a separator to the menu. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddSeparator: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add an item to the menu. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddItem( commandId: Integer ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a check item to the menu. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddCheckItem( commandId: Integer ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a radio item to the menu. Only a single item with the specified
/// |group_id| can be checked at a time. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddRadioItem( commandId: Integer ; const text : ustring; groupId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a sub-menu to the menu. The new sub-menu is returned.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddSubMenu( commandId: Integer ; const text : ustring) : ICefMenuModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert a separator in the menu at the specified |index|. Returns true (1)
/// on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function InsertSeparatorAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert an item in the menu at the specified |index|. Returns true (1) on
/// success.
/// </summary>
2022-09-04 19:18:07 +02:00
function InsertItemAt( index : NativeUInt ; commandId: Integer ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert a check item in the menu at the specified |index|. Returns true (1)
/// on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function InsertCheckItemAt( index : NativeUInt ; commandId: Integer ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert a radio item in the menu at the specified |index|. Only a single
/// item with the specified |group_id| can be checked at a time. Returns true
/// (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function InsertRadioItemAt( index : NativeUInt ; commandId: Integer ; const text : ustring; groupId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
/// is returned.
/// </summary>
2022-09-04 19:18:07 +02:00
function InsertSubMenuAt( index : NativeUInt ; commandId: Integer ; const text : ustring) : ICefMenuModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes the item with the specified |command_id|. Returns true (1) on
/// success.
/// </summary>
2018-05-12 14:50:54 +02:00
function Remove( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes the item at the specified |index|. Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function RemoveAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the index associated with the specified |command_id| or -1 if not
/// found due to the command id not existing in the menu.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIndexOf( commandId: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the command id at the specified |index| or -1 if not found due to
/// invalid range or the index being a separator.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetCommandIdAt( index : NativeUInt ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the command id at the specified |index|. Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetCommandIdAt( index : NativeUInt ; commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the label for the specified |command_id| or NULL if not found.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLabel( commandId: Integer ) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the label at the specified |index| or NULL if not found due to
/// invalid range or the index being a separator.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetLabelAt( index : NativeUInt ) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the label for the specified |command_id|. Returns true (1) on
/// success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetLabel( commandId: Integer ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the label at the specified |index|. Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetLabelAt( index : NativeUInt ; const text : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the item type for the specified |command_id|.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType( commandId: Integer ) : TCefMenuItemType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the item type at the specified |index|.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetTypeAt( index : NativeUInt ) : TCefMenuItemType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the group id for the specified |command_id| or -1 if invalid.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetGroupId( commandId: Integer ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the group id at the specified |index| or -1 if invalid.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetGroupIdAt( index : NativeUInt ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the group id for the specified |command_id|. Returns true (1) on
/// success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetGroupId( commandId, groupId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the group id at the specified |index|. Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetGroupIdAt( index : NativeUInt ; groupId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the submenu for the specified |command_id| or NULL if invalid.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSubMenu( commandId: Integer ) : ICefMenuModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the submenu at the specified |index| or NULL if invalid.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetSubMenuAt( index : NativeUInt ) : ICefMenuModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |command_id| is visible.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsVisible( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |index| is visible.
/// </summary>
2022-09-04 19:18:07 +02:00
function isVisibleAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Change the visibility of the specified |command_id|. Returns true (1) on
/// success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetVisible( commandId: Integer ; visible: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Change the visibility at the specified |index|. Returns true (1) on
/// success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetVisibleAt( index : NativeUInt ; visible: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |command_id| is enabled.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEnabled( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |index| is enabled.
/// </summary>
2022-09-04 19:18:07 +02:00
function IsEnabledAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Change the enabled status of the specified |command_id|. Returns true (1)
/// on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetEnabled( commandId: Integer ; enabled: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Change the enabled status at the specified |index|. Returns true (1) on
/// success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetEnabledAt( index : NativeUInt ; enabled: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |command_id| is checked. Only applies to
/// check and radio items.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsChecked( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |index| is checked. Only applies to
/// check and radio items.
/// </summary>
2022-09-04 19:18:07 +02:00
function IsCheckedAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Check the specified |command_id|. Only applies to check and radio items.
/// Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function setChecked( commandId: Integer ; checked: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Check the specified |index|. Only applies to check and radio items.
/// Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function setCheckedAt( index : NativeUInt ; checked: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |command_id| has a keyboard accelerator
/// assigned.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasAccelerator( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the specified |index| has a keyboard accelerator
/// assigned.
/// </summary>
2022-09-04 19:18:07 +02:00
function HasAcceleratorAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the keyboard accelerator for the specified |command_id|. |key_code|
/// can be any virtual key or character value. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetAccelerator( commandId, keyCode: Integer ; shiftPressed, ctrlPressed, altPressed: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the keyboard accelerator at the specified |index|. |key_code| can be
/// any virtual key or character value. Returns true (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function SetAcceleratorAt( index : NativeUInt ; keyCode: Integer ; shiftPressed, ctrlPressed, altPressed: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Remove the keyboard accelerator for the specified |command_id|. Returns
/// true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function RemoveAccelerator( commandId: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Remove the keyboard accelerator at the specified |index|. Returns true (1)
/// on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function RemoveAcceleratorAt( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieves the keyboard accelerator for the specified |command_id|. Returns
/// true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetAccelerator( commandId: Integer ; out keyCode: Integer ; out shiftPressed, ctrlPressed, altPressed: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieves the keyboard accelerator for the specified |index|. Returns true
/// (1) on success.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetAcceleratorAt( index : NativeUInt ; out keyCode: Integer ; out shiftPressed, ctrlPressed, altPressed: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the explicit color for |command_id| and |color_type| to |color|.
/// Specify a |color| value of 0 to remove the explicit color. If no explicit
/// color or default color is set for |color_type| then the system color will
/// be used. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetColor( commandId: Integer ; colorType: TCefMenuColorType; color: TCefColor) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the explicit color for |command_id| and |index| to |color|. Specify a
/// |color| value of 0 to remove the explicit color. Specify an |index| value
/// of -1 to set the default color for items that do not have an explicit
/// color set. If no explicit color or default color is set for |color_type|
/// then the system color will be used. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetColorAt( index : Integer ; colorType: TCefMenuColorType; color: TCefColor) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns in |color| the color that was explicitly set for |command_id| and
/// |color_type|. If a color was not set then 0 will be returned in |color|.
/// Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetColor( commandId: Integer ; colorType: TCefMenuColorType; out color: TCefColor) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns in |color| the color that was explicitly set for |command_id| and
/// |color_type|. Specify an |index| value of -1 to return the default color
/// in |color|. If a color was not set then 0 will be returned in |color|.
/// Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetColorAt( index : Integer ; colorType: TCefMenuColorType; out color: TCefColor) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the font list for the specified |command_id|. If |font_list| is NULL
/// the system font will be used. Returns true (1) on success. The format is
2024-02-01 15:13:22 +01:00
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names
2023-08-07 20:21:42 +02:00
/// (case-sensitive "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
2024-02-01 15:13:22 +01:00
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function SetFontList( commandId: Integer ; const fontList: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the font list for the specified |index|. Specify an |index| value of
/// -1 to set the default font. If |font_list| is NULL the system font will be
/// used. Returns true (1) on success. The format is
2024-02-01 15:13:22 +01:00
/// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names
2023-08-07 20:21:42 +02:00
/// (case-sensitive "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
2024-02-01 15:13:22 +01:00
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function SetFontListAt( index : Integer ; const fontList: ustring) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that wraps other data value types. Complex types (binary,
/// dictionary and list) will be referenced but not owned by this object. Can be
/// used on any process and thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefValue">Implements TCefValue</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_values_capi.h">CEF source file: /include/capi/cef_values_capi.h (cef_value_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefValue = interface( ICefBaseRefCounted)
[ '{66F9F439-B12B-4EC3-A945-91AE4EF4D4BA}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying data is valid. This will always be true
/// (1) for simple types. For complex types (binary, dictionary and list) the
/// underlying data may become invalid if owned by another object (e.g. list
/// or dictionary) and that other object is then modified or destroyed. This
/// value object can be re-used by calling Set*() even if the underlying data
/// is invalid.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying data is owned by another object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsOwned: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the underlying data is read-only. Some APIs may expose
/// read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have the same underlying
/// data. If true (1) modifications to this object will also affect |that|
/// object and vice-versa.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have an equivalent
/// underlying value but are not necessarily the same object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEqual( const that: ICefValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a copy of this object. The underlying data will also be copied.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy: ICefValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value type.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType: TCefValueType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type bool.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBool: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type int.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetInt: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type double.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDouble: Double ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetString: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type binary. The returned reference may
/// become invalid if the value is owned by another object or if ownership is
/// transferred to another object in the future. To maintain a reference to
/// the value after assigning ownership to a dictionary or list pass this
/// object to the set_value() function instead of passing the returned
/// reference to set_binary().
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBinary: ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type dictionary. The returned reference
/// may become invalid if the value is owned by another object or if ownership
/// is transferred to another object in the future. To maintain a reference to
/// the value after assigning ownership to a dictionary or list pass this
/// object to the set_value() function instead of passing the returned
/// reference to set_dictionary().
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDictionary: ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the underlying value as type list. The returned reference may
/// become invalid if the value is owned by another object or if ownership is
/// transferred to another object in the future. To maintain a reference to
/// the value after assigning ownership to a dictionary or list pass this
/// object to the set_value() function instead of passing the returned
/// reference to set_list().
/// </summary>
2018-05-12 14:50:54 +02:00
function GetList: ICefListValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type null. Returns true (1) if the value was
/// set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetNull: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type bool. Returns true (1) if the value was
/// set successfully.
/// </summary>
2019-11-24 18:19:49 +01:00
function SetBool( value: boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type int. Returns true (1) if the value was
/// set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetInt( value: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type double. Returns true (1) if the value
/// was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDouble( value: Double ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type string. Returns true (1) if the value
/// was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetString( const value: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type binary. Returns true (1) if the value
/// was set successfully. This object keeps a reference to |value| and
/// ownership of the underlying data remains unchanged.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetBinary( const value: ICefBinaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type dict. Returns true (1) if the value was
/// set successfully. This object keeps a reference to |value| and ownership
/// of the underlying data remains unchanged.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDictionary( const value: ICefDictionaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the underlying value as type list. Returns true (1) if the value was
/// set successfully. This object keeps a reference to |value| and ownership
/// of the underlying data remains unchanged.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetList( const value: ICefListValue) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a binary value. Can be used on any process and
/// thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBinaryValue">Implements TCefBinaryValue</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_values_capi.h">CEF source file: /include/capi/cef_values_capi.h (cef_binary_value_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefBinaryValue = interface( ICefBaseRefCounted)
[ '{974AA40A-9C5C-4726-81F0-9F0D46D7C5B3}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. This object may become invalid
/// if the underlying data is owned by another object (e.g. list or
/// dictionary) and that other object is then modified or destroyed. Do not
/// call any other functions if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is currently owned by another object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsOwned: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have the same underlying
/// data.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefBinaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have an equivalent
/// underlying value but are not necessarily the same object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEqual( const that: ICefBinaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a copy of this object. The data in this object will also be
/// copied.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy: ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-11-16 16:58:47 +01:00
/// Returns a pointer to the beginning of the memory block. The returned
/// pointer is valid as long as the ICefBinaryValue is alive.
/// </summary>
function GetRawData: Pointer ;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the data size.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSize: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at
/// the specified byte |data_offset|. Returns the number of bytes read.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetData( buffer: Pointer ; bufferSize, dataOffset: NativeUInt ) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the data size.
/// </summary>
2018-05-12 14:50:54 +02:00
property Size : NativeUInt read GetSize;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a dictionary value. Can be used on any process and
/// thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDictionaryValue">Implements TCefDictionaryValue</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_values_capi.h">CEF source file: /include/capi/cef_values_capi.h (cef_dictionary_value_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDictionaryValue = interface( ICefBaseRefCounted)
[ '{B9638559-54DC-498C-8185-233EEF12BC69}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. This object may become invalid
/// if the underlying data is owned by another object (e.g. list or
/// dictionary) and that other object is then modified or destroyed. Do not
/// call any other functions if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is currently owned by another object.
/// </summary>
2018-05-12 14:50:54 +02:00
function isOwned: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have the same underlying
/// data. If true (1) modifications to this object will also affect |that|
/// object and vice-versa.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefDictionaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have an equivalent
/// underlying value but are not necessarily the same object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEqual( const that: ICefDictionaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a writable copy of this object. If |exclude_NULL_children| is true
/// (1) any NULL dictionaries or lists will be excluded from the copy.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy( excludeEmptyChildren: Boolean ) : ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSize: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes all values. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function Clear: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the current dictionary has a value for the given key.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasKey( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reads all keys for this dictionary into the specified vector.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetKeys( const keys: TStrings) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes the value at the specified key. Returns true (1) is the value was
/// removed successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function Remove( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value type for the specified key.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType( const key: ustring) : TCefValueType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key. For simple types the returned
/// value will copy existing data and modifications to the value will not
/// modify this object. For complex types (binary, dictionary and list) the
/// returned value will reference existing data and modifications to the value
/// will modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValue( const key: ustring) : ICefValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type bool.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBool( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type int.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetInt( const key: ustring) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type double.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDouble( const key: ustring) : Double ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetString( const key: ustring) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type binary. The returned value
/// will reference existing data.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBinary( const key: ustring) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type dictionary. The returned
/// value will reference existing data and modifications to the value will
/// modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDictionary( const key: ustring) : ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified key as type list. The returned value
/// will reference existing data and modifications to the value will modify
/// this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetList( const key: ustring) : ICefListValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key. Returns true (1) if the value was set
/// successfully. If |value| represents simple data then the underlying data
/// will be copied and modifications to |value| will not modify this object.
/// If |value| represents complex data (binary, dictionary or list) then the
/// underlying data will be referenced and modifications to |value| will
/// modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetValue( const key: ustring; const value: ICefValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type null. Returns true (1) if the
/// value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetNull( const key: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type bool. Returns true (1) if the
/// value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetBool( const key: ustring; value: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type int. Returns true (1) if the
/// value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetInt( const key: ustring; value: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type double. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDouble( const key: ustring; value: Double ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type string. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetString( const key, value: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type binary. Returns true (1) if
/// the value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetBinary( const key: ustring; const value: ICefBinaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type dict. Returns true (1) if the
/// value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDictionary( const key: ustring; const value: ICefDictionaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified key as type list. Returns true (1) if the
/// value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetList( const key: ustring; const value: ICefListValue) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a list value. Can be used on any process and thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefListValue">Implements TCefListValue</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_values_capi.h">CEF source file: /include/capi/cef_values_capi.h (cef_list_value_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefListValue = interface( ICefBaseRefCounted)
[ '{09174B9D-0CC6-4360-BBB0-3CC0117F70F6}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. This object may become invalid
/// if the underlying data is owned by another object (e.g. list or
/// dictionary) and that other object is then modified or destroyed. Do not
/// call any other functions if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is currently owned by another object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsOwned: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have the same underlying
/// data. If true (1) modifications to this object will also affect |that|
/// object and vice-versa.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefListValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object and |that| object have an equivalent
/// underlying value but are not necessarily the same object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEqual( const that: ICefListValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a writable copy of this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function Copy: ICefListValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the number of values. If the number of values is expanded all new
/// value slots will default to type null. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetSize( size: NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSize: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes all values. Returns true (1) on success.
/// </summary>
2018-05-12 14:50:54 +02:00
function Clear: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes the value at the specified index.
/// </summary>
2018-05-12 14:50:54 +02:00
function Remove( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value type at the specified index.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetType( index : NativeUInt ) : TCefValueType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index. For simple types the returned
/// value will copy existing data and modifications to the value will not
/// modify this object. For complex types (binary, dictionary and list) the
/// returned value will reference existing data and modifications to the value
/// will modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetValue( index : NativeUInt ) : ICefValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type bool.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBool( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type int.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetInt( index : NativeUInt ) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type double.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDouble( index : NativeUInt ) : Double ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type string.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetString( index : NativeUInt ) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type binary. The returned
/// value will reference existing data.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetBinary( index : NativeUInt ) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type dictionary. The returned
/// value will reference existing data and modifications to the value will
/// modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDictionary( index : NativeUInt ) : ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value at the specified index as type list. The returned value
/// will reference existing data and modifications to the value will modify
/// this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetList( index : NativeUInt ) : ICefListValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index. Returns true (1) if the value was
/// set successfully. If |value| represents simple data then the underlying
/// data will be copied and modifications to |value| will not modify this
/// object. If |value| represents complex data (binary, dictionary or list)
/// then the underlying data will be referenced and modifications to |value|
/// will modify this object.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetValue( index : NativeUInt ; const value: ICefValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type null. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetNull( index : NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type bool. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetBool( index : NativeUInt ; value: Boolean ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type int. Returns true (1) if the
/// value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetInt( index : NativeUInt ; value: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type double. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDouble( index : NativeUInt ; value: Double ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type string. Returns true (1) if
/// the value was set successfully.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetString( index : NativeUInt ; const value: ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type binary. Returns true (1) if
/// the value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetBinary( index : NativeUInt ; const value: ICefBinaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type dict. Returns true (1) if
/// the value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetDictionary( index : NativeUInt ; const value: ICefDictionaryValue) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the value at the specified index as type list. Returns true (1) if
/// the value was set successfully. If |value| is currently owned by another
/// object then the value will be copied and the |value| reference will not
/// change. Otherwise, ownership will be transferred to this object and the
/// |value| reference will be invalidated.
/// </summary>
2018-05-12 14:50:54 +02:00
function SetList( index : NativeUInt ; const value: ICefListValue) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser life span. The
/// functions of this interface will be called on the UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefLifeSpanHandler">Implements TCefLifeSpanHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_life_span_handler_capi.h">CEF source file: /include/capi/cef_life_span_handler_capi.h (cef_life_span_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefLifeSpanHandler = interface( ICefBaseRefCounted)
[ '{0A3EB782-A319-4C35-9B46-09B2834D7169}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread before a new popup browser is created. The
/// |browser| and |frame| values represent the source of the popup request.
/// The |target_url| and |target_frame_name| values indicate where the popup
/// browser should navigate and may be NULL if not specified with the request.
/// The |target_disposition| value indicates where the user intended to open
/// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
/// be true (1) if the popup was opened via explicit user gesture (e.g.
/// clicking a link) or false (0) if the popup opened automatically (e.g. via
/// the DomContentLoaded event). The |popupFeatures| structure contains
/// additional information about the requested popup window. To allow creation
/// of the popup browser optionally modify |windowInfo|, |client|, |settings|
/// and |no_javascript_access| and return false (0). To cancel creation of the
/// popup browser return true (1). The |client| and |settings| values will
/// default to the source browser's values. If the |no_javascript_access|
/// value is set to false (0) the new browser will not be scriptable and may
/// not be hosted in the same renderer process as the source browser. Any
/// modifications to |windowInfo| will be ignored if the parent browser is
2023-08-07 20:21:42 +02:00
/// wrapped in a ICefBrowserView. Popup browser creation will be canceled
2023-08-03 22:11:42 +02:00
/// if the parent browser is destroyed before the popup browser creation
/// completes (indicated by a call to OnAfterCreated for the popup browser).
/// The |extra_info| parameter provides an opportunity to specify extra
/// information specific to the created popup browser that will be passed to
2023-08-07 20:21:42 +02:00
/// ICefRenderProcessHandler.OnBrowserCreated in the render process.
2023-08-03 22:11:42 +02:00
/// </summary>
2019-06-16 10:31:13 +02:00
function OnBeforePopup( const browser: ICefBrowser; const frame: ICefFrame; const targetUrl, targetFrameName: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean ; const popupFeatures: TCefPopupFeatures; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var noJavascriptAccess: Boolean ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-11-16 16:58:47 +01:00
/// <para>Called on the UI thread before a new DevTools popup browser is created.
/// The |browser| value represents the source of the popup request. Optionally
/// modify |windowInfo|, |client|, |settings| and |extra_info| values. The
/// |client|, |settings| and |extra_info| values will default to the source
/// browser's values. Any modifications to |windowInfo| will be ignored if the
/// parent browser is Views-hosted (wrapped in a ICefBrowserView).</para>
/// <para>The |extra_info| parameter provides an opportunity to specify extra
/// information specific to the created popup browser that will be passed to
/// ICefRenderProcessHandler.OnBrowserCreated() in the render process.
/// The existing |extra_info| object, if any, will be read-only but may be
/// replaced with a new object.</para>
/// <para>Views-hosted source browsers will create Views-hosted DevTools popups
/// unless |use_default_window| is set to to true (1). DevTools popups can be
/// blocked by returning true (1) from ICefCommandHandler.OnChromeCommand
/// for IDC_DEV_TOOLS. Only used with the Chrome runtime.</para>
/// </summary>
procedure OnBeforeDevToolsPopup( const browser: ICefBrowser; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var use_default_window: boolean ) ;
/// <summary>
2023-08-03 22:11:42 +02:00
/// Called after a new browser is created. It is now safe to begin performing
2023-08-07 20:21:42 +02:00
/// actions with |browser|. ICefFrameHandler callbacks related to initial
2023-08-03 22:11:42 +02:00
/// main frame creation will arrive before this callback. See
2023-08-07 20:21:42 +02:00
/// ICefFrameHandler documentation for additional usage information.
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnAfterCreated( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2024-02-01 15:13:22 +01:00
/// Called when a browser has received a request to close. This may result
2023-08-07 20:21:42 +02:00
/// directly from a call to ICefBrowserHost.*CloseBrowser or indirectly
2023-08-03 22:11:42 +02:00
/// if the browser is parented to a top-level window created by CEF and the
/// user attempts to close that window (by clicking the 'X', for example). The
2023-08-07 20:21:42 +02:00
/// DoClose function will be called after the JavaScript 'onunload' event
2023-08-03 22:11:42 +02:00
/// has been fired.
///
/// An application should handle top-level owner window close notifications by
2023-08-07 20:21:42 +02:00
/// calling ICefBrowserHost.TryCloseBrowser or
/// ICefBrowserHost.CloseBrowser(false) instead of allowing the window
2023-08-03 22:11:42 +02:00
/// to close immediately (see the examples below). This gives CEF an
/// opportunity to process the 'onbeforeunload' event and optionally cancel
2023-08-07 20:21:42 +02:00
/// the close before DoClose is called.
2023-08-03 22:11:42 +02:00
///
/// When windowed rendering is enabled CEF will internally create a window or
2023-08-07 20:21:42 +02:00
/// view to host the browser. In that case returning false (0) from DoClose()
2023-08-03 22:11:42 +02:00
/// will send the standard close notification to the browser's top-level owner
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
2023-08-07 20:21:42 +02:00
/// Linux or ICefWindowDelegate.CanClose callback from Views). If the
2023-08-03 22:11:42 +02:00
/// browser's host window/view has already been destroyed (via view hierarchy
2023-08-07 20:21:42 +02:00
/// tear-down, for example) then DoClose() will not be called for that
2023-08-03 22:11:42 +02:00
/// browser since is no longer possible to cancel the close.
///
2023-08-07 20:21:42 +02:00
/// When windowed rendering is disabled returning false (0) from DoClose()
2023-08-03 22:11:42 +02:00
/// will cause the browser object to be destroyed immediately.
///
/// If the browser's top-level owner window requires a non-standard close
2023-08-07 20:21:42 +02:00
/// notification then send that notification from DoClose() and return true
2023-08-03 22:11:42 +02:00
/// (1).
///
2023-08-07 20:21:42 +02:00
/// The ICefLifeSpanHandler.OnBeforeClose function will be called
/// after DoClose() (if DoClose() is called) and immediately before the
2023-08-03 22:11:42 +02:00
/// browser object is destroyed. The application should only exit after
2023-08-07 20:21:42 +02:00
/// OnBeforeClose() has been called for all existing browsers.
2023-08-03 22:11:42 +02:00
///
/// The below examples describe what should happen during window close when
/// the browser is parented to an application-provided top-level window.
///
2023-08-07 20:21:42 +02:00
/// Example 1: Using ICefBrowserHost.TryCloseBrowser(). This is
2023-08-03 22:11:42 +02:00
/// recommended for clients using standard close handling and windows created
/// on the browser process UI thread.
/// 1. User clicks the window close button which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
/// TryCloseBrowser() returns false so the client cancels the window
/// close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
2023-08-07 20:21:42 +02:00
/// ICefJSDialogHandler.OnBeforeUnloadDialog()).
2023-08-03 22:11:42 +02:00
/// 4. User approves the close.
/// 5. JavaScript 'onunload' handler executes.
/// 6. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false by default).
/// 7. Application's top-level window receives the close notification and
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
/// allows the window close.
/// 8. Application's top-level window is destroyed.
2023-08-07 20:21:42 +02:00
/// 9. Application's OnBeforeClose() handler is called and the browser object is destroyed.
2023-08-03 22:11:42 +02:00
/// 10. Application exits by calling cef_quit_message_loop() if no other browsers exist.
///
2023-08-07 20:21:42 +02:00
/// Example 2: Using ICefBrowserHost::CloseBrowser(false) and
/// implementing the DoClose() callback. This is recommended for clients
2023-08-03 22:11:42 +02:00
/// using non-standard close handling or windows that were not created on the
/// browser process UI thread.
/// 1. User clicks the window close button which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and:
2023-08-07 20:21:42 +02:00
/// A. Calls ICefBrowserHost.CloseBrowser(false).
2023-08-03 22:11:42 +02:00
/// B. Cancels the window close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
2023-08-07 20:21:42 +02:00
/// ICefJSDialogHandler.OnBeforeUnloadDialog()).
2023-08-03 22:11:42 +02:00
/// 4. User approves the close.
/// 5. JavaScript 'onunload' handler executes.
2023-08-07 20:21:42 +02:00
/// 6. Application's DoClose() handler is called. Application will:
2023-08-03 22:11:42 +02:00
/// A. Set a flag to indicate that the next close attempt will be allowed.
/// B. Return false.
/// 7. CEF sends an close notification to the application's top-level window.
/// 8. Application's top-level window receives the close notification and
/// allows the window to close based on the flag from #6B.
/// 9. Application's top-level window is destroyed.
2023-08-07 20:21:42 +02:00
/// 10. Application's OnBeforeClose() handler is called and the browser object is destroyed.
2023-08-03 22:11:42 +02:00
/// 11. Application exits by calling cef_quit_message_loop() if no other browsers exist.
/// </summary>
2018-05-12 14:50:54 +02:00
function DoClose( const browser: ICefBrowser) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called just before a browser is destroyed. Release all references to the
/// browser object and do not attempt to execute any functions on the browser
/// object (other than IsValid, GetIdentifier or IsSame) after this callback
2023-08-07 20:21:42 +02:00
/// returns. ICefFrameHandler callbacks related to final main frame
/// destruction will arrive after this callback and ICefBrowser.IsValid
2023-08-03 22:11:42 +02:00
/// will return false (0) at that time. Any in-progress network requests
/// associated with |browser| will be aborted when the browser is destroyed,
2023-08-07 20:21:42 +02:00
/// and ICefResourceRequestHandler callbacks related to those requests may
/// still arrive on the IO thread after this callback. See ICefFrameHandler
/// and DoClose() documentation for additional usage information.
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnBeforeClose( const browser: ICefBrowser) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to commands. The functions
/// of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCommandHandler">Implements TCefCommandHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_command_handler_capi.h">CEF source file: /include/capi/cef_command_handler_capi.h (cef_command_handler_t)</see></para>
/// </remarks>
2022-05-03 12:43:16 +02:00
ICefCommandHandler = interface( ICefBaseRefCounted)
[ '{7C931B93-53DC-4607-AABB-2CB4AEF7FB96}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to execute a Chrome command triggered via menu selection or
/// keyboard shortcut. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Return true (1) if the command was handled or
/// false (0) for the default implementation. For context menu commands this
2023-08-07 20:21:42 +02:00
/// will be called after ICefContextMenuHandler.OnContextMenuCommand.
2023-08-03 22:11:42 +02:00
/// Only used with the Chrome runtime.
/// </summary>
2022-05-03 12:43:16 +02:00
function OnChromeCommand( const browser: ICefBrowser; command_id: integer ; disposition: TCefWindowOpenDisposition) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to check if a Chrome app menu item should be visible. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be visible by default. Only used with the Chrome
/// runtime.
/// </summary>
2023-04-08 19:00:33 +02:00
function OnIsChromeAppMenuItemVisible( const browser: ICefBrowser; command_id: integer ) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to check if a Chrome app menu item should be enabled. Values for
/// |command_id| can be found in the cef_command_ids.h file. Only called for
/// menu items that would be enabled by default. Only used with the Chrome
/// runtime.
/// </summary>
2023-04-08 19:00:33 +02:00
function OnIsChromeAppMenuItemEnabled( const browser: ICefBrowser; command_id: integer ) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called during browser creation to check if a Chrome page action icon
/// should be visible. Only called for icons that would be visible by default.
/// Only used with the Chrome runtime.
/// </summary>
2023-04-08 19:00:33 +02:00
function OnIsChromePageActionIconVisible( icon_type: TCefChromePageActionIconType) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called during browser creation to check if a Chrome toolbar button should
/// be visible. Only called for buttons that would be visible by default. Only
/// used with the Chrome runtime.
/// </summary>
2023-04-08 19:00:33 +02:00
function OnIsChromeToolbarButtonVisible( button_type: TCefChromeToolbarButtonType) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2022-05-03 12:43:16 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for asynchronous continuation of
/// ICefExtensionHandler.GetExtensionResource.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefGetExtensionResourceCallback">Implements TCefGetExtensionResourceCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_extension_handler_capi.h">CEF source file: /include/capi/cef_extension_handler_capi.h (cef_get_extension_resource_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefGetExtensionResourceCallback = interface( ICefBaseRefCounted)
[ '{579C8602-8252-40D0-9E0A-501F32C36C42}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Continue the request. Read the resource contents from |stream|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure cont( const stream: ICefStreamReader) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel the request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser extensions. The
/// functions of this interface will be called on the UI thread. See
/// ICefRequestContext.LoadExtension for information about extension
/// loading.
/// </summary>
/// <remarks>
2024-05-28 15:50:48 +02:00
/// <para>WARNING: This API is deprecated and will be removed in ~M127.</para>
2023-07-30 18:47:35 +02:00
/// <para><see cref="uCEFTypes|TCefExtensionHandler">Implements TCefExtensionHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_extension_handler_capi.h">CEF source file: /include/capi/cef_extension_handler_capi.h (cef_extension_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefExtensionHandler = interface( ICefBaseRefCounted)
[ '{3234008F-D809-459D-963D-23BA50219648}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Called if the ICefRequestContext.LoadExtension request fails. |result|
2023-08-03 22:11:42 +02:00
/// will be the error code.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnExtensionLoadFailed( result : TCefErrorcode) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Called if the ICefRequestContext.LoadExtension request succeeds.
2023-08-03 22:11:42 +02:00
/// |extension| is the loaded extension.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnExtensionLoaded( const extension: ICefExtension) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Called after the ICefExtension.Unload request has completed.
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnExtensionUnloaded( const extension: ICefExtension) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when an extension needs a browser to host a background script
/// specified via the "background" manifest key. The browser will have no
/// visible window and cannot be displayed. |extension| is the extension that
/// is loading the background script. |url| is an internally generated
/// reference to an HTML page that will be used to load the background script
/// via a "<script>" src attribute. To allow creation of the browser
/// optionally modify |client| and |settings| and return false (0). To cancel
/// creation of the browser (and consequently cancel load of the background
/// script) return true (1). Successful creation will be indicated by a call
2023-08-07 20:21:42 +02:00
/// to ICefLifeSpanHandler.OnAfterCreated, and
/// ICefBrowserHost.IsBackgroundHost will return true (1) for the
2023-08-03 22:11:42 +02:00
/// resulting browser. See https://developer.chrome.com/extensions/event_pages
/// for more information about extension background script usage.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnBeforeBackgroundBrowser( const extension: ICefExtension; const url: ustring; var client: ICefClient; var settings: TCefBrowserSettings) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when an extension API (e.g. chrome.tabs.create) requests creation
/// of a new browser. |extension| and |browser| are the source of the API
/// call. |active_browser| may optionally be specified via the windowId
/// property or returned via the get_active_browser() callback and provides
/// the default |client| and |settings| values for the new browser. |index| is
/// the position value optionally specified via the index property. |url| is
/// the URL that will be loaded in the browser. |active| is true (1) if the
/// new browser should be active when opened. To allow creation of the
/// browser optionally modify |windowInfo|, |client| and |settings| and return
/// false (0). To cancel creation of the browser return true (1). Successful
/// creation will be indicated by a call to
2023-08-07 20:21:42 +02:00
/// ICefLifeSpanHandler.OnAfterCreated. Any modifications to |windowInfo|
/// will be ignored if |active_browser| is wrapped in a ICefBrowserView.
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function OnBeforeBrowser( const extension: ICefExtension; const browser, active_browser: ICefBrowser; index : Integer ; const url: ustring; active: boolean ; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when no tabId is specified to an extension API call that accepts a
/// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
/// source of the API call. Return the browser that will be acted on by the
/// API call or return NULL to act on |browser|. The returned browser must
2023-08-07 20:21:42 +02:00
/// share the same ICefRequestContext as |browser|. Incognito browsers
2023-08-03 22:11:42 +02:00
/// should not be considered unless the source extension has incognito access
/// enabled, in which case |include_incognito| will be true (1).
/// </summary>
2020-08-04 17:52:09 +02:00
procedure GetActiveBrowser( const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean ; var aRsltBrowser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the tabId associated with |target_browser| is specified to an
/// extension API call that accepts a tabId parameter (e.g. chrome.tabs.*).
/// |extension| and |browser| are the source of the API call. Return true (1)
/// to allow access of false (0) to deny access. Access to incognito browsers
/// should not be allowed unless the source extension has incognito access
/// enabled, in which case |include_incognito| will be true (1).
/// </summary>
2018-05-12 14:50:54 +02:00
function CanAccessBrowser( const extension: ICefExtension; const browser: ICefBrowser; include_incognito: boolean ; const target_browser: ICefBrowser) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to retrieve an extension resource that would normally be loaded
/// from disk (e.g. if a file parameter is specified to
/// chrome.tabs.executeScript). |extension| and |browser| are the source of
/// the resource request. |file| is the requested relative file path. To
/// handle the resource request return true (1) and execute |callback| either
/// synchronously or asynchronously. For the default behavior which reads the
/// resource from the extension directory on disk return false (0).
/// Localization substitutions will not be applied to resources handled via
/// this function.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetExtensionResource( const extension: ICefExtension; const browser: ICefBrowser; const file_: ustring; const callback: ICefGetExtensionResourceCallback) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Object representing an extension. Methods may be called on any thread unless
/// otherwise indicated.
/// </summary>
/// <remarks>
2024-05-28 15:50:48 +02:00
/// <para>WARNING: This API is deprecated and will be removed in ~M127.</para>
2023-07-30 18:47:35 +02:00
/// <para><see cref="uCEFTypes|TCefExtension">Implements TCefExtension</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_extension_capi.h">CEF source file: /include/capi/cef_extension_capi.h (cef_extension_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefExtension = interface( ICefBaseRefCounted)
[ '{D30D1C64-A26F-49C0-AEB7-C55EC68951CA}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the unique extension identifier. This is calculated based on the
/// extension public key, if available, or on the extension path. See
/// https://developer.chrome.com/extensions/manifest/key for details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIdentifier : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the absolute path to the extension directory on disk. This value
/// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPath : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns the extension manifest contents as a ICefDictionaryValue
2023-08-07 20:21:42 +02:00
/// object. See https://developer.chrome.com/extensions/manifest for details.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetManifest : ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is the same extension as |that| object.
/// Extensions are considered the same if identifier, path and loader context
/// match.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that : ICefExtension) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the handler for this extension. Will return NULL for internal
/// extensions or if no handler was passed to
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHandler : ICefExtensionHandler;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request context that loaded this extension. Will return NULL
/// for internal extensions or if the extension has been unloaded. See the
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension documentation for more information
2023-08-07 20:21:42 +02:00
/// about loader contexts. Must be called on the browser process UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLoaderContext : ICefRequestContext;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this extension is currently loaded. Must be called on
/// the browser process UI thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsLoaded : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Unload this extension if it is not an internal extension and is currently
/// loaded. Will result in a call to
2023-08-08 18:55:10 +02:00
/// ICefExtensionHandler.OnExtensionUnloaded on success.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure unload;
2020-08-04 17:52:09 +02:00
function GetBrowserActionPopup : ustring;
function GetBrowserActionIcon : ustring;
function GetPageActionPopup : ustring;
function GetPageActionIcon : ustring;
function GetOptionsPage : ustring;
function GetOptionsUIPage : ustring;
function GetBackgroundPage : ustring;
function GetURL : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the unique extension identifier. This is calculated based on the
/// extension public key, if available, or on the extension path. See
/// https://developer.chrome.com/extensions/manifest/key for details.
/// </summary>
2020-08-04 17:52:09 +02:00
property Identifier : ustring read GetIdentifier;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the absolute path to the extension directory on disk. This value
/// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension.
2023-08-07 20:21:42 +02:00
/// </summary>
2020-08-04 17:52:09 +02:00
property Path : ustring read GetPath;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns the extension manifest contents as a ICefDictionaryValue
2023-08-07 20:21:42 +02:00
/// object. See https://developer.chrome.com/extensions/manifest for details.
/// </summary>
2020-08-04 17:52:09 +02:00
property Manifest : ICefDictionaryValue read GetManifest;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the handler for this extension. Will return NULL for internal
/// extensions or if no handler was passed to
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension.
2023-08-07 20:21:42 +02:00
/// </summary>
2020-08-04 17:52:09 +02:00
property Handler : ICefExtensionHandler read GetHandler;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request context that loaded this extension. Will return NULL
/// for internal extensions or if the extension has been unloaded. See the
2023-08-08 18:55:10 +02:00
/// ICefRequestContext.LoadExtension documentation for more information
2023-08-07 20:21:42 +02:00
/// about loader contexts. Must be called on the browser process UI thread.
/// </summary>
2020-08-04 17:52:09 +02:00
property LoaderContext : ICefRequestContext read GetLoaderContext;
property BrowserActionPopup : ustring read GetBrowserActionPopup;
property BrowserActionIcon : ustring read GetBrowserActionIcon;
property PageActionPopup : ustring read GetPageActionPopup;
property PageActionIcon : ustring read GetPageActionIcon;
property OptionsPage : ustring read GetOptionsPage;
property OptionsUIPage : ustring read GetOptionsUIPage;
property BackgroundPage : ustring read GetBackgroundPage;
property URL : ustring read GetURL;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser load status.
/// The functions of this interface will be called on the browser process UI
/// thread or render process main thread (TID_RENDERER).
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefLoadHandler">Implements TCefLoadHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_load_handler_capi.h">CEF source file: /include/capi/cef_load_handler_capi.h (cef_load_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefLoadHandler = interface( ICefBaseRefCounted)
[ '{2C63FB82-345D-4A5B-9858-5AE7A85C9F49}' ]
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called when the loading state has changed. This callback will be executed
/// twice -- once when loading is initiated either programmatically or by user
/// action, and once when loading is terminated due to completion,
/// cancellation of failure. It will be called before any calls to OnLoadStart
/// and after all calls to OnLoadError and/or OnLoadEnd.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnLoadingStateChange( const browser: ICefBrowser; isLoading, canGoBack, canGoForward: Boolean ) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called after a navigation has been committed and before the browser begins
/// loading contents in the frame. The |frame| value will never be NULL --
/// call the IsMain() function to check if this frame is the main frame.
/// |transition_type| provides information about the source of the navigation
/// and an accurate value is only available in the browser process. Multiple
/// frames may be loading at the same time. Sub-frames may start or continue
/// loading after the main frame load has ended. This function will not be
/// called for same page navigations (fragments, history state, etc.) or for
/// navigations that fail or are canceled before commit. For notification of
/// overall browser load status use OnLoadingStateChange instead.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnLoadStart( const browser: ICefBrowser; const frame: ICefFrame; transitionType: TCefTransitionType) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called when the browser is done loading a frame. The |frame| value will
/// never be NULL -- call the IsMain() function to check if this frame is the
/// main frame. Multiple frames may be loading at the same time. Sub-frames
/// may start or continue loading after the main frame load has ended. This
/// function will not be called for same page navigations (fragments, history
/// state, etc.) or for navigations that fail or are canceled before commit.
/// For notification of overall browser load status use OnLoadingStateChange
/// instead.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnLoadEnd( const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer ) ;
2023-08-03 15:50:13 +02:00
/// <summary>
/// Called when a navigation fails or is canceled. This function may be called
/// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
/// after commit. |errorCode| is the error code number, |errorText| is the
/// error text and |failedUrl| is the URL that failed to load. See
/// net\base\net_error_list.h for complete descriptions of the error codes.
/// </summary>
2024-06-14 12:03:35 +02:00
procedure OnLoadError( const browser: ICefBrowser; const frame: ICefFrame; errorCode: TCefErrorCode; const errorText, failedUrl: ustring) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to filter resource response content. The functions
/// of this interface will be called on the browser process IO thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResponseFilter">Implements TCefResponseFilter</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_response_filter_capi.h">CEF source file: /include/capi/cef_response_filter_capi.h (cef_response_filter_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResponseFilter = interface( ICefBaseRefCounted)
[ '{5013BC3C-F1AE-407A-A571-A4C6B1D6831E}' ]
2024-04-20 17:46:13 +02:00
/// <summary>
/// Initialize the response filter. Will only be called a single time. The
/// filter will not be installed if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function InitFilter: Boolean ;
2024-04-20 17:46:13 +02:00
/// <summary>
/// <para>Called to filter a chunk of data. Expected usage is as follows:</para>
/// <code>
/// 1. Read input data from |data_in| and set |data_in_read| to the number of
/// bytes that were read up to a maximum of |data_in_size|. |data_in| will
/// be NULL if |data_in_size| is zero.
/// 2. Write filtered output data to |data_out| and set |data_out_written| to
/// the number of bytes that were written up to a maximum of
/// |data_out_size|. If no output data was written then all data must be
/// read from |data_in| (user must set |data_in_read| = |data_in_size|).
/// 3. Return RESPONSE_FILTER_DONE if all output data was written or
/// RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
/// </code>
/// <para>This function will be called repeatedly until the input buffer has been
/// fully read (user sets |data_in_read| = |data_in_size|) and there is no
/// more input data to filter (the resource response is complete). This
/// function may then be called an additional time with an NULL input buffer
/// if the user filled the output buffer (set |data_out_written| =
/// |data_out_size|) and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate
/// that output data is still pending.</para>
/// <para>Calls to this function will stop when one of the following conditions is
/// met:</para>
/// <code>
/// 1. There is no more input data to filter (the resource response is
/// complete) and the user sets |data_out_written| = 0 or returns
/// RESPONSE_FILTER_DONE to indicate that all data has been written, or;
/// 2. The user returns RESPONSE_FILTER_ERROR to indicate an error.
/// </code>
/// <para>Do not keep a reference to the buffers passed to this function.</para>
/// </summary>
2018-05-12 14:50:54 +02:00
function Filter( data_in: Pointer ; data_in_size: NativeUInt ; var data_in_read: NativeUInt ; data_out: Pointer ; data_out_size : NativeUInt ; var data_out_written: NativeUInt ) : TCefResponseFilterStatus;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser requests. The
/// functions of this interface will be called on the thread indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRequestHandler">Implements TCefRequestHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_handler_capi.h">CEF source file: /include/capi/cef_request_handler_capi.h (cef_request_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRequestHandler = interface( ICefBaseRefCounted)
[ '{050877A9-D1F8-4EB3-B58E-50DC3E3D39FD}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread before browser navigation. Return true (1) to
/// cancel the navigation or false (0) to allow the navigation to proceed. The
/// |request| object cannot be modified in this callback.
2023-08-07 20:21:42 +02:00
/// ICefLoadHandler.OnLoadingStateChange will be called twice in all
/// cases. If the navigation is allowed ICefLoadHandler.OnLoadStart and
/// ICefLoadHandler.OnLoadEnd will be called. If the navigation is
/// canceled ICefLoadHandler.OnLoadError will be called with an
2023-08-03 22:11:42 +02:00
/// |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true
/// (1) if the browser navigated via explicit user gesture (e.g. clicking a
/// link) or false (0) if it navigated automatically (e.g. via the
/// DomContentLoaded event).
/// </summary>
2018-05-12 14:50:54 +02:00
function OnBeforeBrowse( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; user_gesture, isRedirect: Boolean ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread before OnBeforeBrowse in certain limited cases
/// where navigating a new or different browser might be desirable. This
/// includes user-initiated navigation that might open in a special way (e.g.
/// links clicked via middle-click or ctrl + left-click) and certain types of
/// cross-origin navigation initiated from the renderer process (e.g.
/// navigating the top-level frame to/from a file URL). The |browser| and
/// |frame| values represent the source of the navigation. The
/// |target_disposition| value indicates where the user intended to navigate
/// the browser based on standard Chromium behaviors (e.g. current tab, new
/// tab, etc). The |user_gesture| value will be true (1) if the browser
/// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
/// it navigated automatically (e.g. via the DomContentLoaded event). Return
/// true (1) to cancel the navigation or false (0) to allow the navigation to
/// proceed in the source browser's top-level frame.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnOpenUrlFromTab( const browser: ICefBrowser; const frame: ICefFrame; const targetUrl: ustring; targetDisposition: TCefWindowOpenDisposition; userGesture: Boolean ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the browser process IO thread before a resource request is
/// initiated. The |browser| and |frame| values represent the source of the
/// request. |request| represents the request contents and cannot be modified
/// in this callback. |is_navigation| will be true (1) if the resource request
/// is a navigation. |is_download| will be true (1) if the resource request is
/// a download. |request_initiator| is the origin (scheme + domain) of the
/// page that initiated the request. Set |disable_default_handling| to true
/// (1) to disable default handling of the request, in which case it will need
2023-08-07 20:21:42 +02:00
/// to be handled via ICefResourceRequestHandler.GetResourceHandler or it
2023-08-03 22:11:42 +02:00
/// will be canceled. To allow the resource load to proceed with default
/// handling return NULL. To specify a handler for the resource return a
2023-08-07 20:21:42 +02:00
/// ICefResourceRequestHandler object. If this callback returns NULL the
2023-08-03 22:11:42 +02:00
/// same function will be called on the associated
2023-08-07 20:21:42 +02:00
/// ICefRequestContextHandler, if any.
2023-08-03 22:11:42 +02:00
/// </summary>
2019-06-16 10:31:13 +02:00
procedure GetResourceRequestHandler( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean ; const request_initiator: ustring; var disable_default_handling: boolean ; var aResourceRequestHandler : ICefResourceRequestHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread when the browser needs credentials from the user.
/// |origin_url| is the origin making this authentication request. |isProxy|
/// indicates whether the host is a proxy server. |host| contains the hostname
/// and |port| contains the port number. |realm| is the realm of the challenge
/// and may be NULL. |scheme| is the authentication scheme used, such as
/// "basic" or "digest", and will be NULL if the source of the request is an
/// FTP server. Return true (1) to continue the request and call
2023-08-07 20:21:42 +02:00
/// ICefAuthCallback.cont() either in this function or at a later time
2023-08-03 22:11:42 +02:00
/// when the authentication information is available. Return false (0) to
/// cancel the request immediately.
/// </summary>
2019-07-18 11:48:11 +02:00
function GetAuthCredentials( const browser: ICefBrowser; const originUrl: ustring; isProxy: Boolean ; const host: ustring; port: Integer ; const realm, scheme: ustring; const callback: ICefAuthCallback) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread to handle requests for URLs with an invalid SSL
2023-08-07 20:21:42 +02:00
/// certificate. Return true (1) and call ICefCallback functions either in
2023-08-03 22:11:42 +02:00
/// this function or at a later time to continue or cancel the request. Return
/// false (0) to cancel the request immediately. If
2023-08-07 20:21:42 +02:00
/// TCefSettings.ignore_certificate_errors is set all invalid certificates
2023-08-03 22:11:42 +02:00
/// will be accepted without calling this function.
/// </summary>
2021-10-22 19:19:57 +02:00
function OnCertificateError( const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread when a client certificate is being requested for
/// authentication. Return false (0) to use the default behavior and
/// automatically select the first certificate available. Return true (1) and
2023-08-07 20:21:42 +02:00
/// call ICefSelectClientCertificateCallback.Select either in this
2023-08-03 22:11:42 +02:00
/// function or at a later time to select a certificate. Do not call Select or
/// call it with NULL to continue without using any certificate. |isProxy|
/// indicates whether the host is an HTTPS proxy or the origin server. |host|
/// and |port| contains the hostname and port of the SSL server.
/// |certificates| is the list of certificates to choose from; this list has
/// already been pruned by Chromium so that it only contains certificates from
/// issuers that the server trusts.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnSelectClientCertificate( const browser: ICefBrowser; isProxy: boolean ; const host: ustring; port: integer ; certificatesCount: NativeUInt ; const certificates: TCefX509CertificateArray; const callback: ICefSelectClientCertificateCallback) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the browser process UI thread when the render view associated
/// with |browser| is ready to receive/handle IPC messages in the render
/// process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnRenderViewReady( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Called on the browser process UI thread when the render process is
/// unresponsive as indicated by a lack of input event processing for at least
/// 15 seconds. Return false (0) for the default behavior which is an
/// indefinite wait with the Alloy runtime or display of the "Page
/// unresponsive" dialog with the Chrome runtime. Return true (1) and don't
/// execute the callback for an indefinite wait without display of the Chrome
/// runtime dialog. Return true (1) and call
/// ICefUnresponsiveProcessCallback.Wait either in this function or at a
/// later time to reset the wait timer, potentially triggering another call to
/// this function if the process remains unresponsive. Return true (1) and
/// call ICefUnresponsiveProcessCallback.Terminate either in this
/// function or at a later time to terminate the unresponsive process,
/// resulting in a call to OnRenderProcessTerminated.
/// OnRenderProcessResponsive will be called if the process becomes responsive
/// after this function is called. This functionality depends on the hang
/// monitor which can be disabled by passing the `--disable-hang-monitor`
/// command-line flag or setting GlobalCEFApp.DisableHangMonitor to True.
/// </summary>
function OnRenderProcessUnresponsive( const browser: ICefBrowser; const callback: ICefUnresponsiveProcessCallback) : boolean ;
/// <summary>
/// Called on the browser process UI thread when the render process becomes
/// responsive after previously being unresponsive. See documentation on
/// OnRenderProcessUnresponsive.
/// </summary>
procedure OnRenderProcessResponsive( const browser: ICefBrowser) ;
/// <summary>
2023-08-03 22:11:42 +02:00
/// Called on the browser process UI thread when the render process terminates
2024-05-01 18:19:19 +02:00
/// unexpectedly. |status| indicates how the process terminated. |error_code|
/// and |error_string| represent the error that would be displayed in Chrome's
/// "Aw, Snap!" view. Possible |error_code| values include TCefResultCode
/// non-normal exit values and platform-specific crash values (for example, a
/// Posix signal or Windows hardware exception).
2023-08-03 22:11:42 +02:00
/// </summary>
2024-05-01 18:19:19 +02:00
procedure OnRenderProcessTerminated( const browser: ICefBrowser; status: TCefTerminationStatus; error_code: integer ; const error_string: ustring) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the browser process UI thread when the window.document object of
/// the main frame has been created.
/// </summary>
2020-06-21 21:27:55 +02:00
procedure OnDocumentAvailableInMainFrame( const browser: ICefBrowser) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser requests. The
/// functions of this interface will be called on the IO thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceRequestHandler">Implements TCefResourceRequestHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_request_handler_capi.h">CEF source file: /include/capi/cef_resource_request_handler_capi.h (cef_resource_request_handler_t)</see></para>
/// </remarks>
2019-06-16 10:31:13 +02:00
ICefResourceRequestHandler = interface( ICefBaseRefCounted)
[ '{CFA42A38-EA91-4A95-95CE-178BCD412411}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread before a resource request is loaded. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
2023-08-07 20:21:42 +02:00
/// for requests originating from service workers or ICefUrlRequest. To
2023-08-03 22:11:42 +02:00
/// optionally filter cookies for the request return a
2023-08-07 20:21:42 +02:00
/// ICefCookieAccessFilter object. The |request| object cannot not be
2023-08-03 22:11:42 +02:00
/// modified in this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure GetCookieAccessFilter( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var aFilter: ICefCookieAccessFilter) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread before a resource request is loaded. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
2023-08-07 20:21:42 +02:00
/// for requests originating from service workers or ICefUrlRequest. To
2023-08-03 22:11:42 +02:00
/// redirect or change the resource load optionally modify |request|.
/// Modification of the request URL will be treated as a redirect. Return
/// RV_CONTINUE to continue the request immediately. Return RV_CONTINUE_ASYNC
2023-08-07 20:21:42 +02:00
/// and call ICefCallback functions at a later time to continue or cancel
2023-08-03 22:11:42 +02:00
/// the request asynchronously. Return RV_CANCEL to cancel the request
/// immediately.
/// </summary>
2021-10-22 19:19:57 +02:00
function OnBeforeResourceLoad( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback) : TCefReturnValue;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread before a resource is loaded. The |browser| and
/// |frame| values represent the source of the request, and may be NULL for
2023-08-07 20:21:42 +02:00
/// requests originating from service workers or ICefUrlRequest. To allow
2023-08-03 22:11:42 +02:00
/// the resource to load using the default network loader return NULL. To
2023-08-07 20:21:42 +02:00
/// specify a handler for the resource return a ICefResourceHandler object.
2023-08-03 22:11:42 +02:00
/// The |request| object cannot not be modified in this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure GetResourceHandler( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var aResourceHandler : ICefResourceHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread when a resource load is redirected. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
2023-08-07 20:21:42 +02:00
/// for requests originating from service workers or ICefUrlRequest. The
2023-08-03 22:11:42 +02:00
/// |request| parameter will contain the old URL and other request-related
/// information. The |response| parameter will contain the response that
/// resulted in the redirect. The |new_url| parameter will contain the new URL
/// and can be changed if desired. The |request| and |response| objects cannot
/// be modified in this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure OnResourceRedirect( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var newUrl: ustring) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread when a resource response is received. The
/// |browser| and |frame| values represent the source of the request, and may
2023-08-07 20:21:42 +02:00
/// be NULL for requests originating from service workers or ICefUrlRequest.
2023-08-03 22:11:42 +02:00
/// To allow the resource load to proceed without modification return false
/// (0). To redirect or retry the resource load optionally modify |request|
/// and return true (1). Modification of the request URL will be treated as a
/// redirect. Requests handled using the default network loader cannot be
/// redirected in this callback. The |response| object cannot be modified in
/// this callback.
///
/// WARNING: Redirecting using this function is deprecated. Use
/// OnBeforeResourceLoad or GetResourceHandler to perform redirects.
/// </summary>
2019-06-16 10:31:13 +02:00
function OnResourceResponse( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread to optionally filter resource response content.
/// The |browser| and |frame| values represent the source of the request, and
/// may be NULL for requests originating from service workers or
2023-08-07 20:21:42 +02:00
/// ICefUrlRequest. |request| and |response| represent the request and
2023-08-03 22:11:42 +02:00
/// response respectively and cannot be modified in this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure GetResourceResponseFilter( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; var aResourceFilter: ICefResponseFilter) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread when a resource load has completed. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
2023-08-07 20:21:42 +02:00
/// for requests originating from service workers or ICefUrlRequest.
2023-08-03 22:11:42 +02:00
/// |request| and |response| represent the request and response respectively
/// and cannot be modified in this callback. |status| indicates the load
/// completion status. |received_content_length| is the number of response
/// bytes actually read. This function will be called for all requests,
/// including requests that are aborted due to CEF shutdown or destruction of
/// the associated browser. In cases where the associated browser is destroyed
2023-08-07 20:21:42 +02:00
/// this callback may arrive after the ICefLifeSpanHandler.OnBeforeClose
/// callback for that browser. The ICefFrame.IsValid function can be used
2023-08-03 22:11:42 +02:00
/// to test for this situation, and care should be taken not to call |browser|
/// or |frame| functions that modify state (like LoadURL, SendProcessMessage,
/// etc.) if the frame is invalid.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure OnResourceLoadComplete( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; status: TCefUrlRequestStatus; receivedContentLength: Int64 ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the IO thread to handle requests for URLs with an unknown
/// protocol component. The |browser| and |frame| values represent the source
/// of the request, and may be NULL for requests originating from service
2023-08-07 20:21:42 +02:00
/// workers or ICefUrlRequest. |request| cannot be modified in this
2023-08-03 22:11:42 +02:00
/// callback. Set |allow_os_execution| to true (1) to attempt execution via
/// the registered OS protocol handler, if any. SECURITY WARNING: YOU SHOULD
/// USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR OTHER URL
/// ANALYSIS BEFORE ALLOWING OS EXECUTION.
/// </summary>
2019-06-16 10:31:13 +02:00
procedure OnProtocolExecution( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; var allowOsExecution: Boolean ) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2019-06-16 10:31:13 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to filter cookies that may be sent or received from
/// resource requests. The functions of this interface will be called on the IO
/// thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefCookieAccessFilter">Implements TCefCookieAccessFilter</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_request_handler_capi.h">CEF source file: /include/capi/cef_resource_request_handler_capi.h (cef_cookie_access_filter_t)</see></para>
/// </remarks>
2019-06-16 10:31:13 +02:00
ICefCookieAccessFilter = interface( ICefBaseRefCounted)
[ '{65ECD862-F55F-46E4-8AC3-2AE90DCC86F5}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on the IO thread before a resource request is sent. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
/// for requests originating from service workers or ICefUrlRequest.
/// |request| cannot be modified in this callback. Return true (1) if the
/// specified cookie can be sent with the request or false (0) otherwise.
/// </summary>
2019-06-16 10:31:13 +02:00
function CanSendCookie( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const cookie: PCefCookie) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on the IO thread after a resource response is received. The
/// |browser| and |frame| values represent the source of the request, and may
/// be NULL for requests originating from service workers or ICefUrlRequest.
/// |request| cannot be modified in this callback. Return true (1) if the
/// specified cookie returned with the response can be saved or false (0)
/// otherwise.
/// </summary>
2019-06-16 10:31:13 +02:00
function CanSaveCookie( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2019-06-16 10:31:13 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to browser display state.
/// The functions of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDisplayHandler">Implements TCefDisplayHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_display_handler_capi.h">CEF source file: /include/capi/cef_display_handler_capi.h (cef_display_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDisplayHandler = interface( ICefBaseRefCounted)
[ '{1EC7C76D-6969-41D1-B26D-079BCFF054C4}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a frame's address has changed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnAddressChange( const browser: ICefBrowser; const frame: ICefFrame; const url: ustring) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the page title changes.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnTitleChange( const browser: ICefBrowser; const title: ustring) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the page icon changes.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnFaviconUrlChange( const browser: ICefBrowser; const icon_urls: TStrings) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when web content in the page has toggled fullscreen mode. If
/// |fullscreen| is true (1) the content will automatically be sized to fill
/// the browser content area. If |fullscreen| is false (0) the content will
2023-09-30 20:04:38 +02:00
/// automatically return to its original size and position. With the Alloy
/// runtime the client is responsible for triggering the fullscreen transition
2023-11-08 19:42:42 +01:00
/// (for example, by calling ICefWindow.SetFullscreen when using Views).
2023-09-30 20:04:38 +02:00
/// With the Chrome runtime the fullscreen transition will be triggered
2023-11-08 19:42:42 +01:00
/// automatically. The ICefWindowDelegate.OnWindowFullscreenTransition
2023-09-30 20:04:38 +02:00
/// function will be called during the fullscreen transition for notification
/// purposes.
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnFullScreenModeChange( const browser: ICefBrowser; fullscreen: Boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser is about to display a tooltip. |text| contains the
/// text that will be displayed in the tooltip. To handle the display of the
/// tooltip yourself return true (1). Otherwise, you can optionally modify
/// |text| and then return false (0) to allow the browser to display the
/// tooltip. When window rendering is disabled the application is responsible
/// for drawing tooltips and the return value is ignored.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnTooltip( const browser: ICefBrowser; var text : ustring) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser receives a status message. |value| contains the
/// text that will be displayed in the status message.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnStatusMessage( const browser: ICefBrowser; const value: ustring) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to display a console message. Return true (1) to stop the message
/// from being output to the console.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnConsoleMessage( const browser: ICefBrowser; level: TCefLogSeverity; const message_, source: ustring; line: Integer ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when auto-resize is enabled via
2023-08-08 18:55:10 +02:00
/// ICefBrowserHost.SetAutoResizeEnabled and the contents have auto-
2023-08-03 22:11:42 +02:00
/// resized. |new_size| will be the desired size in view coordinates. Return
/// true (1) if the resize was handled or false (0) for default handling.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnAutoResize( const browser: ICefBrowser; const new_size: PCefSize) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the overall page loading progress has changed. |progress|
/// ranges from 0.0 to 1.0.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnLoadingProgressChange( const browser: ICefBrowser; const progress: double ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
/// |custom_cursor_info| will be populated with the custom cursor information.
/// Return true (1) if the cursor change was handled or false (0) for default
/// handling.
/// </summary>
2021-01-26 18:26:24 +01:00
procedure OnCursorChange( const browser: ICefBrowser; cursor_: TCefCursorHandle; CursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser's access to an audio and/or video source has
/// changed.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure OnMediaAccessChange( const browser: ICefBrowser; has_video_access, has_audio_access: boolean ) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to focus. The functions of
/// this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFocusHandler">Implements TCefFocusHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_focus_handler_capi.h">CEF source file: /include/capi/cef_focus_handler_capi.h (cef_focus_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefFocusHandler = interface( ICefBaseRefCounted)
[ '{BB7FA3FA-7B1A-4ADC-8E50-12A24018DD90}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser component is about to loose focus. For instance,
/// if focus was on the last HTML element and the user pressed the TAB key.
/// |next| will be true (1) if the browser is giving focus to the next
/// component and false (0) if the browser is giving focus to the previous
/// component.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnTakeFocus( const browser: ICefBrowser; next: Boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser component is requesting focus. |source| indicates
/// where the focus request is originating from. Return false (0) to allow the
/// focus to be set or true (1) to cancel setting the focus.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnSetFocus( const browser: ICefBrowser; source: TCefFocusSource) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser component has received focus.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnGotFocus( const browser: ICefBrowser) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to keyboard input. The
/// functions of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefKeyboardHandler">Implements TCefKeyboardHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_keyboard_handler_capi.h">CEF source file: /include/capi/cef_keyboard_handler_capi.h (cef_keyboard_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefKeyboardHandler = interface( ICefBaseRefCounted)
[ '{0512F4EC-ED88-44C9-90D3-5C6D03D3B146}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called before a keyboard event is sent to the renderer. |event| contains
/// information about the keyboard event. |os_event| is the operating system
/// event message, if any. Return true (1) if the event was handled or false
/// (0) otherwise. If the event will be handled in on_key_event() as a
/// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
/// (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function OnPreKeyEvent( const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle; out isKeyboardShortcut: Boolean ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called after the renderer and JavaScript in the page has had a chance to
/// handle the event. |event| contains information about the keyboard event.
/// |os_event| is the operating system event message, if any. Return true (1)
/// if the keyboard event was handled or false (0) otherwise.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnKeyEvent( const browser: ICefBrowser; const event: PCefKeyEvent; osEvent: TCefEventHandle) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to JavaScript dialogs. The
/// functions of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefJsDialogHandler">Implements TCefJsDialogHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_jsdialog_handler_capi.h">CEF source file: /include/capi/cef_jsdialog_handler_capi.h (cef_jsdialog_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefJsDialogHandler = interface( ICefBaseRefCounted)
[ '{64E18F86-DAC5-4ED1-8589-44DE45B9DB56}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to run a JavaScript dialog. If |origin_url| is non-NULL it can be
/// passed to the CefFormatUrlForSecurityDisplay function to retrieve a secure
/// and user-friendly display string. The |default_prompt_text| value will be
/// specified for prompt dialogs only. Set |suppress_message| to true (1) and
/// return false (0) to suppress the message (suppressing messages is
/// preferable to immediately executing the callback as this is used to detect
/// presumably malicious behavior like spamming alert messages in
/// onbeforeunload). Set |suppress_message| to false (0) and return false (0)
/// to use the default implementation (the default implementation will show
/// one modal dialog at a time and suppress any additional dialog requests
/// until the displayed dialog is dismissed). Return true (1) if the
/// application will use a custom dialog or if the callback has been executed
/// immediately. Custom dialogs may be either modal or modeless. If a custom
/// dialog is used the application must execute |callback| once the custom
/// dialog is dismissed.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnJsdialog( const browser: ICefBrowser; const originUrl: ustring; dialogType: TCefJsDialogType; const messageText, defaultPromptText: ustring; const callback: ICefJsDialogCallback; out suppressMessage: Boolean ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to run a dialog asking the user if they want to leave a page.
/// Return false (0) to use the default dialog implementation. Return true (1)
/// if the application will use a custom dialog or if the callback has been
/// executed immediately. Custom dialogs may be either modal or modeless. If a
/// custom dialog is used the application must execute |callback| once the
/// custom dialog is dismissed.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnBeforeUnloadDialog( const browser: ICefBrowser; const messageText: ustring; isReload: Boolean ; const callback: ICefJsDialogCallback) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to cancel any pending dialogs and reset any saved dialog state.
/// Will be called due to events like page navigation irregardless of whether
/// any dialogs are currently pending.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnResetDialogState( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the dialog is closed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnDialogClosed( const browser: ICefBrowser) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle audio events.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefAudioHandler">Implements TCefAudioHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_audio_handler_capi.h">CEF source file: /include/capi/cef_audio_handler_capi.h (cef_audio_handler_t)</see></para>
/// </remarks>
2020-05-23 15:00:44 +02:00
ICefAudioHandler = interface( ICefBaseRefCounted)
[ '{8963271A-0B94-4279-82C8-FB2EA7B3CDEC}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread to allow configuration of audio stream parameters.
/// Return true (1) to proceed with audio stream capture, or false (0) to
/// cancel it. All members of |params| can optionally be configured here, but
/// they are also pre-filled with some sensible defaults.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure OnGetAudioParameters( const browser: ICefBrowser; var params: TCefAudioParameters; var aResult: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on a browser audio capture thread when the browser starts streaming
/// audio. OnAudioStreamStopped will always be called after
/// OnAudioStreamStarted; both functions may be called multiple times for the
/// same browser. |params| contains the audio parameters like sample rate and
/// channel layout. |channels| is the number of channels.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure OnAudioStreamStarted( const browser: ICefBrowser; const params: TCefAudioParameters; channels: integer ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the audio stream thread when a PCM packet is received for the
/// stream. |data| is an array representing the raw PCM data as a floating
/// point type, i.e. 4-byte value(s). |frames| is the number of frames in the
/// PCM packet. |pts| is the presentation timestamp (in milliseconds since the
/// Unix Epoch) and represents the time at which the decompressed packet
/// should be presented to the user. Based on |frames| and the
/// |channel_layout| value passed to OnAudioStreamStarted you can calculate
/// the size of the |data| array in bytes.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure OnAudioStreamPacket( const browser: ICefBrowser; const data : PPSingle; frames: integer ; pts: int64 ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI thread when the stream has stopped. OnAudioSteamStopped
/// will always be called after OnAudioStreamStarted; both functions may be
/// called multiple times for the same stream.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure OnAudioStreamStopped( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the UI or audio stream thread when an error occurred. During the
/// stream creation phase this callback will be called on the UI thread while
/// in the capturing phase it will be called on the audio stream thread. The
/// stream will be stopped immediately.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure OnAudioStreamError( const browser: ICefBrowser; const message_: ustring) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2020-05-23 15:00:44 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for continuation of custom context menu display.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRunContextMenuCallback">Implements TCefRunContextMenuCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_context_menu_handler_capi.h">CEF source file: /include/capi/cef_context_menu_handler_capi.h (cef_run_context_menu_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRunContextMenuCallback = interface( ICefBaseRefCounted)
[ '{44C3C6E3-B64D-4F6E-A318-4A0F3A72EB00}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Complete context menu display by selecting the specified |command_id| and
/// |event_flags|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cont( commandId: Integer ; eventFlags: TCefEventFlags) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel context menu display.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for continuation of custom quick menu display.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRunQuickMenuCallback">Implements TCefRunQuickMenuCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_context_menu_handler_capi.h">CEF source file: /include/capi/cef_context_menu_handler_capi.h (cef_run_quick_menu_callback_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefRunQuickMenuCallback = interface( ICefBaseRefCounted)
[ '{11AD68BF-0055-4106-8F6B-B576F90D812F}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Complete quick menu display by selecting the specified |command_id| and
/// |event_flags|.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure Cont( command_id: Integer ; event_flags: TCefEventFlags) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel quick menu display.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure Cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle context menu events. The functions of
/// this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefContextMenuHandler">Implements TCefContextMenuHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_context_menu_handler_capi.h">CEF source file: /include/capi/cef_context_menu_handler_capi.h (cef_context_menu_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefContextMenuHandler = interface( ICefBaseRefCounted)
[ '{C2951895-4087-49D5-BA18-4D9BA4F5EDD7}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called before a context menu is displayed. |params| provides information
/// about the context menu state. |model| initially contains the default
/// context menu. The |model| can be cleared to show no context menu or
/// modified to show a custom menu. Do not keep references to |params| or
/// |model| outside of this callback.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnBeforeContextMenu( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to allow custom display of the context menu. |params| provides
/// information about the context menu state. |model| contains the context
/// menu model resulting from OnBeforeContextMenu. For custom display return
/// true (1) and execute |callback| either synchronously or asynchronously
/// with the selected command ID. For default display return false (0). Do not
/// keep references to |params| or |model| outside of this callback.
/// </summary>
2018-05-12 14:50:54 +02:00
function RunContextMenu( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; const model: ICefMenuModel; const callback: ICefRunContextMenuCallback) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to execute a command selected from the context menu. Return true
/// (1) if the command was handled or false (0) for the default
2023-08-08 18:55:10 +02:00
/// implementation. See TCefMenuId for the command ids that have default
2023-08-03 22:11:42 +02:00
/// implementations. All user-defined command ids should be between
/// MENU_ID_USER_FIRST and MENU_ID_USER_LAST. |params| will have the same
/// values as what was passed to on_before_context_menu(). Do not keep a
/// reference to |params| outside of this callback.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnContextMenuCommand( const browser: ICefBrowser; const frame: ICefFrame; const params: ICefContextMenuParams; commandId: Integer ; eventFlags: TCefEventFlags) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the context menu is dismissed irregardless of whether the menu
/// was canceled or a command was selected.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnContextMenuDismissed( const browser: ICefBrowser; const frame: ICefFrame) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to allow custom display of the quick menu for a windowless browser.
/// |location| is the top left corner of the selected region. |size| is the
/// size of the selected region. |edit_state_flags| is a combination of flags
/// that represent the state of the quick menu. Return true (1) if the menu
/// will be handled and execute |callback| either synchronously or
/// asynchronously with the selected command ID. Return false (0) to cancel
/// the menu.
/// </summary>
2022-08-06 12:00:28 +02:00
function RunQuickMenu( const browser: ICefBrowser; const frame: ICefFrame; location: PCefPoint; size: PCefSize; edit_state_flags: TCefQuickMenuEditStateFlags; const callback: ICefRunQuickMenuCallback) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to execute a command selected from the quick menu for a windowless
/// browser. Return true (1) if the command was handled or false (0) for the
2023-08-08 18:55:10 +02:00
/// default implementation. See TCefMenuId for command IDs that have
2023-08-03 22:11:42 +02:00
/// default implementations.
/// </summary>
2022-08-06 12:00:28 +02:00
function OnQuickMenuCommand( const browser: ICefBrowser; const frame: ICefFrame; command_id: integer ; event_flags: TCefEventFlags) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the quick menu for a windowless browser is dismissed
/// irregardless of whether the menu was canceled or a command was selected.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure OnQuickMenuDismissed( const browser: ICefBrowser; const frame: ICefFrame) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to receive accessibility notification when
/// accessibility events have been registered. The functions of this interface
/// will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefAccessibilityHandler">Implements TCefAccessibilityHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_accessibility_handler_capi.h">CEF source file: /include/capi/cef_accessibility_handler_capi.h (cef_accessibility_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefAccessibilityHandler = interface( ICefBaseRefCounted)
[ '{1878C3C7-7692-44AB-BFE0-6C387106816B}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called after renderer process sends accessibility tree changes to the
/// browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnAccessibilityTreeChange( const value: ICefValue) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called after renderer process sends accessibility location changes to the
/// browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnAccessibilityLocationChange( const value: ICefValue) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle dialog events. The functions of this
/// interface will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDialogHandler">Implements TCefDialogHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_dialog_handler_capi.h">CEF source file: /include/capi/cef_dialog_handler_capi.h (cef_dialog_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDialogHandler = interface( ICefBaseRefCounted)
[ '{7763F4B2-8BE1-4E80-AC43-8B825850DC67}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
2024-06-14 19:17:43 +02:00
/// <para>Called to run a file chooser dialog. |mode| represents the type of dialog
2023-08-03 22:11:42 +02:00
/// to display. |title| to the title to be used for the dialog and may be NULL
2024-06-14 19:17:43 +02:00
/// to show the default title ("Open" or "Save" depending on the mode).</para>
/// <para>|default_file_path| is the path with optional directory and/or file name
/// component that should be initially selected in the dialog.</para>
/// <para>|accept_filters| are used to restrict the selectable file types and may be
/// any combination of valid lower-cased MIME types (e.g. "text/*" or
/// "image/*") and individual file extensions (e.g. ".txt" or ".png").</para>
/// <para>|accept_extensions| provides the semicolon-delimited expansion of MIME
/// types to file extensions (if known, or NULL string otherwise).</para>
/// <para>|accept_descriptions| provides the descriptions for MIME types (if known,
/// or NULL string otherwise). For example, the "image/*" mime type might have
/// extensions ".png;.jpg;.bmp;..." and description "Image Files".</para>
/// <para>|accept_filters|, |accept_extensions| and |accept_descriptions| will all
/// be the same size. To display a custom dialog return true (1) and execute
/// |callback| either inline or at a later time. To display the default dialog
/// return false (0). If this function returns false (0) it may be called an
/// additional time for the same dialog (both before and after MIME type
/// expansion).</para>
/// </summary>
function OnFileDialog( const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters, accept_extensions, accept_descriptions: TStrings; const callback: ICefFileDialogCallback) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events when window rendering is disabled.
/// The functions of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRenderHandler">Implements TCefRenderHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_render_handler_capi.h">CEF source file: /include/capi/cef_render_handler_capi.h (cef_render_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRenderHandler = interface( ICefBaseRefCounted)
[ '{1FC1C22B-085A-4741-9366-5249B88EC410}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for accessibility notifications. If no handler is
/// provided the default implementation will be used.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetAccessibilityHandler( var aAccessibilityHandler : ICefAccessibilityHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to retrieve the root window rectangle in screen DIP coordinates.
/// Return true (1) if the rectangle was provided. If this function returns
/// false (0) the rectangle from GetViewRect will be used.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetRootScreenRect( const browser: ICefBrowser; var rect: TCefRect) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to retrieve the view rectangle in screen DIP coordinates. This
/// function must always provide a non-NULL rectangle.
/// </summary>
2018-12-12 17:13:23 +01:00
procedure GetViewRect( const browser: ICefBrowser; var rect: TCefRect) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to retrieve the translation from view DIP coordinates to screen
/// coordinates. Windows/Linux should provide screen device (pixel)
/// coordinates and MacOS should provide screen DIP coordinates. Return true
/// (1) if the requested coordinates were provided.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetScreenPoint( const browser: ICefBrowser; viewX, viewY: Integer ; var screenX, screenY: Integer ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to allow the client to fill in the CefScreenInfo object with
/// appropriate values. Return true (1) if the |screen_info| structure has
/// been modified.
///
/// If the screen info rectangle is left NULL the rectangle from GetViewRect
/// will be used. If the rectangle is still NULL or invalid popups may not be
/// drawn correctly.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetScreenInfo( const browser: ICefBrowser; var screenInfo: TCefScreenInfo) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser wants to show or hide the popup widget. The popup
/// should be shown if |show| is true (1) and hidden if |show| is false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPopupShow( const browser: ICefBrowser; show: Boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the browser wants to move or resize the popup widget. |rect|
/// contains the new location and size in view coordinates.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPopupSize( const browser: ICefBrowser; const rect: PCefRect) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when an element should be painted. Pixel values passed to this
/// function are scaled relative to view coordinates based on the value of
2023-08-07 20:21:42 +02:00
/// TCefScreenInfo.device_scale_factor returned from GetScreenInfo. |type|
2023-08-03 22:11:42 +02:00
/// indicates whether the element is the view or the popup widget. |buffer|
/// contains the pixel data for the whole image. |dirtyRects| contains the set
/// of rectangles in pixel coordinates that need to be repainted. |buffer|
/// will be |width|*|height|*4 bytes in size and represents a BGRA image with
/// an upper-left origin. This function is only called when
2023-08-07 20:21:42 +02:00
/// TCefWindowInfo.shared_texture_enabled is set to false (0).
2023-08-03 22:11:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPaint( const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt ; const dirtyRects: PCefRectArray; const buffer: Pointer ; width, height: Integer ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// <para>Called when an element has been rendered to the shared texture handle.
2023-08-03 22:11:42 +02:00
/// |type| indicates whether the element is the view or the popup widget.
/// |dirtyRects| contains the set of rectangles in pixel coordinates that need
2024-05-01 18:19:19 +02:00
/// to be repainted. |info| contains the shared handle; on Windows it is a
/// HANDLE to a texture that can be opened with D3D11 OpenSharedResource, on
/// macOS it is an IOSurface pointer that can be opened with Metal or OpenGL,
/// and on Linux it contains several planes, each with an fd to the underlying
/// system native buffer.</para>
/// <para>The underlying implementation uses a pool to deliver frames. As a result,
/// the handle may differ every frame depending on how many frames are in-
/// progress. The handle's resource cannot be cached and cannot be accessed
/// outside of this callback. It should be reopened each time this callback is
/// executed and the contents should be copied to a texture owned by the
/// client application. The contents of |info| will be released back to the
/// pool after this callback returns.</para>
/// </summary>
procedure OnAcceleratedPaint( const browser: ICefBrowser; kind: TCefPaintElementType; dirtyRectsCount: NativeUInt ; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called to retrieve the size of the touch handle for the specified
/// |orientation|.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure GetTouchHandleSize( const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when touch handle state is updated. The client is responsible for
/// rendering the touch handles.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure OnTouchHandleStateChanged( const browser: ICefBrowser; const state: TCefTouchHandleState) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the user starts dragging content in the web view. Contextual
/// information about the dragged content is supplied by |drag_data|. (|x|,
/// |y|) is the drag start location in screen coordinates. OS APIs that run a
/// system message loop may be used within the StartDragging call.
///
/// Return false (0) to abort the drag operation. Don't call any of
2023-08-07 20:21:42 +02:00
/// ICefBrowserHost.DragSource*Ended* functions after returning false (0).
2023-08-03 22:11:42 +02:00
///
/// Return true (1) to handle the drag operation. Call
2023-08-07 20:21:42 +02:00
/// ICefBrowserHost.DragSourceEndedAt and DragSourceSystemDragEnded either
2023-08-03 22:11:42 +02:00
/// synchronously or asynchronously to inform the web view that the drag
/// operation has ended.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnStartDragging( const browser: ICefBrowser; const dragData: ICefDragData; allowedOps: TCefDragOperations; x, y: Integer ) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the web view wants to update the mouse cursor during a drag &
/// drop operation. |operation| describes the allowed operation (none, move,
/// copy, link).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnUpdateDragCursor( const browser: ICefBrowser; operation: TCefDragOperation) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the scroll offset has changed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnScrollOffsetChanged( const browser: ICefBrowser; x, y: Double ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when the IME composition range has changed. |selected_range| is the
/// range of characters that have been selected. |character_bounds| is the
/// bounds of each character in view coordinates.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnIMECompositionRangeChanged( const browser: ICefBrowser; const selected_range: PCefRange; character_boundsCount: NativeUInt ; const character_bounds: PCefRect) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when text selection has changed for the specified |browser|.
/// |selected_text| is the currently selected text and |selected_range| is the
/// character range.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnTextSelectionChanged( const browser: ICefBrowser; const selected_text: ustring; const selected_range: PCefRange) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when an on-screen keyboard should be shown or hidden for the
/// specified |browser|. |input_mode| specifies what kind of keyboard should
/// be opened. If |input_mode| is CEF_TEXT_INPUT_MODE_NONE, any existing
/// keyboard for this browser should be hidden.
/// </summary>
2019-03-15 17:17:14 +01:00
procedure OnVirtualKeyboardRequested( const browser: ICefBrowser; input_mode: TCefTextInpuMode) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to provide handler implementations.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefClient">Implements TCefClient</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_client_capi.h">CEF source file: /include/capi/cef_client_capi.h (cef_client_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefClient = interface( ICefBaseRefCounted)
[ '{1D502075-2FF0-4E13-A112-9E541CD811F4}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for audio rendering events.
/// </summary>
2020-05-23 15:00:44 +02:00
procedure GetAudioHandler( var aHandler : ICefAudioHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for commands. If no handler is provided the default
/// implementation will be used.
/// </summary>
2022-05-03 12:43:16 +02:00
procedure GetCommandHandler( var aHandler : ICefCommandHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for context menus. If no handler is provided the
/// default implementation will be used.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetContextMenuHandler( var aHandler : ICefContextMenuHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for dialogs. If no handler is provided the default
/// implementation will be used.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetDialogHandler( var aHandler : ICefDialogHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for browser display state events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetDisplayHandler( var aHandler : ICefDisplayHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for download events. If no handler is returned
/// downloads will not be allowed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetDownloadHandler( var aHandler : ICefDownloadHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for drag events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetDragHandler( var aHandler : ICefDragHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for find result events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetFindHandler( var aHandler : ICefFindHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for focus events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetFocusHandler( var aHandler : ICefFocusHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Return the handler for events related to ICefFrame lifespan. This
/// function will be called once during ICefBrowser creation and the result
2023-08-03 22:11:42 +02:00
/// will be cached for performance reasons.
/// </summary>
2021-07-29 16:20:34 +02:00
procedure GetFrameHandler( var aHandler : ICefFrameHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for permission requests.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure GetPermissionHandler( var aHandler: ICefPermissionHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for JavaScript dialogs. If no handler is provided the
/// default implementation will be used.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetJsdialogHandler( var aHandler : ICefJsdialogHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for keyboard events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetKeyboardHandler( var aHandler : ICefKeyboardHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for browser life span events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetLifeSpanHandler( var aHandler : ICefLifeSpanHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for browser load status events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetLoadHandler( var aHandler : ICefLoadHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for printing on Linux. If a print handler is not
/// provided then printing will not be supported on the Linux platform.
/// </summary>
2021-04-18 19:36:20 +02:00
procedure GetPrintHandler( var aHandler : ICefPrintHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for off-screen rendering events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetRenderHandler( var aHandler : ICefRenderHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the handler for browser request events.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetRequestHandler( var aHandler : ICefRequestHandler) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a new message is received from a different process. Return
/// true (1) if the message was handled or false (0) otherwise. It is safe to
/// keep a reference to |message| outside of this callback.
/// </summary>
2019-06-16 10:31:13 +02:00
function OnProcessMessageReceived( const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message_ : ICefProcessMessage) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to make a URL request. URL requests are not associated with a
/// browser instance so no ICefClient callbacks will be executed. URL requests
/// can be created on any valid CEF thread in either the browser or render
/// process. Once created the functions of the URL request object must be
/// accessed on the same thread that created it.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefUrlRequest">Implements TCefUrlRequest</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_urlrequest_capi.h">CEF source file: /include/capi/cef_urlrequest_capi.h (cef_urlrequest_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefUrlRequest = interface( ICefBaseRefCounted)
[ '{59226AC1-A0FA-4D59-9DF4-A65C42391A67}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request object used to create this URL request. The returned
/// object is read-only and should not be modified.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetRequest: ICefRequest;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the client.
/// </summary>
function GetClient: ICefUrlrequestClient;
/// <summary>
/// Returns the request status.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetRequestStatus: TCefUrlRequestStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request error if status is UR_CANCELED or UR_FAILED, or 0
/// otherwise.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetRequestError: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the response, or NULL if no response information is available.
/// Response information will only be available after the upload has
/// completed. The returned object is read-only and should not be modified.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetResponse: ICefResponse;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the response body was served from the cache. This
/// includes responses for which revalidation was required.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetResponseWasCached: boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Cancel the request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request object used to create this URL request. The returned
/// object is read-only and should not be modified.
/// </summary>
2018-05-12 14:50:54 +02:00
property Request : ICefRequest read GetRequest;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the client.
/// </summary>
property Client : ICefUrlrequestClient read Getclient;
/// <summary>
/// Returns the request status.
/// </summary>
2018-05-12 14:50:54 +02:00
property RequestStatus : TCefUrlRequestStatus read GetRequestStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the request error if status is UR_CANCELED or UR_FAILED, or 0
/// otherwise.
/// </summary>
2018-05-12 14:50:54 +02:00
property RequestError : Integer read GetRequestError;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the response body was served from the cache. This
/// includes responses for which revalidation was required.
/// </summary>
2018-05-12 14:50:54 +02:00
property Response : ICefResponse read GetResponse;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the response body was served from the cache. This
/// includes responses for which revalidation was required.
/// </summary>
2018-05-12 14:50:54 +02:00
property ResponseWasCached : boolean read GetResponseWasCached;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that should be implemented by the ICefUrlRequest client. The
/// functions of this interface will be called on the same thread that created
/// the request unless otherwise documented.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefUrlrequestClient">Implements TCefUrlrequestClient</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_urlrequest_capi.h">CEF source file: /include/capi/cef_urlrequest_capi.h (cef_urlrequest_client_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefUrlrequestClient = interface( ICefBaseRefCounted)
[ '{114155BD-C248-4651-9A4F-26F3F9A4F737}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notifies the client that the request has completed. Use the
/// ICefUrlRequest.GetRequestStatus function to determine if the request
/// was successful or not.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnRequestComplete( const request: ICefUrlRequest) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notifies the client of upload progress. |current| denotes the number of
/// bytes sent so far and |total| is the total size of uploading data (or -1
/// if chunked upload is enabled). This function will only be called if the
/// UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnUploadProgress( const request: ICefUrlRequest; current, total: Int64 ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Notifies the client of download progress. |current| denotes the number of
/// bytes received up to the call and |total| is the expected total size of
/// the response (or -1 if not determined).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnDownloadProgress( const request: ICefUrlRequest; current, total: Int64 ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when some part of the response is read. |data| contains the current
/// bytes received since the last call. This function will not be called if
/// the UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnDownloadData( const request: ICefUrlRequest; data: Pointer ; dataLength: NativeUInt ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on the IO thread when the browser needs credentials from the user.
/// |isProxy| indicates whether the host is a proxy server. |host| contains
/// the hostname and |port| contains the port number. Return true (1) to
/// continue the request and call ICefAuthCallback.cont() when the
/// authentication information is available. If the request has an associated
/// browser/frame then returning false (0) will result in a call to
/// GetAuthCredentials on the ICefRequestHandler associated with that
/// browser, if any. Otherwise, returning false (0) will cancel the request
/// immediately. This function will only be called for requests initiated from
/// the browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnGetAuthCredentials( isProxy: Boolean ; const host: ustring; port: Integer ; const realm, scheme: ustring; const callback: ICefAuthCallback) : Boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to receive notification when tracing has completed.
/// The functions of this interface will be called on the browser process UI
/// thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefEndTracingCallback">Implements TCefEndTracingCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_trace_capi.h">CEF source file: /include/capi/cef_trace_capi.h (cef_end_tracing_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefEndTracingCallback = interface( ICefBaseRefCounted)
[ '{79020EBE-9D1D-49A6-9714-8778FE8929F2}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called after all processes have sent their trace data. |tracing_file| is
/// the path at which tracing data was written. The client is responsible for
/// deleting |tracing_file|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnEndTracingComplete( const tracingFile: ustring) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for asynchronous continuation of file dialog requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFileDialogCallback">Implements TCefFileDialogCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_dialog_handler_capi.h">CEF source file: /include/capi/cef_dialog_handler_capi.h (cef_file_dialog_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefFileDialogCallback = interface( ICefBaseRefCounted)
[ '{1AF659AB-4522-4E39-9C52-184000D8E3C7}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Continue the file selection. |file_paths| should be a single value or a
/// list of values depending on the dialog mode. An NULL |file_paths| value is
/// treated the same as calling cancel().
/// </summary>
2022-05-26 13:08:20 +02:00
procedure Cont( const filePaths: TStrings) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel the file selection.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Cancel;
end ;
2024-05-01 18:19:19 +02:00
/// <summary>
/// Callback structure for asynchronous handling of an unresponsive process.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefUnresponsiveProcessCallback">Implements TCefUnresponsiveProcessCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_unresponsive_process_callback_capi.h">CEF source file: /include/capi/cef_unresponsive_process_callback_capi.h (cef_unresponsive_process_callback_t)</see></para>
/// </remarks>
ICefUnresponsiveProcessCallback = interface( ICefBaseRefCounted)
[ '{3E4F2B66-5AAF-4906-B946-C114D0E43C13}' ]
/// <summary>
/// Reset the timeout for the unresponsive process.
/// </summary>
procedure Wait;
/// <summary>
/// Terminate the unresponsive process.
/// </summary>
procedure Terminate;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent drag data. The functions of this interface may
/// be called on any thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDragData">Implements TCefDragData</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_drag_data_capi.h">CEF source file: /include/capi/cef_drag_data_capi.h (cef_drag_data_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDragData = interface( ICefBaseRefCounted)
[ '{FBB6A487-F633-4055-AB3E-6619EDE75683}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a copy of the current object.
/// </summary>
2018-05-12 14:50:54 +02:00
function Clone: ICefDragData;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is read-only.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the drag data is a link.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsLink: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the drag data is a text or html fragment.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsFragment: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the drag data is a file.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsFile: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the link URL that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLinkUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the title associated with the link being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLinkTitle: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the metadata, if any, associated with the link being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLinkMetadata: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the plain text fragment that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFragmentText: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the text/html fragment that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFragmentHtml: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the base URL that the fragment came from. This value is used for
/// resolving relative URLs and may be NULL.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFragmentBaseUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Return the name of the file being dragged out of the browser window.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFileName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Write the contents of the file being dragged out of the web view into
/// |writer|. Returns the number of bytes sent to |writer|. If |writer| is
/// NULL this function will return the size of the file contents in bytes.
/// Call get_file_name() to get a suggested name for the file.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFileContents( const writer: ICefStreamWriter) : NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the list of file names that are being dragged into the browser
/// window.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetFileNames( var names: TStrings) : Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-10-22 19:09:51 +02:00
/// Retrieve the list of file paths that are being dragged into the browser
/// window.
/// </summary>
function GetFilePaths( var paths: TStrings) : Integer ;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Set the link URL that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetLinkUrl( const url: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the title associated with the link being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetLinkTitle( const title: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the metadata associated with the link being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetLinkMetadata( const data: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the plain text fragment that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFragmentText( const text : ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the text/html fragment that is being dragged.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFragmentHtml( const html: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the base URL that the fragment came from.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetFragmentBaseUrl( const baseUrl: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Reset the file contents. You should do this before calling
2023-08-08 18:55:10 +02:00
/// ICefBrowserHost.DragTargetDragEnter as the web view does not allow us
2023-08-07 20:21:42 +02:00
/// to drag in this kind of data.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ResetFileContents;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a file that is being dragged into the webview.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure AddFile( const path, displayName: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clear list of filenames.
/// </summary>
2022-05-03 12:43:16 +02:00
procedure ClearFilenames;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the image representation of drag data. May return NULL if no image
/// representation is available.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetImage : ICefImage;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the image hotspot (drag start location relative to image dimensions).
/// </summary>
2018-05-12 14:50:54 +02:00
function GetImageHotspot : TCefPoint;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if an image representation of drag data is available.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasImage : boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to dragging. The functions
/// of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDragHandler">Implements TCefDragHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_drag_handler_capi.h">CEF source file: /include/capi/cef_drag_handler_capi.h (cef_drag_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefDragHandler = interface( ICefBaseRefCounted)
[ '{59A89579-5B18-489F-A25C-5CC25FF831FC}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when an external drag event enters the browser window. |dragData|
/// contains the drag event data and |mask| represents the type of drag
/// operation. Return false (0) for default drag handling behavior or true (1)
/// to cancel the drag event.
/// </summary>
2018-05-12 14:50:54 +02:00
function OnDragEnter( const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations) : Boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called whenever draggable regions for the browser window change. These can
/// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
/// draggable regions are never defined in a document this function will also
/// never be called. If the last draggable region is removed from a document
/// this function will be called with an NULL vector.
/// </summary>
2019-11-20 10:45:46 +01:00
procedure OnDraggableRegionsChanged( const browser: ICefBrowser; const frame: ICefFrame; regionsCount: NativeUInt ; const regions: PCefDraggableRegionArray) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to find results. The
/// functions of this interface will be called on the UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFindHandler">Implements TCefFindHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_find_handler_capi.h">CEF source file: /include/capi/cef_find_handler_capi.h (cef_find_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefFindHandler = interface( ICefBaseRefCounted)
[ '{F20DF234-BD43-42B3-A80B-D354A9E5B787}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
2023-08-07 20:21:42 +02:00
/// Called to report find results returned by ICefBrowserHost.find().
2023-08-03 22:11:42 +02:00
/// |identifer| is a unique incremental identifier for the currently active
/// search, |count| is the number of matches currently identified,
/// |selectionRect| is the location of where the match was found (in window
/// coordinates), |activeMatchOrdinal| is the current position in the search
/// results, and |finalUpdate| is true (1) if this is the last find
/// notification.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnFindResult( const browser: ICefBrowser; identifier, count: Integer ; const selectionRect: PCefRect; activeMatchOrdinal: Integer ; finalUpdate: Boolean ) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to provide handler implementations. The handler
/// instance will not be released until all objects related to the context have
/// been destroyed.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRequestContextHandler">Implements TCefRequestContextHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_context_handler_capi.h">CEF source file: /include/capi/cef_request_context_handler_capi.h (cef_request_context_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefRequestContextHandler = interface( ICefBaseRefCounted)
[ '{76EB1FA7-78DF-4FD5-ABB3-1CDD3E73A140}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the browser process UI thread immediately after the request
/// context has been initialized.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnRequestContextInitialized( const request_context: ICefRequestContext) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called on the browser process IO thread before a resource request is
/// initiated. The |browser| and |frame| values represent the source of the
/// request, and may be NULL for requests originating from service workers or
2023-08-07 20:21:42 +02:00
/// ICefUrlRequest. |request| represents the request contents and cannot be
2023-08-03 22:11:42 +02:00
/// modified in this callback. |is_navigation| will be true (1) if the
/// resource request is a navigation. |is_download| will be true (1) if the
/// resource request is a download. |request_initiator| is the origin (scheme
/// + domain) of the page that initiated the request. Set
/// |disable_default_handling| to true (1) to disable default handling of the
/// request, in which case it will need to be handled via
2023-08-07 20:21:42 +02:00
/// ICefResourceRequestHandler.GetResourceHandler or it will be canceled.
2023-08-03 22:11:42 +02:00
/// To allow the resource load to proceed with default handling return NULL.
/// To specify a handler for the resource return a
2023-08-07 20:21:42 +02:00
/// ICefResourceRequestHandler object. This function will not be called if
2023-08-03 22:11:42 +02:00
/// the client associated with |browser| returns a non-NULL value from
2023-08-07 20:21:42 +02:00
/// ICefRequestHandler.GetResourceRequestHandler for the same request
/// (identified by ICefRequest.GetIdentifier).
2023-08-03 22:11:42 +02:00
/// </summary>
2019-06-16 10:31:13 +02:00
procedure GetResourceRequestHandler( const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; is_navigation, is_download: boolean ; const request_initiator: ustring; var disable_default_handling: boolean ; var aResourceRequestHandler : ICefResourceRequestHandler) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for ICefRequestContext.ResolveHost.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResolveCallback">Implements TCefResolveCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_context_capi.h">CEF source file: /include/capi/cef_request_context_capi.h (cef_resolve_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResolveCallback = interface( ICefBaseRefCounted)
[ '{0C0EA252-7968-4163-A1BE-A1453576DD06}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on the UI thread after the ResolveHost request has completed.
/// |result| will be the result code. |resolved_ips| will be the list of
/// resolved IP addresses or NULL if the resolution failed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnResolveCompleted( result : TCefErrorCode; const resolvedIps: TStrings) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Manage access to preferences. Many built-in preferences are registered by
/// Chromium. Custom preferences can be registered in
/// ICefBrowserProcessHandler.OnRegisterCustomPreferences.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPreferenceManager">Implements TCefPreferenceManager</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_preference_capi.h">CEF source file: /include/capi/cef_preference_capi.h (cef_preference_manager_t)</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_preference_manager_capi.h">CEF source file: /include/capi/cef_preference_manager_capi.h (cef_preference_manager_t)</see></para>
/// </remarks>
2022-12-16 11:29:15 +01:00
ICefPreferenceManager = interface( ICefBaseRefCounted)
[ '{E8231D35-D028-4E64-BFDB-7E4596027DEC}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if a preference with the specified |name| exists. This
/// function must be called on the browser process UI thread.
/// </summary>
2022-12-16 11:29:15 +01:00
function HasPreference( const name : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the value for the preference with the specified |name|. Returns
/// NULL if the preference does not exist. The returned object contains a copy
/// of the underlying preference value and modifications to the returned
/// object will not modify the underlying preference value. This function must
/// be called on the browser process UI thread.
/// </summary>
2022-12-16 11:29:15 +01:00
function GetPreference( const name : ustring) : ICefValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns all preferences as a dictionary. If |include_defaults| is true (1)
/// then preferences currently at their default value will be included. The
/// returned object contains a copy of the underlying preference values and
/// modifications to the returned object will not modify the underlying
/// preference values. This function must be called on the browser process UI
/// thread.
/// </summary>
2022-12-16 11:29:15 +01:00
function GetAllPreferences( includeDefaults: Boolean ) : ICefDictionaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the preference with the specified |name| can be
/// modified using SetPreference. As one example preferences set via the
/// command-line usually cannot be modified. This function must be called on
/// the browser process UI thread.
/// </summary>
2022-12-16 11:29:15 +01:00
function CanSetPreference( const name : ustring) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the |value| associated with preference |name|. Returns true (1) if the
/// value is set successfully and false (0) otherwise. If |value| is NULL the
/// preference will be restored to its default value. If setting the
/// preference fails then |error| will be populated with a detailed
/// description of the problem. This function must be called on the browser
/// process UI thread.
/// </summary>
2022-12-16 11:29:15 +01:00
function SetPreference( const name : ustring; const value: ICefValue; out error: ustring) : Boolean ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A request context provides request handling for a set of related browser or
/// URL request objects. A request context can be specified when creating a new
/// browser via the ICefBrowserHost static factory functions or when creating
/// a new URL request via the ICefUrlRequest static factory functions. Browser
/// objects with different request contexts will never be hosted in the same
/// render process. Browser objects with the same request context may or may not
/// be hosted in the same render process depending on the process model. Browser
/// objects created indirectly via the JavaScript window.open function or
/// targeted links will share the same render process and the same request
/// context as the source browser. When running in single-process mode there is
/// only a single render process (the main process) and so all browsers created
/// in single-process mode will share the same request context. This will be the
/// first request context passed into a ICefBrowserHost static factory
/// function and all other request context objects will be ignored.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefRequestContext">Implements TCefRequestContext</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_context_capi.h">CEF source file: /include/capi/cef_request_context_capi.h (cef_request_context_t)</see></para>
/// </remarks>
2022-12-16 11:29:15 +01:00
ICefRequestContext = interface( ICefPreferenceManager)
2018-05-12 14:50:54 +02:00
[ '{5830847A-2971-4BD5-ABE6-21451F8923F7}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is pointing to the same context as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const other: ICefRequestContext) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is sharing the same storage as |that|
/// object.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSharingWith( const other: ICefRequestContext) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is the global context. The global context
/// is used by default when creating a browser or URL request with a NULL
/// context argument.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsGlobal: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the handler for this context if any.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHandler: ICefRequestContextHandler;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the cache path for this object. If NULL an "incognito mode" in-
/// memory cache is being used.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCachePath: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the cookie manager for this object. If |callback| is non-NULL it
/// will be executed asnychronously on the UI thread after the manager's
/// storage has been initialized.
/// </summary>
2019-06-16 10:31:13 +02:00
function GetCookieManager( const callback: ICefCompletionCallback) : ICefCookieManager;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the cookie manager for this object. If |callback| is non-NULL it
/// will be executed asnychronously on the UI thread after the manager's
/// storage has been initialized.
/// </summary>
2019-06-16 10:31:13 +02:00
function GetCookieManagerProc( const callback: TCefCompletionCallbackProc) : ICefCookieManager;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Register a scheme handler factory for the specified |scheme_name| and
/// optional |domain_name|. An NULL |domain_name| value for a standard scheme
/// will cause the factory to match all domain names. The |domain_name| value
/// will be ignored for non-standard schemes. If |scheme_name| is a built-in
/// scheme and no handler is returned by |factory| then the built-in scheme
/// handler factory will be called. If |scheme_name| is a custom scheme then
2023-08-08 18:55:10 +02:00
/// you must also implement the ICefApp.OnRegisterCustomSchemes()
2023-08-07 20:21:42 +02:00
/// function in all processes. This function may be called multiple times to
/// change or remove the factory that matches the specified |scheme_name| and
/// optional |domain_name|. Returns false (0) if an error occurs. This
/// function may be called on any thread in the browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
function RegisterSchemeHandlerFactory( const schemeName, domainName: ustring; const factory: ICefSchemeHandlerFactory) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clear all registered scheme handler factories. Returns false (0) on error.
/// This function may be called on any thread in the browser process.
/// </summary>
2018-05-12 14:50:54 +02:00
function ClearSchemeHandlerFactories: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clears all certificate exceptions that were added as part of handling
/// ICefRequestHandler.OnCertificateError(). If you call this it is
/// recommended that you also call CloseAllConnections() or you risk not
/// being prompted again for server certificates if you reconnect quickly. If
/// |callback| is non-NULL it will be executed on the UI thread after
/// completion.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ClearCertificateExceptions( const callback: ICefCompletionCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clears all HTTP authentication credentials that were added as part of
/// handling GetAuthCredentials. If |callback| is non-NULL it will be executed
/// on the UI thread after completion.
/// </summary>
2019-07-18 11:48:11 +02:00
procedure ClearHttpAuthCredentials( const callback: ICefCompletionCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Clears all active and idle connections that Chromium currently has. This
/// is only recommended if you have released all other CEF objects but don't
/// yet want to call cef_shutdown(). If |callback| is non-NULL it will be
/// executed on the UI thread after completion.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure CloseAllConnections( const callback: ICefCompletionCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Attempts to resolve |origin| to a list of associated IP addresses.
/// |callback| will be executed on the UI thread after completion.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ResolveHost( const origin: ustring; const callback: ICefResolveCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Load an extension.
///
/// If extension resources will be read from disk using the default load
/// implementation then |root_directory| should be the absolute path to the
/// extension resources directory and |manifest| should be NULL. If extension
2023-08-08 18:55:10 +02:00
/// resources will be provided by the client (e.g. via ICefRequestHandler
/// and/or ICefExtensionHandler) then |root_directory| should be a path
2023-08-07 20:21:42 +02:00
/// component unique to the extension (if not absolute this will be internally
/// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
/// contents that would otherwise be read from the "manifest.json" file on
/// disk.
///
/// The loaded extension will be accessible in all contexts sharing the same
/// storage (HasExtension returns true (1)). However, only the context on
/// which this function was called is considered the loader (DidLoadExtension
/// returns true (1)) and only the loader will receive
2023-08-08 18:55:10 +02:00
/// ICefRequestContextHandler callbacks for the extension.
2023-08-07 20:21:42 +02:00
///
2023-08-08 18:55:10 +02:00
/// ICefExtensionHandler.OnExtensionLoaded will be called on load success
/// or ICefExtensionHandler.OnExtensionLoadFailed will be called on load
2023-08-07 20:21:42 +02:00
/// failure.
///
/// If the extension specifies a background script via the "background"
2023-08-08 18:55:10 +02:00
/// manifest key then ICefExtensionHandler.OnBeforeBackgroundBrowser will
2023-08-07 20:21:42 +02:00
/// be called to create the background browser. See that function for
/// additional information about background scripts.
///
/// For visible extension views the client application should evaluate the
/// manifest to determine the correct extension URL to load and then pass that
2023-08-08 18:55:10 +02:00
/// URL to the ICefBrowserHost.CreateBrowser* function after the extension
2023-08-07 20:21:42 +02:00
/// has loaded. For example, the client can look for the "browser_action"
/// manifest key as documented at
/// https://developer.chrome.com/extensions/browserAction. Extension URLs take
/// the form "chrome-extension://<extension_id>/<path>".
///
/// Browsers that host extensions differ from normal browsers as follows:
/// - Can access chrome.* JavaScript APIs if allowed by the manifest. Visit
/// chrome://extensions-support for the list of extension APIs currently
/// supported by CEF.
/// - Main frame navigation to non-extension content is blocked.
/// - Pinch-zooming is disabled.
/// - CefBrowserHost::GetExtension returns the hosted extension.
/// - CefBrowserHost::IsBackgroundHost returns true for background hosts.
///
/// See https://developer.chrome.com/extensions for extension implementation
/// and usage documentation.
2024-05-28 15:50:48 +02:00
///
/// WARNING: This function is deprecated and will be removed in ~M127.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
procedure LoadExtension( const root_directory: ustring; const manifest: ICefDictionaryValue; const handler: ICefExtensionHandler) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this context was used to load the extension identified
/// by |extension_id|. Other contexts sharing the same storage will also have
/// access to the extension (see HasExtension). This function must be called
/// on the browser process UI thread.
2024-05-28 15:50:48 +02:00
///
/// WARNING: This function is deprecated and will be removed in ~M127.
2023-08-07 20:21:42 +02:00
/// </summary>
2017-10-26 13:23:13 +02:00
function DidLoadExtension( const extension_id: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this context has access to the extension identified by
/// |extension_id|. This may not be the context that was used to load the
/// extension (see DidLoadExtension). This function must be called on the
/// browser process UI thread.
2024-05-28 15:50:48 +02:00
///
/// WARNING: This function is deprecated and will be removed in ~M127.
2023-08-07 20:21:42 +02:00
/// </summary>
2017-10-26 13:23:13 +02:00
function HasExtension( const extension_id: ustring) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the list of all extensions that this context has access to (see
/// HasExtension). |extension_ids| will be populated with the list of
/// extension ID values. Returns true (1) on success. This function must be
/// called on the browser process UI thread.
2024-05-28 15:50:48 +02:00
///
/// WARNING: This function is deprecated and will be removed in ~M127.
2023-08-07 20:21:42 +02:00
/// </summary>
2017-10-26 13:23:13 +02:00
function GetExtensions( const extension_ids: TStringList) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the extension matching |extension_id| or NULL if no matching
/// extension is accessible in this context (see HasExtension). This function
/// must be called on the browser process UI thread.
2024-05-28 15:50:48 +02:00
///
/// WARNING: This function is deprecated and will be removed in ~M127.
2023-08-07 20:21:42 +02:00
/// </summary>
2018-05-12 14:50:54 +02:00
function GetExtension( const extension_id: ustring) : ICefExtension;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the MediaRouter object associated with this context. If
/// |callback| is non-NULL it will be executed asnychronously on the UI thread
/// after the manager's context has been initialized.
/// </summary>
2021-04-18 19:36:20 +02:00
function GetMediaRouter( const callback: ICefCompletionCallback) : ICefMediaRouter;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns nullptr if no value is configured. Must be called on the browser
/// process UI thread.
/// </summary>
2023-07-30 18:47:35 +02:00
function GetWebsiteSetting( const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes) : ICefValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass nullptr for |value| to remove the
/// default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
/// </summary>
2023-07-30 18:47:35 +02:00
procedure SetWebsiteSetting( const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; const value: ICefValue) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the current value for |content_type| that applies for the
/// specified URLs. If both URLs are NULL the default value will be returned.
/// Returns CEF_CONTENT_SETTING_VALUE_DEFAULT if no value is configured. Must
/// be called on the browser process UI thread.
/// </summary>
2023-07-30 18:47:35 +02:00
function GetContentSetting( const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes) : TCefContentSettingValues;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Sets the current value for |content_type| for the specified URLs in the
/// default scope. If both URLs are NULL, and the context is not incognito,
/// the default value will be set. Pass CEF_CONTENT_SETTING_VALUE_DEFAULT for
/// |value| to use the default value for this content type.
///
/// WARNING: Incorrect usage of this function may cause instability or
/// security issues in Chromium. Make sure that you first understand the
/// potential impact of any changes to |content_type| by reviewing the related
/// source code in Chromium. For example, if you plan to modify
/// CEF_CONTENT_SETTING_TYPE_POPUPS, first review and understand the usage of
/// ContentSettingsType::POPUPS in Chromium:
/// https://source.chromium.org/search?q=ContentSettingsType::POPUPS
/// </summary>
2023-07-30 18:47:35 +02:00
procedure SetContentSetting( const requesting_url, top_level_url: ustring; content_type: TCefContentSettingTypes; value: TCefContentSettingValues) ;
2023-08-07 20:21:42 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Sets the Chrome color scheme for all browsers that share this request
/// context. |variant| values of SYSTEM, LIGHT and DARK change the underlying
/// color mode (e.g. light vs dark). Other |variant| values determine how
/// |user_color| will be applied in the current color mode. If |user_color| is
/// transparent (0) the default color will be used.
/// </summary>
procedure SetChromeColorScheme( variant : TCefColorVariant; user_color: TCefColor) ;
/// <summary>
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
/// be called on the browser process UI thread.
/// </summary>
function GetChromeColorSchemeMode: TCefColorVariant;
/// <summary>
/// Returns the current Chrome color scheme color, or transparent (0) for the
/// default color. Must be called on the browser process UI thread.
/// </summary>
function GetChromeColorSchemeColor: TCefColor;
/// <summary>
/// Returns the current Chrome color scheme variant. Must be called on the
/// browser process UI thread.
/// </summary>
function GetChromeColorSchemeVariant: TCefColorVariant;
/// <summary>
2023-08-07 20:21:42 +02:00
/// Returns the cache path for this object. If NULL an "incognito mode" in-
/// memory cache is being used.
/// </summary>
2024-05-01 18:19:19 +02:00
property CachePath : ustring read GetCachePath;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is the global context. The global context
/// is used by default when creating a browser or URL request with a NULL
/// context argument.
/// </summary>
2024-05-01 18:19:19 +02:00
property IsGlobalContext : boolean read IsGlobal;
/// <summary>
/// Returns the current Chrome color scheme mode (SYSTEM, LIGHT or DARK). Must
/// be called on the browser process UI thread.
/// </summary>
property ChromeColorSchemeMode : TCefColorVariant read GetChromeColorSchemeMode;
/// <summary>
/// Returns the current Chrome color scheme color, or transparent (0) for the
/// default color. Must be called on the browser process UI thread.
/// </summary>
property ChromeColorSchemeColor : TCefColor read GetChromeColorSchemeColor;
/// <summary>
/// Returns the current Chrome color scheme variant. Must be called on the
/// browser process UI thread.
/// </summary>
property ChromeColorSchemeVariant : TCefColorVariant read GetChromeColorSchemeVariant;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing print settings.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPrintSettings">Implements TCefPrintSettings</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_print_settings_capi.h">CEF source file: /include/capi/cef_print_settings_capi.h (cef_print_settings_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPrintSettings = Interface( ICefBaseRefCounted)
[ '{ACBD2395-E9C1-49E5-B7F3-344DAA4A0F12}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the values of this object are read-only. Some APIs may
/// expose read-only objects.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsReadOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the page orientation.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetOrientation( landscape: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the orientation is landscape.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsLandscape: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the printer printable area in device units. Some platforms already
/// provide flipped area. Set |landscape_needs_flip| to false (0) on those
/// platforms to avoid double flipping.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetPrinterPrintableArea( const physicalSizeDeviceUnits: PCefSize; const printableAreaDeviceUnits: PCefRect; landscapeNeedsFlip: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the device name.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetDeviceName( const name : ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the device name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDeviceName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the DPI (dots per inch).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetDpi( dpi: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the DPI (dots per inch).
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDpi: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the page ranges.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetPageRanges( const ranges: TCefRangeArray) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of page ranges that currently exist.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPageRangesCount: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the page ranges.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetPageRanges( out ranges: TCefRangeArray) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set whether only the selection will be printed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetSelectionOnly( selectionOnly: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if only the selection will be printed.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSelectionOnly: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set whether pages will be collated.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetCollate( collate: Boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if pages will be collated.
/// </summary>
2018-05-12 14:50:54 +02:00
function WillCollate: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the color model.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetColorModel( model: TCefColorModel) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the color model.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetColorModel: TCefColorModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the number of copies.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetCopies( copies: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the number of copies.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCopies: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Set the duplex mode.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure SetDuplexMode( mode: TCefDuplexMode) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the duplex mode.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDuplexMode: TCefDuplexMode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the orientation is landscape.
/// </summary>
2018-05-12 14:50:54 +02:00
property Landscape : Boolean read IsLandscape write SetOrientation;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the device name.
/// </summary>
2018-05-12 14:50:54 +02:00
property DeviceName : ustring read GetDeviceName write SetDeviceName;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the DPI (dots per inch).
/// </summary>
2018-05-12 14:50:54 +02:00
property Dpi : Integer read GetDpi write SetDpi;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if only the selection will be printed.
/// </summary>
2018-05-12 14:50:54 +02:00
property SelectionOnly : Boolean read IsSelectionOnly write SetSelectionOnly;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if pages will be collated.
/// </summary>
2018-05-12 14:50:54 +02:00
property Collate : Boolean read WillCollate write SetCollate;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the color model.
/// </summary>
2018-05-12 14:50:54 +02:00
property ColorModel : TCefColorModel read GetColorModel write SetColorModel;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the number of copies.
/// </summary>
2018-05-12 14:50:54 +02:00
property Copies : Integer read GetCopies write SetCopies;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Get the duplex mode.
/// </summary>
2018-05-12 14:50:54 +02:00
property DuplexMode : TCefDuplexMode read GetDuplexMode write SetDuplexMode;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for asynchronous continuation of print dialog requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPrintDialogCallback">Implements TCefPrintDialogCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_print_handler_capi.h">CEF source file: /include/capi/cef_print_handler_capi.h (cef_print_dialog_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPrintDialogCallback = interface( ICefBaseRefCounted)
[ '{1D7FB71E-0019-4A80-95ED-91DDD019253B}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Continue printing with the specified |settings|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure cont( const settings: ICefPrintSettings) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel the printing.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface for asynchronous continuation of print job requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPrintJobCallback">Implements TCefPrintJobCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_print_handler_capi.h">CEF source file: /include/capi/cef_print_handler_capi.h (cef_print_job_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPrintJobCallback = interface( ICefBaseRefCounted)
[ '{5554852A-052C-464B-A868-B618C7E7E2FD}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Indicate completion of the print job.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure cont;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle printing on Linux. Each browser will have
/// only one print job in progress at a time. The functions of this interface
/// will be called on the browser process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPrintHandler">Implements TCefPrintHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_print_handler_capi.h">CEF source file: /include/capi/cef_print_handler_capi.h (cef_print_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefPrintHandler = interface( ICefBaseRefCounted)
[ '{2831D5C9-6E2B-4A30-A65A-0F4435371EFC}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when printing has started for the specified |browser|. This
/// function will be called before the other OnPrint*() functions and
/// irrespective of how printing was initiated (e.g.
2023-08-07 20:21:42 +02:00
/// ICefBrowserHost.print(), JavaScript window.print() or PDF extension
2023-08-03 22:11:42 +02:00
/// print button).
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPrintStart( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Synchronize |settings| with client state. If |get_defaults| is true (1)
/// then populate |settings| with the default print settings. Do not keep a
/// reference to |settings| outside of this callback.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPrintSettings( const browser: ICefBrowser; const settings: ICefPrintSettings; getDefaults: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Show the print dialog. Execute |callback| once the dialog is dismissed.
/// Return true (1) if the dialog will be displayed or false (0) to cancel the
/// printing immediately.
/// </summary>
2021-01-01 17:51:09 +01:00
procedure OnPrintDialog( const browser: ICefBrowser; hasSelection: boolean ; const callback: ICefPrintDialogCallback; var aResult: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Send the print job to the printer. Execute |callback| once the job is
/// completed. Return true (1) if the job will proceed or false (0) to cancel
/// the job immediately.
/// </summary>
2021-01-01 17:51:09 +01:00
procedure OnPrintJob( const browser: ICefBrowser; const documentName, PDFFilePath: ustring; const callback: ICefPrintJobCallback; var aResult: boolean ) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Reset client state related to printing.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnPrintReset( const browser: ICefBrowser) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Return the PDF paper size in device units. Used in combination with
2023-08-07 20:21:42 +02:00
/// ICefBrowserHost.PrintToPdf().
2023-08-03 22:11:42 +02:00
/// </summary>
2021-04-18 19:36:20 +02:00
procedure GetPDFPaperSize( const browser: ICefBrowser; deviceUnitsPerInch: integer ; var aResult: TCefSize) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
procedure RemoveReferences;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used to represent an entry in navigation history.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefNavigationEntry">Implements TCefNavigationEntry</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_navigation_entry_capi.h">CEF source file: /include/capi/cef_navigation_entry_capi.h (cef_navigation_entry_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefNavigationEntry = interface( ICefBaseRefCounted)
[ '{D17B4B37-AA45-42D9-B4E4-AAB6FE2AB297}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this object is valid. Do not call any other functions
/// if this function returns false (0).
/// </summary>
2018-05-12 14:50:54 +02:00
function IsValid: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the actual URL of the page. For some pages this may be data: URL
/// or similar. Use get_display_url() to return a display-friendly version.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a display-friendly version of the URL.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDisplayUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the original URL that was entered by the user before any
/// redirects.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetOriginalUrl: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the title set by the page. This value may be NULL.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTitle: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the transition type which indicates what the user did to move to
/// this page from the previous page.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTransitionType: TCefTransitionType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this navigation includes post data.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasPostData: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time for the last known successful navigation completion. A
/// navigation may be completed more than once if the page is reloaded. May be
/// 0 if the navigation has not yet completed.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCompletionTime: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the HTTP status code for the last known successful navigation
/// response. May be 0 if the response has not yet been received or if the
/// navigation has not yet completed.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHttpStatusCode: Integer ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the SSL information for this navigation entry.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSSLStatus: ICefSSLStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the actual URL of the page. For some pages this may be data: URL
/// or similar. Use get_display_url() to return a display-friendly version.
/// </summary>
2018-05-12 14:50:54 +02:00
property Url : ustring read GetUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a display-friendly version of the URL.
/// </summary>
2018-05-12 14:50:54 +02:00
property DisplayUrl : ustring read GetDisplayUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the original URL that was entered by the user before any
/// redirects.
/// </summary>
2018-05-12 14:50:54 +02:00
property OriginalUrl : ustring read GetOriginalUrl;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the title set by the page. This value may be NULL.
/// </summary>
2018-05-12 14:50:54 +02:00
property Title : ustring read GetTitle;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the transition type which indicates what the user did to move to
/// this page from the previous page.
/// </summary>
2018-05-12 14:50:54 +02:00
property TransitionType : TCefTransitionType read GetTransitionType;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the time for the last known successful navigation completion. A
/// navigation may be completed more than once if the page is reloaded. May be
/// 0 if the navigation has not yet completed.
/// </summary>
2018-05-12 14:50:54 +02:00
property CompletionTime : TDateTime read GetCompletionTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the HTTP status code for the last known successful navigation
/// response. May be 0 if the response has not yet been received or if the
/// navigation has not yet completed.
/// </summary>
2018-05-12 14:50:54 +02:00
property HttpStatusCode : Integer read GetHttpStatusCode;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the SSL information for this navigation entry.
/// </summary>
2018-05-12 14:50:54 +02:00
property SSLStatus : ICefSSLStatus read GetSSLStatus;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing the issuer or subject field of an X.509 certificate.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefX509CertPrincipal">Implements TCefX509CertPrincipal</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_x509_certificate_capi.h">CEF source file: /include/capi/cef_x509_certificate_capi.h (cef_x509cert_principal_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefX509CertPrincipal = interface( ICefBaseRefCounted)
[ '{CD3621ED-7D68-4A1F-95B5-190C7001B65F}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a name that can be used to represent the issuer. It tries in this
/// order: Common Name (CN), Organization Name (O) and Organizational Unit
/// Name (OU) and returns the first non-NULL one found.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDisplayName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the common name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCommonName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the locality name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLocalityName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the state or province name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetStateOrProvinceName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the country name.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCountryName: ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the list of organization names.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetOrganizationNames( const names: TStrings) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Retrieve the list of organization unit names.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetOrganizationUnitNames( const names: TStrings) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a X.509 certificate.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefX509Certificate">Implements TCefX509Certificate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_x509_certificate_capi.h">CEF source file: /include/capi/cef_x509_certificate_capi.h (cef_x509certificate_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefX509Certificate = interface( ICefBaseRefCounted)
[ '{C897979D-F068-4428-82DF-4221612FF7E0}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the subject of the X.509 certificate. For HTTPS server
/// certificates this represents the web server. The common name of the
/// subject should match the host name of the web server.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSubject: ICefX509CertPrincipal;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the issuer of the X.509 certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIssuer: ICefX509CertPrincipal;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the DER encoded serial number for the X.509 certificate. The value
/// possibly includes a leading 00 byte.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSerialNumber: ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the date before which the X.509 certificate is invalid.
/// CefBaseTime.GetTimeT() will return 0 if no date was specified.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetValidStart: TCefBaseTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the date after which the X.509 certificate is invalid.
/// CefBaseTime.GetTimeT() will return 0 if no date was specified.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetValidExpiry: TCefBaseTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the date before which the X.509 certificate is invalid.
/// CefBaseTime.GetTimeT() will return 0 if no date was specified.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetValidStartAsDateTime: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the date after which the X.509 certificate is invalid.
/// CefBaseTime.GetTimeT() will return 0 if no date was specified.
/// </summary>
2022-09-04 19:18:07 +02:00
function GetValidExpiryAsDateTime: TDateTime;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the DER encoded data for the X.509 certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetDerEncoded: ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the PEM encoded data for the X.509 certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetPemEncoded: ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the number of certificates in the issuer chain. If 0, the
/// certificate is self-signed.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetIssuerChainSize: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the DER encoded data for the certificate issuer chain. If we
/// failed to encode a certificate in the chain it is still present in the
/// array but is an NULL string.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetDEREncodedIssuerChain( chainCount: NativeUInt ; var chain : TCefBinaryValueArray) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the PEM encoded data for the certificate issuer chain. If we
/// failed to encode a certificate in the chain it is still present in the
/// array but is an NULL string.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure GetPEMEncodedIssuerChain( chainCount: NativeUInt ; var chain : TCefBinaryValueArray) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing SSL information.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSslInfo">Implements TCefSslInfo</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_ssl_info_capi.h">CEF source file: /include/capi/cef_ssl_info_capi.h (cef_sslinfo_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefSslInfo = interface( ICefBaseRefCounted)
[ '{67EC86BD-DE7D-453D-908F-AD15626C514F}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a bitmask containing any and all problems verifying the server
/// certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCertStatus: TCefCertStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the X.509 certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetX509Certificate: ICefX509Certificate;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing the SSL information for a navigation entry.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSSLStatus">Implements TCefSSLStatus</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_ssl_status_capi.h">CEF source file: /include/capi/cef_ssl_status_capi.h (cef_sslstatus_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefSSLStatus = interface( ICefBaseRefCounted)
[ '{E3F004F2-03D5-46A2-91D0-510C50F3B225}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the status is related to a secure SSL/TLS connection.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSecureConnection: boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a bitmask containing any and all problems verifying the server
/// certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetCertStatus: TCefCertStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the SSL version used for the SSL connection.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetSSLVersion: TCefSSLVersion;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns a bitmask containing the page security content status.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetContentStatus: TCefSSLContentStatus;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the X.509 certificate.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetX509Certificate: ICefX509Certificate;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used to select a client certificate for authentication.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSelectClientCertificateCallback">Implements TCefSelectClientCertificateCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_request_handler_capi.h">CEF source file: /include/capi/cef_request_handler_capi.h (cef_select_client_certificate_callback_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefSelectClientCertificateCallback = interface( ICefBaseRefCounted)
[ '{003E3D09-ADE8-4C6E-A174-079D3D616608}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Chooses the specified certificate for client certificate authentication.
/// NULL value means that no client certificate should be used.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure Select( const cert: ICefX509Certificate) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface used for retrieving resources from the resource bundle (*.pak)
/// files loaded by CEF during startup or via the ICefResourceBundleHandler
/// returned from ICefApp.GetResourceBundleHandler. See TCefSettings for
/// additional options related to resource bundle loading. The functions of this
/// interface may be called on any thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefResourceBundle">Implements TCefResourceBundle</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_resource_bundle_capi.h">CEF source file: /include/capi/cef_resource_bundle_capi.h (cef_resource_bundle_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefResourceBundle = interface( ICefBaseRefCounted)
[ '{3213CF97-C854-452B-B615-39192F8D07DC}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the localized string for the specified |string_id| or an NULL
/// string if the value is not found. Include cef_pack_strings.h for a listing
/// of valid string ID values.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetLocalizedString( stringId: Integer ) : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns a ICefBinaryValue containing the decompressed contents of the
2023-08-07 20:21:42 +02:00
/// specified scale independent |resource_id| or NULL if not found. Include
/// cef_pack_resources.h for a listing of valid resource ID values.
/// </summary>
2020-07-22 18:01:03 +02:00
function GetDataResource( resourceId: Integer ) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Returns a ICefBinaryValue containing the decompressed contents of the
2023-08-07 20:21:42 +02:00
/// specified |resource_id| nearest the scale factor |scale_factor| or NULL if
/// not found. Use a |scale_factor| value of SCALE_FACTOR_NONE for scale
/// independent resources or call GetDataResource instead.Include
/// cef_pack_resources.h for a listing of valid resource ID values.
/// </summary>
2020-07-22 18:01:03 +02:00
function GetDataResourceForScale( resourceId: Integer ; scaleFactor: TCefScaleFactor) : ICefBinaryValue;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Container for a single image represented at different scale factors. All
/// image representations should be the same size in density independent pixel
/// (DIP) units. For example, if the image at scale factor 1.0 is 100x100 pixels
/// then the image at scale factor 2.0 should be 200x200 pixels -- both images
/// will display with a DIP size of 100x100 units. The functions of this
/// interface can be called on any browser process thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefImage">Implements TCefImage</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_image_capi.h">CEF source file: /include/capi/cef_image_capi.h (cef_image_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefImage = interface( ICefBaseRefCounted)
[ '{E2C2F424-26A2-4498-BB45-DA23219831BE}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this Image is NULL.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsEmpty: Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this Image and |that| Image share the same underlying
/// storage. Will also return true (1) if both images are NULL.
/// </summary>
2018-05-12 14:50:54 +02:00
function IsSame( const that: ICefImage) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a bitmap image representation for |scale_factor|. Only 32-bit
/// RGBA/BGRA formats are supported. |pixel_width| and |pixel_height| are the
/// bitmap representation size in pixel coordinates. |pixel_data| is the array
/// of pixel data and should be |pixel_width| x |pixel_height| x 4 bytes in
/// size. |color_type| and |alpha_type| values specify the pixel format.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddBitmap( scaleFactor: Single ; pixelWidth, pixelHeight: Integer ; colorType: TCefColorType; alphaType: TCefAlphaType; const pixelData: Pointer ; pixelDataSize: NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Add a PNG image representation for |scale_factor|. |png_data| is the image
/// data of size |png_data_size|. Any alpha transparency in the PNG data will
/// be maintained.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddPng( scaleFactor: Single ; const pngData: Pointer ; pngDataSize: NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Create a JPEG image representation for |scale_factor|. |jpeg_data| is the
/// image data of size |jpeg_data_size|. The JPEG format does not support
/// transparency so the alpha byte will be set to 0xFF for all pixels.
/// </summary>
2018-05-12 14:50:54 +02:00
function AddJpeg( scaleFactor: Single ; const jpegData: Pointer ; jpegDataSize: NativeUInt ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the image width in density independent pixel (DIP) units.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetWidth: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the image height in density independent pixel (DIP) units.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetHeight: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if this image contains a representation for
/// |scale_factor|.
/// </summary>
2018-05-12 14:50:54 +02:00
function HasRepresentation( scaleFactor: Single ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Removes the representation for |scale_factor|. Returns true (1) on
/// success.
/// </summary>
2018-05-12 14:50:54 +02:00
function RemoveRepresentation( scaleFactor: Single ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns information for the representation that most closely matches
/// |scale_factor|. |actual_scale_factor| is the actual scale factor for the
/// representation. |pixel_width| and |pixel_height| are the representation
/// size in pixel coordinates. Returns true (1) on success.
/// </summary>
2019-05-11 15:40:19 +02:00
function GetRepresentationInfo( scaleFactor: Single ; var actualScaleFactor: Single ; var pixelWidth, pixelHeight: Integer ) : Boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the bitmap representation that most closely matches
/// |scale_factor|. Only 32-bit RGBA/BGRA formats are supported. |color_type|
/// and |alpha_type| values specify the desired output pixel format.
/// |pixel_width| and |pixel_height| are the output representation size in
2023-08-08 18:55:10 +02:00
/// pixel coordinates. Returns a ICefBinaryValue containing the pixel data
2023-08-07 20:21:42 +02:00
/// on success or NULL on failure.
/// </summary>
2019-05-11 15:40:19 +02:00
function GetAsBitmap( scaleFactor: Single ; colorType: TCefColorType; alphaType: TCefAlphaType; var pixelWidth, pixelHeight: Integer ) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the PNG representation that most closely matches |scale_factor|.
/// If |with_transparency| is true (1) any alpha transparency in the image
/// will be represented in the resulting PNG data. |pixel_width| and
/// |pixel_height| are the output representation size in pixel coordinates.
2023-08-08 18:55:10 +02:00
/// Returns a ICefBinaryValue containing the PNG image data on success or
2023-08-07 20:21:42 +02:00
/// NULL on failure.
/// </summary>
2019-05-11 15:40:19 +02:00
function GetAsPng( scaleFactor: Single ; withTransparency: Boolean ; var pixelWidth, pixelHeight: Integer ) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the JPEG representation that most closely matches |scale_factor|.
/// |quality| determines the compression level with 0 == lowest and 100 ==
/// highest. The JPEG format does not support alpha transparency and the alpha
/// channel, if any, will be discarded. |pixel_width| and |pixel_height| are
/// the output representation size in pixel coordinates. Returns a
2023-08-08 18:55:10 +02:00
/// ICefBinaryValue containing the JPEG image data on success or NULL on
2023-08-07 20:21:42 +02:00
/// failure.
/// </summary>
2019-05-11 15:40:19 +02:00
function GetAsJpeg( scaleFactor: Single ; quality: Integer ; var pixelWidth, pixelHeight: Integer ) : ICefBinaryValue;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the image width in density independent pixel (DIP) units.
/// </summary>
2018-05-12 14:50:54 +02:00
property Width : NativeUInt read GetWidth;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the image height in density independent pixel (DIP) units.
/// </summary>
2018-05-12 14:50:54 +02:00
property Height : NativeUInt read GetHeight;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle menu model events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMenuModelDelegate">Implements TCefMenuModelDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_menu_model_delegate_capi.h">CEF source file: /include/capi/cef_menu_model_delegate_capi.h (cef_menu_model_delegate_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefMenuModelDelegate = interface( ICefBaseRefCounted)
[ '{1430D202-2795-433E-9A35-C79A0996F316}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Perform the action associated with the specified |command_id| and optional
/// |event_flags|.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure ExecuteCommand( const menuModel: ICefMenuModel; commandId: Integer ; eventFlags: TCefEventFlags) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when the user moves the mouse outside the menu and over the owning
/// window.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure MouseOutsideMenu( const menuModel: ICefMenuModel; const screenPoint: PCefPoint) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on unhandled open submenu keyboard commands. |is_rtl| will be true
/// (1) if the menu is displaying a right-to-left language.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure UnhandledOpenSubmenu( const menuModel: ICefMenuModel; isRTL: boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called on unhandled close submenu keyboard commands. |is_rtl| will be true
/// (1) if the menu is displaying a right-to-left language.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure UnhandledCloseSubmenu( const menuModel: ICefMenuModel; isRTL: boolean ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// The menu is about to show.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure MenuWillShow( const menuModel: ICefMenuModel) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// The menu has closed.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure MenuClosed( const menuModel: ICefMenuModel) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Optionally modify a menu item label. Return true (1) if |label| was
/// modified.
/// </summary>
2019-11-24 18:19:49 +01:00
function FormatLabel( const menuModel: ICefMenuModel; var label_ : ustring) : boolean ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface representing a server that supports HTTP and WebSocket requests.
/// Server capacity is limited and is intended to handle only a small number of
/// simultaneous connections (e.g. for communicating between applications on
/// localhost). The functions of this interface are safe to call from any thread
/// in the brower process unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefServer">Implements TCefServer</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_server_capi.h">CEF source file: /include/capi/cef_server_capi.h (cef_server_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefServer = interface( ICefBaseRefCounted)
[ '{41D41764-A74B-4552-B166-C77E70549047}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the task runner for the dedicated server thread.
/// </summary>
2018-05-12 14:50:54 +02:00
function GetTaskRunner : ICefTaskRunner;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Stop the server and shut down the dedicated server thread. See
/// ICefServerHandler.OnServerCreated documentation for a description of
/// server lifespan.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure Shutdown;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the server is currently running and accepting incoming
/// connections. See ICefServerHandler.OnServerCreated documentation for a
/// description of server lifespan. This function must be called on the
/// dedicated server thread.
/// </summary>
2017-12-07 10:49:51 +01:00
function IsRunning : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the server address including the port number.
/// </summary>
2017-12-07 10:49:51 +01:00
function GetAddress : ustring;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the server currently has a connection. This function
/// must be called on the dedicated server thread.
/// </summary>
2017-12-07 10:49:51 +01:00
function HasConnection : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if |connection_id| represents a valid connection. This
/// function must be called on the dedicated server thread.
/// </summary>
2017-12-07 10:49:51 +01:00
function IsValidConnection( connection_id: Integer ) : boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send an HTTP 200 "OK" response to the connection identified by
/// |connection_id|. |content_type| is the response content type (e.g.
/// "text/html"), |data| is the response content, and |data_size| is the size
/// of |data| in bytes. The contents of |data| will be copied. The connection
/// will be closed automatically after the response is sent.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure SendHttp200response( connection_id: Integer ; const content_type: ustring; const data: Pointer ; data_size: NativeUInt ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send an HTTP 404 "Not Found" response to the connection identified by
/// |connection_id|. The connection will be closed automatically after the
/// response is sent.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure SendHttp404response( connection_id: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send an HTTP 500 "Internal Server Error" response to the connection
/// identified by |connection_id|. |error_message| is the associated error
/// message. The connection will be closed automatically after the response is
/// sent.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure SendHttp500response( connection_id: Integer ; const error_message: ustring) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a custom HTTP response to the connection identified by
/// |connection_id|. |response_code| is the HTTP response code sent in the
/// status line (e.g. 200), |content_type| is the response content type sent
/// as the "Content-Type" header (e.g. "text/html"), |content_length| is the
/// expected content length, and |extra_headers| is the map of extra response
/// headers. If |content_length| is >= 0 then the "Content-Length" header will
/// be sent. If |content_length| is 0 then no content is expected and the
/// connection will be closed automatically after the response is sent. If
/// |content_length| is < 0 then no "Content-Length" header will be sent and
/// the client will continue reading until the connection is closed. Use the
/// SendRawData function to send the content, if applicable, and call
/// CloseConnection after all content has been sent.
/// </summary>
2018-03-29 20:02:04 +02:00
procedure SendHttpResponse( connection_id, response_code: Integer ; const content_type: ustring; content_length: int64 ; const extra_headers: ICefStringMultimap) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send raw data directly to the connection identified by |connection_id|.
/// |data| is the raw data and |data_size| is the size of |data| in bytes. The
/// contents of |data| will be copied. No validation of |data| is performed
/// internally so the client should be careful to send the amount indicated by
/// the "Content-Length" header, if specified. See SendHttpResponse
/// documentation for intended usage.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure SendRawData( connection_id: Integer ; const data: Pointer ; data_size: NativeUInt ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Close the connection identified by |connection_id|. See SendHttpResponse
/// documentation for intended usage.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure CloseConnection( connection_id: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Send a WebSocket message to the connection identified by |connection_id|.
/// |data| is the response content and |data_size| is the size of |data| in
/// bytes. The contents of |data| will be copied. See
/// ICefServerHandler.OnWebSocketRequest documentation for intended usage.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure SendWebSocketMessage( connection_id: Integer ; const data: Pointer ; data_size: NativeUInt ) ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle HTTP server requests. A new thread will
/// be created for each ICefServer.CreateServer call (the "dedicated server
/// thread"), and the functions of this interface will be called on that thread.
/// It is therefore recommended to use a different ICefServerHandler instance
/// for each ICefServer.CreateServer call to avoid thread safety issues in
/// the ICefServerHandler implementation.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefServerHandler">Implements TCefServerHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_server_capi.h">CEF source file: /include/capi/cef_server_capi.h (cef_server_handler_t)</see></para>
/// </remarks>
2018-05-12 14:50:54 +02:00
ICefServerHandler = interface( ICefBaseRefCounted)
[ '{AFB64A63-44C9-44CD-959B-D8E20F549879}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when |server| is created. If the server was started successfully
/// then ICefServer.IsRunning will return true (1). The server will
/// continue running until ICefServerShutdown is called, after which time
/// OnServerDestroyed will be called. If the server failed to start then
/// OnServerDestroyed will be called immediately after this function returns.
/// </summary>
2018-05-12 14:50:54 +02:00
procedure OnServerCreated( const server: ICefServer) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when |server| is destroyed. The server thread will be stopped after
/// this function returns. The client should release any references to
/// |server| when this function is called. See OnServerCreated documentation
/// for a description of server lifespan.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnServerDestroyed( const server: ICefServer) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when a client connects to |server|. |connection_id| uniquely
/// identifies the connection. Each call to this function will have a matching
/// call to OnClientDisconnected.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnClientConnected( const server: ICefServer; connection_id: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when a client disconnects from |server|. |connection_id| uniquely
/// identifies the connection. The client should release any data associated
/// with |connection_id| when this function is called and |connection_id|
/// should no longer be passed to ICefServer functions. Disconnects can
/// originate from either the client or the server. For example, the server
/// will disconnect automatically after a ICefServer.SendHttpXXXResponse
/// function is called.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnClientDisconnected( const server: ICefServer; connection_id: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when |server| receives an HTTP request. |connection_id| uniquely
/// identifies the connection, |client_address| is the requesting IPv4 or IPv6
/// client address including port number, and |request| contains the request
/// contents (URL, function, headers and optional POST data). Call
/// ICefServer functions either synchronously or asynchronusly to send a
/// response.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnHttpRequest( const server: ICefServer; connection_id: Integer ; const client_address: ustring; const request: ICefRequest) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when |server| receives a WebSocket request. |connection_id|
/// uniquely identifies the connection, |client_address| is the requesting
/// IPv4 or IPv6 client address including port number, and |request| contains
/// the request contents (URL, function, headers and optional POST data).
/// Execute |callback| either synchronously or asynchronously to accept or
/// decline the WebSocket connection. If the request is accepted then
/// OnWebSocketConnected will be called after the WebSocket has connected and
/// incoming messages will be delivered to the OnWebSocketMessage callback. If
/// the request is declined then the client will be disconnected and
/// OnClientDisconnected will be called. Call the
/// ICefServer.SendWebSocketMessage function after receiving the
/// OnWebSocketConnected callback to respond with WebSocket messages.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnWebSocketRequest( const server: ICefServer; connection_id: Integer ; const client_address: ustring; const request: ICefRequest; const callback: ICefCallback) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called after the client has accepted the WebSocket connection for |server|
/// and |connection_id| via the OnWebSocketRequest callback. See
/// OnWebSocketRequest documentation for intended usage.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnWebSocketConnected( const server: ICefServer; connection_id: Integer ) ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Called when |server| receives an WebSocket message. |connection_id|
/// uniquely identifies the connection, |data| is the message content and
/// |data_size| is the size of |data| in bytes. Do not keep a reference to
/// |data| outside of this function. See OnWebSocketRequest documentation for
/// intended usage.
/// </summary>
2017-12-07 10:49:51 +01:00
procedure OnWebSocketMessage( const server: ICefServer; connection_id: Integer ; const data: Pointer ; data_size: NativeUInt ) ;
2018-05-12 14:50:54 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for asynchronous continuation of media access
/// permission requests.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaAccessCallback">Implements TCefMediaAccessCallback</see></para>
/// This record is declared twice with almost identical parameters. "allowed_permissions" is defined as int and uint32.
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_access_handler_capi.h">CEF source file: /include/capi/cef_media_access_handler_capi.h (cef_media_access_callback_t)</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_permission_handler_capi.h">CEF source file: /include/capi/cef_permission_handler_capi.h (cef_media_access_callback_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefMediaAccessCallback = interface( ICefBaseRefCounted)
[ '{66F6F5F4-8489-408B-B9ED-6B705C2E2010}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Call to allow or deny media access. If this callback was initiated in
/// response to a getUserMedia (indicated by
/// CEF_MEDIA_PERMISSION_DEVICE_AUDIO_CAPTURE and/or
/// CEF_MEDIA_PERMISSION_DEVICE_VIDEO_CAPTURE being set) then
/// |allowed_permissions| must match |required_permissions| passed to
/// OnRequestMediaAccessPermission.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure cont( allowed_permissions: TCefMediaAccessPermissionTypes) ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Cancel the media access request.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure cancel;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to media access permission
/// requests. The functions of this interface will be called on the browser
/// process UI thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMediaAccessHandler">Implements TCefMediaAccessHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_media_access_handler_capi.h">CEF source file: /include/capi/cef_media_access_handler_capi.h (cef_media_access_handler_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefMediaAccessHandler = interface( ICefBaseRefCounted)
[ '{8ED04C4A-05F2-46FD-89C4-E6114000D219}' ]
function OnRequestMediaAccessPermission( const browser: ICefBrowser; const frame: ICefFrame; const requesting_url: ustring; requested_permissions: TCefMediaAccessPermissionTypes; const callback: ICefMediaAccessCallback) : boolean ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure RemoveReferences;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Callback interface used for asynchronous continuation of permission prompts.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPermissionPromptCallback">Implements TCefPermissionPromptCallback</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_permission_handler_capi.h">CEF source file: /include/capi/cef_permission_handler_capi.h (cef_permission_prompt_callback_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefPermissionPromptCallback = interface( ICefBaseRefCounted)
[ '{F8827C7D-7B14-499E-B38A-5F9FEB1FD6A6}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Complete the permissions request with the specified |result|.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure cont( result : TCefPermissionRequestResult) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle events related to permission requests.
/// The functions of this interface will be called on the browser process UI
/// thread.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPermissionHandler">Implements TCefPermissionHandler</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_permission_handler_capi.h">CEF source file: /include/capi/cef_permission_handler_capi.h (cef_permission_handler_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefPermissionHandler = interface( ICefBaseRefCounted)
[ '{DC079268-FB08-44DA-B216-35C5C339B341}' ]
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a page requests permission to access media.
/// |requesting_origin| is the URL origin requesting permission.
/// |requested_permissions| is a combination of values from
2023-08-07 20:21:42 +02:00
/// TCefMediaAccessPermissionTypes that represent the requested
/// permissions. Return true (1) and call ICefMediaAccessCallback
2023-08-03 22:11:42 +02:00
/// functions either in this function or at a later time to continue or cancel
/// the request. Return false (0) to proceed with default handling. With the
/// Chrome runtime, default handling will display the permission request UI.
/// With the Alloy runtime, default handling will deny the request. This
/// function will not be called if the "--enable-media-stream" command-line
/// switch is used to grant all permissions.
/// </summary>
2022-08-06 12:00:28 +02:00
function OnRequestMediaAccessPermission( const browser: ICefBrowser; const frame: ICefFrame; const requesting_origin: ustring; requested_permissions: cardinal ; const callback: ICefMediaAccessCallback) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a page should show a permission prompt. |prompt_id| uniquely
/// identifies the prompt. |requesting_origin| is the URL origin requesting
/// permission. |requested_permissions| is a combination of values from
2023-08-07 20:21:42 +02:00
/// TCefPermissionRequestTypes that represent the requested permissions.
/// Return true (1) and call ICefPermissionPromptCallback.Continue either
2023-08-03 22:11:42 +02:00
/// in this function or at a later time to continue or cancel the request.
/// Return false (0) to proceed with default handling. With the Chrome
/// runtime, default handling will display the permission prompt UI. With the
/// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
/// </summary>
2022-08-06 12:00:28 +02:00
function OnShowPermissionPrompt( const browser: ICefBrowser; prompt_id: uint64 ; const requesting_origin: ustring; requested_permissions: cardinal ; const callback: ICefPermissionPromptCallback) : boolean ;
2023-08-03 22:11:42 +02:00
/// <summary>
/// Called when a permission prompt handled via OnShowPermissionPrompt is
/// dismissed. |prompt_id| will match the value that was passed to
/// OnShowPermissionPrompt. |result| will be the value passed to
2023-08-07 20:21:42 +02:00
/// ICefPermissionPromptCallback.Continue or CEF_PERMISSION_RESULT_IGNORE
2023-08-03 22:11:42 +02:00
/// if the dialog was dismissed for other reasons such as navigation, browser
/// closure, etc. This function will not be called if OnShowPermissionPrompt
/// returned false (0) for |prompt_id|.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure OnDismissPermissionPrompt( const browser: ICefBrowser; prompt_id: uint64 ; result : TCefPermissionRequestResult) ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Custom procedure to clear all references.
/// </summary>
2022-08-06 12:00:28 +02:00
procedure RemoveReferences;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that wraps platform-dependent share memory region mapping.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSharedMemoryRegion">Implements TCefSharedMemoryRegion</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_shared_memory_region_capi.h">CEF source file: /include/capi/cef_shared_memory_region_capi.h (cef_shared_memory_region_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefSharedMemoryRegion = interface( ICefBaseRefCounted)
[ '{2828D0E1-44D0-4C6F-8C63-5CA6036DDA82}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the mapping is valid.
/// </summary>
2022-08-06 12:00:28 +02:00
function IsValid: boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the size of the mapping in bytes. Returns 0 for invalid instances.
/// </summary>
2022-08-06 12:00:28 +02:00
function Size: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the pointer to the memory. Returns nullptr for invalid instances.
/// The returned pointer is only valid for the life span of this object.
/// </summary>
2022-08-06 12:00:28 +02:00
function Memory: pointer ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Interface that builds a ICefProcessMessage containing a shared memory
/// region. This interface is not thread-safe but may be used exclusively on a
/// different thread from the one which constructed it.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefSharedProcessMessageBuilder">Implements TCefSharedProcessMessageBuilder</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_shared_process_message_builder_capi.h">CEF source file: /include/capi/cef_shared_process_message_builder_capi.h (cef_shared_process_message_builder_t)</see></para>
/// </remarks>
2022-08-06 12:00:28 +02:00
ICefSharedProcessMessageBuilder = interface( ICefBaseRefCounted)
[ '{B2AF627F-33FA-44F1-B943-FC4F120C84F8}' ]
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns true (1) if the builder is valid.
/// </summary>
2022-08-06 12:00:28 +02:00
function IsValid: boolean ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the size of the shared memory region in bytes. Returns 0 for
/// invalid instances.
/// </summary>
2022-08-06 12:00:28 +02:00
function Size: NativeUInt ;
2023-08-07 20:21:42 +02:00
/// <summary>
/// Returns the pointer to the writable memory. Returns nullptr for invalid
/// instances. The returned pointer is only valid for the life span of this
/// object.
/// </summary>
2022-08-06 12:00:28 +02:00
function Memory: pointer ;
2023-08-07 20:21:42 +02:00
/// <summary>
2023-08-08 18:55:10 +02:00
/// Creates a new ICefProcessMessage from the data provided to the builder.
2023-08-07 20:21:42 +02:00
/// Returns nullptr for invalid instances. Invalidates the builder instance.
/// </summary>
2022-08-06 12:00:28 +02:00
function Build: ICefProcessMessage;
end ;
2018-05-24 19:15:41 +02:00
2020-03-29 17:31:42 +02:00
2023-08-09 19:38:57 +02:00
{ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * Views * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* }
2018-05-24 19:15:41 +02:00
2023-07-30 18:47:35 +02:00
/// <summary>
/// This interface typically, but not always, corresponds to a physical display
/// connected to the system. A fake Display may exist on a headless system, or a
/// Display may correspond to a remote, virtual display. All size and position
/// values are in density independent pixel (DIP) coordinates unless otherwise
/// indicated. Methods must be called on the browser process UI thread unless
/// otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefDisplay">Implements TCefDisplay</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_display_capi.h">CEF source file: /include/capi/views/cef_display_capi.h (cef_display_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefDisplay = interface( ICefBaseRefCounted)
[ '{EC2D3606-DB4C-4894-8D38-B8F99E091965}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the unique identifier for this Display.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetID : int64 ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's device pixel scale factor. This specifies how much
/// the UI should be scaled when the actual output has more pixels than
/// standard displays (which is around 100~120dpi). The potential return
/// values differ by platform.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetDeviceScaleFactor : Single ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| from DIP coordinates to pixel coordinates using this
/// Display's device scale factor.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ConvertPointToPixels( var point: TCefPoint) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| from pixel coordinates to DIP coordinates using this
/// Display's device scale factor.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ConvertPointFromPixels( var point: TCefPoint) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's bounds in DIP screen coordinates. This is the full
/// size of the display.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetBounds : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's work area in DIP screen coordinates. This excludes
/// areas of the display that are occupied with window manager toolbars, etc.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetWorkArea : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's rotation in degrees.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetRotation : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the unique identifier for this Display.
/// </summary>
2020-04-29 19:14:44 +02:00
property ID : int64 read GetID;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's device pixel scale factor. This specifies how much
/// the UI should be scaled when the actual output has more pixels than
/// standard displays (which is around 100~120dpi). The potential return
/// values differ by platform.
/// </summary>
2020-04-29 19:14:44 +02:00
property DeviceScaleFactor : Single read GetDeviceScaleFactor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's bounds in DIP screen coordinates. This is the full
/// size of the display.
/// </summary>
2020-04-29 19:14:44 +02:00
property Bounds : TCefRect read GetBounds;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's work area in DIP screen coordinates. This excludes
/// areas of the display that are occupied with window manager toolbars, etc.
/// </summary>
2020-04-29 19:14:44 +02:00
property WorkArea : TCefRect read GetWorkArea;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Display's rotation in degrees.
/// </summary>
2020-04-29 19:14:44 +02:00
property Rotation : Integer read GetRotation;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A Layout handles the sizing of the children of a Panel according to
/// implementation-specific heuristics. Methods must be called on the browser
/// process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefLayout">Implements TCefLayout</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_layout_capi.h">CEF source file: /include/capi/views/cef_layout_capi.h (cef_layout_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefLayout = interface( ICefBaseRefCounted)
[ '{0EC7AE4B-1672-4D0B-B617-0BDA72F3C7F4}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Layout as a BoxLayout or NULL if this is not a BoxLayout.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsBoxLayout : ICefBoxLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Layout as a FillLayout or NULL if this is not a FillLayout.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsFillLayout : ICefFillLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this Layout is valid.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsValid : boolean ;
2020-04-29 19:14:44 +02:00
property Valid : boolean read IsValid;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A Layout manager that arranges child views vertically or horizontally in a
/// side-by-side fashion with spacing around and between the child views. The
/// child views are always sized according to their preferred size. If the
/// host's bounds provide insufficient space, child views will be clamped.
/// Excess space will not be distributed. Methods must be called on the browser
/// process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBoxLayout">Implements TCefBoxLayout</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_box_layout_capi.h">CEF source file: /include/capi/views/cef_box_layout_capi.h (cef_box_layout_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefBoxLayout = interface( ICefLayout)
[ '{E59FCCAE-A371-4C21-98D3-93D3217016AE}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the flex weight for the given |view|. Using the preferred size as the
/// basis, free space along the main axis is distributed to views in the ratio
/// of their flex weights. Similarly, if the views will overflow the parent,
/// space is subtracted in these ratios. A flex of 0 means this view is not
/// resized. Flex values must not be negative.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetFlexForView( const view: ICefView; flex: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Clears the flex for the given |view|, causing it to use the default flex
/// specified via TCefBoxLayoutSettings.default_flex.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ClearFlexForView( const view: ICefView) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A simple Layout that causes the associated Panel's one child to be sized to
/// match the bounds of its parent. Methods must be called on the browser
/// process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefFillLayout">Implements TCefFillLayout</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_fill_layout_capi.h">CEF source file: /include/capi/views/cef_fill_layout_capi.h (cef_fill_layout_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefFillLayout = interface( ICefLayout)
[ '{3DB214F2-7F27-4306-82C9-8166160422B1}' ]
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Controller for an overlay that contains a contents View added via
/// ICefWindow.AddOverlayView. Methods exposed by this controller should be
/// called in preference to functions of the same name exposed by the contents
/// View unless otherwise indicated. Methods must be called on the browser
/// process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefOverlayController">Implements TCefOverlayController</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_overlay_controller_capi.h">CEF source file: /include/capi/views/cef_overlay_controller_capi.h (cef_overlay_controller_t)</see></para>
/// </remarks>
2021-09-27 12:04:33 +02:00
ICefOverlayController = interface( ICefBaseRefCounted)
[ '{13E1F3D2-32FF-4D30-A30E-D67B6A4846AB}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this object is valid.
/// </summary>
2021-09-27 12:04:33 +02:00
function IsValid: boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this object is the same as |that| object.
/// </summary>
2021-09-27 12:04:33 +02:00
function IsSame( const that: ICefOverlayController) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the contents View for this overlay.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetContentsView: ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the top-level Window hosting this overlay. Use this function
/// instead of calling get_window() on the contents View.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetWindow: ICefWindow;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the docking mode for this overlay.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetDockingMode: TCefDockingMode;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Destroy this overlay.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure DestroyOverlay;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the bounds (size and position) of this overlay. This will set the
/// bounds of the contents View to match and trigger a re-layout if necessary.
/// |bounds| is in parent coordinates and any insets configured on this
/// overlay will be ignored. Use this function only for overlays created with
/// a docking mode value of CEF_DOCKING_MODE_CUSTOM. With other docking modes
/// modify the insets of this overlay and/or layout of the contents View and
/// call size_to_preferred_size() instead to calculate the new size and re-
/// position the overlay if necessary.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetBounds( const bounds: TCefRect) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this overlay in parent
/// coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetBounds: TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this overlay in DIP screen
/// coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetBoundsInScreen: TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the size of this overlay without changing the position. This will set
/// the size of the contents View to match and trigger a re-layout if
/// necessary. |size| is in parent coordinates and any insets configured on
/// this overlay will be ignored. Use this function only for overlays created
/// with a docking mode value of CEF_DOCKING_MODE_CUSTOM. With other docking
/// modes modify the insets of this overlay and/or layout of the contents View
/// and call size_to_preferred_size() instead to calculate the new size and
/// re-position the overlay if necessary.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetSize( const size: TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size of this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetSize: TCefSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the position of this overlay without changing the size. |position| is
/// in parent coordinates and any insets configured on this overlay will be
/// ignored. Use this function only for overlays created with a docking mode
/// value of CEF_DOCKING_MODE_CUSTOM. With other docking modes modify the
/// insets of this overlay and/or layout of the contents View and call
/// size_to_preferred_size() instead to calculate the new size and re-position
/// the overlay if necessary.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetPosition( const position: TCefPoint) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the position of this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetPosition: TCefPoint;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the insets for this overlay. |insets| is in parent coordinates. Use
/// this function only for overlays created with a docking mode value other
/// than CEF_DOCKING_MODE_CUSTOM.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetInsets( const insets: TCefInsets) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the insets for this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetInsets: TCefInsets;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Size this overlay to its preferred size and trigger a re-layout if
/// necessary. The position of overlays created with a docking mode value of
/// CEF_DOCKING_MODE_CUSTOM will not be modified by calling this function.
/// With other docking modes this function may re-position the overlay if
/// necessary to accommodate the new size and any insets configured on the
/// contents View.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SizeToPreferredSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets whether this overlay is visible. Overlays are hidden by default. If
/// this overlay is hidden then it and any child Views will not be drawn and,
/// if any of those Views currently have focus, then focus will also be
/// cleared. Painting is scheduled as needed.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetVisible( visible: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this overlay is visible. A View may be visible but still
/// not drawn in a Window if any parent Views are hidden. Call is_drawn() to
/// determine whether this overlay and all parent Views are visible and will
/// be drawn.
/// </summary>
2021-09-27 12:04:33 +02:00
function IsVisible: boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this overlay is visible and drawn in a Window. A View is
/// drawn if it and all parent Views are visible. To determine if the
/// containing Window is visible to the user on-screen call is_visible() on
/// the Window.
/// </summary>
2021-09-27 12:04:33 +02:00
function IsDrawn: boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the contents View for this overlay.
/// </summary>
2021-09-27 12:04:33 +02:00
property ContentsView : ICefView read GetContentsView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the top-level Window hosting this overlay. Use this function
/// instead of calling get_window() on the contents View.
/// </summary>
2021-09-27 12:04:33 +02:00
property Window : ICefWindow read GetWindow;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the docking mode for this overlay.
/// </summary>
2021-09-27 12:04:33 +02:00
property DockingMode : TCefDockingMode read GetDockingMode;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this overlay in parent
/// coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
property Bounds : TCefRect read GetBounds write SetBounds;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this overlay in DIP screen
/// coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
property BoundsInScreen : TCefRect read GetBoundsInScreen;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size of this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
property Size : TCefSize read GetSize write SetSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the position of this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
property Position : TCefPoint read GetPosition write SetPosition;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the insets for this overlay in parent coordinates.
/// </summary>
2021-09-27 12:04:33 +02:00
property Insets : TCefInsets read GetInsets write SetInsets;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this overlay is visible. A View may be visible but still
/// not drawn in a Window if any parent Views are hidden. Call is_drawn() to
/// determine whether this overlay and all parent Views are visible and will
/// be drawn.
/// </summary>
2021-09-27 12:04:33 +02:00
property Visible : boolean read IsVisible write SetVisible;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this overlay is visible and drawn in a Window. A View is
/// drawn if it and all parent Views are visible. To determine if the
/// containing Window is visible to the user on-screen call is_visible() on
/// the Window.
/// </summary>
2021-09-27 12:04:33 +02:00
property Drawn : boolean read IsDrawn;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A View is a rectangle within the views View hierarchy. It is the base
/// interface for all Views. All size and position values are in density
/// independent pixels (DIP) unless otherwise indicated. Methods must be called
/// on the browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefView">Implements TCefView</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_view_capi.h">CEF source file: /include/capi/views/cef_view_capi.h (cef_view_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefView = interface( ICefBaseRefCounted)
[ '{E9AF950A-F4E8-420C-BD1F-F26F4FDFA48D}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this View as a BrowserView or NULL if this is not a BrowserView.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsBrowserView : ICefBrowserView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this View as a Button or NULL if this is not a Button.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsButton : ICefButton;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this View as a Panel or NULL if this is not a Panel.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsPanel : ICefPanel;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this View as a ScrollView or NULL if this is not a ScrollView.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsScrollView : ICefScrollView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this View as a Textfield or NULL if this is not a Textfield.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsTextfield : ICefTextfield;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the type of this View as a string. Used primarily for testing
/// purposes.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetTypeString : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns a string representation of this View which includes the type and
/// various type-specific identifying attributes. If |include_children| is
/// true (1) any child Views will also be included. Used primarily for testing
/// purposes.
/// </summary>
2020-04-29 19:14:44 +02:00
function ToStringEx( include_children: boolean ) : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is valid.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsValid : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is currently attached to another View. A
/// View can only be attached to one View at a time.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsAttached : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is the same as |that| View.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsSame( const that: ICefView) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the delegate associated with this View, if any.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetDelegate : ICefViewDelegate;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the top-level Window hosting this View, if any.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetWindow : ICefWindow;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the ID for this View.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetID : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the ID for this View. ID should be unique within the subtree that you
/// intend to search for it. 0 is the default ID for views.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetID( id_: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the group id of this View, or -1 if not set.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetGroupID : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// A group id is used to tag Views which are part of the same logical group.
/// Focus can be moved between views with the same group using the arrow keys.
/// The group id is immutable once it's set.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetGroupID( group_id: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the View that contains this View, if any.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetParentView : ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Recursively descends the view tree starting at this View, and returns the
/// first child that it encounters with the given ID. Returns NULL if no
/// matching child view is found.
/// </summary>
2020-04-29 19:14:44 +02:00
function GetViewForID( id_: Integer ) : ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the bounds (size and position) of this View. |bounds| is in parent
/// coordinates, or DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetBounds( const bounds_: TCefRect) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this View in parent coordinates,
/// or DIP screen coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetBounds : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this View in DIP screen
/// coordinates.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetBoundsInScreen : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the size of this View without changing the position. |size| in parent
/// coordinates, or DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetSize( const size_: TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size of this View in parent coordinates, or DIP screen
/// coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetSize : TCefSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the position of this View without changing the size. |position| is in
/// parent coordinates, or DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetPosition( const position_: TCefPoint) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the position of this View. Position is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetPosition : TCefPoint;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the insets for this View. |insets| is in parent coordinates, or DIP
/// screen coordinates if there is no parent.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure SetInsets( const insets: TCefInsets) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the insets for this View in parent coordinates, or DIP screen
/// coordinates if there is no parent.
/// </summary>
2021-09-27 12:04:33 +02:00
function GetInsets: TCefInsets;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size this View would like to be if enough space is available.
/// Size is in parent coordinates, or DIP screen coordinates if there is no
/// parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetPreferredSize : TCefSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Size this View to its preferred size. Size is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SizeToPreferredSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the minimum size for this View. Size is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetMinimumSize : TCefSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the maximum size for this View. Size is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetMaximumSize : TCefSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the height necessary to display this View with the provided width.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetHeightForWidth( width: Integer ) : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Indicate that this View and all parent Views require a re-layout. This
/// ensures the next call to layout() will propagate to this View even if the
/// bounds of parent Views do not change.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure InvalidateLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets whether this View is visible. Windows are hidden by default and other
/// views are visible by default. This View and any parent views must be set
/// as visible for this View to be drawn in a Window. If this View is set as
/// hidden then it and any child views will not be drawn and, if any of those
/// views currently have focus, then focus will also be cleared. Painting is
/// scheduled as needed. If this View is a Window then calling this function
/// is equivalent to calling the Window show() and hide() functions.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetVisible( visible_: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is visible. A view may be visible but still not
/// drawn in a Window if any parent views are hidden. If this View is a Window
/// then a return value of true (1) indicates that this Window is currently
/// visible to the user on-screen. If this View is not a Window then call
/// is_drawn() to determine whether this View and all parent views are visible
/// and will be drawn.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsVisible : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is visible and drawn in a Window. A view is
/// drawn if it and all parent views are visible. If this View is a Window
/// then calling this function is equivalent to calling is_visible().
/// Otherwise, to determine if the containing Window is visible to the user
/// on-screen call is_visible() on the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsDrawn : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set whether this View is enabled. A disabled View does not receive
/// keyboard or mouse inputs. If |enabled| differs from the current value the
/// View will be repainted. Also, clears focus if the focused View is
/// disabled.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetEnabled( enabled_: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is enabled.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsEnabled : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets whether this View is capable of taking focus. It will clear focus if
/// the focused View is set to be non-focusable. This is false (0) by default
/// so that a View used as a container does not get the focus.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetFocusable( focusable_: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is focusable, enabled and drawn.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsFocusable : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return whether this View is focusable when the user requires full keyboard
/// access, even though it may not be normally focusable.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsAccessibilityFocusable : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Request keyboard focus. If this View is focusable it will become the
/// focused View.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure RequestFocus;
2023-08-08 18:55:10 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Sets the background color for this View. The background color will be
/// automatically reset when ICefViewDelegate.OnThemeChanged is called.
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetBackgroundColor( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Returns the background color for this View. If the background color is
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
/// will be returned. If this View belongs to an overlay (created with
/// ICefWindow.AddOverlayView), and the background color is unset, then a
/// value of transparent (0) will be returned.
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
function GetBackgroundColor : TCefColor;
2023-08-08 18:55:10 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Returns the current theme color associated with |color_id|, or the
/// placeholder color (red) if unset. See cef_color_ids.h for standard ID
/// values. Standard colors can be overridden and custom colors can be added
/// using ICefWindow.SetThemeColor.
/// </summary>
function GetThemeColor( color_id: integer ) : TCefColor;
/// <summary>
2023-08-08 18:55:10 +02:00
/// Convert |point| from this View's coordinate system to DIP screen
/// coordinates. This View must belong to a Window when calling this function.
/// Returns true (1) if the conversion is successful or false (0) otherwise.
/// Use ICefDisplay.ConvertPointToPixels() after calling this function
/// if further conversion to display-specific pixel coordinates is desired.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointToScreen( var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| to this View's coordinate system from DIP screen
/// coordinates. This View must belong to a Window when calling this function.
/// Returns true (1) if the conversion is successful or false (0) otherwise.
/// Use ICefDisplay.ConvertPointFromPixels() before calling this
/// function if conversion from display-specific pixel coordinates is
/// necessary.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointFromScreen( var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| from this View's coordinate system to that of the Window.
/// This View must belong to a Window when calling this function. Returns true
/// (1) if the conversion is successful or false (0) otherwise.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointToWindow( var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| to this View's coordinate system from that of the Window.
/// This View must belong to a Window when calling this function. Returns true
/// (1) if the conversion is successful or false (0) otherwise.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointFromWindow( var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| from this View's coordinate system to that of |view|.
/// |view| needs to be in the same Window but not necessarily the same view
/// hierarchy. Returns true (1) if the conversion is successful or false (0)
/// otherwise.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointToView( const view : ICefView; var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Convert |point| to this View's coordinate system from that |view|. |view|
/// needs to be in the same Window but not necessarily the same view
/// hierarchy. Returns true (1) if the conversion is successful or false (0)
/// otherwise.
/// </summary>
2020-04-29 19:14:44 +02:00
function ConvertPointFromView( const view : ICefView; var point: TCefPoint) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is valid.
/// </summary>
2020-04-29 19:14:44 +02:00
property Valid : boolean read IsValid;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is currently attached to another View. A
/// View can only be attached to one View at a time.
/// </summary>
2020-04-29 19:14:44 +02:00
property Attached : boolean read IsAttached;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the delegate associated with this View, if any.
/// </summary>
2020-04-29 19:14:44 +02:00
property Delegate : ICefViewDelegate read GetDelegate;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the top-level Window hosting this View, if any.
/// </summary>
2020-04-29 19:14:44 +02:00
property Window : ICefWindow read GetWindow;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the View that contains this View, if any.
/// </summary>
2020-04-29 19:14:44 +02:00
property ParentView : ICefView read GetParentView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this View in DIP screen
/// coordinates.
/// </summary>
2020-04-29 19:14:44 +02:00
property BoundsInScreen : TCefRect read GetBoundsInScreen;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size this View would like to be if enough space is available.
/// Size is in parent coordinates, or DIP screen coordinates if there is no
/// parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property PreferredSize : TCefSize read GetPreferredSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the minimum size for this View. Size is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property MinimumSize : TCefSize read GetMinimumSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the maximum size for this View. Size is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property MaximumSize : TCefSize read GetMaximumSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is visible. A view may be visible but still not
/// drawn in a Window if any parent views are hidden. If this View is a Window
/// then a return value of true (1) indicates that this Window is currently
/// visible to the user on-screen. If this View is not a Window then call
/// is_drawn() to determine whether this View and all parent views are visible
/// and will be drawn.
/// </summary>
2020-04-29 19:14:44 +02:00
property Visible : boolean read IsVisible write SetVisible;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is visible and drawn in a Window. A view is
/// drawn if it and all parent views are visible. If this View is a Window
/// then calling this function is equivalent to calling is_visible().
/// Otherwise, to determine if the containing Window is visible to the user
/// on-screen call is_visible() on the Window.
/// </summary>
2020-04-29 19:14:44 +02:00
property Drawn : boolean read IsDrawn;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether this View is enabled.
/// </summary>
2020-04-29 19:14:44 +02:00
property Enabled : boolean read IsEnabled write SetEnabled;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if this View is focusable, enabled and drawn.
/// </summary>
2020-04-29 19:14:44 +02:00
property Focusable : boolean read IsFocusable write SetFocusable;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return whether this View is focusable when the user requires full keyboard
/// access, even though it may not be normally focusable.
/// </summary>
2020-04-29 19:14:44 +02:00
property AccessibilityFocusable : boolean read IsAccessibilityFocusable;
2023-08-08 18:55:10 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// Returns the background color for this View. If the background color is
/// unset then the current `GetThemeColor(CEF_ColorPrimaryBackground)` value
/// will be returned. If this View belongs to an overlay (created with
/// ICefWindow.AddOverlayView), and the background color is unset, then a
/// value of transparent (0) will be returned.
2023-08-08 18:55:10 +02:00
/// </summary>
2020-04-29 19:14:44 +02:00
property BackgroundColor : TCefColor read GetBackgroundColor write SetBackgroundColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the ID for this View.
/// </summary>
2020-04-29 19:14:44 +02:00
property ID : integer read GetID write SetID;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the group id of this View, or -1 if not set.
/// </summary>
2020-04-29 19:14:44 +02:00
property GroupID : integer read GetGroupID write SetGroupID;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this View in parent coordinates,
/// or DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property Bounds : TCefRect read GetBounds write SetBounds;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the size of this View in parent coordinates, or DIP screen
/// coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property Size : TCefSize read GetSize write SetSize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the position of this View. Position is in parent coordinates, or
/// DIP screen coordinates if there is no parent.
/// </summary>
2020-04-29 19:14:44 +02:00
property Position : TCefPoint read GetPosition write SetPosition;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the insets for this View in parent coordinates, or DIP screen
/// coordinates if there is no parent.
/// </summary>
2021-09-27 12:04:33 +02:00
property Insets : TCefInsets read GetInsets write SetInsets;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the type of this View as a string. Used primarily for testing
/// purposes.
/// </summary>
2020-05-05 18:10:33 +02:00
property TypeString : ustring read GetTypeString;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle view events. All size and position values
/// are in density independent pixels (DIP) unless otherwise indicated. The
/// functions of this interface will be called on the browser process UI thread
/// unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefViewDelegate">Implements TCefViewDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_view_delegate_capi.h">CEF source file: /include/capi/views/cef_view_delegate_capi.h (cef_view_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefViewDelegate = interface( ICefBaseRefCounted)
[ '{5F900206-B969-4E51-B56C-0FF38D749C72}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the preferred size for |view|. The Layout will use this information
/// to determine the display size.
/// </summary>
2020-04-30 17:28:41 +02:00
procedure OnGetPreferredSize( const view: ICefView; var aResult : TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the minimum size for |view|.
/// </summary>
2020-04-30 17:28:41 +02:00
procedure OnGetMinimumSize( const view: ICefView; var aResult : TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the maximum size for |view|.
/// </summary>
2020-04-30 17:28:41 +02:00
procedure OnGetMaximumSize( const view: ICefView; var aResult : TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the height necessary to display |view| with the provided |width|.
/// If not specified the result of get_preferred_size().height will be used by
/// default. Override if |view|'s preferred height depends upon the width (for
/// example, with Labels).
/// </summary>
2020-04-30 17:28:41 +02:00
procedure OnGetHeightForWidth( const view: ICefView; width: Integer ; var aResult: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when the parent of |view| has changed. If |view| is being added to
/// |parent| then |added| will be true (1). If |view| is being removed from
/// |parent| then |added| will be false (0). If |view| is being reparented the
/// remove notification will be sent before the add notification. Do not
/// modify the view hierarchy in this callback.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnParentViewChanged( const view: ICefView; added: boolean ; const parent: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when a child of |view| has changed. If |child| is being added to
/// |view| then |added| will be true (1). If |child| is being removed from
/// |view| then |added| will be false (0). If |child| is being reparented the
/// remove notification will be sent to the old parent before the add
/// notification is sent to the new parent. Do not modify the view hierarchy
/// in this callback.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnChildViewChanged( const view: ICefView; added: boolean ; const child: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |view| is added or removed from the ICefWindow.
/// </summary>
procedure OnWindowChanged( const view: ICefView; added: boolean ) ;
/// <summary>
/// Called when the layout of |view| has changed.
/// </summary>
2021-09-27 12:04:33 +02:00
procedure OnLayoutChanged( const view: ICefView; new_bounds: TCefRect) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |view| gains focus.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnFocus( const view: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |view| loses focus.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnBlur( const view: ICefView) ;
2024-05-01 18:19:19 +02:00
/// <summary>
/// <para>Called when the theme for |view| has changed, after the new theme colors
/// have already been applied. Views are notified via the component hierarchy
/// in depth-first reverse order (children before parents).</para>
/// <para>This will be called in the following cases:</para>
/// <code>
/// 1. When |view|, or a parent of |view|, is added to a Window.
/// 2. When the native/OS or Chrome theme changes for the Window that contains
/// |view|. See ICefWindowDelegate.OnThemeColorsChanged documentation.
/// 3. When the client explicitly calls ICefWindow.ThemeChanged on the
/// Window that contains |view|.
/// </code>
/// <para>Optionally use this callback to override the new per-View theme colors by
/// calling ICefView.SetBackgroundColor or the appropriate component-
/// specific function. See ICefWindow.SetThemeColor documentation for how
/// to customize additional Window theme colors.</para>
/// <summary>
procedure OnThemeChanged( const view: ICefView) ;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A Textfield supports editing of text. This control is custom rendered with
/// no platform-specific code. Methods must be called on the browser process UI
/// thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefTextfield">Implements TCefTextfield</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_textfield_capi.h">CEF source file: /include/capi/views/cef_textfield_capi.h (cef_textfield_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefTextfield = interface( ICefView)
[ '{B5E30155-DEA5-4CBF-BC9D-578CBCA586D9}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets whether the text will be displayed as asterisks.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetPasswordInput( password_input: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the text will be displayed as asterisks.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsPasswordInput : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets whether the text will read-only.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetReadOnly( read_only: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the text is read-only.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsReadOnly : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the currently displayed text.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetText : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the contents to |text|. The cursor will be moved to end of the text
/// if the current position is outside of the text range.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetText( const text_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Appends |text| to the previously-existing text.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure AppendText( const text_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Inserts |text| at the current cursor position replacing any selected text.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure InsertOrReplaceText( const text_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if there is any selected text.
/// </summary>
2018-05-24 19:15:41 +02:00
function HasSelection : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the currently selected text.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetSelectedText : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Selects all text. If |reversed| is true (1) the range will end at the
/// logical beginning of the text; this generally shows the leading portion of
/// text that overflows its display area.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SelectAll( reversed: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Clears the text selection and sets the caret to the end.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ClearSelection;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the selected logical text range.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetSelectedRange : TCefRange;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Selects the specified logical text range.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SelectRange( const range: TCefRange) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the current cursor position.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetCursorPosition : NativeUInt ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the text color.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetTextColor( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the text color.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetTextColor : TCefColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the selection text color.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetSelectionTextColor( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the selection text color.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetSelectionTextColor : TCefColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the selection background color.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetSelectionBackgroundColor( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the selection background color.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetSelectionBackgroundColor : TCefColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
2024-02-01 15:13:22 +01:00
/// where:
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names (case-sensitive
2023-08-08 18:55:10 +02:00
/// "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
2024-02-01 15:13:22 +01:00
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetFontList( const font_list: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Applies |color| to the specified |range| without changing the default
/// color. If |range| is NULL the color will be set on the complete text
/// contents.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure ApplyTextColor( color: TCefColor; const range: TCefRange) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Applies |style| to the specified |range| without changing the default
/// style. If |add| is true (1) the style will be added, otherwise the style
/// will be removed. If |range| is NULL the style will be set on the complete
/// text contents.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure ApplyTextStyle( style: TCefTextStyle; add: boolean ; const range: TCefRange) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the action associated with the specified command id is
/// enabled. See additional comments on execute_command().
/// </summary>
2020-07-18 19:12:01 +02:00
function IsCommandEnabled( command_id: TCefTextFieldCommands) : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Performs the action associated with the specified command id.
/// </summary>
2020-07-18 19:12:01 +02:00
procedure ExecuteCommand( command_id: TCefTextFieldCommands) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Clears Edit history.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ClearEditHistory;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the placeholder text that will be displayed when the Textfield is
/// NULL.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetPlaceholderText( const text_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the placeholder text that will be displayed when the Textfield is
/// NULL.
/// </summary>
2020-04-29 19:14:44 +02:00
function GetPlaceholderText : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the placeholder text color.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetPlaceholderTextColor( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the accessible name that will be exposed to assistive technology (AT).
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetAccessibleName( const name : ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the text will be displayed as asterisks.
/// </summary>
2020-04-29 19:14:44 +02:00
property PasswordInput : boolean read IsPasswordInput write SetPasswordInput;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the text is read-only.
/// </summary>
2020-04-29 19:14:44 +02:00
property ReadOnly : boolean read IsReadOnly write SetReadOnly;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the currently displayed text.
/// </summary>
2020-04-29 19:14:44 +02:00
property Text : ustring read GetText write SetText;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the currently selected text.
/// </summary>
2020-04-29 19:14:44 +02:00
property SelectedText : ustring read GetSelectedText;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the text color.
/// </summary>
2020-04-29 19:14:44 +02:00
property TextColor : TCefColor read GetTextColor write SetTextColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the selection text color.
/// </summary>
2020-04-29 19:14:44 +02:00
property SelectionTextColor : TCefColor read GetSelectionTextColor write SetSelectionTextColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the selection background color.
/// </summary>
2020-04-29 19:14:44 +02:00
property SelectionBackgroundColor : TCefColor read GetSelectionBackgroundColor write SetSelectionBackgroundColor;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the placeholder text that will be displayed when the Textfield is
/// NULL.
/// </summary>
2020-04-29 19:14:44 +02:00
property PlaceholderText : ustring read GetPlaceholderText write SetPlaceholderText;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle Textfield events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefTextfieldDelegate">Implements TCefTextfieldDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_textfield_delegate_capi.h">CEF source file: /include/capi/views/cef_textfield_delegate_capi.h (cef_textfield_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefTextfieldDelegate = interface( ICefViewDelegate)
[ '{72612994-92BB-4DE9-BB38-6F49FB45F94B}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
2024-02-01 15:13:22 +01:00
/// Called when |textfield| receives a keyboard event. |event| contains
2023-08-08 18:55:10 +02:00
/// information about the keyboard event. Return true (1) if the keyboard
/// event was handled or false (0) otherwise for default handling.
/// </summary>
2020-05-05 18:10:33 +02:00
procedure OnKeyEvent( const textfield: ICefTextfield; const event: TCefKeyEvent; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called after performing a user action that may change |textfield|.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnAfterUserAction( const textfield: ICefTextfield) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A ScrollView will show horizontal and/or vertical scrollbars when necessary
/// based on the size of the attached content view. Methods must be called on
/// the browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefScrollView">Implements TCefScrollView</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_scroll_view_capi.h">CEF source file: /include/capi/views/cef_scroll_view_capi.h (cef_scroll_view_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefScrollView = interface( ICefView)
[ '{55DF2883-0574-4F10-B6F5-DE4730964B5B}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the content View. The content View must have a specified size (e.g.
/// via ICefView.SetBounds or ICefViewDelegate.GetPreferredSize).
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetContentView( const view: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the content View.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetContentView : ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the visible region of the content View.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetVisibleContentRect : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the horizontal scrollbar is currently showing.
/// </summary>
2018-05-24 19:15:41 +02:00
function HasHorizontalScrollbar : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the height of the horizontal scrollbar.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetHorizontalScrollbarHeight : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the vertical scrollbar is currently showing.
/// </summary>
2018-05-24 19:15:41 +02:00
function HasVerticalScrollbar : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the width of the vertical scrollbar.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetVerticalScrollbarWidth : Integer ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the content View.
/// </summary>
2020-04-29 19:14:44 +02:00
property ContentView : ICefView read GetContentView write SetContentView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the visible region of the content View.
/// </summary>
2020-04-29 19:14:44 +02:00
property VisibleContentRect : TCefRect read GetVisibleContentRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the height of the horizontal scrollbar.
/// </summary>
2020-04-29 19:14:44 +02:00
property HorizontalScrollbarHeight : Integer read GetHorizontalScrollbarHeight;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the width of the vertical scrollbar.
/// </summary>
2020-04-29 19:14:44 +02:00
property VerticalScrollbarWidth : Integer read GetVerticalScrollbarWidth;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A Panel is a container in the views hierarchy that can contain other Views
/// as children. Methods must be called on the browser process UI thread unless
/// otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPanel">Implements TCefPanel</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_panel_capi.h">CEF source file: /include/capi/views/cef_panel_capi.h (cef_panel_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefPanel = interface( ICefView)
[ '{6F2F680A-3637-4438-81B8-79AD6C02252D}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Panel as a Window or NULL if this is not a Window.
/// </summary>
2020-05-05 18:10:33 +02:00
function GetAsWindow : ICefWindow;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set this Panel's Layout to FillLayout and return the FillLayout object.
/// </summary>
2018-05-24 19:15:41 +02:00
function SetToFillLayout : ICefFillLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set this Panel's Layout to BoxLayout and return the BoxLayout object.
/// </summary>
2020-04-29 19:14:44 +02:00
function SetToBoxLayout( const settings: TCefBoxLayoutSettings) : ICefBoxLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Layout.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetLayout : ICefLayout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Lay out the child Views (set their bounds based on sizing heuristics
/// specific to the current Layout).
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Layout;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Add a child View.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure AddChildView( const view: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Add a child View at the specified |index|. If |index| matches the result
/// of GetChildCount() then the View will be added at the end.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure AddChildViewAt( const view: ICefView; index : Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Move the child View to the specified |index|. A negative value for |index|
/// will move the View to the end.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure ReorderChildView( const view: ICefView; index : Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Remove a child View. The View can then be added to another Panel.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure RemoveChildView( const view: ICefView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Remove all child Views. The removed Views will be deleted if the client
/// holds no references to them.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure RemoveAllChildViews;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the number of child Views.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetChildViewCount : NativeUInt ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the child View at the specified |index|.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetChildViewAt( index : Integer ) : ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Panel as a Window or NULL if this is not a Window.
/// </summary>
2020-05-05 18:10:33 +02:00
property AsWindow : ICefWindow read GetAsWindow;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle Panel events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefPanelDelegate">Implements TCefPanelDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_panel_delegate_capi.h">CEF source file: /include/capi/views/cef_panel_delegate_capi.h (cef_panel_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefPanelDelegate = interface( ICefViewDelegate)
[ '{305D453F-FEBA-48ED-AE33-5D978823EA96}' ]
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A View hosting a ICefBrowser instance. Methods must be called on the
/// browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBrowserView">Implements TCefBrowserView</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_browser_view_capi.h">CEF source file: /include/capi/views/cef_browser_view_capi.h (cef_browser_view_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefBrowserView = interface( ICefView)
[ '{A617EE5D-B933-4E14-9FC0-7E88E9B6C051}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the ICefBrowser hosted by this BrowserView. Will return NULL if
/// the browser has not yet been created or has already been destroyed.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetBrowser : ICefBrowser;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the Chrome toolbar associated with this BrowserView. Only
2023-09-24 11:21:05 +02:00
/// supported when using the Chrome runtime. The ICefBrowserViewDelegate.GetChromeToolbarType
2023-08-08 18:55:10 +02:00
/// function must return a value other than
/// CEF_CTT_NONE and the toolbar will not be available until after this
/// BrowserView is added to a ICefWindow and
/// ICefViewDelegate.OnWindowChanged() has been called.
/// </summary>
2021-04-18 19:36:20 +02:00
function GetChromeToolbar : ICefView;
2023-08-08 18:55:10 +02:00
/// <summary>
2023-11-16 16:58:47 +01:00
/// Sets whether normal priority accelerators are first forwarded to the web
/// content (`keydown` event handler) or ICefKeyboardHandler. Normal priority
/// accelerators can be registered via ICefWindow.SetAccelerator (with
/// |high_priority|=false) or internally for standard accelerators supported
/// by the Chrome runtime. If |prefer_accelerators| is true then the matching
/// accelerator will be triggered immediately (calling
/// ICefWindowDelegate.OnAccelerator or ICefCommandHandler.OnChromeCommand
/// respectively) and the event will not be forwarded to the web content or
/// ICefKeyboardHandler first. If |prefer_accelerators| is false then the
/// matching accelerator will only be triggered if the event is not handled by
/// web content (`keydown` event handler that calls `event.preventDefault()`)
/// or by ICefKeyboardHandler. The default value is false.
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetPreferAccelerators( prefer_accelerators: boolean ) ;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Returns the runtime style for this BrowserView (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
function GetRuntimeStyle : TCefRuntimeStyle;
/// <summary>
/// Returns the runtime style for this BrowserView (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
property RuntimeStyle : TCefRuntimeStyle read GetRuntimeStyle;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle BrowserView events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefBrowserViewDelegate">Implements TCefBrowserViewDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_browser_view_delegate_capi.h">CEF source file: /include/capi/views/cef_browser_view_delegate_capi.h (cef_browser_view_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefBrowserViewDelegate = interface( ICefViewDelegate)
[ '{578A0DD4-2E7D-4061-B4DB-7C3CDC7A90C0}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |browser| associated with |browser_view| is created. This
/// function will be called after ICefLifeSpanHandler.OnAfterCreated()
/// is called for |browser| and before OnPopupBrowserViewCreated() is
/// called for |browser|'s parent delegate if |browser| is a popup.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnBrowserCreated( const browser_view: ICefBrowserView; const browser: ICefBrowser) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |browser| associated with |browser_view| is destroyed. Release
/// all references to |browser| and do not attempt to execute any functions on
/// |browser| after this callback returns. This function will be called before
/// ICefLifeSpanHandler.OnBeforeClose() is called for |browser|.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnBrowserDestroyed( const browser_view: ICefBrowserView; const browser: ICefBrowser) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called before a new popup BrowserView is created. The popup originated
/// from |browser_view|. |settings| and |client| are the values returned from
/// ICefLifeSpanHandler.OnBeforePopup(). |is_devtools| will be true (1)
/// if the popup will be a DevTools browser. Return the delegate that will be
/// used for the new popup BrowserView.
/// </summary>
2020-05-05 18:10:33 +02:00
procedure OnGetDelegateForPopupBrowserView( const browser_view: ICefBrowserView; const settings: TCefBrowserSettings; const client: ICefClient; is_devtools: boolean ; var aResult : ICefBrowserViewDelegate) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called after |popup_browser_view| is created. This function will be called
/// after ICefLifeSpanHandler.OnAfterCreated() and OnBrowserCreated()
/// are called for the new popup browser. The popup originated from
/// |browser_view|. |is_devtools| will be true (1) if the popup is a DevTools
/// browser. Optionally add |popup_browser_view| to the views hierarchy
/// yourself and return true (1). Otherwise return false (0) and a default
/// ICefWindow will be created for the popup.
/// </summary>
2020-05-05 18:10:33 +02:00
procedure OnPopupBrowserViewCreated( const browser_view, popup_browser_view: ICefBrowserView; is_devtools: boolean ; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the Chrome toolbar type that will be available via
/// ICefBrowserView.GetChromeToolbar(). See that function for related
/// documentation.
/// </summary>
2023-09-26 19:06:38 +02:00
procedure OnGetChromeToolbarType( const browser_view: ICefBrowserView; var aResult : TCefChromeToolbarType) ;
2023-09-24 11:21:05 +02:00
/// <summary>
/// Return true (1) to create frameless windows for Document picture-in-
/// picture popups. Content in frameless windows should specify draggable
/// regions using "-webkit-app-region: drag" CSS.
/// </summary>
procedure OnUseFramelessWindowForPictureInPicture( const browser_view: ICefBrowserView; var aResult: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |browser_view| receives a gesture command. Return true (1) to
/// handle (or disable) a |gesture_command| or false (0) to propagate the
2023-09-01 17:27:50 +02:00
/// gesture to the browser for default handling. With the Chrome runtime these
/// commands can also be handled via cef_command_handler_t::OnChromeCommand.
2023-08-08 18:55:10 +02:00
/// </summary>
2023-05-29 17:20:32 +02:00
procedure OnGestureCommand( const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean ) ;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Optionally change the runtime style for this BrowserView. See
/// TCefRuntimeStyle documentation for details.
/// </summary>
procedure OnGetBrowserRuntimeStyle( var aResult : TCefRuntimeStyle) ;
2020-05-05 18:10:33 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A View representing a button. Depending on the specific type, the button
/// could be implemented by a native control or custom rendered. Methods must be
/// called on the browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefButton">Implements TCefButton</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_button_capi.h">CEF source file: /include/capi/views/cef_button_capi.h (cef_button_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefButton = interface( ICefView)
[ '{D3D2E8A0-9F9C-4BD8-B495-655976534281}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this Button as a LabelButton or NULL if this is not a LabelButton.
/// </summary>
2018-05-24 19:15:41 +02:00
function AsLabelButton : ICefLabelButton;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the current display state of the Button.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetState( state_: TCefButtonState) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the current display state of the Button.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetState : TCefButtonState;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the Button will use an ink drop effect for displaying state changes.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetInkDropEnabled( enabled_: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the tooltip text that will be displayed when the user hovers the
/// mouse cursor over the Button.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetTooltipText( const tooltip_text: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the accessible name that will be exposed to assistive technology
/// (AT).
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetAccessibleName( const name : ustring) ;
2020-04-29 19:14:44 +02:00
property State : TCefButtonState read GetState write SetState;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle Button events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefButtonDelegate">Implements TCefButtonDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_button_delegate_capi.h">CEF source file: /include/capi/views/cef_button_delegate_capi.h (cef_button_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefButtonDelegate = interface( ICefViewDelegate)
[ '{EA1EB5A4-DFB0-4A13-A23B-54FAF9401B39}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |button| is pressed.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnButtonPressed( const button: ICefButton) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when the state of |button| changes.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure OnButtonStateChanged( const button: ICefButton) ;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// LabelButton is a button with optional text and/or icon. Methods must be
/// called on the browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefLabelButton">Implements TCefLabelButton</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_label_button_capi.h">CEF source file: /include/capi/views/cef_label_button_capi.h (cef_label_button_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefLabelButton = interface( ICefButton)
[ '{A99FD4F3-7EE6-4796-8BF6-EC367D51EED8}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns this LabelButton as a MenuButton or NULL if this is not a
/// MenuButton.
/// </summary>
2020-04-29 19:14:44 +02:00
function AsMenuButton : ICefMenuButton;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the text shown on the LabelButton. By default |text| will also be
/// used as the accessible name.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetText( const text_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the text shown on the LabelButton.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetText : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the image shown for |button_state|. When this Button is drawn if no
/// image exists for the current state then the image for
/// CEF_BUTTON_STATE_NORMAL, if any, will be shown.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetImage( button_state: TCefButtonState; const image: ICefImage) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the image shown for |button_state|. If no image exists for that
/// state then the image for CEF_BUTTON_STATE_NORMAL will be returned.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetImage( button_state: TCefButtonState) : ICefImage;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the text color shown for the specified button |for_state| to |color|.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetTextColor( for_state: TCefButtonState; color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the text colors shown for the non-disabled states to |color|.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetEnabledTextColors( color: TCefColor) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
2024-02-01 15:13:22 +01:00
/// where:
/// - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names (case-sensitive
2023-08-08 18:55:10 +02:00
/// "Bold" and "Italic" are supported), and
/// - SIZE is an integer font size in pixels with the suffix "px".
///
2024-02-01 15:13:22 +01:00
/// Here are examples of valid font description strings:
/// - "Arial, Helvetica, Bold Italic 14px"
/// - "Arial, 14px"
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetFontList( const font_list: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sets the horizontal alignment; reversed in RTL. Default is
/// CEF_HORIZONTAL_ALIGNMENT_CENTER.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetHorizontalAlignment( alignment: TCefHorizontalAlignment) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Reset the minimum size of this LabelButton to |size|.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetMinimumSize( const size_: TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Reset the maximum size of this LabelButton to |size|.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetMaximumSize( const size_: TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the text shown on the LabelButton.
/// </summary>
2020-04-29 19:14:44 +02:00
property Text : ustring read GetText write SetText;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// MenuButton is a button with optional text, icon and/or menu marker that
/// shows a menu when clicked with the left mouse button. All size and position
/// values are in density independent pixels (DIP) unless otherwise indicated.
/// Methods must be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMenuButton">Implements TCefMenuButton</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_menu_button_capi.h">CEF source file: /include/capi/views/cef_menu_button_capi.h (cef_menu_button_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefMenuButton = interface( ICefLabelButton)
[ '{62BFE81A-7810-400B-83C6-76D1DF133710}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
/// position in screen coordinates. |anchor_position| specifies how the menu
/// will be anchored relative to |screen_point|. This function should be
/// called from ICefMenuButtonDelegate.OnMenuButtonPressed().
/// </summary>
2020-04-29 19:14:44 +02:00
procedure ShowMenu( const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position: TCefMenuAnchorPosition) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Show the menu for this button. Results in a call to
/// ICefMenuButtonDelegate.OnMenuButtonPressed().
/// </summary>
2018-05-24 19:15:41 +02:00
procedure TriggerMenu;
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// MenuButton pressed lock is released when this object is destroyed.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMenuButtonPressedLock">Implements TCefMenuButtonPressedLock</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_menu_button_delegate_capi.h">CEF source file: /include/capi/views/cef_menu_button_delegate_capi.h (cef_menu_button_pressed_lock_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefMenuButtonPressedLock = interface( ICefBaseRefCounted)
[ '{71498C53-0B1D-4A05-98A0-3E589F2A1683}' ]
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle MenuButton events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefMenuButtonDelegate">Implements TCefMenuButtonDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_menu_button_delegate_capi.h">CEF source file: /include/capi/views/cef_menu_button_delegate_capi.h (cef_menu_button_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefMenuButtonDelegate = interface( ICefButtonDelegate)
[ '{D0E89A75-463A-4766-8701-BD8D24B11E9F}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |button| is pressed. Call ICefMenuButton.ShowMenu() to
/// show a popup menu at |screen_point|. When showing a custom popup such as a
/// window keep a reference to |button_pressed_lock| until the popup is hidden
/// to maintain the pressed button state.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure OnMenuButtonPressed( const menu_button: ICefMenuButton; const screen_point: TCefPoint; const button_pressed_lock: ICefMenuButtonPressedLock) ;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// A Window is a top-level Window/widget in the Views hierarchy. By default it
/// will have a non-client area with title bar, icon and buttons that supports
/// moving and resizing. All size and position values are in density independent
/// pixels (DIP) unless otherwise indicated. Methods must be called on the
/// browser process UI thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefWindow">Implements TCefWindow</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_window_capi.h">CEF source file: /include/capi/views/cef_window_capi.h (cef_window_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefWindow = interface( ICefPanel)
[ '{C450C974-BF0A-4968-A6BE-153CEAD10DA6}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Show the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Show;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Show the Window as a browser modal dialog relative to |browser_view|. A
/// parent Window must be returned via
/// ICefWindowDelegate.GetParentWindow() and |browser_view| must belong
/// to that parent Window. While this Window is visible, |browser_view| will
/// be disabled while other controls in the parent Window remain enabled.
/// Navigating or destroying the |browser_view| will close this Window
/// automatically. Alternately, use show() and return true (1) from
/// ICefWindowDelegate.IsWindowModalDialog() for a window modal dialog
/// where all controls in the parent Window are disabled.
/// </summary>
2023-07-30 18:47:35 +02:00
procedure ShowAsBrowserModalDialog( const browser_view: ICefBrowserView) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Hide the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Hide;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Sizes the Window to |size| and centers it in the current display.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure CenterWindow( const size_: TCefSize) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Close the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Close;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the Window has been closed.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsClosed : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Activate the Window, assuming it already exists and is visible.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Activate;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Deactivate the Window, making the next Window in the Z order the active
/// Window.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure Deactivate;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether the Window is the currently active Window.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsActive : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Bring this Window to the top of other Windows in the Windowing system.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure BringToTop;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the Window to be on top of other Windows in the Windowing system.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetAlwaysOnTop( on_top: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns whether the Window has been set to be on top of other Windows in
/// the Windowing system.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsAlwaysOnTop : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Maximize the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Maximize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Minimize the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Minimize;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Restore the Window.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure Restore;
2023-08-08 18:55:10 +02:00
/// <summary>
2023-09-30 20:04:38 +02:00
/// Set fullscreen Window state. The
/// ICefWindowDelegate.OnWindowFullscreenTransition function will be
/// called during the fullscreen transition for notification purposes.
2023-08-08 18:55:10 +02:00
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetFullscreen( fullscreen: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the Window is maximized.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsMaximized : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the Window is minimized.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsMinimized : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns true (1) if the Window is fullscreen.
/// </summary>
2018-05-24 19:15:41 +02:00
function IsFullscreen : boolean ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the Window title.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetTitle( const title_: ustring) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window title.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetTitle : ustring;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the Window icon. This should be a 16x16 icon suitable for use in the
/// Windows's title bar.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetWindowIcon( const image: ICefImage) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window icon.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetWindowIcon : ICefImage;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the Window App icon. This should be a larger icon for use in the host
/// environment app switching UI. On Windows, this is the ICON_BIG used in
/// Alt-Tab list and Windows taskbar. The Window icon will be used by default
/// if no Window App icon is specified.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SetWindowAppIcon( const image: ICefImage) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window App icon.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetWindowAppIcon : ICefImage;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Add a View that will be overlayed on the Window contents with absolute
/// positioning and high z-order. Positioning is controlled by |docking_mode|
2024-02-01 15:13:22 +01:00
/// as described below. Setting |can_activate| to true (1) will allow the
/// overlay view to receive input focus. The returned cef_overlay_controller_t
/// object is used to control the overlay. Overlays are hidden by default.
2023-08-08 18:55:10 +02:00
///
/// With CEF_DOCKING_MODE_CUSTOM:
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
/// and positioned in the top-left corner.
/// 2. Optionally change the overlay position and/or size by calling
/// CefOverlayController methods.
/// 3. Call ICefOverlayController.SetVisible(true) to show the overlay.
/// 4. The overlay will be automatically re-sized if |view|'s layout
/// changes. Optionally change the overlay position and/or size when
/// OnLayoutChanged is called on the Window's delegate to indicate a
/// change in Window bounds.
///
/// With other docking modes:
/// 1. The overlay is initially hidden, sized to |view|'s preferred size,
/// and positioned based on |docking_mode|.
/// 2. Call ICefOverlayController.SetVisible(true) to show the overlay.
/// 3. The overlay will be automatically re-sized if |view|'s layout changes
/// and re-positioned as appropriate when the Window resizes.
///
/// Overlays created by this function will receive a higher z-order then any
/// child Views added previously. It is therefore recommended to call this
/// function last after all other child Views have been added so that the
/// overlay displays as the top-most child of the Window.
/// </summary>
2024-02-01 15:13:22 +01:00
function AddOverlayView( const view: ICefView; docking_mode: TCefDockingMode; can_activate: boolean ) : ICefOverlayController;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Show a menu with contents |menu_model|. |screen_point| specifies the menu
/// position in screen coordinates. |anchor_position| specifies how the menu
/// will be anchored relative to |screen_point|.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure ShowMenu( const menu_model: ICefMenuModel; const screen_point: TCefPoint; anchor_position : TCefMenuAnchorPosition) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Cancel the menu that is currently showing, if any.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure CancelMenu;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the Display that most closely intersects the bounds of this
/// Window. May return NULL if this Window is not currently displayed.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetDisplay : ICefDisplay;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this Window's client area.
/// Position is in screen coordinates.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetClientAreaBoundsInScreen : TCefRect;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Set the regions where mouse events will be intercepted by this Window to
/// support drag operations. Call this function with an NULL vector to clear
/// the draggable regions. The draggable region bounds should be in window
/// coordinates.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SetDraggableRegions( regionsCount: NativeUInt ; const regions: PCefDraggableRegionArray) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Retrieve the platform window handle for this Window.
/// </summary>
2018-05-24 19:15:41 +02:00
function GetWindowHandle : TCefWindowHandle;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Simulate a key press. |key_code| is the VKEY_* value from Chromium's
/// ui/events/keycodes/keyboard_codes.h header (VK_* values on Windows).
/// |event_flags| is some combination of EVENTFLAG_SHIFT_DOWN,
/// EVENTFLAG_CONTROL_DOWN and/or EVENTFLAG_ALT_DOWN. This function is exposed
/// primarily for testing purposes.
/// </summary>
2020-05-05 18:10:33 +02:00
procedure SendKeyPress( key_code: Integer ; event_flags: cardinal ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Simulate a mouse move. The mouse cursor will be moved to the specified
/// (screen_x, screen_y) position. This function is exposed primarily for
/// testing purposes.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure SendMouseMove( screen_x, screen_y: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Simulate mouse down and/or mouse up events. |button| is the mouse button
/// type. If |mouse_down| is true (1) a mouse down event will be sent. If
/// |mouse_up| is true (1) a mouse up event will be sent. If both are true (1)
/// a mouse down event will be sent followed by a mouse up event (equivalent
/// to clicking the mouse button). The events will be sent using the current
/// cursor position so make sure to call send_mouse_move() first to position
/// the mouse. This function is exposed primarily for testing purposes.
/// </summary>
2020-04-29 19:14:44 +02:00
procedure SendMouseEvents( button: TCefMouseButtonType; mouse_down, mouse_up: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
2023-11-16 16:58:47 +01:00
/// <para>Set the keyboard accelerator for the specified |command_id|. |key_code|
/// can be any virtual key or character value. Required modifier keys are
/// specified by |shift_pressed|, |ctrl_pressed| and/or |alt_pressed|.
2023-08-08 18:55:10 +02:00
/// ICefWindowDelegate.OnAccelerator will be called if the keyboard
2023-11-16 16:58:47 +01:00
/// combination is triggered while this window has focus.</para>
/// <para>The |high_priority| value will be considered if a child ICefBrowserView
/// has focus when the keyboard combination is triggered. If |high_priority|
/// is true (1) then the key event will not be forwarded to the web content
/// (`keydown` event handler) or ICefKeyboardHandler first. If
/// |high_priority| is false (0) then the behavior will depend on the
/// ICefBrowserView.SetPreferAccelerators configuration.</para>
/// </summary>
procedure SetAccelerator( command_id, key_code : Integer ; shift_pressed, ctrl_pressed, alt_pressed, high_priority: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Remove the keyboard accelerator for the specified |command_id|.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure RemoveAccelerator( command_id: Integer ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Remove all keyboard accelerators.
/// </summary>
2018-05-24 19:15:41 +02:00
procedure RemoveAllAccelerators;
2024-05-01 18:19:19 +02:00
/// <summary>
/// <para>Override a standard theme color or add a custom color associated with
/// |color_id|. See cef_color_ids.h for standard ID values. Recommended usage
/// is as follows:</para>
/// <code>
/// 1. Customize the default native/OS theme by calling SetThemeColor before
/// showing the first Window. When done setting colors call
/// ICefWindow.ThemeChanged to trigger ICefViewDelegate.OnThemeChanged
/// notifications.
/// 2. Customize the current native/OS or Chrome theme after it changes by
/// calling SetThemeColor from the ICefWindowDelegate.OnThemeColorsChanged
/// callback. ICefViewDelegate.OnThemeChanged notifications will then be
/// triggered automatically.
/// </code>
/// <para>The configured color will be available immediately via
/// ICefView.GetThemeColor and will be applied to each View in this
/// Window's component hierarchy when ICefViewDelegate.OnThemeChanged is
/// called. See OnThemeColorsChanged documentation for additional details.</para>
/// <para>Clients wishing to add custom colors should use |color_id| values >=
/// CEF_ChromeColorsEnd.</para>
/// </summary>
procedure SetThemeColor( color_id: integer ; color: TCefColor) ;
/// <summary>
2024-05-28 15:50:48 +02:00
/// <para>Trigger ICefViewDelegate.OnThemeChanged callbacks for each View in
2024-05-01 18:19:19 +02:00
/// this Window's component hierarchy. Unlike a native/OS or Chrome theme
/// change this function does not reset theme colors to standard values and
/// does not result in a call to ICefWindowDelegate.OnThemeColorsChanged.</para>
/// <para>Do not call this function from ICefWindowDelegate.OnThemeColorsChanged
/// or ICefViewDelegate.OnThemeChanged.</para>
/// </summary>
procedure ThemeChanged;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Returns the runtime style for this Window (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
function GetRuntimeStyle: TCefRuntimeStyle;
2024-05-01 18:19:19 +02:00
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window title.
/// </summary>
2020-04-29 19:14:44 +02:00
property Title : ustring read GetTitle write SetTitle;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window icon.
/// </summary>
2020-04-29 19:14:44 +02:00
property WindowIcon : ICefImage read GetWindowIcon write SetWindowIcon;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Get the Window App icon.
/// </summary>
2020-04-29 19:14:44 +02:00
property WindowAppIcon : ICefImage read GetWindowAppIcon write SetWindowAppIcon;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the Display that most closely intersects the bounds of this
/// Window. May return NULL if this Window is not currently displayed.
/// </summary>
2020-04-29 19:14:44 +02:00
property Display : ICefDisplay read GetDisplay;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Returns the bounds (size and position) of this Window's client area.
/// Position is in screen coordinates.
/// </summary>
2020-04-29 19:14:44 +02:00
property ClientAreaBoundsInScreen : TCefRect read GetClientAreaBoundsInScreen;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Retrieve the platform window handle for this Window.
/// </summary>
2020-04-29 19:14:44 +02:00
property WindowHandle : TCefWindowHandle read GetWindowHandle;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Returns the runtime style for this Window (ALLOY or CHROME). See
/// TCefRuntimeStyle documentation for details.
/// </summary>
property RuntimeStyle : TCefRuntimeStyle read GetRuntimeStyle;
2018-05-24 19:15:41 +02:00
end ;
2023-07-30 18:47:35 +02:00
/// <summary>
/// Implement this interface to handle window events. The functions of this
/// interface will be called on the browser process UI thread unless otherwise
/// indicated.
/// </summary>
/// <remarks>
/// <para><see cref="uCEFTypes|TCefWindowDelegate">Implements TCefWindowDelegate</see></para>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_window_delegate_capi.h">CEF source file: /include/capi/views/cef_window_delegate_capi.h (cef_window_delegate_t)</see></para>
/// </remarks>
2018-05-24 19:15:41 +02:00
ICefWindowDelegate = interface( ICefPanelDelegate)
[ '{52D4EE2C-303B-42B6-A35F-30D03834A23F}' ]
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |window| is created.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnWindowCreated( const window_: ICefWindow) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |window| is closing.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnWindowClosing( const window_: ICefWindow) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |window| is destroyed. Release all references to |window| and
/// do not attempt to execute any functions on |window| after this callback
/// returns.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnWindowDestroyed( const window_: ICefWindow) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |window| is activated or deactivated.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnWindowActivationChanged( const window_: ICefWindow; active: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when |window| bounds have changed. |new_bounds| will be in DIP
/// screen coordinates.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnWindowBoundsChanged( const window_: ICefWindow; const new_bounds: TCefRect) ;
2023-08-08 18:55:10 +02:00
/// <summary>
2023-09-30 20:04:38 +02:00
/// Called when |window| is transitioning to or from fullscreen mode. On MacOS
/// the transition occurs asynchronously with |is_competed| set to false (0)
/// when the transition starts and true (1) after the transition completes. On
/// other platforms the transition occurs synchronously with |is_completed|
/// set to true (1) after the transition completes. With the Alloy runtime you
/// must also implement ICefDisplayHandler.OnFullscreenModeChange to
/// handle fullscreen transitions initiated by browser content.
/// </summary>
procedure OnWindowFullscreenTransition( const window_: ICefWindow; is_completed: boolean ) ;
/// <summary>
2023-08-08 18:55:10 +02:00
/// Return the parent for |window| or NULL if the |window| does not have a
/// parent. Windows with parents will not get a taskbar button. Set |is_menu|
/// to true (1) if |window| will be displayed as a menu, in which case it will
/// not be clipped to the parent window bounds. Set |can_activate_menu| to
/// false (0) if |is_menu| is true (1) and |window| should not be activated
/// (given keyboard focus) when displayed.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnGetParentWindow( const window_: ICefWindow; var is_menu, can_activate_menu: boolean ; var aResult : ICefWindow) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| should be created as a window modal dialog.
/// Only called when a Window is returned via get_parent_window() with
/// |is_menu| set to false (0). All controls in the parent Window will be
/// disabled while |window| is visible. This functionality is not supported by
/// all Linux window managers. Alternately, use
/// ICefWindow.ShowAsBrowserModalDialog() for a browser modal dialog
/// that works on all platforms.
/// </summary>
2023-07-30 18:47:35 +02:00
procedure OnIsWindowModalDialog( const window_: ICefWindow; var aResult: boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the initial bounds for |window| in density independent pixel (DIP)
/// coordinates. If this function returns an NULL CefRect then
/// GetPreferredSize() will be called to retrieve the size, and the window
/// will be placed on the screen with origin (0,0). This function can be used
/// in combination with ICefView.GetBoundsInScreen() to restore the
/// previous window bounds.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnGetInitialBounds( const window_: ICefWindow; var aResult : TCefRect) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return the initial show state for |window|.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnGetInitialShowState( const window_: ICefWindow; var aResult : TCefShowState) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| should be created without a frame or title
/// bar. The window will be resizable if can_resize() returns true (1). Use
/// ICefWindow.SetDraggableRegions() to specify draggable regions.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnIsFrameless( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| should be created with standard window buttons
/// like close, minimize and zoom. This function is only supported on macOS.
/// </summary>
2023-03-10 16:55:57 +01:00
procedure OnWithStandardWindowButtons( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return whether the titlebar height should be overridden, and sets the
/// height of the titlebar in |titlebar_height|. On macOS, it can also be used
/// to adjust the vertical position of the traffic light buttons in frameless
/// windows. The buttons will be positioned halfway down the titlebar at a
/// height of |titlebar_height| / 2.
/// </summary>
2023-03-10 16:55:57 +01:00
procedure OnGetTitlebarHeight( const window_: ICefWindow; var titlebar_height: Single ; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
2024-05-01 18:19:19 +02:00
/// <para>Return whether the view should accept the initial mouse-down event,
/// allowing it to respond to click-through behavior. If STATE_ENABLED is
/// returned, the view will be sent a mouseDown: message for an initial mouse-
/// down event, activating the view with one click, instead of clicking first
/// to make the window active and then clicking the view.</para>
/// <para>This function is only supported on macOS. For more details, refer to the
/// documentation of acceptsFirstMouse.</para>
/// </summary>
procedure OnAcceptsFirstMouse( const window_: ICefWindow; var aResult: TCefState) ;
/// <summary>
2023-08-08 18:55:10 +02:00
/// Return true (1) if |window| can be resized.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnCanResize( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| can be maximized.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnCanMaximize( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| can be minimized.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnCanMinimize( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Return true (1) if |window| can be closed. This will be called for user-
/// initiated window close actions and when ICefWindow.close() is called.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnCanClose( const window_: ICefWindow; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called when a keyboard accelerator registered with
/// ICefWindow.SetAccelerator is triggered. Return true (1) if the
/// accelerator was handled or false (0) otherwise.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnAccelerator( const window_: ICefWindow; command_id: Integer ; var aResult : boolean ) ;
2023-08-08 18:55:10 +02:00
/// <summary>
/// Called after all other controls in the window have had a chance to handle
/// the event. |event| contains information about the keyboard event. Return
/// true (1) if the keyboard event was handled or false (0) otherwise.
/// </summary>
2022-12-16 11:29:15 +01:00
procedure OnKeyEvent( const window_: ICefWindow; const event: TCefKeyEvent; var aResult : boolean ) ;
2024-05-01 18:19:19 +02:00
/// <summary>
/// <para>Called after the native/OS or Chrome theme for |window| has changed.
/// |chrome_theme| will be true (1) if the notification is for a Chrome theme.</para>
/// <para>Native/OS theme colors are configured globally and do not need to be
/// customized for each Window individually. An example of a native/OS theme
/// change that triggers this callback is when the user switches between dark
/// and light mode during application lifespan. Native/OS theme changes can be
/// disabled by passing the `--force-dark-mode` or `--force-light-mode`
/// command-line flag.</para>
/// <para>Chrome theme colors will be applied and this callback will be triggered
/// if/when a BrowserView is added to the Window's component hierarchy. Chrome
/// theme colors can be configured on a per-RequestContext basis using
/// ICefRequestContext.SetChromeColorScheme or (Chrome runtime only) by
/// visiting chrome://settings/manageProfile. Any theme changes using those
/// mechanisms will also trigger this callback. Chrome theme colors will be
/// persisted and restored from disk cache with the Chrome runtime, and with
/// the Alloy runtime if persist_user_preferences is set to true (1) via
/// CefSettings or ICefRequestContext Settings.</para>
/// <para>This callback is not triggered on Window creation so clients that wish to
/// customize the initial native/OS theme must call
/// ICefWindow.SetThemeColor and ICefWindow.ThemeChanged before showing
/// the first Window.</para>
/// <para>Theme colors will be reset to standard values before this callback is
/// called for the first affected Window. Call ICefWindow.SetThemeColor
/// from inside this callback to override a standard color or add a custom
/// color. ICefViewDelegate.OnThemeChanged will be called after this
/// callback for the complete |window| component hierarchy.</para>
/// </summary>
procedure OnThemeColorsChanged( const window_: ICefWindow; chrome_theme: Integer ) ;
2024-05-28 15:50:48 +02:00
/// <summary>
/// Optionally change the runtime style for this Window. See
/// TCefRuntimeStyle documentation for details.
/// </summary>
procedure OnGetWindowRuntimeStyle( var aResult: TCefRuntimeStyle) ;
2018-05-24 19:15:41 +02:00
end ;
2018-05-12 14:50:54 +02:00
implementation
end .