CefMenuModel

interface CefMenuModel

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.

Types

Link copied to clipboard
class MenuId
Link copied to clipboard
Supported menu item types.

Functions

Link copied to clipboard
abstract fun addCheckItem(command_id: Int, label: String): Boolean
Add a check item to the menu.
Link copied to clipboard
abstract fun addItem(command_id: Int, label: String): Boolean
Add an item to the menu.
Link copied to clipboard
abstract fun addRadioItem(command_id: Int, label: String, group_id: Int): Boolean
Add a radio item to the menu.
Link copied to clipboard
abstract fun addSeparator(): Boolean
Add a separator to the menu.
Link copied to clipboard
abstract fun addSubMenu(command_id: Int, label: String): CefMenuModel
Add a sub-menu to the menu.
Link copied to clipboard
abstract fun clear(): Boolean
Clears the menu.
Link copied to clipboard
abstract fun getAccelerator(command_id: Int, key_code: IntRef, shift_pressed: BoolRef, ctrl_pressed: BoolRef, alt_pressed: BoolRef): Boolean
Retrieves the keyboard accelerator for the specified |command_id|.
Link copied to clipboard
abstract fun getAcceleratorAt(index: Int, key_code: IntRef, shift_pressed: BoolRef, ctrl_pressed: BoolRef, alt_pressed: BoolRef): Boolean
Retrieves the keyboard accelerator for the specified |index|.
Link copied to clipboard
abstract fun getCommandIdAt(index: Int): Int
Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.
Link copied to clipboard
abstract fun getCount(): Int
Returns the number of items in this menu.
Link copied to clipboard
abstract fun getGroupId(command_id: Int): Int
Returns the group id for the specified |command_id| or -1 if invalid.
Link copied to clipboard
abstract fun getGroupIdAt(index: Int): Int
Returns the group id at the specified |index| or -1 if invalid.
Link copied to clipboard
abstract fun getIndexOf(command_id: Int): Int
Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.
Link copied to clipboard
abstract fun getLabel(command_id: Int): String
Returns the label for the specified |command_id| or empty if not found.
Link copied to clipboard
abstract fun getLabelAt(index: Int): String
Returns the label at the specified |index| or empty if not found due to invalid range or the index being a separator.
Link copied to clipboard
abstract fun getSubMenu(command_id: Int): CefMenuModel
Returns the submenu for the specified |command_id| or empty if invalid.
Link copied to clipboard
abstract fun getSubMenuAt(index: Int): CefMenuModel
Returns the submenu at the specified |index| or empty if invalid.
Link copied to clipboard
abstract fun getType(command_id: Int): CefMenuModel.MenuItemType
Returns the item type for the specified |command_id|.
Link copied to clipboard
Returns the item type at the specified |index|.
Link copied to clipboard
abstract fun hasAccelerator(command_id: Int): Boolean
Returns true if the specified |command_id| has a keyboard accelerator assigned.
Link copied to clipboard
abstract fun hasAcceleratorAt(index: Int): Boolean
Returns true if the specified |index| has a keyboard accelerator assigned.
Link copied to clipboard
abstract fun insertCheckItemAt(index: Int, command_id: Int, label: String): Boolean
Insert a check item in the menu at the specified |index|.
Link copied to clipboard
abstract fun insertItemAt(index: Int, command_id: Int, label: String): Boolean
Insert an item in the menu at the specified |index|.
Link copied to clipboard
abstract fun insertRadioItemAt(index: Int, command_id: Int, label: String, group_id: Int): Boolean
Insert a radio item in the menu at the specified |index|.
Link copied to clipboard
abstract fun insertSeparatorAt(index: Int): Boolean
Insert a separator in the menu at the specified |index|.
Link copied to clipboard
abstract fun insertSubMenuAt(index: Int, command_id: Int, label: String): CefMenuModel
Insert a sub-menu in the menu at the specified |index|.
Link copied to clipboard
abstract fun isChecked(command_id: Int): Boolean
Returns true if the specified |command_id| is checked.
Link copied to clipboard
abstract fun isCheckedAt(index: Int): Boolean
Returns true if the specified |index| is checked.
Link copied to clipboard
abstract fun isEnabled(command_id: Int): Boolean
Returns true if the specified |command_id| is enabled.
Link copied to clipboard
abstract fun isEnabledAt(index: Int): Boolean
Returns true if the specified |index| is enabled.
Link copied to clipboard
abstract fun isVisible(command_id: Int): Boolean
Returns true if the specified |command_id| is visible.
Link copied to clipboard
abstract fun isVisibleAt(index: Int): Boolean
Returns true if the specified |index| is visible.
Link copied to clipboard
abstract fun remove(command_id: Int): Boolean
Removes the item with the specified |command_id|.
Link copied to clipboard
abstract fun removeAccelerator(command_id: Int): Boolean
Remove the keyboard accelerator for the specified |command_id|.
Link copied to clipboard
abstract fun removeAcceleratorAt(index: Int): Boolean
Remove the keyboard accelerator at the specified |index|.
Link copied to clipboard
abstract fun removeAt(index: Int): Boolean
Removes the item at the specified |index|.
Link copied to clipboard
abstract fun setAccelerator(command_id: Int, key_code: Int, shift_pressed: Boolean, ctrl_pressed: Boolean, alt_pressed: Boolean): Boolean
Set the keyboard accelerator for the specified |command_id|.
Link copied to clipboard
abstract fun setAcceleratorAt(index: Int, key_code: Int, shift_pressed: Boolean, ctrl_pressed: Boolean, alt_pressed: Boolean): Boolean
Set the keyboard accelerator at the specified |index|.
Link copied to clipboard
abstract fun setChecked(command_id: Int, checked: Boolean): Boolean
Check the specified |command_id|.
Link copied to clipboard
abstract fun setCheckedAt(index: Int, checked: Boolean): Boolean
Check the specified |index|.
Link copied to clipboard
abstract fun setCommandIdAt(index: Int, command_id: Int): Boolean
Sets the command id at the specified |index|.
Link copied to clipboard
abstract fun setEnabled(command_id: Int, enabled: Boolean): Boolean
Change the enabled status of the specified |command_id|.
Link copied to clipboard
abstract fun setEnabledAt(index: Int, enabled: Boolean): Boolean
Change the enabled status at the specified |index|.
Link copied to clipboard
abstract fun setGroupId(command_id: Int, group_id: Int): Boolean
Sets the group id for the specified |command_id|.
Link copied to clipboard
abstract fun setGroupIdAt(index: Int, group_id: Int): Boolean
Sets the group id at the specified |index|.
Link copied to clipboard
abstract fun setLabel(command_id: Int, label: String): Boolean
Sets the label for the specified |command_id|.
Link copied to clipboard
abstract fun setLabelAt(index: Int, label: String): Boolean
Set the label at the specified |index|.
Link copied to clipboard
abstract fun setVisible(command_id: Int, visible: Boolean): Boolean
Change the visibility of the specified |command_id|.
Link copied to clipboard
abstract fun setVisibleAt(index: Int, visible: Boolean): Boolean
Change the visibility at the specified |index|.