# Interface ICefMenuModel

Description
Hierarchy
Fields
Methods
Properties

## Unit

uCEFInterfaces

## Declaration

`type ICefMenuModel = interface(ICefBaseRefCounted)`

## Description

Supports creation and modification of menus. See TCefMenuId 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 functions of this interface can only be accessed on the browser process the UI thread.

UNKNOWN

<see href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_menu_model_capi.h">CEF source file: /include/capi/cef_menu_model_capi.h (cef_menu_model_t))

## Hierarchy

- IInterface
- ICefBaseRefCounted
- ICefMenuModel

## Overview

### Methods

| `function IsSubMenu: Boolean;`
| `function Clear: Boolean;`
| `function GetCount: NativeUInt;`
| `function AddSeparator: Boolean;`
| `function AddItem(commandId: Integer; const text: ustring): Boolean;`
| `function AddCheckItem(commandId: Integer; const text: ustring): Boolean;`
| `function AddRadioItem(commandId: Integer; const text: ustring; groupId: Integer): Boolean;`
| `function AddSubMenu(commandId: Integer; const text: ustring): ICefMenuModel;`
| `function InsertSeparatorAt(index: NativeUInt): Boolean;`
| `function InsertItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean;`
| `function InsertCheckItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean;`
| `function InsertRadioItemAt(index: NativeUInt; commandId: Integer; const text: ustring; groupId: Integer): Boolean;`
| `function InsertSubMenuAt(index: NativeUInt; commandId: Integer; const text: ustring): ICefMenuModel;`
| `function Remove(commandId: Integer): Boolean;`
| `function RemoveAt(index: NativeUInt): Boolean;`
| `function GetIndexOf(commandId: Integer): Integer;`
| `function GetCommandIdAt(index: NativeUInt): Integer;`
| `function SetCommandIdAt(index: NativeUInt; commandId: Integer): Boolean;`
| `function GetLabel(commandId: Integer): ustring;`
| `function GetLabelAt(index: NativeUInt): ustring;`
| `function SetLabel(commandId: Integer; const text: ustring): Boolean;`
| `function SetLabelAt(index: NativeUInt; const text: ustring): Boolean;`
| `function GetType(commandId: Integer): TCefMenuItemType;`
| `function GetTypeAt(index: NativeUInt): TCefMenuItemType;`
| `function GetGroupId(commandId: Integer): Integer;`
| `function GetGroupIdAt(index: NativeUInt): Integer;`
| `function SetGroupId(commandId, groupId: Integer): Boolean;`
| `function SetGroupIdAt(index: NativeUInt; groupId: Integer): Boolean;`
| `function GetSubMenu(commandId: Integer): ICefMenuModel;`
| `function GetSubMenuAt(index: NativeUInt): ICefMenuModel;`
| `function IsVisible(commandId: Integer): Boolean;`
| `function isVisibleAt(index: NativeUInt): Boolean;`
| `function SetVisible(commandId: Integer; visible: Boolean): Boolean;`
| `function SetVisibleAt(index: NativeUInt; visible: Boolean): Boolean;`
| `function IsEnabled(commandId: Integer): Boolean;`
| `function IsEnabledAt(index: NativeUInt): Boolean;`
| `function SetEnabled(commandId: Integer; enabled: Boolean): Boolean;`
| `function SetEnabledAt(index: NativeUInt; enabled: Boolean): Boolean;`
| `function IsChecked(commandId: Integer): Boolean;`
| `function IsCheckedAt(index: NativeUInt): Boolean;`
| `function setChecked(commandId: Integer; checked: Boolean): Boolean;`
| `function setCheckedAt(index: NativeUInt; checked: Boolean): Boolean;`
| `function HasAccelerator(commandId: Integer): Boolean;`
| `function HasAcceleratorAt(index: NativeUInt): Boolean;`
| `function SetAccelerator(commandId, keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
| `function SetAcceleratorAt(index: NativeUInt; keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
| `function RemoveAccelerator(commandId: Integer): Boolean;`
| `function RemoveAcceleratorAt(index: NativeUInt): Boolean;`
| `function GetAccelerator(commandId: Integer; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
| `function GetAcceleratorAt(index: NativeUInt; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
| `function SetColor(commandId: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean;`
| `function SetColorAt(index: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean;`
| `function GetColor(commandId: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean;`
| `function GetColorAt(index: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean;`
| `function SetFontList(commandId: Integer; const fontList: ustring): Boolean;`
| `function SetFontListAt(index: Integer; const fontList: ustring): Boolean;`

## Description

### Methods

| `function IsSubMenu: Boolean;`
Returns true (1) if this menu is a submenu. ###### Attributes GUID['{40AF19D3-8B4E-44B8-8F89-DEB5907FC495}']

| `function Clear: Boolean;`
Clears the menu. Returns true (1) on success.

| `function GetCount: NativeUInt;`
Returns the number of items in this menu.

| `function AddSeparator: Boolean;`
Add a separator to the menu. Returns true (1) on success.

| `function AddItem(commandId: Integer; const text: ustring): Boolean;`
Add an item to the menu. Returns true (1) on success.

| `function AddCheckItem(commandId: Integer; const text: ustring): Boolean;`
Add a check item to the menu. Returns true (1) on success.

| `function AddRadioItem(commandId: Integer; const text: ustring; groupId: Integer): Boolean;`
Add a radio item to the menu. Only a single item with the specified |group_id| can be checked at a time. Returns true (1) on success.

| `function AddSubMenu(commandId: Integer; const text: ustring): ICefMenuModel;`
Add a sub-menu to the menu. The new sub-menu is returned.

| `function InsertSeparatorAt(index: NativeUInt): Boolean;`
Insert a separator in the menu at the specified |index|. Returns true (1) on success.

| `function InsertItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean;`
Insert an item in the menu at the specified |index|. Returns true (1) on success.

| `function InsertCheckItemAt(index: NativeUInt; commandId: Integer; const text: ustring): Boolean;`
Insert a check item in the menu at the specified |index|. Returns true (1) on success.

| `function InsertRadioItemAt(index: NativeUInt; commandId: Integer; const text: ustring; groupId: Integer): Boolean;`
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 (1) on success.

| `function InsertSubMenuAt(index: NativeUInt; commandId: Integer; const text: ustring): ICefMenuModel;`
Insert a sub-menu in the menu at the specified |index|. The new sub-menu is returned.

| `function Remove(commandId: Integer): Boolean;`
Removes the item with the specified |command_id|. Returns true (1) on success.

| `function RemoveAt(index: NativeUInt): Boolean;`
Removes the item at the specified |index|. Returns true (1) on success.

| `function GetIndexOf(commandId: Integer): Integer;`
Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.

| `function GetCommandIdAt(index: NativeUInt): Integer;`
Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.

| `function SetCommandIdAt(index: NativeUInt; commandId: Integer): Boolean;`
Sets the command id at the specified |index|. Returns true (1) on success.

| `function GetLabel(commandId: Integer): ustring;`
Returns the label for the specified |command_id| or NULL if not found.

| `function GetLabelAt(index: NativeUInt): ustring;`
Returns the label at the specified |index| or NULL if not found due to invalid range or the index being a separator.

| `function SetLabel(commandId: Integer; const text: ustring): Boolean;`
Sets the label for the specified |command_id|. Returns true (1) on success.

| `function SetLabelAt(index: NativeUInt; const text: ustring): Boolean;`
Set the label at the specified |index|. Returns true (1) on success.

| `function GetType(commandId: Integer): TCefMenuItemType;`
Returns the item type for the specified |command_id|.

| `function GetTypeAt(index: NativeUInt): TCefMenuItemType;`
Returns the item type at the specified |index|.

| `function GetGroupId(commandId: Integer): Integer;`
Returns the group id for the specified |command_id| or -1 if invalid.

| `function GetGroupIdAt(index: NativeUInt): Integer;`
Returns the group id at the specified |index| or -1 if invalid.

| `function SetGroupId(commandId, groupId: Integer): Boolean;`
Sets the group id for the specified |command_id|. Returns true (1) on success.

| `function SetGroupIdAt(index: NativeUInt; groupId: Integer): Boolean;`
Sets the group id at the specified |index|. Returns true (1) on success.

| `function GetSubMenu(commandId: Integer): ICefMenuModel;`
Returns the submenu for the specified |command_id| or NULL if invalid.

| `function GetSubMenuAt(index: NativeUInt): ICefMenuModel;`
Returns the submenu at the specified |index| or NULL if invalid.

| `function IsVisible(commandId: Integer): Boolean;`
Returns true (1) if the specified |command_id| is visible.

| `function isVisibleAt(index: NativeUInt): Boolean;`
Returns true (1) if the specified |index| is visible.

| `function SetVisible(commandId: Integer; visible: Boolean): Boolean;`
Change the visibility of the specified |command_id|. Returns true (1) on success.

| `function SetVisibleAt(index: NativeUInt; visible: Boolean): Boolean;`
Change the visibility at the specified |index|. Returns true (1) on success.

| `function IsEnabled(commandId: Integer): Boolean;`
Returns true (1) if the specified |command_id| is enabled.

| `function IsEnabledAt(index: NativeUInt): Boolean;`
Returns true (1) if the specified |index| is enabled.

| `function SetEnabled(commandId: Integer; enabled: Boolean): Boolean;`
Change the enabled status of the specified |command_id|. Returns true (1) on success.

| `function SetEnabledAt(index: NativeUInt; enabled: Boolean): Boolean;`
Change the enabled status at the specified |index|. Returns true (1) on success.

| `function IsChecked(commandId: Integer): Boolean;`
Returns true (1) if the specified |command_id| is checked. Only applies to check and radio items.

| `function IsCheckedAt(index: NativeUInt): Boolean;`
Returns true (1) if the specified |index| is checked. Only applies to check and radio items.

| `function setChecked(commandId: Integer; checked: Boolean): Boolean;`
Check the specified |command_id|. Only applies to check and radio items. Returns true (1) on success.

| `function setCheckedAt(index: NativeUInt; checked: Boolean): Boolean;`
Check the specified |index|. Only applies to check and radio items. Returns true (1) on success.

| `function HasAccelerator(commandId: Integer): Boolean;`
Returns true (1) if the specified |command_id| has a keyboard accelerator assigned.

| `function HasAcceleratorAt(index: NativeUInt): Boolean;`
Returns true (1) if the specified |index| has a keyboard accelerator assigned.

| `function SetAccelerator(commandId, keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
Set the keyboard accelerator for the specified |command_id|. |key_code| can be any virtual key or character value. Returns true (1) on success.

| `function SetAcceleratorAt(index: NativeUInt; keyCode: Integer; shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
Set the keyboard accelerator at the specified |index|. |key_code| can be any virtual key or character value. Returns true (1) on success.

| `function RemoveAccelerator(commandId: Integer): Boolean;`
Remove the keyboard accelerator for the specified |command_id|. Returns true (1) on success.

| `function RemoveAcceleratorAt(index: NativeUInt): Boolean;`
Remove the keyboard accelerator at the specified |index|. Returns true (1) on success.

| `function GetAccelerator(commandId: Integer; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
Retrieves the keyboard accelerator for the specified |command_id|. Returns true (1) on success.

| `function GetAcceleratorAt(index: NativeUInt; out keyCode: Integer; out shiftPressed, ctrlPressed, altPressed: Boolean): Boolean;`
Retrieves the keyboard accelerator for the specified |index|. Returns true (1) on success.

| `function SetColor(commandId: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean;`
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 (1) on success.

| `function SetColorAt(index: Integer; colorType: TCefMenuColorType; color: TCefColor): Boolean;`
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 (1) on success.

| `function GetColor(commandId: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean;`
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 (1) on success.

| `function GetColorAt(index: Integer; colorType: TCefMenuColorType; out color: TCefColor): Boolean;`
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 (1) on success.

| `function SetFontList(commandId: Integer; const fontList: ustring): Boolean;`
Sets the font list for the specified |command_id|. If |font_list| is NULL the system font will be used. Returns true (1) on success. 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"

| `function SetFontListAt(index: Integer; const fontList: ustring): Boolean;`
Sets the font list for the specified |index|. Specify an |index| value of -1 to set the default font. If |font_list| is NULL the system font will be used. Returns true (1) on success. 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"

Generated by PasDoc 0.16.0-snapshot.