Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

(default)
Class CefMenuModel

CefBaseRefCounted
   |
   +--CefMenuModel

   in cef_menu_model.h

class CefMenuModel
extends CefBaseRefCounted

Supports creation and modification of menus. See cef_menu_id_t for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The methods of this class can only be accessed on the browser process the UI thread.


Inner Classes, Typedefs, and Enums
typedef CefMenuModel::MenuItemType
          
 
Method Summary
 virtual bool AddCheckItem( int command_id, const CefString& label )= 0
          Add a check item to the menu.
 virtual bool AddItem( int command_id, const CefString& label )= 0
          Add an item to the menu.
 virtual bool AddRadioItem( int command_id, const CefString& label, int group_id )= 0
          Add a radio item to the menu.
 virtual bool AddSeparator()= 0
          Add a separator to the menu.
 virtual CefRefPtr< CefMenuModel > AddSubMenu( int command_id, const CefString& label )= 0
          Add a sub-menu to the menu.
 virtual bool Clear()= 0
          Clears the menu.
 static CefRefPtr< CefMenuModel > CreateMenuModel( CefRefPtr< CefMenuModelDelegate > delegate )
          Create a new MenuModel with the specified |delegate|.
 virtual bool GetAccelerator( int command_id, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed )= 0
          Retrieves the keyboard accelerator for the specified |command_id|.
 virtual bool GetAcceleratorAt( int index, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed )= 0
          Retrieves the keyboard accelerator for the specified |index|.
 virtual bool GetColor( int command_id, cef_menu_color_type_t color_type, cef_color_t& color )= 0
          Returns in |color| the color that was explicitly set for |command_id| and |color_type|.
 virtual bool GetColorAt( int index, cef_menu_color_type_t color_type, cef_color_t& color )= 0
          Returns in |color| the color that was explicitly set for |command_id| and |color_type|.
 virtual int GetCommandIdAt( int index )= 0
          Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.
 virtual int GetCount()= 0
          Returns the number of items in this menu.
 virtual int GetGroupId( int command_id )= 0
          Returns the group id for the specified |command_id| or -1 if invalid.
 virtual int GetGroupIdAt( int index )= 0
          Returns the group id at the specified |index| or -1 if invalid.
 virtual int GetIndexOf( int command_id )= 0
          Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.
 virtual CefString GetLabel( int command_id )= 0
          Returns the label for the specified |command_id| or empty if not found.
 virtual CefString GetLabelAt( int index )= 0
          Returns the label at the specified |index| or empty if not found due to invalid range or the index being a separator.
 virtual CefRefPtr< CefMenuModel > GetSubMenu( int command_id )= 0
          Returns the submenu for the specified |command_id| or empty if invalid.
 virtual CefRefPtr< CefMenuModel > GetSubMenuAt( int index )= 0
          Returns the submenu at the specified |index| or empty if invalid.
 virtual CefMenuModel::MenuItemType GetType( int command_id )= 0
          Returns the item type for the specified |command_id|.
 virtual CefMenuModel::MenuItemType GetTypeAt( int index )= 0
          Returns the item type at the specified |index|.
 virtual bool HasAccelerator( int command_id )= 0
          Returns true if the specified |command_id| has a keyboard accelerator assigned.
 virtual bool HasAcceleratorAt( int index )= 0
          Returns true if the specified |index| has a keyboard accelerator assigned.
 virtual bool InsertCheckItemAt( int index, int command_id, const CefString& label )= 0
          Insert a check item in the menu at the specified |index|.
 virtual bool InsertItemAt( int index, int command_id, const CefString& label )= 0
          Insert an item in the menu at the specified |index|.
 virtual bool InsertRadioItemAt( int index, int command_id, const CefString& label, int group_id )= 0
          Insert a radio item in the menu at the specified |index|.
 virtual bool InsertSeparatorAt( int index )= 0
          Insert a separator in the menu at the specified |index|.
 virtual CefRefPtr< CefMenuModel > InsertSubMenuAt( int index, int command_id, const CefString& label )= 0
          Insert a sub-menu in the menu at the specified |index|.
 virtual bool IsChecked( int command_id )= 0
          Returns true if the specified |command_id| is checked.
 virtual bool IsCheckedAt( int index )= 0
          Returns true if the specified |index| is checked.
 virtual bool IsEnabled( int command_id )= 0
          Returns true if the specified |command_id| is enabled.
 virtual bool IsEnabledAt( int index )= 0
          Returns true if the specified |index| is enabled.
 virtual bool IsSubMenu()= 0
          Returns true if this menu is a submenu.
 virtual bool IsVisible( int command_id )= 0
          Returns true if the specified |command_id| is visible.
 virtual bool IsVisibleAt( int index )= 0
          Returns true if the specified |index| is visible.
 virtual bool Remove( int command_id )= 0
          Removes the item with the specified |command_id|.
 virtual bool RemoveAccelerator( int command_id )= 0
          Remove the keyboard accelerator for the specified |command_id|.
 virtual bool RemoveAcceleratorAt( int index )= 0
          Remove the keyboard accelerator at the specified |index|.
 virtual bool RemoveAt( int index )= 0
          Removes the item at the specified |index|.
 virtual bool SetAccelerator( int command_id, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed )= 0
          Set the keyboard accelerator for the specified |command_id|.
 virtual bool SetAcceleratorAt( int index, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed )= 0
          Set the keyboard accelerator at the specified |index|.
 virtual bool SetChecked( int command_id, bool checked )= 0
          Check the specified |command_id|.
 virtual bool SetCheckedAt( int index, bool checked )= 0
          Check the specified |index|.
 virtual bool SetColor( int command_id, cef_menu_color_type_t color_type, cef_color_t color )= 0
          Set the explicit color for |command_id| and |color_type| to |color|.
 virtual bool SetColorAt( int index, cef_menu_color_type_t color_type, cef_color_t color )= 0
          Set the explicit color for |command_id| and |index| to |color|.
 virtual bool SetCommandIdAt( int index, int command_id )= 0
          Sets the command id at the specified |index|.
 virtual bool SetEnabled( int command_id, bool enabled )= 0
          Change the enabled status of the specified |command_id|.
 virtual bool SetEnabledAt( int index, bool enabled )= 0
          Change the enabled status at the specified |index|.
 virtual bool SetFontList( int command_id, const CefString& font_list )= 0
          Sets the font list for the specified |command_id|.
 virtual bool SetFontListAt( int index, const CefString& font_list )= 0
          Sets the font list for the specified |index|.
 virtual bool SetGroupId( int command_id, int group_id )= 0
          Sets the group id for the specified |command_id|.
 virtual bool SetGroupIdAt( int index, int group_id )= 0
          Sets the group id at the specified |index|.
 virtual bool SetLabel( int command_id, const CefString& label )= 0
          Sets the label for the specified |command_id|.
 virtual bool SetLabelAt( int index, const CefString& label )= 0
          Set the label at the specified |index|.
 virtual bool SetVisible( int command_id, bool visible )= 0
          Change the visibility of the specified |command_id|.
 virtual bool SetVisibleAt( int index, bool visible )= 0
          Change the visibility at the specified |index|.
   
