unit uCEFInterfaces; {$IFDEF FPC} {$MODE OBJFPC}{$H+} {$ENDIF} {$I cef.inc} {$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF} {$MINENUMSIZE 4} interface uses {$IFDEF DELPHI16_UP} {$IFDEF MSWINDOWS}WinApi.Windows,{$ENDIF} System.Classes, {$ELSE} {$IFDEF MSWINDOWS}Windows,{$ENDIF} Classes, {$ENDIF} uCEFTypes, uCEFSchemeRegistrar; type ICefBrowser = interface; ICefFrame = interface; ICefFrameHandler = interface; 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; ICefUnresponsiveProcessCallback = interface; 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; ICefResourceRequestHandler = interface; ICefCookieAccessFilter = interface; ICefResourceBundleHandler = interface; ICefBrowserProcessHandler = interface; ICefRenderProcessHandler = interface; ICefProcessMessage = interface; ICefLifeSpanHandler = interface; ICefCommandHandler = interface; ICefGetExtensionResourceCallback = interface; ICefExtensionHandler = interface; ICefExtension = interface; ICefStreamReader = interface; ICefLoadHandler = interface; ICefServer = interface; ICefServerHandler = interface; ICefContextMenuParams = interface; ICefMenuModel = interface; ICefRunContextMenuCallback = interface; ICefRunQuickMenuCallback = interface; ICefDownloadItem = interface; ICefBeforeDownloadCallback = interface; ICefJsDialogCallback = interface; ICefDownloadItemCallback = interface; ICefResourceSkipCallback = interface; ICefResourceReadCallback = interface; ICefResourceHandler = interface; ICefResponse = interface; ICefResponseFilter = interface; ICefAuthCallback = interface; ICefCallback = interface; ICefDragHandler = interface; ICefFindHandler = interface; ICefCookieManager = interface; 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; ICefUrlRequest = interface; ICefPostDataElement = interface; ICefRegistration = interface; ICefMediaRouter = interface; ICefMediaObserver = interface; ICefMediaRoute = interface; ICefMediaRouteCreateCallback = interface; ICefMediaSink = interface; ICefMediaSinkDeviceInfoCallback = interface; ICefMediaSource = interface; ICefAudioHandler = interface; ICefDevToolsMessageObserver = interface; ICefValue = interface; ICefPrintSettings = interface; ICefMediaAccessCallback = interface; ICefMediaAccessHandler = interface; ICefPermissionPromptCallback = interface; ICefPermissionHandler = interface; ICefSharedMemoryRegion = interface; ICefSharedProcessMessageBuilder = interface; ICefBrowserViewDelegate = interface; ICefMenuButtonPressedLock = interface; ICefRequestContextHandler = interface; TCefv8ValueArray = array of ICefv8Value; TCefX509CertificateArray = array of ICefX509Certificate; TCefBinaryValueArray = array of ICefBinaryValue; TCefPostDataElementArray = array of ICefPostDataElement; TCefMediaRouteArray = array of ICefMediaRoute; TCefMediaSinkArray = array of ICefMediaSink; TCefDisplayArray = array of ICefDisplay; /// /// Custom record with media sink information. /// TCefMediaSinkInfo = record ID : ustring; Name : ustring; IconType : TCefMediaSinkIconType; SinkType : TCefMediaType; SinkIntf : ICefMediaSink; end; TCefMediaSinkInfoArray = array of TCefMediaSinkInfo; /// /// Custom record with media route information. /// TCefMediaRouteInfo = record ID : ustring; SourceID : ustring; SinkID : ustring; RouteIntf : ICefMediaRoute; end; TCefMediaRouteInfoArray = array of TCefMediaRouteInfo; /// /// Custom record with media source information. /// TCefMediaSourceInfo = record ID : ustring; Valid : boolean; SourceType : TCefMediaType; SourceIntf : ICefMediaSource; end; TCefMediaSourceInfoArray = array of TCefMediaSourceInfo; {* ******************************************* **** Callback procedures and functions **** ******************************************* *} 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); 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; TOnPdfPrintFinishedProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const path: ustring; ok: Boolean); TCefDomVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const document: ICefDomDocument); TCefDomVisitorProc2 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument); TCefDomVisitorProc3 = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const browser : ICefBrowser; const frame: ICefFrame; const document: ICefDomDocument; const aValue : ustring); TCefStringVisitorProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const str: ustring); TCefRunFileDialogCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const filePaths: TStrings); 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); 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; TCefMediaRouteCreateCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(result: TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute); TCefMediaSinkDeviceInfoCallbackProc = {$IFDEF DELPHI12_UP}reference to{$ENDIF} procedure(const ip_address: ustring; port: integer; const model_name: ustring); {* ******************************************* ************ Custom interfaces ************ ******************************************* *} /// /// Custom interface used to handle all the CEF functions related to CefStringList. /// 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; /// /// Custom interface used to handle all the CEF functions related to CefStringMap. /// 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; /// /// Custom interface used to handle all the CEF functions related to CefStringMultimap. /// 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; /// /// Custom interface used to handle all the TCefApplicationCore events. /// IApplicationCoreEvents = interface ['{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); procedure doOnAlreadyRunningAppRelaunch(const commandLine: ICefCommandLine; const current_directory: ustring; var aResult: boolean); procedure doOnScheduleMessagePumpWork(const delayMs: Int64); procedure doGetDefaultClient(var aClient : ICefClient); procedure doGetDefaultRequestContextHandler(var aRequestContextHandler : ICefRequestContextHandler); // 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; /// /// Custom interface used to handle all the TChromiumCore events. /// IChromiumEvents = interface ['{0C139DB1-0349-4D7F-8155-76FEA6A0126D}'] procedure GetSettings(var settings: TCefBrowserSettings); // ICefClient function doOnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const message: ICefProcessMessage): 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); // 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); 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); // 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); procedure doOnCursorChange(const browser: ICefBrowser; cursor_: TCefCursorHandle; cursorType: TCefCursorType; const customCursorInfo: PCefCursorInfo; var aResult : boolean); procedure doOnMediaAccessChange(const browser: ICefBrowser; has_video_access, has_audio_access: boolean); // ICefDownloadHandler function doOnCanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean; function doOnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback): boolean; 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 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; procedure doOnBeforeDevToolsPopup(const browser: ICefBrowser; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var use_default_window: boolean); 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; 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); function doOnGetAuthCredentials(const browser: ICefBrowser; const originUrl: ustring; isProxy: Boolean; const host: ustring; port: Integer; const realm, scheme: ustring; const callback: ICefAuthCallback): Boolean; function doOnCertificateError(const browser: ICefBrowser; certError: TCefErrorcode; const requestUrl: ustring; const sslInfo: ICefSslInfo; const callback: ICefCallback): Boolean; 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); 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); procedure doOnDocumentAvailableInMainFrame(const browser: ICefBrowser); // ICefResourceRequestHandler function doOnBeforeResourceLoad(const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const callback: ICefCallback): TCefReturnValue; 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; // ICefDialogHandler function doOnFileDialog(const browser: ICefBrowser; mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters, accept_extensions, accept_descriptions: TStrings; const callback: ICefFileDialogCallback): Boolean; // ICefRenderHandler procedure doOnGetAccessibilityHandler(var aAccessibilityHandler : ICefAccessibilityHandler); function doOnGetRootScreenRect(const browser: ICefBrowser; var rect: TCefRect): Boolean; procedure doOnGetViewRect(const browser: ICefBrowser; var rect: TCefRect); 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); procedure doOnPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const buffer: Pointer; width, height: Integer); procedure doOnAcceleratedPaint(const browser: ICefBrowser; type_: TCefPaintElementType; dirtyRectsCount: NativeUInt; const dirtyRects: PCefRectArray; const info: PCefAcceleratedPaintInfo); procedure doGetTouchHandleSize(const browser: ICefBrowser; orientation: TCefHorizontalAlignment; var size: TCefSize); procedure doOnTouchHandleStateChanged(const browser: ICefBrowser; const state: TCefTouchHandleState); 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); procedure doOnVirtualKeyboardRequested(const browser: ICefBrowser; input_mode: TCefTextInpuMode); // ICefDragHandler function doOnDragEnter(const browser: ICefBrowser; const dragData: ICefDragData; mask: TCefDragOperations): Boolean; procedure doOnDraggableRegionsChanged(const browser: ICefBrowser; const frame: ICefFrame; regionsCount: NativeUInt; const regions: PCefDraggableRegionArray); // ICefFindHandler procedure doOnFindResult(const browser: ICefBrowser; identifier, count: Integer; const selectionRect: PCefRect; activeMatchOrdinal: Integer; finalUpdate: Boolean); // ICefRequestContextHandler procedure doOnRequestContextInitialized(const request_context: ICefRequestContext); 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); // 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); // 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); // ICefDevToolsMessageObserver 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); procedure doOnDevToolsAgentAttached(const browser: ICefBrowser); procedure doOnDevToolsAgentDetached(const browser: ICefBrowser); // 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; // 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); // ICefFrameHandler procedure doOnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame); procedure doOnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean); procedure doOnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); procedure doOnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); // ICefCommandHandler function doOnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean; 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; // 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); // 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); function doNavigationVisitorResultAvailable(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer) : boolean; procedure doDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); procedure doOnCookiesStoreFlushed; procedure doCertificateExceptionsCleared; procedure doHttpAuthCredentialsCleared; procedure doAllConnectionsClosed; procedure doOnExecuteTaskOnCefThread(aTaskID : cardinal); 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); procedure doOnCookieVisitorDestroyed(aID : integer); procedure doOnCookieSet(aSuccess : boolean; aID : integer); procedure doUpdateZoomStep(aInc : boolean); procedure doUpdateZoomPct(aInc : boolean); procedure doSetZoomLevel(const aValue : double); procedure doSetZoomPct(const aValue : double); procedure doSetZoomStep(aValue : byte); procedure doReadZoom; procedure doMediaRouteCreateFinished(result: TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute); procedure doOnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring); procedure doBrowserNavigation(aTask : TCefBrowserNavigation); procedure doSetAudioMuted(aValue : boolean); procedure doToggleAudioMuted; procedure doEnableFocus; function MustCreateAudioHandler : boolean; function MustCreateCommandHandler : boolean; 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; function MustCreateMediaObserver : boolean; function MustCreatePrintHandler : boolean; function MustCreateFrameHandler : boolean; function MustCreatePermissionHandler : boolean; function GetComponentID : integer; property ComponentID : integer read GetComponentID; end; /// /// Custom interface used to handle all the TCEFServerComponent events. /// IServerEvents = interface ['{06A1B3C6-0967-4F6C-A751-8AA3A29E2FF5}'] // ICefServerHandler procedure doOnServerCreated(const server: ICefServer); 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); end; /// /// Custom interface used to handle all the TCEFUrlRequestClientComponent events. /// ICEFUrlRequestClientEvents = interface ['{1AA800A7-56A1-43CA-A224-49368F18BDD8}'] // 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; function GetComponentID : integer; property ComponentID : integer read GetComponentID; end; /// /// Custom interface used to handle the ICefViewDelegate events. /// 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); procedure doOnThemeChanged(const view: ICefView); // Custom procedure doCreateCustomView; function GetComponentID : integer; property ComponentID : integer read GetComponentID; end; /// /// Custom interface used to handle all the ICefTextfieldDelegate events. /// 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; /// /// Custom interface used to handle all the ICefBrowserViewDelegate events. /// 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); procedure doOnGetChromeToolbarType(const browser_view: ICefBrowserView; var aChromeToolbarType: TCefChromeToolbarType); procedure doOnUseFramelessWindowForPictureInPicture(const browser_view: ICefBrowserView; var aResult: boolean); procedure doOnGestureCommand(const browser_view: ICefBrowserView; gesture_command: TCefGestureCommand; var aResult : boolean); procedure doOnGetBrowserRuntimeStyle(var aResult : TCefRuntimeStyle); end; /// /// Custom interface used to handle all the ICefButtonDelegate events. /// ICefButtonDelegateEvents = interface(ICefViewDelegateEvents) ['{E8DF70BE-5DEB-42CF-AF86-B0FF1040498E}'] procedure doOnButtonPressed(const button: ICefButton); procedure doOnButtonStateChanged(const button: ICefButton); end; /// /// Custom interface used to handle all the ICefMenuButtonDelegate events. /// ICefMenuButtonDelegateEvents = interface(ICefButtonDelegateEvents) ['{DA36DD60-7609-4576-BB8E-6A55FD48C680}'] procedure doOnMenuButtonPressed(const menu_button: ICefMenuButton; const screen_point: TCefPoint; const button_pressed_lock: ICefMenuButtonPressedLock); end; /// /// Custom interface used to handle all the ICefPanelDelegate events. /// ICefPanelDelegateEvents = interface(ICefViewDelegateEvents) ['{F1F2963F-82C3-48F0-9B9C-7C213BACB96B}'] end; /// /// Custom interface used to handle all the ICefWindowDelegate events. /// 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); procedure doOnWindowFullscreenTransition(const window_: ICefWindow; is_completed: boolean); 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); procedure doOnAcceptsFirstMouse(const window_: ICefWindow; var aResult: TCefState); 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); procedure doOnThemeColorsChanged(const window_: ICefWindow; chrome_theme: Integer); procedure doOnGetWindowRuntimeStyle(var aResult: TCefRuntimeStyle); end; {* ******************************************* ************** CEF interfaces ************* ******************************************* *} /// /// All ref-counted framework interfaces must inherit from this interface. /// /// /// Implements TCefBaseRefCounted /// CEF source file: /include/capi/cef_base_capi.h (cef_base_ref_counted_t) /// ICefBaseRefCounted = interface ['{1F9A7B44-DCDC-4477-9180-3ADD44BDEB7B}'] /// /// Called to increment the reference count for the object. Should be called /// for every new copy of a pointer to a given object. /// function Wrap: Pointer; /// /// Compares the aData pointer with the FData field if the current instance. /// function SameAs(aData : Pointer) : boolean; overload; function SameAs(const aBaseRefCounted : ICefBaseRefCounted) : boolean; overload; /// /// Returns true (1) if the current reference count is 1. /// function HasOneRef : boolean; /// /// Returns true (1) if the current reference count is at least 1. /// function HasAtLeastOneRef : boolean; /// /// Releases all other instances. /// procedure DestroyOtherRefs; end; /// /// Callback interface for ICefBrowserHost.RunFileDialog. The functions of /// this interface will be called on the browser process UI thread. /// /// /// Implements TCefRunFileDialogCallback /// CEF source file: /include/capi/cef_browser_capi.h (cef_run_file_dialog_callback_t) /// ICefRunFileDialogCallback = interface(ICefBaseRefCounted) ['{59FCECC6-E897-45BA-873B-F09586C4BE47}'] /// /// 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. /// procedure OnFileDialogDismissed(const filePaths: TStrings); end; /// /// Callback interface for ICefBrowserHost.GetNavigationEntries. The /// functions of this interface will be called on the browser process UI thread. /// /// /// Implements TCefNavigationEntryVisitor /// CEF source file: /include/capi/cef_browser_capi.h (cef_navigation_entry_visitor_t) /// ICefNavigationEntryVisitor = interface(ICefBaseRefCounted) ['{CC4D6BC9-0168-4C2C-98BA-45E9AA9CD619}'] /// /// 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. /// function Visit(const entry: ICefNavigationEntry; current: Boolean; index, total: Integer): Boolean; end; /// /// Callback interface for ICefBrowserHost.PrintToPDF. The functions of this /// interface will be called on the browser process UI thread. /// /// /// Implements TCefPdfPrintCallback /// CEF source file: /include/capi/cef_browser_capi.h (cef_pdf_print_callback_t) /// ICefPdfPrintCallback = interface(ICefBaseRefCounted) ['{F1CC58E9-2C30-4932-91AE-467C8D8EFB8E}'] /// /// 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. /// procedure OnPdfPrintFinished(const path: ustring; ok: Boolean); end; /// /// Callback interface for ICefBrowserHost.DownloadImage. The functions of /// this interface will be called on the browser process UI thread. /// /// /// Implements TCefDownloadImageCallback /// CEF source file: /include/capi/cef_browser_capi.h (cef_download_image_callback_t) /// ICefDownloadImageCallback = interface(ICefBaseRefCounted) ['{0C6E9032-27DF-4584-95C6-DC3C7CB63727}'] /// /// 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. /// procedure OnDownloadImageFinished(const imageUrl: ustring; httpStatusCode: Integer; const image: ICefImage); end; /// /// 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. /// /// /// Implements TCefBrowserHost /// CEF source file: /include/capi/cef_browser_capi.h (cef_browser_host_t) /// ICefBrowserHost = interface(ICefBaseRefCounted) ['{53AE02FF-EF5D-48C3-A43E-069DA9535424}'] /// /// Returns the hosted browser object. /// function GetBrowser: ICefBrowser; /// /// 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. /// procedure CloseBrowser(forceClose: Boolean); /// /// 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. /// function TryCloseBrowser: Boolean; /// /// Set whether the browser is focused. /// procedure SetFocus(focus: Boolean); /// /// 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. /// function GetWindowHandle: TCefWindowHandle; /// /// 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. /// function GetOpenerWindowHandle: TCefWindowHandle; /// /// Returns true (1) if this browser is wrapped in a ICefBrowserView. /// function HasView: Boolean; /// /// Returns the client for this browser. /// function GetClient: ICefClient; /// /// Returns the request context for this browser. /// function GetRequestContext: ICefRequestContext; /// /// Returns true (1) if this browser can execute the specified zoom command. /// This function can only be called on the UI thread. /// function CanZoom(command: TCefZoomCommand): boolean; /// /// 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. /// procedure Zoom(command: TCefZoomCommand); /// /// 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. /// function GetDefaultZoomLevel: Double; /// /// Get the current zoom level. This function can only be called on the UI /// thread. /// function GetZoomLevel: Double; /// /// Change the zoom level to the specified value. Specify 0.0 to reset the /// 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. /// procedure SetZoomLevel(const zoomLevel: Double); /// /// 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. /// procedure RunFileDialog(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: ICefRunFileDialogCallback); /// /// 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. /// procedure RunFileDialogProc(mode: TCefFileDialogMode; const title, defaultFilePath: ustring; const acceptFilters: TStrings; const callback: TCefRunFileDialogCallbackProc); /// /// Download the file at |url| using ICefDownloadHandler. /// procedure StartDownload(const url: ustring); /// /// 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. /// procedure DownloadImage(const imageUrl: ustring; isFavicon: Boolean; maxImageSize: cardinal; bypassCache: Boolean; const callback: ICefDownloadImageCallback); /// /// Print the current browser contents. /// procedure Print; /// /// 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. /// procedure PrintToPdf(const path: ustring; settings: PCefPdfPrintSettings; const callback: ICefPdfPrintCallback); /// /// 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. /// procedure PrintToPdfProc(const path: ustring; settings: PCefPdfPrintSettings; const callback: TOnPdfPrintFinishedProc); /// /// 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. /// procedure Find(const searchText: ustring; forward_, matchCase, findNext: Boolean); /// /// Cancel all searches that are currently going on. /// procedure StopFinding(clearSelection: Boolean); /// /// 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. /// procedure ShowDevTools(const windowInfo: PCefWindowInfo; const client: ICefClient; const settings: PCefBrowserSettings; inspectElementAt: PCefPoint); /// /// Explicitly close the associated DevTools browser, if any. /// procedure CloseDevTools; /// /// Returns true (1) if this browser currently has an associated DevTools /// browser. Must be called on the browser process UI thread. /// function HasDevTools: Boolean; /// /// 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=` command-line flag. /// function SendDevToolsMessage(const message_: ustring): boolean; /// /// 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. /// function ExecuteDevToolsMethod(message_id: integer; const method: ustring; const params: ICefDictionaryValue): Integer; /// /// 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. /// function AddDevToolsMessageObserver(const observer: ICefDevToolsMessageObserver): ICefRegistration; /// /// 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. /// procedure GetNavigationEntries(const visitor: ICefNavigationEntryVisitor; currentOnly: Boolean); /// /// 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. /// procedure GetNavigationEntriesProc(const proc: TCefNavigationEntryVisitorProc; currentOnly: Boolean); /// /// If a misspelled word is currently selected in an editable node calling /// this function will replace it with the specified |word|. /// procedure ReplaceMisspelling(const word: ustring); /// /// Add the specified |word| to the spelling dictionary. /// procedure AddWordToDictionary(const word: ustring); /// /// Returns true (1) if window rendering is disabled. /// function IsWindowRenderingDisabled: Boolean; /// /// 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. /// procedure WasResized; /// /// 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. /// procedure WasHidden(hidden: Boolean); /// /// 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. /// procedure NotifyScreenInfoChanged; /// /// Invalidate the view. The browser will call ICefRenderHandler.OnPaint /// asynchronously. This function is only used when window rendering is /// disabled. /// procedure Invalidate(kind: TCefPaintElementType); /// /// Issue a BeginFrame request to Chromium. Only valid when /// TCefWindowInfo.external_begin_frame_enabled is set to true (1). /// procedure SendExternalBeginFrame; /// /// Send a key event to the browser. /// procedure SendKeyEvent(const event: PCefKeyEvent); /// /// Send a mouse click event to the browser. The |x| and |y| coordinates are /// relative to the upper-left corner of the view. /// procedure SendMouseClickEvent(const event: PCefMouseEvent; type_: TCefMouseButtonType; mouseUp: Boolean; clickCount: Integer); /// /// Send a mouse move event to the browser. The |x| and |y| coordinates are /// relative to the upper-left corner of the view. /// procedure SendMouseMoveEvent(const event: PCefMouseEvent; mouseLeave: Boolean); /// /// 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. /// procedure SendMouseWheelEvent(const event: PCefMouseEvent; deltaX, deltaY: Integer); /// /// Send a touch event to the browser for a windowless browser. /// procedure SendTouchEvent(const event: PCefTouchEvent); /// /// Send a capture lost event to the browser. /// procedure SendCaptureLostEvent; /// /// Notify the browser that the window hosting it is about to be moved or /// resized. This function is only used on Windows and Linux. /// procedure NotifyMoveOrResizeStarted; /// /// 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. /// function GetWindowlessFrameRate : Integer; /// /// 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. /// procedure SetWindowlessFrameRate(frameRate: Integer); /// /// 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. /// procedure IMESetComposition(const text: ustring; const underlines : TCefCompositionUnderlineDynArray; const replacement_range, selection_range : PCefRange); /// /// 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. /// procedure IMECommitText(const text: ustring; const replacement_range : PCefRange; relative_cursor_pos : integer); /// /// 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. /// procedure IMEFinishComposingText(keep_selection : boolean); /// /// 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. /// procedure IMECancelComposition; /// /// 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. /// procedure DragTargetDragEnter(const dragData: ICefDragData; const event: PCefMouseEvent; allowedOps: TCefDragOperations); /// /// 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. /// procedure DragTargetDragOver(const event: PCefMouseEvent; allowedOps: TCefDragOperations); /// /// 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. /// procedure DragTargetDragLeave; /// /// 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. /// procedure DragTargetDrop(const event: PCefMouseEvent); /// /// 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. /// procedure DragSourceEndedAt(x, y: Integer; op: TCefDragOperation); /// /// 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. /// procedure DragSourceSystemDragEnded; /// /// Returns the current visible navigation entry for this browser. This /// function can only be called on the UI thread. /// function GetVisibleNavigationEntry : ICefNavigationEntry; /// /// 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. /// procedure SetAccessibilityState(accessibilityState: TCefState); /// /// Enable notifications of auto resize via /// ICefDisplayHandler.OnAutoResize. Notifications are disabled by /// default. |min_size| and |max_size| define the range of allowed sizes. /// procedure SetAutoResizeEnabled(enabled: boolean; const min_size, max_size: PCefSize); /// /// Returns the extension hosted in this browser or NULL if no extension is /// hosted. See ICefRequestContext.LoadExtension for details. /// /// /// WARNING: This API is deprecated and will be removed in ~M127. /// function GetExtension : ICefExtension; /// /// 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. /// /// /// WARNING: This API is deprecated and will be removed in ~M127. /// function IsBackgroundHost : boolean; /// /// Set whether the browser's audio is muted. /// procedure SetAudioMuted(mute: boolean); /// /// Returns true (1) if the browser's audio is muted. This function can only /// be called on the UI thread. /// function IsAudioMuted : boolean; /// /// 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. /// function IsFullscreen : boolean; /// /// 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. /// procedure ExitFullscreen(will_cause_resize: boolean); /// /// 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. /// /// /// See the IDC_* constants in uCEFConstants.pas for all the |command_id| values. /// The command_id values are also available in chrome/app/chrome_command_ids.h /// function CanExecuteChromeCommand(command_id: integer): boolean; /// /// 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. /// /// /// See the IDC_* constants in uCEFConstants.pas for all the |command_id| values. /// The command_id values are also available in chrome/app/chrome_command_ids.h /// procedure ExecuteChromeCommand(command_id: integer; disposition: TCefWindowOpenDisposition); /// /// 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. /// /// /// This function can only be called on the CEF UI thread. /// function IsRenderProcessUnresponsive : boolean; /// /// Returns the runtime style for this browser (ALLOY or CHROME). See /// TCefRuntimeStyle documentation for details. /// /// /// This function can only be called on the CEF UI thread. /// function GetRuntimeStyle : TCefRuntimeStyle; /// /// Returns the hosted browser object. /// property Browser : ICefBrowser read GetBrowser; /// /// 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. /// property WindowHandle : TCefWindowHandle read GetWindowHandle; /// /// 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. /// property OpenerWindowHandle : TCefWindowHandle read GetOpenerWindowHandle; /// /// Get the current zoom level. The default zoom level is 0.0. This function /// can only be called on the UI thread. /// property ZoomLevel : Double read GetZoomLevel write SetZoomLevel; /// /// Get the default zoom level. This value will be 0.0 by default but can be /// configured with the Chrome runtime. /// /// /// This property can only be used on the CEF UI thread. /// property DefaultZoomLevel : Double read GetDefaultZoomLevel; /// /// Returns the request context for this browser. /// property RequestContext : ICefRequestContext read GetRequestContext; /// /// 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. /// property VisibleNavigationEntry : ICefNavigationEntry read GetVisibleNavigationEntry; /// /// Returns the runtime style for this browser (ALLOY or CHROME). See /// TCefRuntimeStyle documentation for details. /// /// /// This property can only be used on the CEF UI thread. /// property RuntimeStyle : TCefRuntimeStyle read GetRuntimeStyle; end; /// /// Interface representing a message. Can be used on any process and thread. /// /// /// Implements TCefProcessMessage /// CEF source file: /include/capi/cef_process_message_capi.h (cef_process_message_t) /// ICefProcessMessage = interface(ICefBaseRefCounted) ['{E0B1001A-8777-425A-869B-29D40B8B93B1}'] /// /// Returns true (1) if this object is valid. Do not call any other functions /// if this function returns false (0). /// function IsValid: Boolean; /// /// Returns true (1) if the values of this object are read-only. Some APIs may /// expose read-only objects. /// function IsReadOnly: Boolean; /// /// Returns a writable copy of this object. Returns nullptr when message /// contains a shared memory region. /// function Copy: ICefProcessMessage; /// /// Returns the message name. /// function GetName: ustring; /// /// Returns the list of arguments. Returns nullptr when message contains a /// shared memory region. /// function GetArgumentList: ICefListValue; /// /// Returns the shared memory region. Returns nullptr when message contains an /// argument list. /// function GetSharedMemoryRegion: ICefSharedMemoryRegion; /// /// Returns the message name. /// property Name : ustring read GetName; /// /// Returns the list of arguments. Returns nullptr when message contains a /// shared memory region. /// property ArgumentList : ICefListValue read GetArgumentList; /// /// Returns the shared memory region. Returns nullptr when message contains an /// argument list. /// property SharedMemoryRegion : ICefSharedMemoryRegion read GetSharedMemoryRegion; end; /// /// 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. /// /// /// Implements TCefBrowser /// CEF source file: /include/capi/cef_browser_capi.h (cef_browser_t) /// ICefBrowser = interface(ICefBaseRefCounted) ['{BA003C2E-CF15-458F-9D4A-FE3CEFCF3EEF}'] /// /// True if this object is currently valid. This will return false (0) after /// ICefLifeSpanHandler.OnBeforeClose is called. /// function IsValid: boolean; /// /// Returns the browser host object. This function can only be called in the /// browser process. /// function GetHost: ICefBrowserHost; /// /// Returns true (1) if the browser can navigate backwards. /// function CanGoBack: Boolean; /// /// Navigate backwards. /// procedure GoBack; /// /// Returns true (1) if the browser can navigate forwards. /// function CanGoForward: Boolean; /// /// Navigate forwards. /// procedure GoForward; /// /// Returns true (1) if the browser is currently loading. /// function IsLoading: Boolean; /// /// Reload the current page. /// procedure Reload; /// /// Reload the current page ignoring any cached data. /// procedure ReloadIgnoreCache; /// /// Stop loading the page. /// procedure StopLoad; /// /// Returns the globally unique identifier for this browser. This value is /// also used as the tabId for extension APIs. /// function GetIdentifier: Integer; /// /// Returns true (1) if this object is pointing to the same handle as |that| /// object. /// function IsSame(const that: ICefBrowser): Boolean; /// /// Returns true (1) if the browser is a popup. /// function IsPopup: Boolean; /// /// Returns true (1) if a document has been loaded in the browser. /// function HasDocument: Boolean; /// /// 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). /// function GetMainFrame: ICefFrame; /// /// Returns the focused frame for the browser. /// function GetFocusedFrame: ICefFrame; /// /// Returns the frame with the specified identifier, or NULL if not found. /// function GetFrameByIdentifier(const identifier: ustring): ICefFrame; /// /// Returns the frame with the specified name, or NULL if not found. /// function GetFrameByName(const name: ustring): ICefFrame; /// /// Returns the number of frames that currently exist. /// function GetFrameCount: NativeUInt; /// /// Returns the identifiers of all existing frames. /// function GetFrameIdentifiers(var aFrameIdentifiers : TStrings) : boolean; /// /// Returns the names of all existing frames. /// function GetFrameNames(var aFrameNames : TStrings) : boolean; /// /// 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). /// property MainFrame : ICefFrame read GetMainFrame; /// /// Returns the focused frame for the browser. /// property FocusedFrame : ICefFrame read GetFocusedFrame; /// /// Returns the number of frames that currently exist. /// property FrameCount : NativeUInt read GetFrameCount; /// /// Returns the browser host object. This function can only be called in the /// browser process. /// property Host : ICefBrowserHost read GetHost; /// /// Returns the globally unique identifier for this browser. This value is /// also used as the tabId for extension APIs. /// property Identifier : Integer read GetIdentifier; end; /// /// Interface used to represent a single element in the request post data. The /// functions of this interface may be called on any thread. /// /// /// Implements TCefPostDataElement /// CEF source file: /include/capi/cef_request_capi.h (cef_post_data_element_t) /// ICefPostDataElement = interface(ICefBaseRefCounted) ['{3353D1B8-0300-4ADC-8D74-4FF31C77D13C}'] /// /// Returns true (1) if this object is read-only. /// function IsReadOnly: Boolean; /// /// Remove all contents from the post data element. /// procedure SetToEmpty; /// /// The post data element will represent a file. /// procedure SetToFile(const fileName: ustring); /// /// The post data element will represent bytes. The bytes passed in will be /// copied. /// procedure SetToBytes(size: NativeUInt; const bytes: Pointer); /// /// Return the type of this post data element. /// function GetType: TCefPostDataElementType; /// /// Return the file name. /// function GetFile: ustring; /// /// Return the number of bytes. /// function GetBytesCount: NativeUInt; /// /// Read up to |size| bytes into |bytes| and return the number of bytes /// actually read. /// function GetBytes(size: NativeUInt; bytes: Pointer): NativeUInt; end; /// /// Interface used to represent post data for a web request. The functions of /// this interface may be called on any thread. /// /// /// Implements TCefPostData /// CEF source file: /include/capi/cef_request_capi.h (cef_post_data_t) /// ICefPostData = interface(ICefBaseRefCounted) ['{1E677630-9339-4732-BB99-D6FE4DE4AEC0}'] /// /// Returns true (1) if this object is read-only. /// function IsReadOnly: Boolean; /// /// 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. /// function HasExcludedElements: Boolean; /// /// Returns the number of existing post data elements. /// function GetElementCount: NativeUInt; /// /// Retrieve the post data elements. /// procedure GetElements(elementsCount: NativeUInt; var elements: TCefPostDataElementArray); /// /// Remove the specified post data element. Returns true (1) if the removal /// succeeds. /// function RemoveElement(const element: ICefPostDataElement): Boolean; /// /// Add the specified post data element. Returns true (1) if the add /// succeeds. /// function AddElement(const element: ICefPostDataElement): Boolean; /// /// Remove all existing post data elements. /// procedure RemoveElements; end; /// /// Interface used to represent a web request. The functions of this interface /// may be called on any thread. /// /// /// Implements TCefRequest /// CEF source file: /include/capi/cef_request_capi.h (cef_request_t) /// ICefRequest = interface(ICefBaseRefCounted) ['{FB4718D3-7D13-4979-9F4C-D7F6C0EC592A}'] /// /// Returns true (1) if this object is read-only. /// function IsReadOnly: Boolean; /// /// Get the fully qualified URL. /// function GetUrl: ustring; /// /// Set the fully qualified URL. /// procedure SetUrl(const value: ustring); /// /// Get the request function type. The value will default to POST if post data /// is provided and GET otherwise. /// function GetMethod: ustring; /// /// Set the request function type. /// procedure SetMethod(const value: ustring); /// /// 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. /// procedure SetReferrer(const referrerUrl: ustring; policy: TCefReferrerPolicy); /// /// Get the referrer URL. /// function GetReferrerUrl: ustring; /// /// Get the referrer policy. /// function GetReferrerPolicy: TCefReferrerPolicy; /// /// Get the post data. /// function GetPostData: ICefPostData; /// /// Set the post data. /// procedure SetPostData(const value: ICefPostData); /// /// Get the header values. Will not include the Referer value if any. /// procedure GetHeaderMap(const HeaderMap: ICefStringMultimap); /// /// Set the header values. If a Referer value exists in the header map it will /// be removed and ignored. /// procedure SetHeaderMap(const HeaderMap: ICefStringMultimap); /// /// 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. /// function GetHeaderByName(const name: ustring): ustring; /// /// 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. /// procedure SetHeaderByName(const name, value: ustring; overwrite: boolean); /// /// Get the flags used in combination with ICefUrlRequest. See /// TCefUrlRequestFlags for supported values. /// function GetFlags: TCefUrlRequestFlags; /// /// Set the flags used in combination with ICefUrlRequest. See /// TCefUrlRequestFlags for supported values. /// procedure SetFlags(flags: TCefUrlRequestFlags); /// /// Get the URL to the first party for cookies used in combination with /// ICefUrlRequest. /// function GetFirstPartyForCookies: ustring; /// /// Set the URL to the first party for cookies used in combination with /// ICefUrlRequest. /// procedure SetFirstPartyForCookies(const url: ustring); /// /// Set all values at one time. This method corresponds to TCefRequest.set_ and cef_request_t.set /// procedure Assign(const url, method: ustring; const postData: ICefPostData; const headerMap: ICefStringMultimap); /// /// Get the resource type for this request. Only available in the browser /// process. /// function GetResourceType: TCefResourceType; /// /// 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. /// function GetTransitionType: TCefTransitionType; /// /// 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. /// function GetIdentifier: UInt64; /// /// Get the fully qualified URL. /// property Url : ustring read GetUrl write SetUrl; /// /// Get the request function type. The value will default to POST if post data /// is provided and GET otherwise. /// property Method : ustring read GetMethod write SetMethod; /// /// Get the referrer URL. /// property ReferrerUrl : ustring read GetReferrerUrl; /// /// Get the referrer policy. /// property ReferrerPolicy : TCefReferrerPolicy read GetReferrerPolicy; /// /// Get the post data. /// property PostData : ICefPostData read GetPostData write SetPostData; /// /// Get the flags used in combination with ICefUrlRequest. See /// TCefUrlRequestFlags for supported values. /// property Flags : TCefUrlRequestFlags read GetFlags write SetFlags; /// /// Get the URL to the first party for cookies used in combination with /// ICefUrlRequest. /// property FirstPartyForCookies : ustring read GetFirstPartyForCookies write SetFirstPartyForCookies; /// /// Get the resource type for this request. Only available in the browser /// process. /// property ResourceType : TCefResourceType read GetResourceType; /// /// 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. /// property TransitionType : TCefTransitionType read GetTransitionType; /// /// 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. /// property Identifier : UInt64 read GetIdentifier; end; /// /// Implement this interface to receive string values asynchronously. /// /// /// Implements TCefStringVisitor /// CEF source file: /include/capi/cef_string_visitor_capi.h (cef_string_visitor_t) /// ICefStringVisitor = interface(ICefBaseRefCounted) ['{63ED4D6C-2FC8-4537-964B-B84C008F6158}'] /// /// Method that will be executed. /// procedure Visit(const str: ustring); end; /// /// 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. /// /// /// Implements TCefFrame /// CEF source file: /include/capi/cef_frame_capi.h (cef_frame_t) /// ICefFrame = interface(ICefBaseRefCounted) ['{8FD3D3A6-EA3A-4A72-8501-0276BD5C3D1D}'] /// /// True if this object is currently attached to a valid frame. /// function IsValid: Boolean; /// /// Execute undo in this frame. /// procedure Undo; /// /// Execute redo in this frame. /// procedure Redo; /// /// Execute cut in this frame. /// procedure Cut; /// /// Execute copy in this frame. /// procedure Copy; /// /// Execute paste in this frame. /// procedure Paste; /// /// Execute delete in this frame. /// procedure Del; /// /// Execute select all in this frame. /// procedure SelectAll; /// /// 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. /// procedure ViewSource; /// /// Retrieve this frame's HTML source as a string sent to the specified /// visitor. /// procedure GetSource(const visitor: ICefStringVisitor); /// /// Retrieve this frame's HTML source as a string sent to the specified /// visitor. /// procedure GetSourceProc(const proc: TCefStringVisitorProc); /// /// Retrieve this frame's display text as a string sent to the specified /// visitor. /// procedure GetText(const visitor: ICefStringVisitor); /// /// Retrieve this frame's display text as a string sent to the specified /// visitor. /// procedure GetTextProc(const proc: TCefStringVisitorProc); /// /// 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). /// procedure LoadRequest(const request: ICefRequest); /// /// Load the specified |url|. /// procedure LoadUrl(const url: ustring); /// /// 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. /// procedure ExecuteJavaScript(const code, scriptUrl: ustring; startLine: Integer); /// /// Returns true (1) if this is the main (top-level) frame. /// function IsMain: Boolean; /// /// Returns true (1) if this is the focused frame. /// function IsFocused: Boolean; /// /// 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. /// function GetName: ustring; /// /// Returns the globally unique identifier for this frame or empty if the /// underlying frame does not yet exist. /// function GetIdentifier: ustring; /// /// Returns the parent of this frame or NULL if this is the main (top-level) /// frame. /// function GetParent: ICefFrame; /// /// Returns the URL currently loaded in this frame. /// function GetUrl: ustring; /// /// Returns the browser that this frame belongs to. /// function GetBrowser: ICefBrowser; /// /// Get the V8 context associated with the frame. This function can only be /// called from the render process. /// function GetV8Context: ICefv8Context; /// /// Visit the DOM document. This function can only be called from the render /// process. /// procedure VisitDom(const visitor: ICefDomVisitor); /// /// Visit the DOM document. This function can only be called from the render /// process. /// procedure VisitDomProc(const proc: TCefDomVisitorProc); /// /// 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. /// function CreateUrlRequest(const request: ICefRequest; const client: ICefUrlrequestClient): ICefUrlRequest; /// /// 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. /// procedure SendProcessMessage(targetProcess: TCefProcessId; const message_: ICefProcessMessage); /// /// 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. /// property Name : ustring read GetName; /// /// Returns the URL currently loaded in this frame. /// property Url : ustring read GetUrl; /// /// Returns the browser that this frame belongs to. /// property Browser : ICefBrowser read GetBrowser; /// /// Returns the parent of this frame or NULL if this is the main (top-level) /// frame. /// property Parent : ICefFrame read GetParent; /// /// Returns the globally unique identifier for this frame or empty if the /// underlying frame does not yet exist. /// property Identifier : ustring read GetIdentifier; end; /// /// 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. /// /// /// Implements TCefFrameHandler /// CEF source file: /include/capi/cef_frame_handler_capi.h (cef_frame_handler_t) /// ICefFrameHandler = interface(ICefBaseRefCounted) ['{B437128C-F7CB-4F75-83CF-A257B98C0B6E}'] /// /// 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|. /// procedure OnFrameCreated(const browser: ICefBrowser; const frame: ICefFrame); /// /// 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. /// procedure OnFrameAttached(const browser: ICefBrowser; const frame: ICefFrame; reattached: boolean); /// /// Called when a frame loses its connection to the renderer process and will /// be destroyed. Any pending or future commands will be discarded and /// 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 /// |browser|. /// procedure OnFrameDetached(const browser: ICefBrowser; const frame: ICefFrame); /// /// 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() /// 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 /// |browser|. /// procedure OnMainFrameChanged(const browser: ICefBrowser; const old_frame, new_frame: ICefFrame); /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Interface used to read data from a stream. The functions of this interface /// may be called on any thread. /// /// /// Implements TCefStreamReader /// CEF source file: /include/capi/cef_stream_capi.h (cef_stream_reader_t) /// ICefCustomStreamReader = interface(ICefBaseRefCounted) ['{BBCFF23A-6FE7-4C28-B13E-6D2ACA5C83B7}'] /// /// Read raw binary data. /// function Read(ptr: Pointer; size, n: NativeUInt): NativeUInt; /// /// 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. /// function Seek(offset: Int64; whence: Integer): Integer; /// /// Return the current offset position. /// function Tell: Int64; /// /// Return non-zero if at end of file. /// function Eof: Boolean; /// /// 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. /// function MayBlock: Boolean; end; /// /// Interface used to read data from a stream. The functions of this interface /// may be called on any thread. /// /// /// Implements TCefStreamReader /// CEF source file: /include/capi/cef_stream_capi.h (cef_stream_reader_t) /// ICefStreamReader = interface(ICefBaseRefCounted) ['{DD5361CB-E558-49C5-A4BD-D1CE84ADB277}'] /// /// Read raw binary data. /// function Read(ptr: Pointer; size, n: NativeUInt): NativeUInt; /// /// 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. /// function Seek(offset: Int64; whence: Integer): Integer; /// /// Return the current offset position. /// function Tell: Int64; /// /// Return non-zero if at end of file. /// function Eof: Boolean; /// /// 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. /// function MayBlock: Boolean; end; /// /// Structure the client can implement to provide a custom stream reader. The /// functions of this structure may be called on any thread. /// /// /// Implements TCefReadHandler /// CEF source file: /include/capi/cef_stream_capi.h (cef_read_handler_tcef_stream_reader_t) /// ICefReadHandler = interface(ICefBaseRefCounted) ['{10152506-B2F8-4765-BBBC-9CA8A85A2C87}'] /// /// Read raw binary data. /// function Read(ptr: Pointer; size, n: NativeUInt): NativeUInt; /// /// 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. /// function Seek(offset: Int64; whence: Integer): Integer; /// /// Return the current offset position. /// function Tell: Int64; /// /// Return non-zero if at end of file. /// function Eof: Boolean; /// /// 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. /// function MayBlock: Boolean; end; /// /// Interface the client can implement to provide a custom stream writer. The /// functions of this interface may be called on any thread. /// /// /// Implements TCefWriteHandler /// CEF source file: /include/capi/cef_stream_capi.h (cef_write_handler_t) /// ICefWriteHandler = interface(ICefBaseRefCounted) ['{F2431888-4EAB-421E-9EC3-320BE695AF30}'] /// /// Write raw binary data. /// function Write(const ptr: Pointer; size, n: NativeUInt): NativeUInt; /// /// 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. /// function Seek(offset: Int64; whence: Integer): Integer; /// /// Return the current offset position. /// function Tell: Int64; /// /// Flush the stream. /// function Flush: Integer; /// /// 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. /// function MayBlock: Boolean; end; /// /// Interface used to write data to a stream. The functions of this interface /// may be called on any thread. /// /// /// Implements TCefStreamWriter /// CEF source file: /include/capi/cef_stream_capi.h (cef_stream_writer_t) /// ICefStreamWriter = interface(ICefBaseRefCounted) ['{4AA6C477-7D8A-4D5A-A704-67F900A827E7}'] /// /// Write raw binary data. /// function Write(const ptr: Pointer; size, n: NativeUInt): NativeUInt; /// /// 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. /// function Seek(offset: Int64; whence: Integer): Integer; /// /// Return the current offset position. /// function Tell: Int64; /// /// Flush the stream. /// function Flush: Integer; /// /// 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. /// function MayBlock: Boolean; end; /// /// Interface used to represent a web response. The functions of this interface /// may be called on any thread. /// /// /// Implements TCefResponse /// CEF source file: /include/capi/cef_response_capi.h (cef_response_t) /// ICefResponse = interface(ICefBaseRefCounted) ['{E9C896E4-59A8-4B96-AB5E-6EA3A498B7F1}'] /// /// Returns true (1) if this object is read-only. /// function IsReadOnly: Boolean; /// /// Get the response error code. Returns ERR_NONE if there was no error. /// function GetError: TCefErrorCode; /// /// Set the response error code. This can be used by custom scheme handlers to /// return errors during initial request processing. /// procedure SetError(error: TCefErrorCode); /// /// Get the response status code. /// function GetStatus: Integer; /// /// Set the response status code. /// procedure SetStatus(status: Integer); /// /// Get the response status text. /// function GetStatusText: ustring; /// /// Set the response status text. /// procedure SetStatusText(const StatusText: ustring); /// /// Get the response mime type. /// function GetMimeType: ustring; /// /// Set the response mime type. /// procedure SetMimeType(const mimetype: ustring); /// /// Get the response charset. /// function GetCharset: ustring; /// /// Set the response charset. /// procedure SetCharset(const charset: ustring); /// /// Get the value for the specified response header field. /// function GetHeaderByName(const name: ustring): ustring; /// /// 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. /// procedure SetHeaderByName(const name, value: ustring; overwrite: boolean); /// /// Get all response header fields. /// procedure GetHeaderMap(const headerMap: ICefStringMultimap); /// /// Set all response header fields. /// procedure SetHeaderMap(const headerMap: ICefStringMultimap); /// /// Get the resolved URL after redirects or changed as a result of HSTS. /// function GetURL: ustring; /// /// Set the resolved URL after redirects or changed as a result of HSTS. /// procedure SetURL(const url: ustring); /// /// Get the response status code. /// property Status : Integer read GetStatus write SetStatus; /// /// Get the response status text. /// property StatusText : ustring read GetStatusText write SetStatusText; /// /// Get the response mime type. /// property MimeType : ustring read GetMimeType write SetMimeType; /// /// Get the response charset. /// property Charset : ustring read GetCharset write SetCharset; /// /// Get the response error code. Returns ERR_NONE if there was no error. /// property Error : TCefErrorCode read GetError write SetError; /// /// Get the resolved URL after redirects or changed as a result of HSTS. /// property URL : ustring read GetURL write SetURL; end; /// /// Interface used to represent a download item. /// /// /// Implements TCefDownloadItem /// CEF source file: /include/capi/cef_download_item_capi.h (cef_download_item_t) /// ICefDownloadItem = interface(ICefBaseRefCounted) ['{B34BD320-A82E-4185-8E84-B98E5EEC803F}'] /// /// Returns true (1) if this object is valid. Do not call any other functions /// if this function returns false (0). /// function IsValid: Boolean; /// /// Returns true (1) if the download is in progress. /// function IsInProgress: Boolean; /// /// Returns true (1) if the download is complete. /// function IsComplete: Boolean; /// /// Returns true (1) if the download has been canceled. /// function IsCanceled: Boolean; /// /// Returns true (1) if the download has been interrupted. /// function IsInterrupted: Boolean; /// /// Returns the most recent interrupt reason. /// function GetInterruptReason: TCefDownloadInterruptReason; /// /// Returns a simple speed estimate in bytes/s. /// function GetCurrentSpeed: Int64; /// /// Returns the rough percent complete or -1 if the receive total size is /// unknown. /// function GetPercentComplete: Integer; /// /// Returns the total number of bytes. /// function GetTotalBytes: Int64; /// /// Returns the number of received bytes. /// function GetReceivedBytes: Int64; /// /// Returns the time that the download started. /// function GetStartTime: TDateTime; /// /// Returns the time that the download ended. /// function GetEndTime: TDateTime; /// /// Returns the full path to the downloaded or downloading file. /// function GetFullPath: ustring; /// /// Returns the unique identifier for this download. /// function GetId: Cardinal; /// /// Returns the URL. /// function GetUrl: ustring; /// /// Returns the original URL before any redirections. /// function GetOriginalUrl: ustring; /// /// Returns the suggested file name. /// function GetSuggestedFileName: ustring; /// /// Returns the content disposition. /// function GetContentDisposition: ustring; /// /// Returns the mime type. /// function GetMimeType: ustring; /// /// Returns a simple speed estimate in bytes/s. /// property CurrentSpeed : Int64 read GetCurrentSpeed; /// /// Returns the rough percent complete or -1 if the receive total size is /// unknown. /// property PercentComplete : Integer read GetPercentComplete; /// /// Returns the total number of bytes. /// property TotalBytes : Int64 read GetTotalBytes; /// /// Returns the number of received bytes. /// property ReceivedBytes : Int64 read GetReceivedBytes; /// /// Returns the time that the download started. /// property StartTime : TDateTime read GetStartTime; /// /// Returns the time that the download ended. /// property EndTime : TDateTime read GetEndTime; /// /// Returns the full path to the downloaded or downloading file. /// property FullPath : ustring read GetFullPath; /// /// Returns the unique identifier for this download. /// property Id : Cardinal read GetId; /// /// Returns the URL. /// property Url : ustring read GetUrl; /// /// Returns the original URL before any redirections. /// property OriginalUrl : ustring read GetOriginalUrl; /// /// Returns the suggested file name. /// property SuggestedFileName : ustring read GetSuggestedFileName; /// /// Returns the content disposition. /// property ContentDisposition : ustring read GetContentDisposition; /// /// Returns the mime type. /// property MimeType : ustring read GetMimeType; /// /// Returns the most recent interrupt reason. /// property InterruptReason : TCefDownloadInterruptReason read GetInterruptReason; end; /// /// Callback interface used to asynchronously continue a download. /// /// /// Implements TCefBeforeDownloadCallback /// CEF source file: /include/capi/cef_download_handler_capi.h (cef_before_download_callback_t) /// ICefBeforeDownloadCallback = interface(ICefBaseRefCounted) ['{5A81AF75-CBA2-444D-AD8E-522160F36433}'] /// /// 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. /// procedure Cont(const downloadPath: ustring; showDialog: Boolean); end; /// /// Callback interface used to asynchronously cancel a download. /// /// /// Implements TCefDownloadItemCallback /// CEF source file: /include/capi/cef_download_handler_capi.h (cef_download_item_callback_t) /// ICefDownloadItemCallback = interface(ICefBaseRefCounted) ['{498F103F-BE64-4D5F-86B7-B37EC69E1735}'] /// /// Call to cancel the download. /// procedure Cancel; /// /// Call to pause the download. /// procedure Pause; /// /// Call to resume the download. /// procedure Resume; end; /// /// Interface used to handle file downloads. The functions of this interface /// will called on the browser process UI thread. /// /// /// Implements TCefDownloadHandler /// CEF source file: /include/capi/cef_download_handler_capi.h (cef_download_handler_t) /// ICefDownloadHandler = interface(ICefBaseRefCounted) ['{3137F90A-5DC5-43C1-858D-A269F28EF4F1}'] /// /// 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. /// function CanDownload(const browser: ICefBrowser; const url, request_method: ustring): boolean; /// /// Called before a download begins. |suggested_name| is the suggested name /// 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. /// function OnBeforeDownload(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const suggestedName: ustring; const callback: ICefBeforeDownloadCallback): boolean; /// /// Called when a download's status or progress information has been updated. /// This may be called multiple times before and after OnBeforeDownload. /// 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. /// procedure OnDownloadUpdated(const browser: ICefBrowser; const downloadItem: ICefDownloadItem; const callback: ICefDownloadItemCallback); /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Interface representing a V8 exception. The functions of this interface may /// be called on any render process thread. /// /// /// Implements TCefV8Exception /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8exception_t) /// ICefV8Exception = interface(ICefBaseRefCounted) ['{7E422CF0-05AC-4A60-A029-F45105DCE6A4}'] /// /// Returns the exception message. /// function GetMessage: ustring; /// /// Returns the line of source code that the exception occurred within. /// function GetSourceLine: ustring; /// /// Returns the resource name for the script from where the function causing /// the error originates. /// function GetScriptResourceName: ustring; /// /// Returns the 1-based number of the line where the error occurred or 0 if /// the line number is unknown. /// function GetLineNumber: Integer; /// /// Returns the index within the script of the first character where the error /// occurred. /// function GetStartPosition: Integer; /// /// Returns the index within the script of the last character where the error /// occurred. /// function GetEndPosition: Integer; /// /// Returns the index within the line of the first character where the error /// occurred. /// function GetStartColumn: Integer; /// /// Returns the index within the line of the last character where the error /// occurred. /// function GetEndColumn: Integer; /// /// Returns the exception message. /// property Message : ustring read GetMessage; /// /// Returns the line of source code that the exception occurred within. /// property SourceLine : ustring read GetSourceLine; /// /// Returns the resource name for the script from where the function causing /// the error originates. /// property ScriptResourceName : ustring read GetScriptResourceName; /// /// Returns the 1-based number of the line where the error occurred or 0 if /// the line number is unknown. /// property LineNumber : Integer read GetLineNumber; /// /// Returns the index within the script of the first character where the error /// occurred. /// property StartPosition : Integer read GetStartPosition; /// /// Returns the index within the script of the last character where the error /// occurred. /// property EndPosition : Integer read GetEndPosition; /// /// Returns the index within the line of the first character where the error /// occurred. /// property StartColumn : Integer read GetStartColumn; /// /// Returns the index within the line of the last character where the error /// occurred. /// property EndColumn : Integer read GetEndColumn; end; /// /// Callback interface that is passed to ICefV8value.CreateArrayBuffer. /// /// /// Implements TCefv8ArrayBufferReleaseCallback /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8array_buffer_release_callback_t) /// ICefv8ArrayBufferReleaseCallback = interface(ICefBaseRefCounted) ['{4EAAB422-D046-43DF-B1F0-5503116A5816}'] /// /// 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. /// procedure ReleaseBuffer(buffer : Pointer); end; /// /// 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. /// /// /// Implements TCefV8Context /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8context_t) /// ICefv8Context = interface(ICefBaseRefCounted) ['{2295A11A-8773-41F2-AD42-308C215062D9}'] /// /// 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. /// function GetTaskRunner: ICefTaskRunner; /// /// 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). /// function IsValid: Boolean; /// /// Returns the browser for this context. This function will return an NULL /// reference for WebWorker contexts. /// function GetBrowser: ICefBrowser; /// /// Returns the frame for this context. This function will return an NULL /// reference for WebWorker contexts. /// function GetFrame: ICefFrame; /// /// Returns the global object for this context. The context must be entered /// before calling this function. /// function GetGlobal: ICefv8Value; /// /// 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. /// function Enter: Boolean; /// /// Exit this context. Call this function only after calling enter(). Returns /// true (1) if the scope was exited successfully. /// function Exit: Boolean; /// /// Returns true (1) if this object is pointing to the same handle as |that| /// object. /// function IsSame(const that: ICefv8Context): Boolean; /// /// 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). /// function Eval(const code: ustring; const script_url: ustring; start_line: integer; var retval: ICefv8Value; var exception: ICefV8Exception): Boolean; /// /// Returns the browser for this context. This function will return an NULL /// reference for WebWorker contexts. /// property Browser : ICefBrowser read GetBrowser; /// /// Returns the frame for this context. This function will return an NULL /// reference for WebWorker contexts. /// property Frame : ICefFrame read GetFrame; /// /// Returns the global object for this context. The context must be entered /// before calling this function. /// property Global : ICefv8Value read GetGlobal; end; /// /// 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. /// /// /// Implements TCefv8Handler /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8handler_t) /// ICefv8Handler = interface(ICefBaseRefCounted) ['{F94CDC60-FDCB-422D-96D5-D2A775BD5D73}'] /// /// 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. /// function Execute(const name: ustring; const object_: ICefv8Value; const arguments: TCefv8ValueArray; var retval: ICefv8Value; var exception: ustring): Boolean; end; /// /// 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. /// /// /// Implements TCefV8Interceptor /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8interceptor_t) /// ICefV8Interceptor = interface(ICefBaseRefCounted) ['{B3B8FD7C-A916-4B25-93A2-2892AC324F21}'] /// /// 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. /// function GetByName(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; /// /// 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. /// function GetByIndex(index: integer; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): boolean; /// /// 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. /// function SetByName(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): boolean; /// /// 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. /// function SetByIndex(index: integer; const object_, value: ICefv8Value; var exception: ustring): boolean; end; /// /// 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. /// /// /// Implements TCefV8Accessor /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8accessor_t) /// ICefV8Accessor = interface(ICefBaseRefCounted) ['{DCA6D4A2-726A-4E24-AA64-5E8C731D868A}'] /// /// 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. /// function Get(const name: ustring; const object_: ICefv8Value; var retval: ICefv8Value; var exception: ustring): Boolean; /// /// 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. /// function Set_(const name: ustring; const object_, value: ICefv8Value; var exception: ustring): Boolean; end; /// /// 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. /// /// /// Implements TCefTask /// CEF source file: /include/capi/cef_task_capi.h (cef_task_t) /// ICefTask = interface(ICefBaseRefCounted) ['{0D965470-4A86-47CE-BD39-A8770021AD7E}'] /// /// Method that will be executed on the target thread. /// procedure Execute; end; /// /// 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). /// /// /// Implements TCefTaskRunner /// CEF source file: /include/capi/cef_task_capi.h (cef_task_runner_t) /// ICefTaskRunner = interface(ICefBaseRefCounted) ['{6A500FA3-77B7-4418-8EA8-6337EED1337B}'] /// /// Returns true (1) if this object is pointing to the same task runner as /// |that| object. /// function IsSame(const that: ICefTaskRunner): Boolean; /// /// Returns true (1) if this task runner belongs to the current thread. /// function BelongsToCurrentThread: Boolean; /// /// Returns true (1) if this task runner is for the specified CEF thread. /// function BelongsToThread(threadId: TCefThreadId): Boolean; /// /// Post a task for execution on the thread associated with this task runner. /// Execution will occur asynchronously. /// function PostTask(const task: ICefTask): Boolean; /// /// 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. /// function PostDelayedTask(const task: ICefTask; delayMs: Int64): Boolean; end; /// /// 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. /// /// /// Implements TCefThread /// CEF source file: /include/capi/cef_thread_capi.h (cef_thread_t) /// ICefThread = interface(ICefBaseRefCounted) ['{26B30EA5-F44A-4C40-97DF-67FD9E73A4FF}'] /// /// Returns the ICefTaskRunner that will execute code on this thread's /// message loop. This function is safe to call from any thread. /// function GetTaskRunner : ICefTaskRunner; /// /// Returns the platform thread ID. It will return the same value after stop() /// is called. This function is safe to call from any thread. /// function GetPlatformThreadID : TCefPlatformThreadId; /// /// 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). /// procedure Stop; /// /// Returns true (1) if the thread is currently running. This function must be /// called from the same thread that called cef_thread_create(). /// function IsRunning : boolean; end; /// /// 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. /// /// /// Implements TCefWaitableEvent /// CEF source file: /include/capi/cef_waitable_event_capi.h (cef_waitable_event_t) /// ICefWaitableEvent = interface(ICefBaseRefCounted) ['{965C90C9-3DAE-457F-AA64-E04FF508094A}'] /// /// Put the event in the un-signaled state. /// procedure Reset; /// /// Put the event in the signaled state. This causes any thread blocked on /// Wait to be woken up. /// procedure Signal; /// /// 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. /// function IsSignaled : boolean; /// /// 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. /// procedure Wait; /// /// 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. /// function TimedWait(max_ms: int64): boolean; end; /// /// 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. /// /// /// Implements TCefv8Value /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8value_t) /// ICefv8Value = interface(ICefBaseRefCounted) ['{52319B8D-75A8-422C-BD4B-16FA08CC7F42}'] /// /// 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). /// function IsValid: Boolean; /// /// True if the value type is undefined. /// function IsUndefined: Boolean; /// /// True if the value type is null. /// function IsNull: Boolean; /// /// True if the value type is bool. /// function IsBool: Boolean; /// /// True if the value type is int. /// function IsInt: Boolean; /// /// True if the value type is unsigned int. /// function IsUInt: Boolean; /// /// True if the value type is double. /// function IsDouble: Boolean; /// /// True if the value type is Date. /// function IsDate: Boolean; /// /// True if the value type is string. /// function IsString: Boolean; /// /// True if the value type is object. /// function IsObject: Boolean; /// /// True if the value type is array. /// function IsArray: Boolean; /// /// True if the value type is an ArrayBuffer. /// function IsArrayBuffer: Boolean; /// /// True if the value type is function. /// function IsFunction: Boolean; /// /// True if the value type is a Promise. /// function IsPromise: Boolean; /// /// Returns true (1) if this object is pointing to the same handle as |that| /// object. /// function IsSame(const that: ICefv8Value): Boolean; /// /// Return a bool value. /// function GetBoolValue: Boolean; /// /// Return an int value. /// function GetIntValue: Integer; /// /// Return an unsigned int value. /// function GetUIntValue: Cardinal; /// /// Return a double value. /// function GetDoubleValue: Double; /// /// Return a Date value. /// function GetDateValue: TDateTime; /// /// Return a string value. /// function GetStringValue: ustring; /// /// Returns true (1) if this is a user created object. /// function IsUserCreated: Boolean; /// /// 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. /// function HasException: Boolean; /// /// Returns the exception resulting from the last function call. This /// attribute exists only in the scope of the current CEF value object. /// function GetException: ICefV8Exception; /// /// Clears the last exception and returns true (1) on success. /// function ClearException: Boolean; /// /// Returns true (1) if this object will re-throw future exceptions. This /// attribute exists only in the scope of the current CEF value object. /// function WillRethrowExceptions: Boolean; /// /// 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. /// function SetRethrowExceptions(rethrow: Boolean): Boolean; /// /// Returns true (1) if the object has a value with the specified identifier. /// function HasValueByKey(const key: ustring): Boolean; /// /// Returns true (1) if the object has a value with the specified identifier. /// function HasValueByIndex(index: Integer): Boolean; /// /// 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. /// function DeleteValueByKey(const key: ustring): Boolean; /// /// 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. /// function DeleteValueByIndex(index: Integer): Boolean; /// /// Returns the value with the specified identifier on success. Returns NULL /// if this function is called incorrectly or an exception is thrown. /// function GetValueByKey(const key: ustring): ICefv8Value; /// /// Returns the value with the specified identifier on success. Returns NULL /// if this function is called incorrectly or an exception is thrown. /// function GetValueByIndex(index: Integer): ICefv8Value; /// /// 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. /// function SetValueByKey(const key: ustring; const value: ICefv8Value; attribute: TCefV8PropertyAttributes): Boolean; /// /// 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. /// function SetValueByIndex(index: Integer; const value: ICefv8Value): Boolean; /// /// Registers an identifier and returns true (1) on success. Access to the /// identifier will be forwarded to the ICefV8Accessor instance passed to /// cef_v8value_create_object(). 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. /// function SetValueByAccessor(const key: ustring; attribute: TCefV8PropertyAttributes): Boolean; /// /// Read the keys for the object's values into the specified vector. Integer- /// based keys will also be returned as strings. /// function GetKeys(const keys: TStrings): Integer; /// /// 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. /// function SetUserData(const data: ICefv8Value): Boolean; /// /// Returns the user data, if any, assigned to this object. /// function GetUserData: ICefv8Value; /// /// Returns the amount of externally allocated memory registered for the /// object. /// function GetExternallyAllocatedMemory: Integer; /// /// 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 /// to perform global garbage collection. Each ICefv8Value tracks the amount /// 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. /// function AdjustExternallyAllocatedMemory(changeInBytes: Integer): Integer; /// /// Returns the number of elements in the array. /// function GetArrayLength: Integer; /// /// Returns the ReleaseCallback object associated with the ArrayBuffer or NULL /// if the ArrayBuffer was not created with CreateArrayBuffer. /// function GetArrayBufferReleaseCallback : ICefv8ArrayBufferReleaseCallback; /// /// 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 /// ICefv8ArrayBufferReleaseCallback.ReleaseBuffer will be called to /// release the underlying buffer. /// function NeuterArrayBuffer : boolean; /// /// Returns the length (in bytes) of the ArrayBuffer. /// function GetArrayBufferByteLength: NativeUInt; /// /// 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. /// function GetArrayBufferData: Pointer; /// /// Returns the function name. /// function GetFunctionName: ustring; /// /// Returns the function handler or NULL if not a CEF-created function. /// function GetFunctionHandler: ICefv8Handler; /// /// Execute the function using the current V8 context. This function should /// 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 /// ('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. /// function ExecuteFunction(const obj: ICefv8Value; const arguments: TCefv8ValueArray): ICefv8Value; /// /// 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. /// function ExecuteFunctionWithContext(const context: ICefv8Context; const obj: ICefv8Value; const arguments: TCefv8ValueArray): ICefv8Value; /// /// Resolve the Promise using the current V8 context. This function should /// 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 /// to the resolved promise. Returns true (1) on success. Returns false (0) if /// this function is called incorrectly or an exception is thrown. /// function ResolvePromise(const arg: ICefv8Value): boolean; /// /// Reject the Promise using the current V8 context. This function should 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. Returns true (1) on success. Returns false (0) /// if this function is called incorrectly or an exception is thrown. /// function RejectPromise(const errorMsg: ustring): boolean; end; /// /// 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. /// /// /// Implements TCefV8StackFrame /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8stack_frame_t) /// ICefV8StackFrame = interface(ICefBaseRefCounted) ['{BA1FFBF4-E9F2-4842-A827-DC220F324286}'] /// /// 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). /// function IsValid: Boolean; /// /// Returns the name of the resource script that contains the function. /// function GetScriptName: ustring; /// /// 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. /// function GetScriptNameOrSourceUrl: ustring; /// /// Returns the name of the function. /// function GetFunctionName: ustring; /// /// Returns the 1-based line number for the function call or 0 if unknown. /// function GetLineNumber: Integer; /// /// Returns the 1-based column offset on the line for the function call or 0 /// if unknown. /// function GetColumn: Integer; /// /// Returns true (1) if the function was compiled using eval(). /// function IsEval: Boolean; /// /// Returns true (1) if the function was called as a constructor via "new". /// function IsConstructor: Boolean; /// /// Returns the name of the resource script that contains the function. /// property ScriptName : ustring read GetScriptName; /// /// 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. /// property ScriptNameOrSourceUrl : ustring read GetScriptNameOrSourceUrl; /// /// Returns the name of the function. /// property FunctionName : ustring read GetFunctionName; /// /// Returns the 1-based line number for the function call or 0 if unknown. /// property LineNumber : Integer read GetLineNumber; /// /// Returns the 1-based column offset on the line for the function call or 0 /// if unknown. /// property Column : Integer read GetColumn; end; /// /// 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. /// /// /// Implements TCefV8StackTrace /// CEF source file: /include/capi/cef_v8_capi.h (cef_v8stack_trace_t) /// ICefV8StackTrace = interface(ICefBaseRefCounted) ['{32111C84-B7F7-4E3A-92B9-7CA1D0ADB613}'] /// /// 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). /// function IsValid: Boolean; /// /// Returns the number of stack frames. /// function GetFrameCount: Integer; /// /// Returns the stack frame at the specified 0-based index. /// function GetFrame(index: Integer): ICefV8StackFrame; /// /// Returns the number of stack frames. /// property FrameCount : Integer read GetFrameCount; /// /// Returns the stack frame at the specified 0-based index. /// property Frame[index: Integer] : ICefV8StackFrame read GetFrame; end; /// /// 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. /// /// /// Implements TCefXmlReader /// CEF source file: /include/capi/cef_xml_reader_capi.h (cef_xml_reader_t) /// ICefXmlReader = interface(ICefBaseRefCounted) ['{0DE686C3-A8D7-45D2-82FD-92F7F4E62A90}'] /// /// 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. /// function MoveToNextNode: Boolean; /// /// Close the document. This should be called directly to ensure that cleanup /// occurs on the correct thread. /// function Close: Boolean; /// /// Returns true (1) if an error has been reported by the XML parser. /// function HasError: Boolean; /// /// Returns the error string. /// function GetError: ustring; /// /// Returns the node type. /// function GetType: TCefXmlNodeType; /// /// Returns the node depth. Depth starts at 0 for the root node. /// function GetDepth: Integer; /// /// Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- /// LocalPart for additional details. /// function GetLocalName: ustring; /// /// Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for /// additional details. /// function GetPrefix: ustring; /// /// Returns the qualified name, equal to (Prefix:)LocalName. See /// http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. /// function GetQualifiedName: ustring; /// /// Returns the URI defining the namespace associated with the node. See /// http://www.w3.org/TR/REC-xml-names/ for additional details. /// function GetNamespaceUri: ustring; /// /// Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for /// additional details. /// function GetBaseUri: ustring; /// /// Returns the xml:lang scope within which the node resides. See /// http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. /// function GetXmlLang: ustring; /// /// Returns true (1) if the node represents an NULL element. "" is /// considered NULL but "" is not. /// function IsEmptyElement: Boolean; /// /// Returns true (1) if the node has a text value. /// function HasValue: Boolean; /// /// Returns the text value. /// function GetValue: ustring; /// /// Returns true (1) if the node has attributes. /// function HasAttributes: Boolean; /// /// Returns the number of attributes. /// function GetAttributeCount: NativeUInt; /// /// Returns the value of the attribute at the specified 0-based index. /// function GetAttributeByIndex(index: Integer): ustring; /// /// Returns the value of the attribute with the specified qualified name. /// function GetAttributeByQName(const qualifiedName: ustring): ustring; /// /// Returns the value of the attribute with the specified local name and /// namespace URI. /// function GetAttributeByLName(const localName, namespaceURI: ustring): ustring; /// /// Returns an XML representation of the current node's children. /// function GetInnerXml: ustring; /// /// Returns an XML representation of the current node including its children. /// function GetOuterXml: ustring; /// /// Returns the line number for the current node. /// function GetLineNumber: Integer; /// /// Moves the cursor to the attribute at the specified 0-based index. Returns /// true (1) if the cursor position was set successfully. /// function MoveToAttributeByIndex(index: Integer): Boolean; /// /// Moves the cursor to the attribute with the specified qualified name. /// Returns true (1) if the cursor position was set successfully. /// function MoveToAttributeByQName(const qualifiedName: ustring): Boolean; /// /// Moves the cursor to the attribute with the specified local name and /// namespace URI. Returns true (1) if the cursor position was set /// successfully. /// function MoveToAttributeByLName(const localName, namespaceURI: ustring): Boolean; /// /// Moves the cursor to the first attribute in the current element. Returns /// true (1) if the cursor position was set successfully. /// function MoveToFirstAttribute: Boolean; /// /// Moves the cursor to the next attribute in the current element. Returns /// true (1) if the cursor position was set successfully. /// function MoveToNextAttribute: Boolean; /// /// Moves the cursor back to the carrying element. Returns true (1) if the /// cursor position was set successfully. /// function MoveToCarryingElement: Boolean; end; /// /// 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. /// /// /// Implements TCefZipReader /// CEF source file: /include/capi/cef_zip_reader_capi.h (cef_zip_reader_t) /// ICefZipReader = interface(ICefBaseRefCounted) ['{3B6C591F-9877-42B3-8892-AA7B27DA34A8}'] /// /// Moves the cursor to the first file in the archive. Returns true (1) if the /// cursor position was set successfully. /// function MoveToFirstFile: Boolean; /// /// Moves the cursor to the next file in the archive. Returns true (1) if the /// cursor position was set successfully. /// function MoveToNextFile: Boolean; /// /// 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. /// function MoveToFile(const fileName: ustring; caseSensitive: Boolean): Boolean; /// /// Closes the archive. This should be called directly to ensure that cleanup /// occurs on the correct thread. /// function Close: Boolean; /// /// Returns the name of the file. /// function GetFileName: ustring; /// /// Returns the uncompressed size of the file. /// function GetFileSize: Int64; /// /// Returns the last modified timestamp for the file. /// function GetFileLastModified: TCefBaseTime; /// /// Opens the file for reading of uncompressed data. A read password may /// optionally be specified. /// function OpenFile(const password: ustring): Boolean; /// /// Closes the file. /// function CloseFile: Boolean; /// /// 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. /// function ReadFile(buffer: Pointer; bufferSize: NativeUInt): Integer; /// /// Returns the current offset in the uncompressed file contents. /// function Tell: Int64; /// /// Returns true (1) if at end of the file contents. /// function Eof: Boolean; end; /// /// Interface used to represent a DOM node. The functions of this interface /// should only be called on the render process main thread. /// /// /// Implements TCefDomNode /// CEF source file: /include/capi/cef_dom_capi.h (cef_domnode_t) /// ICefDomNode = interface(ICefBaseRefCounted) ['{96C03C9E-9C98-491A-8DAD-1947332232D6}'] /// /// Returns the type for this node. /// function GetType: TCefDomNodeType; /// /// Returns true (1) if this is a text node. /// function IsText: Boolean; /// /// Returns true (1) if this is an element node. /// function IsElement: Boolean; /// /// Returns true (1) if this is an editable node. /// function IsEditable: Boolean; /// /// Returns true (1) if this is a form control element node. /// function IsFormControlElement: Boolean; /// /// Returns the type of this form control element node. /// function GetFormControlElementType: TCefDomFormControlType; /// /// Returns true (1) if this object is pointing to the same handle as |that| /// object. /// function IsSame(const that: ICefDomNode): Boolean; /// /// Returns the name of this node. /// function GetName: ustring; /// /// Returns the value of this node. /// function GetValue: ustring; /// /// Set the value of this node. Returns true (1) on success. /// function SetValue(const value: ustring): Boolean; /// /// Returns the contents of this node as markup. /// function GetAsMarkup: ustring; /// /// Returns the document associated with this node. /// function GetDocument: ICefDomDocument; /// /// Returns the parent node. /// function GetParent: ICefDomNode; /// /// Returns the previous sibling node. /// function GetPreviousSibling: ICefDomNode; /// /// Returns the next sibling node. /// function GetNextSibling: ICefDomNode; /// /// Returns true (1) if this node has child nodes. /// function HasChildren: Boolean; /// /// Return the first child node. /// function GetFirstChild: ICefDomNode; /// /// Returns the last child node. /// function GetLastChild: ICefDomNode; /// /// Returns the tag name of this element. /// function GetElementTagName: ustring; /// /// Returns true (1) if this element has attributes. /// function HasElementAttributes: Boolean; /// /// Returns true (1) if this element has an attribute named |attrName|. /// function HasElementAttribute(const attrName: ustring): Boolean; /// /// Returns the element attribute named |attrName|. /// function GetElementAttribute(const attrName: ustring): ustring; /// /// Returns a ICefStringMap of all element attributes. /// procedure GetElementAttributes(const attrMap: ICefStringMap); overload; /// /// Returns a TStrings of all element attributes. /// procedure GetElementAttributes(var attrList: TStrings); overload; /// /// Set the value for the element attribute named |attrName|. Returns true (1) /// on success. /// function SetElementAttribute(const attrName, value: ustring): Boolean; /// /// Returns the inner text of the element. /// function GetElementInnerText: ustring; /// /// Returns the bounds of the element in device pixels. Use /// "window.devicePixelRatio" to convert to/from CSS pixels. /// function GetElementBounds: TCefRect; /// /// Returns the type for this node. /// property NodeType : TCefDomNodeType read GetType; /// /// Returns the name of this node. /// property Name : ustring read GetName; /// /// Returns the contents of this node as markup. /// property AsMarkup : ustring read GetAsMarkup; /// /// Returns the document associated with this node. /// property Document : ICefDomDocument read GetDocument; /// /// Returns the parent node. /// property Parent : ICefDomNode read GetParent; /// /// Returns the previous sibling node. /// property PreviousSibling : ICefDomNode read GetPreviousSibling; /// /// Returns the next sibling node. /// property NextSibling : ICefDomNode read GetNextSibling; /// /// Return the first child node. /// property FirstChild : ICefDomNode read GetFirstChild; /// /// Returns the last child node. /// property LastChild : ICefDomNode read GetLastChild; /// /// Returns the tag name of this element. /// property ElementTagName : ustring read GetElementTagName; /// /// Returns the inner text of the element. /// property ElementInnerText : ustring read GetElementInnerText; /// /// Returns the bounds of the element in device pixels. Use /// "window.devicePixelRatio" to convert to/from CSS pixels. /// property ElementBounds : TCefRect read GetElementBounds; end; /// /// Interface used to represent a DOM document. The functions of this interface /// should only be called on the render process main thread thread. /// /// /// Implements TCefDomDocument /// CEF source file: /include/capi/cef_dom_capi.h (cef_domdocument_t) /// ICefDomDocument = interface(ICefBaseRefCounted) ['{08E74052-45AF-4F69-A578-98A5C3959426}'] /// /// Returns the document type. /// function GetType: TCefDomDocumentType; /// /// Returns the root document node. /// function GetDocument: ICefDomNode; /// /// Returns the BODY node of an HTML document. /// function GetBody: ICefDomNode; /// /// Returns the HEAD node of an HTML document. /// function GetHead: ICefDomNode; /// /// Returns the title of an HTML document. /// function GetTitle: ustring; /// /// Returns the document element with the specified ID value. /// function GetElementById(const id: ustring): ICefDomNode; /// /// Returns the node that currently has keyboard focus. /// function GetFocusedNode: ICefDomNode; /// /// Returns true (1) if a portion of the document is selected. /// function HasSelection: Boolean; /// /// Returns the selection offset within the start node. /// function GetSelectionStartOffset: Integer; /// /// Returns the selection offset within the end node. /// function GetSelectionEndOffset: Integer; /// /// Returns the contents of this selection as markup. /// function GetSelectionAsMarkup: ustring; /// /// Returns the contents of this selection as text. /// function GetSelectionAsText: ustring; /// /// Returns the base URL for the document. /// function GetBaseUrl: ustring; /// /// Returns a complete URL based on the document base URL and the specified /// partial URL. /// function GetCompleteUrl(const partialURL: ustring): ustring; /// /// Returns the document type. /// property DocType : TCefDomDocumentType read GetType; /// /// Returns the root document node. /// property Document : ICefDomNode read GetDocument; /// /// Returns the BODY node of an HTML document. /// property Body : ICefDomNode read GetBody; /// /// Returns the HEAD node of an HTML document. /// property Head : ICefDomNode read GetHead; /// /// Returns the title of an HTML document. /// property Title : ustring read GetTitle; /// /// Returns the node that currently has keyboard focus. /// property FocusedNode : ICefDomNode read GetFocusedNode; /// /// Returns the selection offset within the start node. /// property SelectionStartOffset : Integer read GetSelectionStartOffset; /// /// Returns the selection offset within the end node. /// property SelectionEndOffset : Integer read GetSelectionEndOffset; /// /// Returns the contents of this selection as markup. /// property SelectionAsMarkup : ustring read GetSelectionAsMarkup; /// /// Returns the contents of this selection as text. /// property SelectionAsText : ustring read GetSelectionAsText; /// /// Returns the base URL for the document. /// property BaseUrl : ustring read GetBaseUrl; end; /// /// Interface to implement for visiting the DOM. The functions of this interface /// will be called on the render process main thread. /// /// /// Implements TCefDomVisitor /// CEF source file: /include/capi/cef_dom_capi.h (cef_domvisitor_t) /// ICefDomVisitor = interface(ICefBaseRefCounted) ['{30398428-3196-4531-B968-2DDBED36F6B0}'] /// /// 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. /// procedure visit(const document: ICefDomDocument); end; /// /// Interface to implement for visiting cookie values. The functions of this /// interface will always be called on the UI thread. /// /// /// Implements TCefCookieVisitor /// CEF source file: /include/capi/cef_cookie_capi.h (cef_cookie_visitor_t) /// ICefCookieVisitor = interface(ICefBaseRefCounted) ['{8378CF1B-84AB-4FDB-9B86-34DDABCCC402}'] /// /// 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. /// 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; end; /// /// 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. /// /// /// Implements TCefCommandLine /// CEF source file: /include/capi/cef_command_line_capi.h (cef_command_line_t) /// ICefCommandLine = interface(ICefBaseRefCounted) ['{6B43D21B-0F2C-4B94-B4E6-4AF0D7669D8E}'] /// /// Returns true (1) if this object is valid. Do not call any other functions /// if this function returns false (0). /// function IsValid: Boolean; /// /// Returns true (1) if the values of this object are read-only. Some APIs may /// expose read-only objects. /// function IsReadOnly: Boolean; /// /// Returns a writable copy of this object. /// function Copy: ICefCommandLine; /// /// 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. /// procedure InitFromArgv(argc: Integer; const argv: PPAnsiChar); /// /// Initialize the command line with the string returned by calling /// GetCommandLineW(). This function is only supported on Windows. /// procedure InitFromString(const commandLine: ustring); /// /// Reset the command-line switches and arguments but leave the program /// component unchanged. /// procedure Reset; /// /// Constructs and returns the represented command line string. Use this /// function cautiously because quoting behavior is unclear. /// function GetCommandLineString: ustring; /// /// Retrieve the original command line string as a vector of strings. The argv /// array: `{ program, [(--|-|/)switch[=value]]*, [--], [argument]* }` /// procedure GetArgv(var args: TStrings); /// /// Get the program part of the command line string (the first item). /// function GetProgram: ustring; /// /// Set the program part of the command line string (the first item). /// procedure SetProgram(const prog: ustring); /// /// Returns true (1) if the command line has switches. /// function HasSwitches: Boolean; /// /// Returns true (1) if the command line contains the given switch. /// function HasSwitch(const name: ustring): Boolean; /// /// Returns the value associated with the given switch. If the switch has no /// value or isn't present this function returns the NULL string. /// function GetSwitchValue(const name: ustring): ustring; /// /// Returns the map of switch names and values. If a switch has no value an /// NULL string is returned. /// function GetSwitches(var switches: TStrings): boolean; overload; /// /// Returns the map of switch names and values. If a switch has no value an /// NULL string is returned. /// function GetSwitches(var SwitchKeys, SwitchValues: TStringList): boolean; overload; /// /// Add a switch to the end of the command line. /// procedure AppendSwitch(const name: ustring); /// /// 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. /// procedure AppendSwitchWithValue(const name, value: ustring); /// /// True if there are remaining command line arguments. /// function HasArguments: Boolean; /// /// Get the remaining command line arguments. /// procedure GetArguments(var arguments: TStrings); /// /// Add an argument to the end of the command line. /// procedure AppendArgument(const argument: ustring); /// /// Insert a command before the current command. Common for debuggers, like /// "valgrind" or "gdb --args". /// procedure PrependWrapper(const wrapper: ustring); /// /// Constructs and returns the represented command line string. Use this /// function cautiously because quoting behavior is unclear. /// property CommandLineString : ustring read GetCommandLineString; end; /// /// Generic callback interface used for managing the lifespan of a registration. /// /// /// Implements TCefRegistration /// CEF source file: /include/capi/cef_registration_capi.h (cef_registration_t) /// ICefRegistration = interface(ICefBaseRefCounted) ['{9226018F-7A56-4F2E-AF01-43268E33EE6B}'] end; /// /// Callback interface for ICefBrowserHost.AddDevToolsMessageObserver. The /// functions of this interface will be called on the browser process UI thread. /// /// /// Implements TCefDevToolsMessageObserver /// CEF source file: /include/capi/cef_devtools_message_observer_capi.h (cef_dev_tools_message_observer_t) /// ICefDevToolsMessageObserver = interface(ICefBaseRefCounted) ['{76E5BB2B-7F69-4BC9-94C7-B55C61CE630F}'] /// /// 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 /// ICefBrowserHost.SendDevToolsMessage, and optionally either a "result" /// (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). /// procedure OnDevToolsMessage(const browser: ICefBrowser; const message_: Pointer; message_size: NativeUInt; var aHandled: boolean); /// /// 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. /// procedure OnDevToolsMethodResult(const browser: ICefBrowser; message_id: integer; success: boolean; const result: Pointer; result_size: NativeUInt); /// /// 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. /// procedure OnDevToolsEvent(const browser: ICefBrowser; const method: ustring; const params: Pointer; params_size: NativeUInt); /// /// 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. /// procedure OnDevToolsAgentAttached(const browser: ICefBrowser); /// /// 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. /// procedure OnDevToolsAgentDetached(const browser: ICefBrowser); end; /// /// 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. /// /// /// Implements TCefMediaRouter /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_router_t) /// ICefMediaRouter = interface(ICefBaseRefCounted) ['{F18C3880-CB8D-48F9-9D74-DCFF4B9E88DF}'] /// /// Add an observer for MediaRouter events. The observer will remain /// registered until the returned Registration object is destroyed. /// function AddObserver(const observer: ICefMediaObserver): ICefRegistration; /// /// 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:?clientId="). /// function GetSource(const urn: ustring): ICefMediaSource; /// /// Trigger an asynchronous call to ICefMediaObserver.OnSinks on all /// registered observers. /// procedure NotifyCurrentSinks; /// /// Create a new route between |source| and |sink|. Source and sink must be /// valid, compatible (as reported by ICefMediaSink.IsCompatibleWith), and /// 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 /// asynchronous call to ICefMediaObserver.OnRoutes on all registered /// observers. /// procedure CreateRoute(const source: ICefMediaSource; const sink: ICefMediaSink; const callback: ICefMediaRouteCreateCallback); /// /// Trigger an asynchronous call to ICefMediaObserver.OnRoutes on all /// registered observers. /// procedure NotifyCurrentRoutes; end; /// /// 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. /// /// /// Implements TCefMediaObserver /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_observer_t) /// ICefMediaObserver = interface(ICefBaseRefCounted) ['{0B27C8D1-63E3-4F69-939F-DCAD518654A3}'] /// /// The list of available media sinks has changed or /// ICefMediaRouter.NotifyCurrentSinks was called. /// procedure OnSinks(const sinks: TCefMediaSinkArray); /// /// The list of available media routes has changed or /// ICefMediaRouter.NotifyCurrentRoutes was called. /// procedure OnRoutes(const routes: TCefMediaRouteArray); /// /// The connection state of |route| has changed. /// procedure OnRouteStateChanged(const route: ICefMediaRoute; state: TCefMediaRouteConnectionState); /// /// A message was received over |route|. |message| is only valid for the scope /// of this callback and should be copied if necessary. /// procedure OnRouteMessageReceived(const route: ICefMediaRoute; const message_: ustring); end; /// /// 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. /// /// /// Implements TCefMediaRoute /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_route_t) /// ICefMediaRoute = interface(ICefBaseRefCounted) ['{D8959122-DD19-4933-B4D9-DF829062A0D3}'] /// /// Returns the ID for this route. /// function GetId: ustring; /// /// Returns the source associated with this route. /// function GetSource: ICefMediaSource; /// /// Returns the sink associated with this route. /// function GetSink: ICefMediaSink; /// /// Send a message over this route. |message_| will be copied if necessary. /// procedure SendRouteMessage(const message_: ustring); /// /// Terminate this route. Will result in an asynchronous call to /// ICefMediaObserver.OnRoutes on all registered observers. /// procedure Terminate; /// /// Returns the ID for this route. /// property ID : ustring read GetId; /// /// Returns the source associated with this route. /// property Source : ICefMediaSource read GetSource; /// /// Returns the sink associated with this route. /// property Sink : ICefMediaSink read GetSink; end; /// /// Callback interface for ICefMediaRouter.CreateRoute. The functions of /// this interface will be called on the browser process UI thread. /// /// /// Implements TCefMediaRouteCreateCallback /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_route_create_callback_t) /// ICefMediaRouteCreateCallback = interface(ICefBaseRefCounted) ['{8848CBFE-36AC-4AC8-BC10-386B69FB27BE}'] /// /// 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. /// procedure OnMediaRouteCreateFinished(result: TCefMediaRouterCreateResult; const error: ustring; const route: ICefMediaRoute); end; /// /// Callback interface for ICefMediaSink.GetDeviceInfo. The functions of /// this interface will be called on the browser process UI thread. /// /// /// Implements TCefMediaSinkDeviceInfoCallback /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_sink_device_info_callback_t) /// ICefMediaSinkDeviceInfoCallback = interface(ICefBaseRefCounted) ['{633898DD-4169-45D0-ADDD-6E68B3686E0D}'] /// /// Method that will be executed asyncronously once device information has /// been retrieved. /// procedure OnMediaSinkDeviceInfo(const ip_address: ustring; port: integer; const model_name: ustring); end; /// /// 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. /// /// /// Implements TCefMediaSink /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_sink_t) /// ICefMediaSink = interface(ICefBaseRefCounted) ['{EDA1A4B2-2A4C-42DD-A7DF-901BF93D908D}'] /// /// Returns the ID for this sink. /// function GetId: ustring; /// /// Returns the name of this sink. /// function GetName: ustring; /// /// Returns the icon type for this sink. /// function GetIconType: TCefMediaSinkIconType; /// /// Asynchronously retrieves device info. /// procedure GetDeviceInfo(const callback: ICefMediaSinkDeviceInfoCallback); /// /// Returns true (1) if this sink accepts content via Cast. /// function IsCastSink: boolean; /// /// Returns true (1) if this sink accepts content via DIAL. /// function IsDialSink: boolean; /// /// Returns true (1) if this sink is compatible with |source|. /// function IsCompatibleWith(const source: ICefMediaSource): boolean; /// /// Returns the ID for this sink. /// property ID : ustring read GetId; /// /// Returns the name of this sink. /// property Name : ustring read GetName; /// /// Returns the icon type for this sink. /// property IconType : TCefMediaSinkIconType read GetIconType; end; /// /// 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. /// /// /// Implements TCefMediaSource /// CEF source file: /include/capi/cef_media_router_capi.h (cef_media_source_t) /// ICefMediaSource = interface(ICefBaseRefCounted) ['{734ED6E4-6498-43ED-AAA4-6B993EDC30BE}'] /// /// Returns the ID (media source URN or URL) for this source. /// function GetId : ustring; /// /// Returns true (1) if this source outputs its content via Cast. /// function IsCastSource : boolean; /// /// Returns true (1) if this source outputs its content via DIAL. /// function IsDialSource : boolean; /// /// Returns the ID (media source URN or URL) for this source. /// property ID : ustring read GetId; end; /// /// 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. /// /// /// Implements TCefResourceBundleHandler /// CEF source file: /include/capi/cef_resource_bundle_handler_capi.h (cef_resource_bundle_handler_t) /// ICefResourceBundleHandler = interface(ICefBaseRefCounted) ['{09C264FD-7E03-41E3-87B3-4234E82B5EA2}'] /// /// 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. /// function GetLocalizedString(stringId: Integer; var stringVal: ustring): Boolean; /// /// 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. /// function GetDataResource(resourceId: Integer; var data: Pointer; var dataSize: NativeUInt): Boolean; /// /// 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. /// function GetDataResourceForScale(resourceId: Integer; scaleFactor: TCefScaleFactor; var data: Pointer; var dataSize: NativeUInt): Boolean; /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Interface used to implement browser process callbacks. The functions of this /// interface will be called on the browser process main thread unless otherwise /// indicated. /// /// /// Implements TCefBrowserProcessHandler /// CEF source file: /include/capi/cef_browser_process_handler_capi.h (cef_browser_process_handler_t) /// ICefBrowserProcessHandler = interface(ICefBaseRefCounted) ['{27291B7A-C0AE-4EE0-9115-15C810E22F6C}'] /// /// Provides an opportunity to register custom preferences prior to global and /// request context initialization. /// If |type| is CEF_PREFERENCES_TYPE_GLOBAL the registered preferences can be /// accessed via ICefPreferenceManager.GetGlobalPreferences after /// OnContextInitialized is called. Global preferences are registered a single /// time at application startup. See related TCefSettings.cache_path and /// TCefSettings.persist_user_preferences configuration. /// If |type| is CEF_PREFERENCES_TYPE_REQUEST_CONTEXT the preferences can be /// 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 /// TCefRequestContextSettings.persist_user_preferences configuration. /// Do not keep a reference to the |registrar| object. This function is called /// on the browser process UI thread. /// procedure OnRegisterCustomPreferences(type_: TCefPreferencesType; registrar: PCefPreferenceRegistrar); /// /// Called on the browser process UI thread immediately after the CEF context /// has been initialized. /// procedure OnContextInitialized; /// /// 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. /// procedure OnBeforeChildProcessLaunch(const commandLine: ICefCommandLine); /// /// 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. /// 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. /// This function will be called on the browser process UI thread. /// procedure OnAlreadyRunningAppRelaunch(const commandLine: ICefCommandLine; const current_directory: ustring; var aResult: boolean); /// /// 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. /// procedure OnScheduleMessagePumpWork(const delayMs: Int64); /// /// 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. /// procedure GetDefaultClient(var aClient : ICefClient); /// /// 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. /// procedure GetDefaultRequestContextHandler(var aRequestContextHandler : ICefRequestContextHandler); /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// 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. /// /// /// Implements TCefRenderProcessHandler /// CEF source file: /include/capi/cef_render_process_handler_capi.h (cef_render_process_handler_t) /// ICefRenderProcessHandler = interface(ICefBaseRefCounted) ['{FADEE3BC-BF66-430A-BA5D-1EE3782ECC58}'] /// /// Called after WebKit has been initialized. /// procedure OnWebKitInitialized; /// /// 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(). /// procedure OnBrowserCreated(const browser: ICefBrowser; const extra_info: ICefDictionaryValue); /// /// Called before a browser is destroyed. /// procedure OnBrowserDestroyed(const browser: ICefBrowser); /// /// Return the handler for browser load status events. /// function GetLoadHandler : ICefLoadHandler; /// /// 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. /// procedure OnContextCreated(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context); /// /// Called immediately before the V8 context for a frame is released. No /// references to the context should be kept after this function is called. /// procedure OnContextReleased(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context); /// /// 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. /// procedure OnUncaughtException(const browser: ICefBrowser; const frame: ICefFrame; const context: ICefv8Context; const V8Exception: ICefV8Exception; const stackTrace: ICefV8StackTrace); /// /// 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. /// procedure OnFocusedNodeChanged(const browser: ICefBrowser; const frame: ICefFrame; const node: ICefDomNode); /// /// 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. /// function OnProcessMessageReceived(const browser: ICefBrowser; const frame: ICefFrame; sourceProcess: TCefProcessId; const aMessage: ICefProcessMessage): Boolean; /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Implement this interface to provide handler implementations. Methods will be /// called by the process and/or thread indicated. /// /// /// Implements TCefApp /// CEF source file: /include/capi/cef_app_capi.h (cef_app_t) /// ICefApp = interface(ICefBaseRefCounted) ['{970CA670-9070-4642-B188-7D8A22DAEED4}'] /// /// 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 /// ICefCommandLine object passed to this function. The /// TCefSettings.command_line_args_disabled value can be used to start with /// 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. /// procedure OnBeforeCommandLineProcessing(const processType: ustring; const commandLine: ICefCommandLine); /// /// 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. /// procedure OnRegisterCustomSchemes(const registrar: TCefSchemeRegistrarRef); /// /// Return the handler for resource bundle events. If /// TCefSettings.pack_loading_disabled is true (1) a handler must be /// 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. /// procedure GetResourceBundleHandler(var aHandler : ICefResourceBundleHandler); /// /// Return the handler for functionality specific to the browser process. This /// function is called on multiple threads in the browser process. /// procedure GetBrowserProcessHandler(var aHandler : ICefBrowserProcessHandler); /// /// Return the handler for functionality specific to the render process. This /// function is called on the render process main thread. /// procedure GetRenderProcessHandler(var aHandler : ICefRenderProcessHandler); /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Generic callback interface used for asynchronous completion. /// /// /// Implements TCefCompletionCallback /// CEF source file: /include/capi/cef_callback_capi.h (cef_completion_callback_t) /// ICefCompletionCallback = interface(ICefBaseRefCounted) ['{A8ECCFBB-FEE0-446F-AB32-AD69A7478D57}'] /// /// Method that will be called once the task is complete. /// procedure OnComplete; end; /// /// Interface to implement to be notified of asynchronous completion via /// ICefCookieManager.SetCookie. /// /// /// Implements TCefSetCookieCallback /// CEF source file: /include/capi/cef_cookie_capi.h (cef_set_cookie_callback_t) /// ICefSetCookieCallback = interface(ICefBaseRefCounted) ['{16E14B6F-CB0A-4F9D-A008-239E0BC7B892}'] /// /// Method that will be called upon completion. |success| will be true (1) if /// the cookie was set successfully. /// procedure OnComplete(success: Boolean); end; /// /// Interface to implement to be notified of asynchronous completion via /// ICefCookieManager.DeleteCookies. /// /// /// Implements TCefDeleteCookiesCallback /// CEF source file: /include/capi/cef_cookie_capi.h (cef_delete_cookies_callback_t) /// ICefDeleteCookiesCallback = interface(ICefBaseRefCounted) ['{758B79A1-B9E8-4F0D-94A0-DCE5AFADE33D}'] /// /// Method that will be called upon completion. |num_deleted| will be the /// number of cookies that were deleted. /// procedure OnComplete(numDeleted: Integer); end; /// /// Interface used for managing cookies. The functions of this interface may be /// called on any thread unless otherwise indicated. /// /// /// Implements TCefCookieManager /// CEF source file: /include/capi/cef_cookie_capi.h (cef_cookie_manager_t) /// ICefCookieManager = Interface(ICefBaseRefCounted) ['{CC1749E6-9AD3-4283-8430-AF6CBF3E8785}'] /// /// 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. /// function VisitAllCookies(const visitor: ICefCookieVisitor): Boolean; function VisitAllCookiesProc(const visitor: TCefCookieVisitorProc): Boolean; /// /// 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. /// function VisitUrlCookies(const url: ustring; includeHttpOnly: Boolean; const visitor: ICefCookieVisitor): Boolean; function VisitUrlCookiesProc(const url: ustring; includeHttpOnly: Boolean; const visitor: TCefCookieVisitorProc): Boolean; /// /// 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. /// 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; /// /// 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. /// function DeleteCookies(const url, cookieName: ustring; const callback: ICefDeleteCookiesCallback): Boolean; function DeleteCookiesProc(const url, cookieName: ustring; const callback: TCefDeleteCookiesCallbackProc): Boolean; /// /// 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. /// function FlushStore(const callback: ICefCompletionCallback): Boolean; function FlushStoreProc(const proc: TCefCompletionCallbackProc): Boolean; end; /// /// Generic callback interface used for asynchronous continuation. /// /// /// Implements TCefCallback /// CEF source file: /include/capi/cef_callback_capi.h (cef_callback_t) /// ICefCallback = interface(ICefBaseRefCounted) ['{1B8C449F-E2D6-4B78-9BBA-6F47E8BCDF37}'] /// /// Continue processing. /// procedure Cont; /// /// Cancel processing. /// procedure Cancel; end; /// /// Callback for asynchronous continuation of ICefResourceHandler.skip. /// /// /// Implements TCefResourceSkipCallback /// CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_skip_callback_t) /// ICefResourceSkipCallback = interface(ICefBaseRefCounted) ['{5ADDE93E-5858-41FD-81E8-ED8BF710D92A}'] /// /// 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. /// procedure Cont(bytes_skipped: int64); end; /// /// Callback for asynchronous continuation of ICefResourceHandler.read. /// /// /// Implements TCefResourceReadCallback /// CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_read_callback_t) /// ICefResourceReadCallback = interface(ICefBaseRefCounted) ['{7669335F-7A4B-4657-86CA-C02B12369602}'] /// /// 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. /// procedure Cont(bytes_read: int64); end; /// /// Interface used to implement a custom request handler interface. The /// functions of this interface will be called on the IO thread unless otherwise /// indicated. /// /// /// Implements TCefResourceHandler /// CEF source file: /include/capi/cef_resource_handler_capi.h (cef_resource_handler_t) /// ICefResourceHandler = interface(ICefBaseRefCounted) ['{BD3EA208-AAAD-488C-BFF2-76993022F2B5}'] /// /// 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. /// function open(const request: ICefRequest; var handle_request: boolean; const callback: ICefCallback): boolean; /// /// 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). /// /// /// WARNING: This function is deprecated. Use Open instead. /// function ProcessRequest(const request: ICefRequest; const callback: ICefCallback): boolean; /// /// 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. /// procedure GetResponseHeaders(const response: ICefResponse; out responseLength: Int64; out redirectUrl: ustring); /// /// 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. /// function skip(bytes_to_skip: int64; var bytes_skipped: Int64; const callback: ICefResourceSkipCallback): boolean; /// /// 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. /// function read(const data_out: Pointer; bytes_to_read: Integer; var bytes_read: Integer; const callback: ICefResourceReadCallback): boolean; /// /// 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). /// /// /// WARNING: This function is deprecated. Use Skip and Read instead. /// function ReadResponse(const dataOut: Pointer; bytesToRead: Integer; var bytesRead: Integer; const callback: ICefCallback): boolean; /// /// Request processing has been canceled. /// procedure Cancel; end; /// /// Interface that creates ICefResourceHandler instances for handling scheme /// requests. The functions of this interface will always be called on the IO /// thread. /// /// /// Implements TCefSchemeHandlerFactory /// CEF source file: /include/capi/cef_scheme_capi.h (cef_scheme_handler_factory_t) /// ICefSchemeHandlerFactory = interface(ICefBaseRefCounted) ['{4D9B7960-B73B-4EBD-9ABE-6C1C43C245EB}'] /// /// 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. /// function New(const browser: ICefBrowser; const frame: ICefFrame; const schemeName: ustring; const request: ICefRequest): ICefResourceHandler; end; /// /// Callback interface used for asynchronous continuation of authentication /// requests. /// /// /// Implements TCefAuthCallback /// CEF source file: /include/capi/cef_auth_callback_capi.h (cef_auth_callback_t) /// ICefAuthCallback = interface(ICefBaseRefCounted) ['{500C2023-BF4D-4FF7-9C04-165E5C389131}'] /// /// Continue the authentication request. /// procedure Cont(const username, password: ustring); /// /// Cancel the authentication request. /// procedure Cancel; end; /// /// Callback interface used for asynchronous continuation of JavaScript dialog /// requests. /// /// /// Implements TCefJsDialogCallback /// CEF source file: /include/capi/cef_jsdialog_handler_capi.h (cef_jsdialog_callback_t) /// ICefJsDialogCallback = interface(ICefBaseRefCounted) ['{187B2156-9947-4108-87AB-32E559E1B026}'] /// /// 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. /// procedure Cont(success: Boolean; const userInput: ustring); end; /// /// Provides information about the context menu state. The functions of this /// interface can only be accessed on browser process the UI thread. /// /// /// Implements TCefContextMenuParams /// CEF source file: /include/capi/cef_context_menu_handler_capi.h (cef_context_menu_params_t) /// ICefContextMenuParams = interface(ICefBaseRefCounted) ['{E31BFA9E-D4E2-49B7-A05D-20018C8794EB}'] /// /// Returns the X coordinate of the mouse where the context menu was invoked. /// Coords are relative to the associated RenderView's origin. /// function GetXCoord: Integer; /// /// Returns the Y coordinate of the mouse where the context menu was invoked. /// Coords are relative to the associated RenderView's origin. /// function GetYCoord: Integer; /// /// Returns flags representing the type of node that the context menu was /// invoked on. /// function GetTypeFlags: TCefContextMenuTypeFlags; /// /// Returns the URL of the link, if any, that encloses the node that the /// context menu was invoked on. /// function GetLinkUrl: ustring; /// /// Returns the link URL, if any, to be used ONLY for "copy link address". We /// don't validate this field in the frontend process. /// function GetUnfilteredLinkUrl: ustring; /// /// 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. /// function GetSourceUrl: ustring; /// /// Returns true (1) if the context menu was invoked on an image which has /// non-NULL contents. /// function HasImageContents: Boolean; /// /// Returns the title text or the alt text if the context menu was invoked on /// an image. /// function GetTitleText: ustring; /// /// Returns the URL of the top level page that the context menu was invoked /// on. /// function GetPageUrl: ustring; /// /// Returns the URL of the subframe that the context menu was invoked on. /// function GetFrameUrl: ustring; /// /// Returns the character encoding of the subframe that the context menu was /// invoked on. /// function GetFrameCharset: ustring; /// /// Returns the type of context node that the context menu was invoked on. /// function GetMediaType: TCefContextMenuMediaType; /// /// Returns flags representing the actions supported by the media element, if /// any, that the context menu was invoked on. /// function GetMediaStateFlags: TCefContextMenuMediaStateFlags; /// /// Returns the text of the selection, if any, that the context menu was /// invoked on. /// function GetSelectionText: ustring; /// /// Returns the text of the misspelled word, if any, that the context menu was /// invoked on. /// function GetMisspelledWord: ustring; /// /// 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. /// function GetDictionarySuggestions(const suggestions: TStringList): Boolean; /// /// Returns true (1) if the context menu was invoked on an editable node. /// function IsEditable: Boolean; /// /// Returns true (1) if the context menu was invoked on an editable node where /// spell-check is enabled. /// function IsSpellCheckEnabled: Boolean; /// /// Returns flags representing the actions supported by the editable node, if /// any, that the context menu was invoked on. /// function GetEditStateFlags: TCefContextMenuEditStateFlags; /// /// Returns true (1) if the context menu contains items specified by the /// renderer process. /// function IsCustomMenu: Boolean; /// /// Returns the X coordinate of the mouse where the context menu was invoked. /// Coords are relative to the associated RenderView's origin. /// property XCoord : Integer read GetXCoord; /// /// Returns the Y coordinate of the mouse where the context menu was invoked. /// Coords are relative to the associated RenderView's origin. /// property YCoord : Integer read GetYCoord; /// /// Returns flags representing the type of node that the context menu was /// invoked on. /// property TypeFlags : TCefContextMenuTypeFlags read GetTypeFlags; /// /// Returns the URL of the link, if any, that encloses the node that the /// context menu was invoked on. /// property LinkUrl : ustring read GetLinkUrl; /// /// Returns the link URL, if any, to be used ONLY for "copy link address". We /// don't validate this field in the frontend process. /// property UnfilteredLinkUrl : ustring read GetUnfilteredLinkUrl; /// /// 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. /// property SourceUrl : ustring read GetSourceUrl; /// /// Returns the title text or the alt text if the context menu was invoked on /// an image. /// property TitleText : ustring read GetTitleText; /// /// Returns the URL of the top level page that the context menu was invoked /// on. /// property PageUrl : ustring read GetPageUrl; /// /// Returns the URL of the subframe that the context menu was invoked on. /// property FrameUrl : ustring read GetFrameUrl; /// /// Returns the character encoding of the subframe that the context menu was /// invoked on. /// property FrameCharset : ustring read GetFrameCharset; /// /// Returns the type of context node that the context menu was invoked on. /// property MediaType : TCefContextMenuMediaType read GetMediaType; /// /// Returns flags representing the actions supported by the media element, if /// any, that the context menu was invoked on. /// property MediaStateFlags : TCefContextMenuMediaStateFlags read GetMediaStateFlags; /// /// Returns the text of the selection, if any, that the context menu was /// invoked on. /// property SelectionText : ustring read GetSelectionText; /// /// Returns the text of the misspelled word, if any, that the context menu was /// invoked on. /// property MisspelledWord : ustring read GetMisspelledWord; /// /// Returns flags representing the actions supported by the editable node, if /// any, that the context menu was invoked on. /// property EditStateFlags : TCefContextMenuEditStateFlags read GetEditStateFlags; end; /// /// 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. /// /// /// Implements TCefMenuModel /// CEF source file: /include/capi/cef_menu_model_capi.h (cef_menu_model_t) /// ICefMenuModel = interface(ICefBaseRefCounted) ['{40AF19D3-8B4E-44B8-8F89-DEB5907FC495}'] /// /// Returns true (1) if this menu is a submenu. /// function IsSubMenu: Boolean; /// /// Clears the menu. Returns true (1) on success. /// function Clear: Boolean; /// /// Returns the number of items in this menu. /// function GetCount: NativeUInt; /// /// Add a separator to the menu. Returns true (1) on success. /// function AddSeparator: Boolean; /// /// Add an item to the menu. Returns true (1) on success. /// function AddItem(commandId: Integer; const text: ustring): Boolean; /// /// Add a check item to the menu. Returns true (1) on success. /// function AddCheckItem(commandId: Integer; const text: ustring): Boolean; /// /// 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. /// function AddRadioItem(commandId: Integer; const text: ustring; groupId: Integer): Boolean; /// /// Add a sub-menu to the menu. The new sub-menu is returned. /// function AddSubMenu(commandId: Integer; const text: ustring): ICefMenuModel; /// /// Insert a separator in the menu at the specified |index|. Returns true (1) /// on success. /// function InsertSeparatorAt(index: NativeUInt): Boolean; /// /// Insert an item in the menu at the specified |index|. Returns true (1) on /// success. /// function InsertItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean; /// /// Insert a check item in the menu at the specified |index|. Returns true (1) /// on success. /// function InsertCheckItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean; /// /// 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. /// function InsertRadioItemAt(index: NativeUInt; commandId: Integer; const text: ustring; groupId: Integer): Boolean; /// /// Insert a sub-menu in the menu at the specified |index|. The new sub-menu /// is returned. /// function InsertSubMenuAt(index: NativeUInt; commandId: Integer; const text: ustring): ICefMenuModel; /// /// Removes the item with the specified |command_id|. Returns true (1) on /// success. /// function Remove(commandId: Integer): Boolean; /// /// Removes the item at the specified |index|. Returns true (1) on success. /// function RemoveAt(index: NativeUInt): Boolean; /// /// Returns the index associated with the specified |command_id| or -1 if not /// found due to the command id not existing in the menu. /// function GetIndexOf(commandId: Integer): Integer; /// /// Returns the command id at the specified |index| or -1 if not found due to /// invalid range or the index being a separator. /// function GetCommandIdAt(index: NativeUInt): Integer; /// /// Sets the command id at the specified |index|. Returns true (1) on success. /// function SetCommandIdAt(index: NativeUInt; commandId: Integer): Boolean; /// /// Returns the label for the specified |command_id| or NULL if not found. /// function GetLabel(commandId: Integer): ustring; /// /// Returns the label at the specified |index| or NULL if not found due to /// invalid range or the index being a separator. /// function GetLabelAt(index: NativeUInt): ustring; /// /// Sets the label for the specified |command_id|. Returns true (1) on /// success. /// function SetLabel(commandId: Integer; const text: ustring): Boolean; /// /// Set the label at the specified |index|. Returns true (1) on success. /// function SetLabelAt(index: NativeUInt; const text: ustring): Boolean; /// /// Returns the item type for the specified |command_id|. /// function GetType(commandId: Integer): TCefMenuItemType; /// /// Returns the item type at the specified |index|. /// function GetTypeAt(index: NativeUInt): TCefMenuItemType; /// /// Returns the group id for the specified |command_id| or -1 if invalid. /// function GetGroupId(commandId: Integer): Integer; /// /// Returns the group id at the specified |index| or -1 if invalid. /// function GetGroupIdAt(index: NativeUInt): Integer; /// /// Sets the group id for the specified |command_id|. Returns true (1) on /// success. /// function SetGroupId(commandId, groupId: Integer): Boolean; /// /// Sets the group id at the specified |index|. Returns true (1) on success. /// function SetGroupIdAt(index: NativeUInt; groupId: Integer): Boolean; /// /// Returns the submenu for the specified |command_id| or NULL if invalid. /// function GetSubMenu(commandId: Integer): ICefMenuModel; /// /// Returns the submenu at the specified |index| or NULL if invalid. /// function GetSubMenuAt(index: NativeUInt): ICefMenuModel; /// /// Returns true (1) if the specified |command_id| is visible. /// function IsVisible(commandId: Integer): Boolean; /// /// Returns true (1) if the specified |index| is visible. /// function isVisibleAt(index: NativeUInt): Boolean; /// /// Change the visibility of the specified |command_id|. Returns true (1) on /// success. /// function SetVisible(commandId: Integer; visible: Boolean): Boolean; /// /// Change the visibility at the specified |index|. Returns true (1) on /// success. /// function SetVisibleAt(index: NativeUInt; visible: Boolean): Boolean; /// /// Returns true (1) if the specified |command_id| is enabled. /// function IsEnabled(commandId: Integer): Boolean; /// /// Returns true (1) if the specified |index| is enabled. /// function IsEnabledAt(index: NativeUInt): Boolean; /// /// Change the enabled status of the specified |command_id|. Returns true (1) /// on success. /// function SetEnabled(commandId: Integer; enabled: Boolean): Boolean; /// /// Change the enabled status at the specified |index|. Returns true (1) on /// success. /// function SetEnabledAt(index: NativeUInt; enabled: Boolean): Boolean; /// /// Returns true (1) if the specified |command_id| is checked. Only applies to /// check and radio items. /// function IsChecked(commandId: Integer): Boolean; /// /// Returns true (1) if the specified |index| is checked. Only applies to /// check and radio items. /// function IsCheckedAt(index: NativeUInt): Boolean; /// /// Check the specified |command_id|. Only applies to check and radio items. /// Returns true (1) on success. /// function setChecked(commandId: Integer; checked: Boolean): Boolean; /// /// Check the specified |index|. Only applies to check and radio items. /// Returns true (1) on success. /// function setCheckedAt(index: NativeUInt; checked: Boolean): Boolean; /// /// Returns true (1) if the specified |command_id| has a keyboard accelerator /// assigned. /// function HasAccelerator(commandId: Integer): Boolean; /// /// Returns true (1) if the specified |index| has a keyboard accelerator /// assigned. /// function HasAcceleratorAt(index: NativeUInt): Boolean; /// /// Set the keyboard accelerator for the specified |command_id|. |key_code| /// can be any virtual key or character value. Returns true (1) on success. /// function SetAccelerator(commandId, keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean; /// /// Set the keyboard accelerator at the specified |index|. |key_code| can be /// any virtual key or character value. Returns true (1) on success. /// function SetAcceleratorAt(index: NativeUInt; keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean; /// /// Remove the keyboard accelerator for the specified |command_id|. Returns /// true (1) on success. /// function RemoveAccelerator(commandId: Integer): Boolean; /// /// Remove the keyboard accelerator at the specified |index|. Returns true (1) /// on success. /// function RemoveAcceleratorAt(index: NativeUInt): Boolean; /// /// Retrieves the keyboard accelerator for the specified |command_id|. Returns /// true (1) on success. /// function GetAccelerator(commandId: Integer; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean; /// /// Retrieves the keyboard accelerator for the specified |index|. Returns true /// (1) on success. /// function GetAcceleratorAt(index: NativeUInt; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean; /// /// 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. /// function SetColor(commandId: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean; /// /// 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. /// function SetColorAt(index: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean; /// /// 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. /// function GetColor(commandId: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean; /// /// 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. /// function GetColorAt(index: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean; /// /// 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 /// ",[STYLES] ", 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 "Bold" and "Italic" are supported), and /// - SIZE is an integer font size in pixels with the suffix "px". /// /// Here are examples of valid font description strings: /// - "Arial, Helvetica, Bold Italic 14px" /// - "Arial, 14px" /// function SetFontList(commandId: Integer; const fontList: ustring): Boolean; /// /// 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 /// ",[STYLES] ", 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 "Bold" and "Italic" are supported), and /// - SIZE is an integer font size in pixels with the suffix "px". /// /// Here are examples of valid font description strings: /// - "Arial, Helvetica, Bold Italic 14px" /// - "Arial, 14px" /// function SetFontListAt(index: Integer; const fontList: ustring): Boolean; end; /// /// 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. /// /// /// Implements TCefValue /// CEF source file: /include/capi/cef_values_capi.h (cef_value_t) /// ICefValue = interface(ICefBaseRefCounted) ['{66F9F439-B12B-4EC3-A945-91AE4EF4D4BA}'] /// /// 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. /// function IsValid: Boolean; /// /// Returns true (1) if the underlying data is owned by another object. /// function IsOwned: Boolean; /// /// Returns true (1) if the underlying data is read-only. Some APIs may expose /// read-only objects. /// function IsReadOnly: Boolean; /// /// 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. /// function IsSame(const that: ICefValue): Boolean; /// /// Returns true (1) if this object and |that| object have an equivalent /// underlying value but are not necessarily the same object. /// function IsEqual(const that: ICefValue): Boolean; /// /// Returns a copy of this object. The underlying data will also be copied. /// function Copy: ICefValue; /// /// Returns the underlying value type. /// function GetType: TCefValueType; /// /// Returns the underlying value as type bool. /// function GetBool: Boolean; /// /// Returns the underlying value as type int. /// function GetInt: Integer; /// /// Returns the underlying value as type double. /// function GetDouble: Double; /// /// Returns the underlying value as type string. /// function GetString: ustring; /// /// 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(). /// function GetBinary: ICefBinaryValue; /// /// 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(). /// function GetDictionary: ICefDictionaryValue; /// /// 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(). /// function GetList: ICefListValue; /// /// Sets the underlying value as type null. Returns true (1) if the value was /// set successfully. /// function SetNull: Boolean; /// /// Sets the underlying value as type bool. Returns true (1) if the value was /// set successfully. /// function SetBool(value: boolean): Boolean; /// /// Sets the underlying value as type int. Returns true (1) if the value was /// set successfully. /// function SetInt(value: Integer): Boolean; /// /// Sets the underlying value as type double. Returns true (1) if the value /// was set successfully. /// function SetDouble(value: Double): Boolean; /// /// Sets the underlying value as type string. Returns true (1) if the value /// was set successfully. /// function SetString(const value: ustring): Boolean; /// /// 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. /// function SetBinary(const value: ICefBinaryValue): Boolean; /// /// 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. /// function SetDictionary(const value: ICefDictionaryValue): Boolean; /// /// 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. /// function SetList(const value: ICefListValue): Boolean; end; /// /// Interface representing a binary value. Can be used on any process and /// thread. /// /// /// Implements TCefBinaryValue /// CEF source file: /include/capi/cef_values_capi.h (cef_binary_value_t) /// ICefBinaryValue = interface(ICefBaseRefCounted) ['{974AA40A-9C5C-4726-81F0-9F0D46D7C5B3}'] /// /// 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). /// function IsValid: Boolean; /// /// Returns true (1) if this object is currently owned by another object. /// function IsOwned: Boolean; /// /// Returns true (1) if this object and |that| object have the same underlying /// data. /// function IsSame(const that: ICefBinaryValue): Boolean; /// /// Returns true (1) if this object and |that| object have an equivalent /// underlying value but are not necessarily the same object. /// function IsEqual(const that: ICefBinaryValue): Boolean; /// /// Returns a copy of this object. The data in this object will also be /// copied. /// function Copy: ICefBinaryValue; /// /// Returns a pointer to the beginning of the memory block. The returned /// pointer is valid as long as the ICefBinaryValue is alive. /// function GetRawData: Pointer; /// /// Returns the data size. /// function GetSize: NativeUInt; /// /// Read up to |buffer_size| number of bytes into |buffer|. Reading begins at /// the specified byte |data_offset|. Returns the number of bytes read. /// function GetData(buffer: Pointer; bufferSize, dataOffset: NativeUInt): NativeUInt; /// /// Returns the data size. /// property Size : NativeUInt read GetSize; end; /// /// Interface representing a dictionary value. Can be used on any process and /// thread. /// /// /// Implements TCefDictionaryValue /// CEF source file: /include/capi/cef_values_capi.h (cef_dictionary_value_t) /// ICefDictionaryValue = interface(ICefBaseRefCounted) ['{B9638559-54DC-498C-8185-233EEF12BC69}'] /// /// 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). /// function IsValid: Boolean; /// /// Returns true (1) if this object is currently owned by another object. /// function isOwned: Boolean; /// /// Returns true (1) if the values of this object are read-only. Some APIs may /// expose read-only objects. /// function IsReadOnly: Boolean; /// /// 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. /// function IsSame(const that: ICefDictionaryValue): Boolean; /// /// Returns true (1) if this object and |that| object have an equivalent /// underlying value but are not necessarily the same object. /// function IsEqual(const that: ICefDictionaryValue): Boolean; /// /// 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. /// function Copy(excludeEmptyChildren: Boolean): ICefDictionaryValue; /// /// Returns the number of values. /// function GetSize: NativeUInt; /// /// Removes all values. Returns true (1) on success. /// function Clear: Boolean; /// /// Returns true (1) if the current dictionary has a value for the given key. /// function HasKey(const key: ustring): Boolean; /// /// Reads all keys for this dictionary into the specified vector. /// function GetKeys(const keys: TStrings): Boolean; /// /// Removes the value at the specified key. Returns true (1) is the value was /// removed successfully. /// function Remove(const key: ustring): Boolean; /// /// Returns the value type for the specified key. /// function GetType(const key: ustring): TCefValueType; /// /// 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. /// function GetValue(const key: ustring): ICefValue; /// /// Returns the value at the specified key as type bool. /// function GetBool(const key: ustring): Boolean; /// /// Returns the value at the specified key as type int. /// function GetInt(const key: ustring): Integer; /// /// Returns the value at the specified key as type double. /// function GetDouble(const key: ustring): Double; /// /// Returns the value at the specified key as type string. /// function GetString(const key: ustring): ustring; /// /// Returns the value at the specified key as type binary. The returned value /// will reference existing data. /// function GetBinary(const key: ustring): ICefBinaryValue; /// /// 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. /// function GetDictionary(const key: ustring): ICefDictionaryValue; /// /// 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. /// function GetList(const key: ustring): ICefListValue; /// /// 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. /// function SetValue(const key: ustring; const value: ICefValue): Boolean; /// /// Sets the value at the specified key as type null. Returns true (1) if the /// value was set successfully. /// function SetNull(const key: ustring): Boolean; /// /// Sets the value at the specified key as type bool. Returns true (1) if the /// value was set successfully. /// function SetBool(const key: ustring; value: Boolean): Boolean; /// /// Sets the value at the specified key as type int. Returns true (1) if the /// value was set successfully. /// function SetInt(const key: ustring; value: Integer): Boolean; /// /// Sets the value at the specified key as type double. Returns true (1) if /// the value was set successfully. /// function SetDouble(const key: ustring; value: Double): Boolean; /// /// Sets the value at the specified key as type string. Returns true (1) if /// the value was set successfully. /// function SetString(const key, value: ustring): Boolean; /// /// 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. /// function SetBinary(const key: ustring; const value: ICefBinaryValue): Boolean; /// /// 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. /// function SetDictionary(const key: ustring; const value: ICefDictionaryValue): Boolean; /// /// 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. /// function SetList(const key: ustring; const value: ICefListValue): Boolean; end; /// /// Interface representing a list value. Can be used on any process and thread. /// /// /// Implements TCefListValue /// CEF source file: /include/capi/cef_values_capi.h (cef_list_value_t) /// ICefListValue = interface(ICefBaseRefCounted) ['{09174B9D-0CC6-4360-BBB0-3CC0117F70F6}'] /// /// 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). /// function IsValid: Boolean; /// /// Returns true (1) if this object is currently owned by another object. /// function IsOwned: Boolean; /// /// Returns true (1) if the values of this object are read-only. Some APIs may /// expose read-only objects. /// function IsReadOnly: Boolean; /// /// 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. /// function IsSame(const that: ICefListValue): Boolean; /// /// Returns true (1) if this object and |that| object have an equivalent /// underlying value but are not necessarily the same object. /// function IsEqual(const that: ICefListValue): Boolean; /// /// Returns a writable copy of this object. /// function Copy: ICefListValue; /// /// 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. /// function SetSize(size: NativeUInt): Boolean; /// /// Returns the number of values. /// function GetSize: NativeUInt; /// /// Removes all values. Returns true (1) on success. /// function Clear: Boolean; /// /// Removes the value at the specified index. /// function Remove(index: NativeUInt): Boolean; /// /// Returns the value type at the specified index. /// function GetType(index: NativeUInt): TCefValueType; /// /// 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. /// function GetValue(index: NativeUInt): ICefValue; /// /// Returns the value at the specified index as type bool. /// function GetBool(index: NativeUInt): Boolean; /// /// Returns the value at the specified index as type int. /// function GetInt(index: NativeUInt): Integer; /// /// Returns the value at the specified index as type double. /// function GetDouble(index: NativeUInt): Double; /// /// Returns the value at the specified index as type string. /// function GetString(index: NativeUInt): ustring; /// /// Returns the value at the specified index as type binary. The returned /// value will reference existing data. /// function GetBinary(index: NativeUInt): ICefBinaryValue; /// /// 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. /// function GetDictionary(index: NativeUInt): ICefDictionaryValue; /// /// 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. /// function GetList(index: NativeUInt): ICefListValue; /// /// 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. /// function SetValue(index: NativeUInt; const value: ICefValue): Boolean; /// /// Sets the value at the specified index as type null. Returns true (1) if /// the value was set successfully. /// function SetNull(index: NativeUInt): Boolean; /// /// Sets the value at the specified index as type bool. Returns true (1) if /// the value was set successfully. /// function SetBool(index: NativeUInt; value: Boolean): Boolean; /// /// Sets the value at the specified index as type int. Returns true (1) if the /// value was set successfully. /// function SetInt(index: NativeUInt; value: Integer): Boolean; /// /// Sets the value at the specified index as type double. Returns true (1) if /// the value was set successfully. /// function SetDouble(index: NativeUInt; value: Double): Boolean; /// /// Sets the value at the specified index as type string. Returns true (1) if /// the value was set successfully. /// function SetString(index: NativeUInt; const value: ustring): Boolean; /// /// 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. /// function SetBinary(index: NativeUInt; const value: ICefBinaryValue): Boolean; /// /// 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. /// function SetDictionary(index: NativeUInt; const value: ICefDictionaryValue): Boolean; /// /// 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. /// function SetList(index: NativeUInt; const value: ICefListValue): Boolean; end; /// /// 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. /// /// /// Implements TCefLifeSpanHandler /// CEF source file: /include/capi/cef_life_span_handler_capi.h (cef_life_span_handler_t) /// ICefLifeSpanHandler = interface(ICefBaseRefCounted) ['{0A3EB782-A319-4C35-9B46-09B2834D7169}'] /// /// 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 /// wrapped in a ICefBrowserView. Popup browser creation will be canceled /// 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 /// ICefRenderProcessHandler.OnBrowserCreated in the render process. /// 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; /// /// 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). /// 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. /// 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. /// procedure OnBeforeDevToolsPopup(const browser: ICefBrowser; var windowInfo: TCefWindowInfo; var client: ICefClient; var settings: TCefBrowserSettings; var extra_info: ICefDictionaryValue; var use_default_window: boolean); /// /// Called after a new browser is created. It is now safe to begin performing /// actions with |browser|. ICefFrameHandler callbacks related to initial /// main frame creation will arrive before this callback. See /// ICefFrameHandler documentation for additional usage information. /// procedure OnAfterCreated(const browser: ICefBrowser); /// /// Called when a browser has received a request to close. This may result /// directly from a call to ICefBrowserHost.*CloseBrowser or indirectly /// 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 /// DoClose function will be called after the JavaScript 'onunload' event /// has been fired. /// /// An application should handle top-level owner window close notifications by /// calling ICefBrowserHost.TryCloseBrowser or /// ICefBrowserHost.CloseBrowser(false) instead of allowing the window /// to close immediately (see the examples below). This gives CEF an /// opportunity to process the 'onbeforeunload' event and optionally cancel /// the close before DoClose is called. /// /// When windowed rendering is enabled CEF will internally create a window or /// view to host the browser. In that case returning false (0) from DoClose() /// 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 /// Linux or ICefWindowDelegate.CanClose callback from Views). If the /// browser's host window/view has already been destroyed (via view hierarchy /// tear-down, for example) then DoClose() will not be called for that /// browser since is no longer possible to cancel the close. /// /// When windowed rendering is disabled returning false (0) from DoClose() /// will cause the browser object to be destroyed immediately. /// /// If the browser's top-level owner window requires a non-standard close /// notification then send that notification from DoClose() and return true /// (1). /// /// The ICefLifeSpanHandler.OnBeforeClose function will be called /// after DoClose() (if DoClose() is called) and immediately before the /// browser object is destroyed. The application should only exit after /// OnBeforeClose() has been called for all existing browsers. /// /// The below examples describe what should happen during window close when /// the browser is parented to an application-provided top-level window. /// /// Example 1: Using ICefBrowserHost.TryCloseBrowser(). This is /// 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 /// ICefJSDialogHandler.OnBeforeUnloadDialog()). /// 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. /// 9. Application's OnBeforeClose() handler is called and the browser object is destroyed. /// 10. Application exits by calling cef_quit_message_loop() if no other browsers exist. /// /// Example 2: Using ICefBrowserHost::CloseBrowser(false) and /// implementing the DoClose() callback. This is recommended for clients /// 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: /// A. Calls ICefBrowserHost.CloseBrowser(false). /// B. Cancels the window close. /// 3. JavaScript 'onbeforeunload' handler executes and shows the close /// confirmation dialog (which can be overridden via /// ICefJSDialogHandler.OnBeforeUnloadDialog()). /// 4. User approves the close. /// 5. JavaScript 'onunload' handler executes. /// 6. Application's DoClose() handler is called. Application will: /// 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. /// 10. Application's OnBeforeClose() handler is called and the browser object is destroyed. /// 11. Application exits by calling cef_quit_message_loop() if no other browsers exist. /// function DoClose(const browser: ICefBrowser): Boolean; /// /// 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 /// returns. ICefFrameHandler callbacks related to final main frame /// destruction will arrive after this callback and ICefBrowser.IsValid /// will return false (0) at that time. Any in-progress network requests /// associated with |browser| will be aborted when the browser is destroyed, /// 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. /// procedure OnBeforeClose(const browser: ICefBrowser); /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Implement this interface to handle events related to commands. The functions /// of this interface will be called on the UI thread. /// /// /// Implements TCefCommandHandler /// CEF source file: /include/capi/cef_command_handler_capi.h (cef_command_handler_t) /// ICefCommandHandler = interface(ICefBaseRefCounted) ['{7C931B93-53DC-4607-AABB-2CB4AEF7FB96}'] /// /// 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 /// will be called after ICefContextMenuHandler.OnContextMenuCommand. /// Only used with the Chrome runtime. /// function OnChromeCommand(const browser: ICefBrowser; command_id: integer; disposition: TCefWindowOpenDisposition): boolean; /// /// 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. /// function OnIsChromeAppMenuItemVisible(const browser: ICefBrowser; command_id: integer): boolean; /// /// 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. /// function OnIsChromeAppMenuItemEnabled(const browser: ICefBrowser; command_id: integer): boolean; /// /// 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. /// function OnIsChromePageActionIconVisible(icon_type: TCefChromePageActionIconType): boolean; /// /// 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. /// function OnIsChromeToolbarButtonVisible(button_type: TCefChromeToolbarButtonType): boolean; /// /// Custom procedure to clear all references. /// procedure RemoveReferences; end; /// /// Callback interface used for asynchronous continuation of /// ICefExtensionHandler.GetExtensionResource. /// /// /// Implements TCefGetExtensionResourceCallback /// CEF source file: /include/capi/cef_extension_handler_capi.h (cef_get_extension_resource_callback_t) /// ICefGetExtensionResourceCallback = interface(ICefBaseRefCounted) ['{579C8602-8252-40D0-9E0A-501F32C36C42}'] /// /// Continue the request. Read the resource contents from |stream|. /// procedure cont(const stream: ICefStreamReader); /// /// Cancel the request. /// procedure cancel; end; /// /// 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. /// /// /// WARNING: This API is deprecated and will be removed in ~M127. /// Implements TCefExtensionHandler /// CEF source file: /include/capi/cef_extension_handler_capi.h (cef_extension_handler_t) /// ICefExtensionHandler = interface(ICefBaseRefCounted) ['{3234008F-D809-459D-963D-23BA50219648}'] /// /// Called if the ICefRequestContext.LoadExtension request fails. |result| /// will be the error code. /// procedure OnExtensionLoadFailed(result: TCefErrorcode); /// /// Called if the ICefRequestContext.LoadExtension request succeeds. /// |extension| is the loaded extension. /// procedure OnExtensionLoaded(const extension: ICefExtension); /// /// Called after the ICefExtension.Unload request has completed. /// procedure OnExtensionUnloaded(const extension: ICefExtension); /// /// 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 "