Chromium Embedded Framework (CEF)
114.2.1+gd70a0a8+chromium-114.0.5735.45
|
Supports creation and modification of menus. More...
#include "include/cef_menu_model.h"
Public Types | |
typedef cef_menu_item_type_t | MenuItemType |
Public Member Functions | |
virtual bool | IsSubMenu ()=0 |
Returns true if this menu is a submenu. More... | |
virtual bool | Clear ()=0 |
Clears the menu. More... | |
virtual size_t | GetCount ()=0 |
Returns the number of items in this menu. More... | |
virtual bool | AddSeparator ()=0 |
Add a separator to the menu. More... | |
virtual bool | AddItem (int command_id, const CefString &label)=0 |
Add an item to the menu. More... | |
virtual bool | AddCheckItem (int command_id, const CefString &label)=0 |
Add a check item to the menu. More... | |
virtual bool | AddRadioItem (int command_id, const CefString &label, int group_id)=0 |
Add a radio item to the menu. More... | |
virtual CefRefPtr< CefMenuModel > | AddSubMenu (int command_id, const CefString &label)=0 |
Add a sub-menu to the menu. More... | |
virtual bool | InsertSeparatorAt (size_t index)=0 |
Insert a separator in the menu at the specified |index|. More... | |
virtual bool | InsertItemAt (size_t index, int command_id, const CefString &label)=0 |
Insert an item in the menu at the specified |index|. More... | |
virtual bool | InsertCheckItemAt (size_t index, int command_id, const CefString &label)=0 |
Insert a check item in the menu at the specified |index|. More... | |
virtual bool | InsertRadioItemAt (size_t index, int command_id, const CefString &label, int group_id)=0 |
Insert a radio item in the menu at the specified |index|. More... | |
virtual CefRefPtr< CefMenuModel > | InsertSubMenuAt (size_t index, int command_id, const CefString &label)=0 |
Insert a sub-menu in the menu at the specified |index|. More... | |
virtual bool | Remove (int command_id)=0 |
Removes the item with the specified |command_id|. More... | |
virtual bool | RemoveAt (size_t index)=0 |
Removes the item at the specified |index|. More... | |
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. More... | |
virtual int | GetCommandIdAt (size_t 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. More... | |
virtual bool | SetCommandIdAt (size_t index, int command_id)=0 |
Sets the command id at the specified |index|. More... | |
virtual CefString | GetLabel (int command_id)=0 |
Returns the label for the specified |command_id| or empty if not found. More... | |
virtual CefString | GetLabelAt (size_t index)=0 |
Returns the label at the specified |index| or empty if not found due to invalid range or the index being a separator. More... | |
virtual bool | SetLabel (int command_id, const CefString &label)=0 |
Sets the label for the specified |command_id|. More... | |
virtual bool | SetLabelAt (size_t index, const CefString &label)=0 |
Set the label at the specified |index|. More... | |
virtual MenuItemType | GetType (int command_id)=0 |
Returns the item type for the specified |command_id|. More... | |
virtual MenuItemType | GetTypeAt (size_t index)=0 |
Returns the item type at the specified |index|. More... | |
virtual int | GetGroupId (int command_id)=0 |
Returns the group id for the specified |command_id| or -1 if invalid. More... | |
virtual int | GetGroupIdAt (size_t index)=0 |
Returns the group id at the specified |index| or -1 if invalid. More... | |
virtual bool | SetGroupId (int command_id, int group_id)=0 |
Sets the group id for the specified |command_id|. More... | |
virtual bool | SetGroupIdAt (size_t index, int group_id)=0 |
Sets the group id at the specified |index|. More... | |
virtual CefRefPtr< CefMenuModel > | GetSubMenu (int command_id)=0 |
Returns the submenu for the specified |command_id| or empty if invalid. More... | |
virtual CefRefPtr< CefMenuModel > | GetSubMenuAt (size_t index)=0 |
Returns the submenu at the specified |index| or empty if invalid. More... | |
virtual bool | IsVisible (int command_id)=0 |
Returns true if the specified |command_id| is visible. More... | |
virtual bool | IsVisibleAt (size_t index)=0 |
Returns true if the specified |index| is visible. More... | |
virtual bool | SetVisible (int command_id, bool visible)=0 |
Change the visibility of the specified |command_id|. More... | |
virtual bool | SetVisibleAt (size_t index, bool visible)=0 |
Change the visibility at the specified |index|. More... | |
virtual bool | IsEnabled (int command_id)=0 |
Returns true if the specified |command_id| is enabled. More... | |
virtual bool | IsEnabledAt (size_t index)=0 |
Returns true if the specified |index| is enabled. More... | |
virtual bool | SetEnabled (int command_id, bool enabled)=0 |
Change the enabled status of the specified |command_id|. More... | |
virtual bool | SetEnabledAt (size_t index, bool enabled)=0 |
Change the enabled status at the specified |index|. More... | |
virtual bool | IsChecked (int command_id)=0 |
Returns true if the specified |command_id| is checked. More... | |
virtual bool | IsCheckedAt (size_t index)=0 |
Returns true if the specified |index| is checked. More... | |
virtual bool | SetChecked (int command_id, bool checked)=0 |
Check the specified |command_id|. More... | |
virtual bool | SetCheckedAt (size_t index, bool checked)=0 |
Check the specified |index|. More... | |
virtual bool | HasAccelerator (int command_id)=0 |
Returns true if the specified |command_id| has a keyboard accelerator assigned. More... | |
virtual bool | HasAcceleratorAt (size_t index)=0 |
Returns true if the specified |index| has a keyboard accelerator assigned. More... | |
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|. More... | |
virtual bool | SetAcceleratorAt (size_t index, int key_code, bool shift_pressed, bool ctrl_pressed, bool alt_pressed)=0 |
Set the keyboard accelerator at the specified |index|. More... | |
virtual bool | RemoveAccelerator (int command_id)=0 |
Remove the keyboard accelerator for the specified |command_id|. More... | |
virtual bool | RemoveAcceleratorAt (size_t index)=0 |
Remove the keyboard accelerator at the specified |index|. More... | |
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|. More... | |
virtual bool | GetAcceleratorAt (size_t index, int &key_code, bool &shift_pressed, bool &ctrl_pressed, bool &alt_pressed)=0 |
Retrieves the keyboard accelerator for the specified |index|. More... | |
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|. More... | |
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|. More... | |
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|. More... | |
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|. More... | |
virtual bool | SetFontList (int command_id, const CefString &font_list)=0 |
Sets the font list for the specified |command_id|. More... | |
virtual bool | SetFontListAt (int index, const CefString &font_list)=0 |
Sets the font list for the specified |index|. 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< CefMenuModel > | CreateMenuModel (CefRefPtr< CefMenuModelDelegate > delegate) |
Create a new MenuModel with the specified |delegate|. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from CefBaseRefCounted | |
virtual | ~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.
|
pure virtual |
Add a check item to the menu.
Returns true on success.
|
pure virtual |
Add an item to the menu.
Returns true on success.
|
pure virtual |
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.
|
pure virtual |
Add a separator to the menu.
Returns true on success.
|
pure virtual |
Add a sub-menu to the menu.
The new sub-menu is returned.
|
pure virtual |
Clears the menu.
Returns true on success.
|
static |
Create a new MenuModel with the specified |delegate|.
|
pure virtual |
Retrieves the keyboard accelerator for the specified |command_id|.
Returns true on success.
|
pure virtual |
Retrieves the keyboard accelerator for the specified |index|.
Returns true on success.
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.
|
pure virtual |
Returns the number of items in this menu.
|
pure virtual |
Returns the group id for the specified |command_id| or -1 if invalid.
|
pure virtual |
Returns the group id at the specified |index| or -1 if invalid.
|
pure virtual |
Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.
|
pure virtual |
Returns the label for the specified |command_id| or empty if not found.
|
pure virtual |
Returns the label at the specified |index| or empty if not found due to invalid range or the index being a separator.
|
pure virtual |
Returns the submenu for the specified |command_id| or empty if invalid.
|
pure virtual |
Returns the submenu at the specified |index| or empty if invalid.
|
pure virtual |
Returns the item type for the specified |command_id|.
|
pure virtual |
Returns the item type at the specified |index|.
|
pure virtual |
Returns true if the specified |command_id| has a keyboard accelerator assigned.
|
pure virtual |
Returns true if the specified |index| has a keyboard accelerator assigned.
|
pure virtual |
Insert a check item in the menu at the specified |index|.
Returns true on success.
|
pure virtual |
Insert an item in the menu at the specified |index|.
Returns true on success.
|
pure virtual |
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.
|
pure virtual |
Insert a separator in the menu at the specified |index|.
Returns true on success.
|
pure virtual |
Insert a sub-menu in the menu at the specified |index|.
The new sub-menu is returned.
|
pure virtual |
Returns true if the specified |command_id| is checked.
Only applies to check and radio items.
|
pure virtual |
Returns true if the specified |index| is checked.
Only applies to check and radio items.
|
pure virtual |
Returns true if the specified |command_id| is enabled.
|
pure virtual |
Returns true if the specified |index| is enabled.
|
pure virtual |
Returns true if this menu is a submenu.
|
pure virtual |
Returns true if the specified |command_id| is visible.
|
pure virtual |
Returns true if the specified |index| is visible.
|
pure virtual |
Removes the item with the specified |command_id|.
Returns true on success.
|
pure virtual |
Remove the keyboard accelerator for the specified |command_id|.
Returns true on success.
|
pure virtual |
Remove the keyboard accelerator at the specified |index|.
Returns true on success.
|
pure virtual |
Removes the item at the specified |index|.
Returns true on success.
|
pure virtual |
Set the keyboard accelerator for the specified |command_id|.
|key_code| can be any virtual key or character value. Returns true on success.
|
pure virtual |
Set the keyboard accelerator at the specified |index|.
|key_code| can be any virtual key or character value. Returns true on success.
|
pure virtual |
Check the specified |command_id|.
Only applies to check and radio items. Returns true on success.
|
pure virtual |
Check the specified |index|.
Only applies to check and radio items. Returns true on success.
|
pure virtual |
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.
|
pure virtual |
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.
|
pure virtual |
Sets the command id at the specified |index|.
Returns true on success.
|
pure virtual |
Change the enabled status of the specified |command_id|.
Returns true on success.
|
pure virtual |
Change the enabled status at the specified |index|.
Returns true on success.
|
pure virtual |
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 "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
Here are examples of valid font description strings:
|
pure virtual |
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 "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
Here are examples of valid font description strings:
|
pure virtual |
Sets the group id for the specified |command_id|.
Returns true on success.
|
pure virtual |
Sets the group id at the specified |index|.
Returns true on success.
|
pure virtual |
Sets the label for the specified |command_id|.
Returns true on success.
|
pure virtual |
Set the label at the specified |index|.
Returns true on success.
|
pure virtual |
Change the visibility of the specified |command_id|.
Returns true on success.
|
pure virtual |
Change the visibility at the specified |index|.
Returns true on success.