Methods inherited from class CefBaseRefCounted
AddRef, Release, HasOneRef, HasAtLeastOneRef
 

Method Detail

AddCheckItem

public virtual bool AddCheckItem( int command_id, const CefString& label )= 0;
Add a check item to the menu. Returns true on success.

AddItem

public virtual bool AddItem( int command_id, const CefString& label )= 0;
Add an item to the menu. Returns true on success.

AddRadioItem

public virtual bool AddRadioItem( int command_id, const CefString& label, int group_id )= 0;
Add a radio item to the menu. Only a single item with the specified |group_id| can be checked at a time. Returns true on success.

AddSeparator

public virtual bool AddSeparator()= 0;
Add a separator to the menu. Returns true on success.

AddSubMenu

public virtual CefRefPtr< CefMenuModel > AddSubMenu( int command_id, const CefString& label )= 0;
Add a sub-menu to the menu. The new sub-menu is returned.

Clear

public virtual bool Clear()= 0;
Clears the menu. Returns true on success.

CreateMenuModel

public static CefRefPtr< CefMenuModel > CreateMenuModel( CefRefPtr< CefMenuModelDelegate > delegate );
Create a new MenuModel with the specified |delegate|.

GetAccelerator

public virtual bool GetAccelerator( int command_id, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed )= 0;
Retrieves the keyboard accelerator for the specified |command_id|. Returns true on success.

