CEF4Delphi/source/uCEFChromiumOptions.pas

83 lines
4.0 KiB
ObjectPascal
Raw Normal View History

2017-01-27 17:29:37 +01:00
unit uCEFChromiumOptions;
{$IFDEF FPC}
{$MODE OBJFPC}{$H+}
{$ENDIF}
2017-02-05 20:56:46 +01:00
{$I cef.inc}
{$IFNDEF TARGET_64BITS}{$ALIGN ON}{$ENDIF}
{$MINENUMSIZE 4}
2017-01-27 17:29:37 +01:00
interface
uses
2017-02-05 20:56:46 +01:00
{$IFDEF DELPHI16_UP}
2017-01-27 17:29:37 +01:00
System.Classes,
2017-02-05 20:56:46 +01:00
{$ELSE}
Classes,
{$ENDIF}
2021-04-18 19:36:20 +02:00
uCEFTypes, uCEFConstants;
2017-01-27 17:29:37 +01:00
type
TChromiumOptions = class(TPersistent)
protected
FWindowlessFrameRate : Integer;
FJavascript : TCefState;
FJavascriptCloseWindows : TCefState;
FJavascriptAccessClipboard : TCefState;
FJavascriptDomPaste : TCefState;
FImageLoading : TCefState;
FImageShrinkStandaloneToFit : TCefState;
FTextAreaResize : TCefState;
FTabToLinks : TCefState;
FLocalStorage : TCefState;
FDatabases : TCefState;
FWebgl : TCefState;
FBackgroundColor : TCefColor;
FAcceptLanguageList : ustring;
2022-05-03 12:43:16 +02:00
FChromeStatusBubble : TCefState;
2017-01-27 17:29:37 +01:00
public
constructor Create; virtual;
published
property Javascript : TCefState read FJavascript write FJavascript default STATE_DEFAULT;
property JavascriptCloseWindows : TCefState read FJavascriptCloseWindows write FJavascriptCloseWindows default STATE_DEFAULT;
property JavascriptAccessClipboard : TCefState read FJavascriptAccessClipboard write FJavascriptAccessClipboard default STATE_DEFAULT;
property JavascriptDomPaste : TCefState read FJavascriptDomPaste write FJavascriptDomPaste default STATE_DEFAULT;
property ImageLoading : TCefState read FImageLoading write FImageLoading default STATE_DEFAULT;
property ImageShrinkStandaloneToFit : TCefState read FImageShrinkStandaloneToFit write FImageShrinkStandaloneToFit default STATE_DEFAULT;
property TextAreaResize : TCefState read FTextAreaResize write FTextAreaResize default STATE_DEFAULT;
property TabToLinks : TCefState read FTabToLinks write FTabToLinks default STATE_DEFAULT;
property LocalStorage : TCefState read FLocalStorage write FLocalStorage default STATE_DEFAULT;
property Databases : TCefState read FDatabases write FDatabases default STATE_DEFAULT;
property Webgl : TCefState read FWebgl write FWebgl default STATE_DEFAULT;
property BackgroundColor : TCefColor read FBackgroundColor write FBackgroundColor default 0;
property AcceptLanguageList : ustring read FAcceptLanguageList write FAcceptLanguageList;
2021-04-18 19:36:20 +02:00
property WindowlessFrameRate : Integer read FWindowlessFrameRate write FWindowlessFrameRate default CEF_OSR_FRAMERATE_DEFAULT;
2022-05-03 12:43:16 +02:00
property ChromeStatusBubble : TCefState read FChromeStatusBubble write FChromeStatusBubble default STATE_DEFAULT;
2017-01-27 17:29:37 +01:00
end;
implementation
constructor TChromiumOptions.Create;
begin
2021-04-18 19:36:20 +02:00
FWindowlessFrameRate := CEF_OSR_FRAMERATE_DEFAULT; // Use CEF_OSR_SHARED_TEXTURES_FRAMERATE_DEFAULT if the shared textures are enabled.
2017-01-27 17:29:37 +01:00
FJavascript := STATE_DEFAULT;
FJavascriptCloseWindows := STATE_DEFAULT;
FJavascriptAccessClipboard := STATE_DEFAULT;
FJavascriptDomPaste := STATE_DEFAULT;
FImageLoading := STATE_DEFAULT;
FImageShrinkStandaloneToFit := STATE_DEFAULT;
FTextAreaResize := STATE_DEFAULT;
FTabToLinks := STATE_DEFAULT;
FLocalStorage := STATE_DEFAULT;
FDatabases := STATE_DEFAULT;
FWebgl := STATE_DEFAULT;
FBackgroundColor := 0;
2022-05-03 12:43:16 +02:00
FChromeStatusBubble := STATE_DEFAULT;
2017-01-27 17:29:37 +01:00
end;
end.