Chromium Embedded Framework (CEF)  131.2.1+ge081753+chromium-131.0.6778.13
CefTextfield Class Referenceabstract

A Textfield supports editing of text. More...

#include "include/views/cef_textfield.h"

Inheritance diagram for CefTextfield:
CefView CefBaseRefCounted

Public Member Functions

virtual void SetPasswordInput (bool password_input)=0
 Sets whether the text will be displayed as asterisks. More...
 
virtual bool IsPasswordInput ()=0
 Returns true if the text will be displayed as asterisks. More...
 
virtual void SetReadOnly (bool read_only)=0
 Sets whether the text will read-only. More...
 
virtual bool IsReadOnly ()=0
 Returns true if the text is read-only. More...
 
virtual CefString GetText ()=0
 Returns the currently displayed text. More...
 
virtual void SetText (const CefString &text)=0
 Sets the contents to |text|. More...
 
virtual void AppendText (const CefString &text)=0
 Appends |text| to the previously-existing text. More...
 
virtual void InsertOrReplaceText (const CefString &text)=0
 Inserts |text| at the current cursor position replacing any selected text. More...
 
virtual bool HasSelection ()=0
 Returns true if there is any selected text. More...
 
virtual CefString GetSelectedText ()=0
 Returns the currently selected text. More...
 
virtual void SelectAll (bool reversed)=0
 Selects all text. More...
 
virtual void ClearSelection ()=0
 Clears the text selection and sets the caret to the end. More...
 
virtual CefRange GetSelectedRange ()=0
 Returns the selected logical text range. More...
 
virtual void SelectRange (const CefRange &range)=0
 Selects the specified logical text range. More...
 
virtual size_t GetCursorPosition ()=0
 Returns the current cursor position. More...
 
virtual void SetTextColor (cef_color_t color)=0
 Sets the text color. More...
 
virtual cef_color_t GetTextColor ()=0
 Returns the text color. More...
 
virtual void SetSelectionTextColor (cef_color_t color)=0
 Sets the selection text color. More...
 
virtual cef_color_t GetSelectionTextColor ()=0
 Returns the selection text color. More...
 
virtual void SetSelectionBackgroundColor (cef_color_t color)=0
 Sets the selection background color. More...
 
virtual cef_color_t GetSelectionBackgroundColor ()=0
 Returns the selection background color. More...
 
virtual void SetFontList (const CefString &font_list)=0
 Sets the font list. More...
 
virtual void ApplyTextColor (cef_color_t color, const CefRange &range)=0
 Applies |color| to the specified |range| without changing the default color. More...
 
virtual void ApplyTextStyle (cef_text_style_t style, bool add, const CefRange &range)=0
 Applies |style| to the specified |range| without changing the default style. More...
 
virtual bool IsCommandEnabled (cef_text_field_commands_t command_id)=0
 Returns true if the action associated with the specified command id is enabled. More...
 
virtual void ExecuteCommand (cef_text_field_commands_t command_id)=0
 Performs the action associated with the specified command id. More...
 
virtual void ClearEditHistory ()=0
 Clears Edit history. More...
 
virtual void SetPlaceholderText (const CefString &text)=0
 Sets the placeholder text that will be displayed when the Textfield is empty. More...
 
virtual CefString GetPlaceholderText ()=0
 Returns the placeholder text that will be displayed when the Textfield is empty. More...
 
virtual void SetPlaceholderTextColor (cef_color_t color)=0
 Sets the placeholder text color. More...
 
virtual void SetAccessibleName (const CefString &name)=0
 Set the accessible name that will be exposed to assistive technology (AT). More...
 
- Public Member Functions inherited from CefView
virtual CefRefPtr< CefBrowserViewAsBrowserView ()=0
 Returns this View as a BrowserView or NULL if this is not a BrowserView. More...
 
virtual CefRefPtr< CefButtonAsButton ()=0
 Returns this View as a Button or NULL if this is not a Button. More...
 
virtual CefRefPtr< CefPanelAsPanel ()=0
 Returns this View as a Panel or NULL if this is not a Panel. More...
 
virtual CefRefPtr< CefScrollViewAsScrollView ()=0
 Returns this View as a ScrollView or NULL if this is not a ScrollView. More...
 
virtual CefRefPtr< CefTextfieldAsTextfield ()=0
 Returns this View as a Textfield or NULL if this is not a Textfield. More...
 
virtual CefString GetTypeString ()=0
 Returns the type of this View as a string. More...
 
virtual CefString ToString (bool include_children)=0
 Returns a string representation of this View which includes the type and various type-specific identifying attributes. More...
 
virtual bool IsValid ()=0
 Returns true if this View is valid. More...
 
virtual bool IsAttached ()=0
 Returns true if this View is currently attached to another View. More...
 
virtual bool IsSame (CefRefPtr< CefView > that)=0
 Returns true if this View is the same as |that| View. More...
 
virtual CefRefPtr< CefViewDelegateGetDelegate ()=0
 Returns the delegate associated with this View, if any. More...
 
virtual CefRefPtr< CefWindowGetWindow ()=0
 Returns the top-level Window hosting this View, if any. More...
 
virtual int GetID ()=0
 Returns the ID for this View. More...
 
virtual void SetID (int id)=0
 Sets the ID for this View. More...
 
virtual int GetGroupID ()=0
 Returns the group id of this View, or -1 if not set. More...
 
virtual void SetGroupID (int group_id)=0
 A group id is used to tag Views which are part of the same logical group. More...
 
virtual CefRefPtr< CefViewGetParentView ()=0
 Returns the View that contains this View, if any. More...
 
virtual CefRefPtr< CefViewGetViewForID (int id)=0
 Recursively descends the view tree starting at this View, and returns the first child that it encounters with the given ID. More...
 
virtual void SetBounds (const CefRect &bounds)=0
 Sets the bounds (size and position) of this View. More...
 
virtual CefRect GetBounds ()=0
 Returns the bounds (size and position) of this View in parent coordinates, or DIP screen coordinates if there is no parent. More...
 
virtual CefRect GetBoundsInScreen ()=0
 Returns the bounds (size and position) of this View in DIP screen coordinates. More...
 
virtual void SetSize (const CefSize &size)=0
 Sets the size of this View without changing the position. More...
 
virtual CefSize GetSize ()=0
 Returns the size of this View in parent coordinates, or DIP screen coordinates if there is no parent. More...
 
virtual void SetPosition (const CefPoint &position)=0
 Sets the position of this View without changing the size. More...
 
virtual CefPoint GetPosition ()=0
 Returns the position of this View. More...
 
virtual void SetInsets (const CefInsets &insets)=0
 Sets the insets for this View. More...
 
virtual CefInsets GetInsets ()=0
 Returns the insets for this View in parent coordinates, or DIP screen coordinates if there is no parent. More...
 
virtual CefSize GetPreferredSize ()=0
 Returns the size this View would like to be if enough space is available. More...
 
virtual void SizeToPreferredSize ()=0
 Size this View to its preferred size. More...
 
virtual CefSize GetMinimumSize ()=0
 Returns the minimum size for this View. More...
 
virtual CefSize GetMaximumSize ()=0
 Returns the maximum size for this View. More...
 
virtual int GetHeightForWidth (int width)=0
 Returns the height necessary to display this View with the provided width. More...
 
virtual void InvalidateLayout ()=0
 Indicate that this View and all parent Views require a re-layout. More...
 
virtual void SetVisible (bool visible)=0
 Sets whether this View is visible. More...
 
virtual bool IsVisible ()=0
 Returns whether this View is visible. More...
 
virtual bool IsDrawn ()=0
 Returns whether this View is visible and drawn in a Window. More...
 
virtual void SetEnabled (bool enabled)=0
 Set whether this View is enabled. More...
 
virtual bool IsEnabled ()=0
 Returns whether this View is enabled. More...
 