GetAcceleratorAt

public virtual bool GetAcceleratorAt( int index, int& key_code, bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed )= 0;
Retrieves the keyboard accelerator for the specified |index|. Returns true on success.

GetColor

public virtual bool GetColor( int command_id, cef_menu_color_type_t color_type, cef_color_t& color )= 0;
Returns in |color| the color that was explicitly set for |command_id| and |color_type|. If a color was not set then 0 will be returned in |color|. Returns true on success.

GetColorAt

public virtual bool GetColorAt( int index, cef_menu_color_type_t color_type, cef_color_t& color )= 0;
Returns in |color| the color that was explicitly set for |command_id| and |color_type|. Specify an |index| value of -1 to return the default color in |color|. If a color was not set then 0 will be returned in |color|. Returns true on success.

GetCommandIdAt

public virtual int GetCommandIdAt( int index )= 0;
Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.

GetCount

public virtual int GetCount()= 0;
Returns the number of items in this menu.

GetGroupId

public virtual int GetGroupId( int command_id )= 0;
Returns the group id for the specified |command_id| or -1 if invalid.

GetGroupIdAt

public virtual int GetGroupIdAt( int index )= 0;
Returns the group id at the specified |index| or -1 if invalid.

GetIndexOf

public virtual int GetIndexOf( int command_id )= 0;
Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.

GetLabel

public virtual CefString GetLabel( int command_id )= 0;
Returns the label for the specified |command_id| or empty if not found.

GetLabelAt

public virtual CefString GetLabelAt( int index )= 0;
Returns the label at the specified |index| or empty if not found due to invalid range or the index being a separator.

GetSubMenu

public virtual CefRefPtr< CefMenuModel > GetSubMenu( int command_id )= 0;
Returns the submenu for the specified |command_id| or empty if invalid.

GetSubMenuAt

public virtual CefRefPtr< CefMenuModel > GetSubMenuAt( int index )= 0;
Returns the submenu at the specified |index| or empty if invalid.

GetType

public virtual CefMenuModel::MenuItemType GetType( int command_id )= 0;
Returns the item type for the specified |command_id|.

GetTypeAt

public virtual CefMenuModel::MenuItemType GetTypeAt( int index )= 0;
Returns the item type at the specified |index|.

HasAccelerator

public virtual bool HasAccelerator( int command_id )= 0;
Returns true if the specified |command_id| has a keyboard accelerator assigned.

HasAcceleratorAt

public virtual bool HasAcceleratorAt( int index )= 0;
Returns true if the specified |index| has a keyboard accelerator assigned.

InsertCheckItemAt

public virtual bool InsertCheckItemAt( int index, int command_id, const CefString& label )= 0;
Insert a check item in the menu at the specified |index|. Returns true on success.

InsertItemAt

public virtual bool InsertItemAt( int index, int command_id, const CefString& label )= 0;
Insert an item in the menu at the specified |index|. Returns true on success.

InsertRadioItemAt

public virtual bool InsertRadioItemAt( int index, int command_id, const CefString& label, int group_id )= 0;
Insert a radio item in the menu at the specified |index|. Only a single item with the specified |group_id| can be checked at a time. Returns true on success.

InsertSeparatorAt

public virtual bool InsertSeparatorAt( int index )= 0;
Insert a separator in the menu at the specified |index|. Returns true on success.

InsertSubMenuAt

public virtual CefRefPtr< CefMenuModel > InsertSubMenuAt( int index, int command_id, const CefString& label )= 0;
Insert a sub-menu in the menu at the specified |index|. The new sub-menu is returned.

IsChecked

public virtual bool IsChecked( int command_id )= 0;
Returns true if the specified |command_id| is checked. Only applies to check and radio items.

IsCheckedAt

public virtual bool IsCheckedAt( int index )= 0;
Returns true if the specified |index| is checked. Only applies to check and radio items.

IsEnabled

public virtual bool IsEnabled( int command_id )= 0;
Returns true if the specified |command_id| is enabled.

IsEnabledAt

public virtual bool IsEnabledAt( int index )= 0;
Returns true if the specified |index| is enabled.

IsSubMenu

public virtual bool IsSubMenu()= 0;
Returns true if this menu is a submenu.

