Chromium Embedded Framework (CEF)  122.1.5+gf09a9bc+chromium-122.0.6261.29
CefLabelButton Class Referenceabstract

LabelButton is a button with optional text and/or icon. More...

#include "include/views/cef_label_button.h"

Inheritance diagram for CefLabelButton:
CefButton CefView CefBaseRefCounted CefMenuButton

Public Member Functions

virtual CefRefPtr< CefMenuButtonAsMenuButton ()=0
 Returns this LabelButton as a MenuButton or NULL if this is not a MenuButton. More...
 
virtual void SetText (const CefString &text)=0
 Sets the text shown on the LabelButton. More...
 
virtual CefString GetText ()=0
 Returns the text shown on the LabelButton. More...
 
virtual void SetImage (cef_button_state_t button_state, CefRefPtr< CefImage > image)=0
 Sets the image shown for |button_state|. More...
 
virtual CefRefPtr< CefImageGetImage (cef_button_state_t button_state)=0
 Returns the image shown for |button_state|. More...
 
virtual void SetTextColor (cef_button_state_t for_state, cef_color_t color)=0
 Sets the text color shown for the specified button |for_state| to |color|. More...
 
virtual void SetEnabledTextColors (cef_color_t color)=0
 Sets the text colors shown for the non-disabled states to |color|. More...
 
virtual void SetFontList (const CefString &font_list)=0
 Sets the font list. More...
 
virtual void SetHorizontalAlignment (cef_horizontal_alignment_t alignment)=0
 Sets the horizontal alignment; reversed in RTL. More...
 
virtual void SetMinimumSize (const CefSize &size)=0
 Reset the minimum size of this LabelButton to |size|. More...
 
virtual void SetMaximumSize (const CefSize &size)=0
 Reset the maximum size of this LabelButton to |size|. More...
 
- Public Member Functions inherited from CefButton
virtual CefRefPtr< CefLabelButtonAsLabelButton ()=0
 Returns this Button as a LabelButton or NULL if this is not a LabelButton. More...
 
virtual void SetState (cef_button_state_t state)=0
 Sets the current display state of the Button. More...
 
virtual cef_button_state_t GetState ()=0
 Returns the current display state of the Button. More...
 
virtual void SetInkDropEnabled (bool enabled)=0
 Sets the Button will use an ink drop effect for displaying state changes. More...
 
virtual void SetTooltipText (const CefString &tooltip_text)=0
 Sets the tooltip text that will be displayed when the user hovers the mouse cursor over the Button. More...
 
virtual void SetAccessibleName (const CefString &name)=0
 Sets 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 void RequestFocus ()=0
 Request keyboard focus. 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 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< CefLabelButtonCreateLabelButton (CefRefPtr< CefButtonDelegate > delegate, const CefString &text)
 Create a new LabelButton. More...
 

Additional Inherited Members

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

Detailed Description

LabelButton is a button with optional text and/or icon.

Methods must be called on the browser process UI thread unless otherwise indicated.

Member Function Documentation

◆ AsMenuButton()

virtual CefRefPtr<CefMenuButton> CefLabelButton::AsMenuButton ( )
pure virtual

Returns this LabelButton as a MenuButton or NULL if this is not a MenuButton.

◆ CreateLabelButton()

static CefRefPtr<CefLabelButton> CefLabelButton::CreateLabelButton ( CefRefPtr< CefButtonDelegate delegate,
const CefString text 
)
static

Create a new LabelButton.

A |delegate| must be provided to handle the button click. |text| will be shown on the LabelButton and used as the default accessible name.

◆ GetImage()

virtual CefRefPtr<CefImage> CefLabelButton::GetImage ( cef_button_state_t  button_state)
pure virtual

Returns the image shown for |button_state|.

If no image exists for that state then the image for CEF_BUTTON_STATE_NORMAL will be returned.

◆ GetText()

virtual CefString CefLabelButton::GetText ( )
pure virtual

Returns the text shown on the LabelButton.

◆ SetEnabledTextColors()

virtual void CefLabelButton::SetEnabledTextColors ( cef_color_t  color)
pure virtual

Sets the text colors shown for the non-disabled states to |color|.

◆ SetFontList()

virtual void CefLabelButton::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"

◆ SetHorizontalAlignment()

virtual void CefLabelButton::SetHorizontalAlignment ( cef_horizontal_alignment_t  alignment)
pure virtual

Sets the horizontal alignment; reversed in RTL.

Default is CEF_HORIZONTAL_ALIGNMENT_CENTER.

◆ SetImage()

virtual void CefLabelButton::SetImage ( cef_button_state_t  button_state,
CefRefPtr< CefImage image 
)
pure virtual

Sets the image shown for |button_state|.

When this Button is drawn if no image exists for the current state then the image for CEF_BUTTON_STATE_NORMAL, if any, will be shown.

◆ SetMaximumSize()

virtual void CefLabelButton::SetMaximumSize ( const CefSize size)
pure virtual

Reset the maximum size of this LabelButton to |size|.

◆ SetMinimumSize()

virtual void CefLabelButton::SetMinimumSize ( const CefSize size)
pure virtual

Reset the minimum size of this LabelButton to |size|.

◆ SetText()

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

Sets the text shown on the LabelButton.

By default |text| will also be used as the accessible name.

◆ SetTextColor()

virtual void CefLabelButton::SetTextColor ( cef_button_state_t  for_state,
cef_color_t  color 
)
pure virtual

Sets the text color shown for the specified button |for_state| to |color|.


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