virtual void SetFocusable (bool focusable)=0
 Sets whether this View is capable of taking focus. More...
 
virtual bool IsFocusable ()=0
 Returns true if this View is focusable, enabled and drawn. More...
 
virtual bool IsAccessibilityFocusable ()=0
 Return whether this View is focusable when the user requires full keyboard access, even though it may not be normally focusable. More...
 
virtual bool HasFocus ()=0
 Returns true if this View has focus in the context of the containing Window. More...
 
virtual void RequestFocus ()=0
 Request focus for this View in the context of the containing Window. More...
 
virtual void SetBackgroundColor (cef_color_t color)=0
 Sets the background color for this View. More...
 
virtual cef_color_t GetBackgroundColor ()=0
 Returns the background color for this View. More...
 
virtual cef_color_t GetThemeColor (int color_id)=0
 Returns the current theme color associated with |color_id|, or the placeholder color (red) if unset. More...
 
virtual bool ConvertPointToScreen (CefPoint &point)=0
 Convert |point| from this View's coordinate system to DIP screen coordinates. More...
 
virtual bool ConvertPointFromScreen (CefPoint &point)=0
 Convert |point| to this View's coordinate system from DIP screen coordinates. More...
 
virtual bool ConvertPointToWindow (CefPoint &point)=0
 Convert |point| from this View's coordinate system to that of the Window. More...
 
virtual bool ConvertPointFromWindow (CefPoint &point)=0
 Convert |point| to this View's coordinate system from that of the Window. More...
 
virtual bool ConvertPointToView (CefRefPtr< CefView > view, CefPoint &point)=0
 Convert |point| from this View's coordinate system to that of |view|. More...
 
virtual bool ConvertPointFromView (CefRefPtr< CefView > view, CefPoint &point)=0
 Convert |point| to this View's coordinate system from that |view|. More...
 
- Public Member Functions inherited from CefBaseRefCounted
virtual void AddRef () const =0
 Called to increment the reference count for the object. More...
 
virtual bool Release () const =0
 Called to decrement the reference count for the object. More...
 
virtual bool HasOneRef () const =0
 Returns true if the reference count is 1. More...
 
virtual bool HasAtLeastOneRef () const =0
 Returns true if the reference count is at least 1. More...
 

Static Public Member Functions

static CefRefPtr< CefTextfieldCreateTextfield (CefRefPtr< CefTextfieldDelegate > delegate)
 Create a new Textfield. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CefBaseRefCounted
virtual ~CefBaseRefCounted ()
 

Detailed Description

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.

Member Function Documentation

◆ AppendText()

virtual void CefTextfield::AppendText ( const CefString text)
pure virtual

Appends |text| to the previously-existing text.

◆ ApplyTextColor()

virtual void CefTextfield::ApplyTextColor ( cef_color_t  color,
const CefRange range 
)
pure virtual

Applies |color| to the specified |range| without changing the default color.

If |range| is empty the color will be set on the complete text contents.

◆ ApplyTextStyle()

virtual void CefTextfield::ApplyTextStyle ( cef_text_style_t  style,
bool  add,
const CefRange range 
)
pure virtual

Applies |style| to the specified |range| without changing the default style.

If |add| is true the style will be added, otherwise the style will be removed. If |range| is empty the style will be set on the complete text contents.

◆ ClearEditHistory()

virtual void CefTextfield::ClearEditHistory ( )
pure virtual

Clears Edit history.

◆ ClearSelection()

virtual void CefTextfield::ClearSelection ( )
pure virtual

Clears the text selection and sets the caret to the end.

◆ CreateTextfield()

static CefRefPtr<CefTextfield> CefTextfield::CreateTextfield ( CefRefPtr< CefTextfieldDelegate delegate)
static

Create a new Textfield.

◆ ExecuteCommand()

virtual void CefTextfield::ExecuteCommand ( cef_text_field_commands_t  command_id)
pure virtual

Performs the action associated with the specified command id.

