# Interface ICefMenuModel

Description
Hierarchy
Methods

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

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

## Description

### Methods

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Public | `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"

Public | `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 1.0.4.