IsVisible

public virtual bool IsVisible( int command_id )= 0;
Returns true if the specified |command_id| is visible.

IsVisibleAt

public virtual bool IsVisibleAt( int index )= 0;
Returns true if the specified |index| is visible.

Remove

public virtual bool Remove( int command_id )= 0;
Removes the item with the specified |command_id|. Returns true on success.

RemoveAccelerator

public virtual bool RemoveAccelerator( int command_id )= 0;
Remove the keyboard accelerator for the specified |command_id|. Returns true on success.

RemoveAcceleratorAt

public virtual bool RemoveAcceleratorAt( int index )= 0;
Remove the keyboard accelerator at the specified |index|. Returns true on success.

RemoveAt

public virtual bool RemoveAt( int index )= 0;
Removes the item at the specified |index|. Returns true on success.

SetAccelerator

public virtual bool SetAccelerator( int command_id, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed )= 0;
Set the keyboard accelerator for the specified |command_id|. |key_code| can be any virtual key or character value. Returns true on success.

SetAcceleratorAt

public virtual bool SetAcceleratorAt( int index, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed )= 0;
Set the keyboard accelerator at the specified |index|. |key_code| can be any virtual key or character value. Returns true on success.

SetChecked

public virtual bool SetChecked( int command_id, bool checked )= 0;
Check the specified |command_id|. Only applies to check and radio items. Returns true on success.

SetCheckedAt

public virtual bool SetCheckedAt( int index, bool checked )= 0;
Check the specified |index|. Only applies to check and radio items. Returns true on success.

SetColor

public virtual bool SetColor( int command_id, cef_menu_color_type_t color_type, cef_color_t color )= 0;
Set the explicit color for |command_id| and |color_type| to |color|. Specify a |color| value of 0 to remove the explicit color. If no explicit color or default color is set for |color_type| then the system color will be used. Returns true on success.

SetColorAt

public virtual bool SetColorAt( int index, cef_menu_color_type_t color_type, cef_color_t color )= 0;
Set the explicit color for |command_id| and |index| to |color|. Specify a |color| value of 0 to remove the explicit color. Specify an |index| value of -1 to set the default color for items that do not have an explicit color set. If no explicit color or default color is set for |color_type| then the system color will be used. Returns true on success.

SetCommandIdAt

public virtual bool SetCommandIdAt( int index, int command_id )= 0;
Sets the command id at the specified |index|. Returns true on success.

SetEnabled

public virtual bool SetEnabled( int command_id, bool enabled )= 0;
Change the enabled status of the specified |command_id|. Returns true on success.

SetEnabledAt

public virtual bool SetEnabledAt( int index, bool enabled )= 0;
Change the enabled status at the specified |index|. Returns true on success.

SetFontList

public virtual bool SetFontList( int command_id, const CefString& font_list )= 0;
Sets the font list for the specified |command_id|. If |font_list| is empty the system font will be used. Returns true on success. The format is ",[STYLES] ", 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"

SetFontListAt

public virtual bool SetFontListAt( int index, const CefString& font_list )= 0;
Sets the font list for the specified |index|. Specify an |index| value of -1 to set the default font. If |font_list| is empty the system font will be used. Returns true on success. The format is ",[STYLES] ", 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"

SetGroupId

public virtual bool SetGroupId( int command_id, int group_id )= 0;
Sets the group id for the specified |command_id|. Returns true on success.

SetGroupIdAt

public virtual bool SetGroupIdAt( int index, int group_id )= 0;
Sets the group id at the specified |index|. Returns true on success.

SetLabel

public virtual bool SetLabel( int command_id, const CefString& label )= 0;
Sets the label for the specified |command_id|. Returns true on success.

SetLabelAt

public virtual bool SetLabelAt( int index, const CefString& label )= 0;
Set the label at the specified |index|. Returns true on success.

SetVisible

public virtual bool SetVisible( int command_id, bool visible )= 0;
Change the visibility of the specified |command_id|. Returns true on success.

SetVisibleAt

public virtual bool SetVisibleAt( int index, bool visible )= 0;
Change the visibility at the specified |index|. Returns true on success.

 Overview   Project   Class   Tree   Index 
CEF3 C++ API Docs - Version 80.1.4+g8927396+chromium-80.0.3987.149
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt