Chromium Embedded Framework (CEF)  130.1.2+g48f3ef6+chromium-130.0.6723.44
CefView Class Referenceabstract

A View is a rectangle within the views View hierarchy. More...

#include "include/views/cef_view.h"

Inheritance diagram for CefView:
CefBaseRefCounted CefBrowserView CefButton CefPanel CefScrollView CefTextfield CefLabelButton CefWindow CefMenuButton

Public Member Functions

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 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...
 

Additional Inherited Members

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

Detailed Description

A View is a rectangle within the views View hierarchy.

It is the base class for all Views. All size and position values are in density independent pixels (DIP) unless otherwise indicated. Methods must be called on the browser process UI thread unless otherwise indicated.

Member Function Documentation

◆ AsBrowserView()

virtual CefRefPtr<CefBrowserView> CefView::AsBrowserView ( )
pure virtual

Returns this View as a BrowserView or NULL if this is not a BrowserView.

◆ AsButton()

virtual CefRefPtr<CefButton> CefView::AsButton ( )
pure virtual

Returns this View as a Button or NULL if this is not a Button.

◆ AsPanel()

virtual CefRefPtr<CefPanel> CefView::AsPanel ( )
pure virtual

Returns this View as a Panel or NULL if this is not a Panel.

◆ AsScrollView()

virtual CefRefPtr<CefScrollView> CefView::AsScrollView ( )
pure virtual

Returns this View as a ScrollView or NULL if this is not a ScrollView.

◆ AsTextfield()

virtual CefRefPtr<CefTextfield> CefView::AsTextfield ( )
pure virtual

Returns this View as a Textfield or NULL if this is not a Textfield.

◆ ConvertPointFromScreen()

virtual bool CefView::ConvertPointFromScreen ( CefPoint point)
pure virtual

Convert |point| to this View's coordinate system from DIP screen coordinates.

This View must belong to a Window when calling this method. Returns true if the conversion is successful or false otherwise. Use CefDisplay::ConvertPointFromPixels() before calling this method if conversion from display-specific pixel coordinates is necessary.

◆ ConvertPointFromView()

virtual bool CefView::ConvertPointFromView ( CefRefPtr< CefView view,
CefPoint point 
)
pure virtual

Convert |point| to this View's coordinate system from that |view|.

|view| needs to be in the same Window but not necessarily the same view hierarchy. Returns true if the conversion is successful or false otherwise.

◆ ConvertPointFromWindow()

virtual bool CefView::ConvertPointFromWindow ( CefPoint point)
pure virtual

Convert |point| to this View's coordinate system from that of the Window.

This View must belong to a Window when calling this method. Returns true if the conversion is successful or false otherwise.

◆ ConvertPointToScreen()

virtual bool CefView::ConvertPointToScreen ( CefPoint point)
pure virtual

Convert |point| from this View's coordinate system to DIP screen coordinates.

This View must belong to a Window when calling this method. Returns true if the conversion is successful or false otherwise. Use CefDisplay::ConvertPointToPixels() after calling this method if further conversion to display-specific pixel coordinates is desired.

◆ ConvertPointToView()

virtual bool CefView::ConvertPointToView ( CefRefPtr< CefView view,
CefPoint point 
)
pure virtual

Convert |point| from this View's coordinate system to that of |view|.

|view| needs to be in the same Window but not necessarily the same view hierarchy. Returns true if the conversion is successful or false otherwise.

◆ ConvertPointToWindow()

virtual bool CefView::ConvertPointToWindow ( CefPoint point)
pure virtual

Convert |point| from this View's coordinate system to that of the Window.

This View must belong to a Window when calling this method. Returns true if the conversion is successful or false otherwise.

◆ GetBackgroundColor()

virtual cef_color_t CefView::GetBackgroundColor ( )
pure virtual

Returns the background color for this View.

If the background color is unset then the current GetThemeColor(CEF_ColorPrimaryBackground) value will be returned. If this View belongs to an overlay (created with CefWindow::AddOverlayView), and the background color is unset, then a value of transparent (0) will be returned.

◆ GetBounds()

virtual CefRect CefView::GetBounds ( )
pure virtual

Returns the bounds (size and position) of this View in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetBoundsInScreen()

virtual CefRect CefView::GetBoundsInScreen ( )
pure virtual

Returns the bounds (size and position) of this View in DIP screen coordinates.

◆ GetDelegate()

virtual CefRefPtr<CefViewDelegate> CefView::GetDelegate ( )
pure virtual

Returns the delegate associated with this View, if any.

◆ GetGroupID()

virtual int CefView::GetGroupID ( )
pure virtual

Returns the group id of this View, or -1 if not set.

◆ GetHeightForWidth()

virtual int CefView::GetHeightForWidth ( int  width)
pure virtual

Returns the height necessary to display this View with the provided width.

◆ GetID()

virtual int CefView::GetID ( )
pure virtual

Returns the ID for this View.

◆ GetInsets()

virtual CefInsets CefView::GetInsets ( )
pure virtual

Returns the insets for this View in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetMaximumSize()

virtual CefSize CefView::GetMaximumSize ( )
pure virtual

Returns the maximum size for this View.

Size is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetMinimumSize()

virtual CefSize CefView::GetMinimumSize ( )
pure virtual

Returns the minimum size for this View.

Size is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetParentView()

virtual CefRefPtr<CefView> CefView::GetParentView ( )
pure virtual

Returns the View that contains this View, if any.

◆ GetPosition()

virtual CefPoint CefView::GetPosition ( )
pure virtual

Returns the position of this View.

Position is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetPreferredSize()

virtual CefSize CefView::GetPreferredSize ( )
pure virtual

Returns the size this View would like to be if enough space is available.

Size is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetSize()

virtual CefSize CefView::GetSize ( )
pure virtual

Returns the size of this View in parent coordinates, or DIP screen coordinates if there is no parent.

◆ GetThemeColor()

virtual cef_color_t CefView::GetThemeColor ( int  color_id)
pure virtual

Returns the current theme color associated with |color_id|, or the placeholder color (red) if unset.

See cef_color_ids.h for standard ID values. Standard colors can be overridden and custom colors can be added using CefWindow::SetThemeColor.

◆ GetTypeString()

virtual CefString CefView::GetTypeString ( )
pure virtual

Returns the type of this View as a string.

Used primarily for testing purposes.

◆ GetViewForID()

virtual CefRefPtr<CefView> CefView::GetViewForID ( int  id)
pure virtual

Recursively descends the view tree starting at this View, and returns the first child that it encounters with the given ID.

Returns NULL if no matching child view is found.

◆ GetWindow()

virtual CefRefPtr<CefWindow> CefView::GetWindow ( )
pure virtual

Returns the top-level Window hosting this View, if any.

◆ InvalidateLayout()

virtual void CefView::InvalidateLayout ( )
pure virtual

Indicate that this View and all parent Views require a re-layout.

This ensures the next call to Layout() will propagate to this View even if the bounds of parent Views do not change.

◆ IsAccessibilityFocusable()

virtual bool CefView::IsAccessibilityFocusable ( )
pure virtual

Return whether this View is focusable when the user requires full keyboard access, even though it may not be normally focusable.

◆ IsAttached()

virtual bool CefView::IsAttached ( )
pure virtual

Returns true if this View is currently attached to another View.

A View can only be attached to one View at a time.

◆ IsDrawn()

virtual bool CefView::IsDrawn ( )
pure virtual

Returns whether this View is visible and drawn in a Window.

A view is drawn if it and all parent views are visible. If this View is a Window then calling this method is equivalent to calling IsVisible(). Otherwise, to determine if the containing Window is visible to the user on-screen call IsVisible() on the Window.

◆ IsEnabled()

virtual bool CefView::IsEnabled ( )
pure virtual

Returns whether this View is enabled.

◆ IsFocusable()

virtual bool CefView::IsFocusable ( )
pure virtual

Returns true if this View is focusable, enabled and drawn.

◆ IsSame()

virtual bool CefView::IsSame ( CefRefPtr< CefView that)
pure virtual

Returns true if this View is the same as |that| View.

◆ IsValid()

virtual bool CefView::IsValid ( )
pure virtual

Returns true if this View is valid.

◆ IsVisible()

virtual bool CefView::IsVisible ( )
pure virtual

Returns whether this View is visible.

A view may be visible but still not drawn in a Window if any parent views are hidden. If this View is a Window then a return value of true indicates that this Window is currently visible to the user on-screen. If this View is not a Window then call IsDrawn() to determine whether this View and all parent views are visible and will be drawn.

◆ RequestFocus()

virtual void CefView::RequestFocus ( )
pure virtual

Request keyboard focus.

If this View is focusable it will become the focused View.

◆ SetBackgroundColor()

virtual void CefView::SetBackgroundColor ( cef_color_t  color)
pure virtual

Sets the background color for this View.

The background color will be automatically reset when CefViewDelegate::OnThemeChanged is called.

◆ SetBounds()

virtual void CefView::SetBounds ( const CefRect bounds)
pure virtual

Sets the bounds (size and position) of this View.

|bounds| is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ SetEnabled()

virtual void CefView::SetEnabled ( bool  enabled)
pure virtual

Set whether this View is enabled.

A disabled View does not receive keyboard or mouse inputs. If |enabled| differs from the current value the View will be repainted. Also, clears focus if the focused View is disabled.

◆ SetFocusable()

virtual void CefView::SetFocusable ( bool  focusable)
pure virtual

Sets whether this View is capable of taking focus.

It will clear focus if the focused View is set to be non-focusable. This is false by default so that a View used as a container does not get the focus.

◆ SetGroupID()

virtual void CefView::SetGroupID ( int  group_id)
pure virtual

A group id is used to tag Views which are part of the same logical group.

Focus can be moved between views with the same group using the arrow keys. The group id is immutable once it's set.

◆ SetID()

virtual void CefView::SetID ( int  id)
pure virtual

Sets the ID for this View.

ID should be unique within the subtree that you intend to search for it. 0 is the default ID for views.

◆ SetInsets()

virtual void CefView::SetInsets ( const CefInsets insets)
pure virtual

Sets the insets for this View.

|insets| is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ SetPosition()

virtual void CefView::SetPosition ( const CefPoint position)
pure virtual

Sets the position of this View without changing the size.

|position| is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ SetSize()

virtual void CefView::SetSize ( const CefSize size)
pure virtual

Sets the size of this View without changing the position.

|size| in parent coordinates, or DIP screen coordinates if there is no parent.

◆ SetVisible()

virtual void CefView::SetVisible ( bool  visible)
pure virtual

Sets whether this View is visible.

Windows are hidden by default and other views are visible by default. This View and any parent views must be set as visible for this View to be drawn in a Window. If this View is set as hidden then it and any child views will not be drawn and, if any of those views currently have focus, then focus will also be cleared. Painting is scheduled as needed. If this View is a Window then calling this method is equivalent to calling the Window Show() and Hide() methods.

◆ SizeToPreferredSize()

virtual void CefView::SizeToPreferredSize ( )
pure virtual

Size this View to its preferred size.

Size is in parent coordinates, or DIP screen coordinates if there is no parent.

◆ ToString()

virtual CefString CefView::ToString ( bool  include_children)
pure virtual

Returns a string representation of this View which includes the type and various type-specific identifying attributes.

If |include_children| is true any child Views will also be included. Used primarily for testing purposes.


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