1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-11-23 21:34:53 +02:00

Update to CEF 117.1.5

This commit is contained in:
salvadordf
2023-09-29 19:23:38 +02:00
parent fd75f6f65e
commit f423f19168
36 changed files with 2208 additions and 40 deletions

View File

@@ -20,42 +20,168 @@ uses
uCEFBaseRefCounted, uCEFInterfaces, uCEFTypes, uCEFView;
type
/// <summary>
/// A Textfield supports editing of text. This control is custom rendered with
/// no platform-specific code. Methods must be called on the browser process UI
/// thread unless otherwise indicated.
/// </summary>
/// <remarks>
/// <para><see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/views/cef_textfield_capi.h">CEF source file: /include/capi/views/cef_textfield_capi.h (cef_textfield_t)</see></para>
/// </remarks>
TCefTextfieldRef = class(TCefViewRef, ICefTextfield)
protected
/// <summary>
/// Sets whether the text will be displayed as asterisks.
/// </summary>
procedure SetPasswordInput(password_input: boolean);
/// <summary>
/// Returns true (1) if the text will be displayed as asterisks.
/// </summary>
function IsPasswordInput : boolean;
/// <summary>
/// Sets whether the text will read-only.
/// </summary>
procedure SetReadOnly(read_only: boolean);
/// <summary>
/// Returns true (1) if the text is read-only.
/// </summary>
function IsReadOnly : boolean;
/// <summary>
/// Returns the currently displayed text.
/// </summary>
function GetText : ustring;
/// <summary>
/// Sets the contents to |text|. The cursor will be moved to end of the text
/// if the current position is outside of the text range.
/// </summary>
procedure SetText(const text_: ustring);
/// <summary>
/// Appends |text| to the previously-existing text.
/// </summary>
procedure AppendText(const text_: ustring);
/// <summary>
/// Inserts |text| at the current cursor position replacing any selected text.
/// </summary>
procedure InsertOrReplaceText(const text_: ustring);
/// <summary>
/// Returns true (1) if there is any selected text.
/// </summary>
function HasSelection : boolean;
/// <summary>
/// Returns the currently selected text.
/// </summary>
function GetSelectedText : ustring;
/// <summary>
/// Selects all text. If |reversed| is true (1) the range will end at the
/// logical beginning of the text; this generally shows the leading portion of
/// text that overflows its display area.
/// </summary>
procedure SelectAll(reversed: boolean);
/// <summary>
/// Clears the text selection and sets the caret to the end.
/// </summary>
procedure ClearSelection;
/// <summary>
/// Returns the selected logical text range.
/// </summary>
function GetSelectedRange : TCefRange;
/// <summary>
/// Selects the specified logical text range.
/// </summary>
procedure SelectRange(const range: TCefRange);
/// <summary>
/// Returns the current cursor position.
/// </summary>
function GetCursorPosition : NativeUInt;
/// <summary>
/// Sets the text color.
/// </summary>
procedure SetTextColor(color: TCefColor);
/// <summary>
/// Returns the text color.
/// </summary>
function GetTextColor : TCefColor;
/// <summary>
/// Sets the selection text color.
/// </summary>
procedure SetSelectionTextColor(color: TCefColor);
/// <summary>
/// Returns the selection text color.
/// </summary>
function GetSelectionTextColor : TCefColor;
/// <summary>
/// Sets the selection background color.
/// </summary>
procedure SetSelectionBackgroundColor(color: TCefColor);
/// <summary>
/// Returns the selection background color.
/// </summary>
function GetSelectionBackgroundColor : TCefColor;
/// <summary>
/// Sets the font list. The format is "<FONT_FAMILY_LIST>,[STYLES] <SIZE>",
/// where: - FONT_FAMILY_LIST is a comma-separated list of font family names,
/// - STYLES is an optional space-separated list of style names (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"
/// </summary>
procedure SetFontList(const font_list: ustring);
/// <summary>
/// Applies |color| to the specified |range| without changing the default
/// color. If |range| is NULL the color will be set on the complete text
/// contents.
/// </summary>
procedure ApplyTextColor(color: TCefColor; const range: TCefRange);
/// <summary>
/// Applies |style| to the specified |range| without changing the default
/// style. If |add| is true (1) the style will be added, otherwise the style
/// will be removed. If |range| is NULL the style will be set on the complete
/// text contents.
/// </summary>
procedure ApplyTextStyle(style: TCefTextStyle; add: boolean; const range: TCefRange);
/// <summary>
/// Returns true (1) if the action associated with the specified command id is
/// enabled. See additional comments on execute_command().
/// </summary>
function IsCommandEnabled(command_id: TCefTextFieldCommands): boolean;
/// <summary>
/// Performs the action associated with the specified command id.
/// </summary>
procedure ExecuteCommand(command_id: TCefTextFieldCommands);
/// <summary>
/// Clears Edit history.
/// </summary>
procedure ClearEditHistory;
/// <summary>
/// Sets the placeholder text that will be displayed when the Textfield is
/// NULL.
/// </summary>
procedure SetPlaceholderText(const text_: ustring);
/// <summary>
/// Returns the placeholder text that will be displayed when the Textfield is
/// NULL.
/// </summary>
function GetPlaceholderText : ustring;
/// <summary>
/// Sets the placeholder text color.
/// </summary>
procedure SetPlaceholderTextColor(color: TCefColor);
/// <summary>
/// Set the accessible name that will be exposed to assistive technology (AT).
/// </summary>
procedure SetAccessibleName(const name: ustring);
public
/// <summary>
/// Returns a ICefTextfield instance using a PCefTextfield data pointer.
/// </summary>
class function UnWrap(data: Pointer): ICefTextfield;
/// <summary>
/// Create a new Textfield.
/// </summary>
class function CreateTextField(const delegate: ICefTextfieldDelegate): ICefTextfield;
end;