◆ GetCursorPosition()

virtual size_t CefTextfield::GetCursorPosition ( )
pure virtual

Returns the current cursor position.

◆ GetPlaceholderText()

virtual CefString CefTextfield::GetPlaceholderText ( )
pure virtual

Returns the placeholder text that will be displayed when the Textfield is empty.

◆ GetSelectedRange()

virtual CefRange CefTextfield::GetSelectedRange ( )
pure virtual

Returns the selected logical text range.

◆ GetSelectedText()

virtual CefString CefTextfield::GetSelectedText ( )
pure virtual

Returns the currently selected text.

◆ GetSelectionBackgroundColor()

virtual cef_color_t CefTextfield::GetSelectionBackgroundColor ( )
pure virtual

Returns the selection background color.

◆ GetSelectionTextColor()

virtual cef_color_t CefTextfield::GetSelectionTextColor ( )
pure virtual

Returns the selection text color.

◆ GetText()

virtual CefString CefTextfield::GetText ( )
pure virtual

Returns the currently displayed text.

◆ GetTextColor()

virtual cef_color_t CefTextfield::GetTextColor ( )
pure virtual

Returns the text color.

◆ HasSelection()

virtual bool CefTextfield::HasSelection ( )
pure virtual

Returns true if there is any selected text.

◆ InsertOrReplaceText()

virtual void CefTextfield::InsertOrReplaceText ( const CefString text)
pure virtual

Inserts |text| at the current cursor position replacing any selected text.

◆ IsCommandEnabled()

virtual bool CefTextfield::IsCommandEnabled ( cef_text_field_commands_t  command_id)
pure virtual

Returns true if the action associated with the specified command id is enabled.

See additional comments on ExecuteCommand().

◆ IsPasswordInput()

virtual bool CefTextfield::IsPasswordInput ( )
pure virtual

Returns true if the text will be displayed as asterisks.

◆ IsReadOnly()

virtual bool CefTextfield::IsReadOnly ( )
pure virtual

Returns true if the text is read-only.

◆ SelectAll()

virtual void CefTextfield::SelectAll ( bool  reversed)
pure virtual

Selects all text.

If |reversed| is true the range will end at the logical beginning of the text; this generally shows the leading portion of text that overflows its display area.

◆ SelectRange()

virtual void CefTextfield::SelectRange ( const CefRange range)
pure virtual

Selects the specified logical text range.

◆ SetAccessibleName()

virtual void CefTextfield::SetAccessibleName ( const CefString name)
pure virtual

Set the accessible name that will be exposed to assistive technology (AT).

◆ SetFontList()

virtual void CefTextfield::SetFontList ( const CefString font_list)
pure virtual

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"

◆ SetPasswordInput()

virtual void CefTextfield::SetPasswordInput ( bool  password_input)
pure virtual

Sets whether the text will be displayed as asterisks.

◆ SetPlaceholderText()

virtual void CefTextfield::SetPlaceholderText ( const CefString text)
pure virtual

Sets the placeholder text that will be displayed when the Textfield is empty.

◆ SetPlaceholderTextColor()

virtual void CefTextfield::SetPlaceholderTextColor ( cef_color_t  color)
pure virtual

Sets the placeholder text color.

◆ SetReadOnly()

virtual void CefTextfield::SetReadOnly ( bool  read_only)
pure virtual

Sets whether the text will read-only.

◆ SetSelectionBackgroundColor()

virtual void CefTextfield::SetSelectionBackgroundColor ( cef_color_t  color)
pure virtual

Sets the selection background color.

◆ SetSelectionTextColor()

virtual void CefTextfield::SetSelectionTextColor ( cef_color_t  color)
pure virtual

Sets the selection text color.

◆ SetText()

virtual void CefTextfield::SetText ( const CefString text)
pure virtual

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.

◆ SetTextColor()

virtual void CefTextfield::SetTextColor ( cef_color_t  color)
pure virtual

Sets the text color.


The documentation for this class was generated from the following file: