The OpenD Programming Language

cef_menu_model_t

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 functions of this structure can only be accessed on the browser process the UI thread.

version(cef && embedded_cef_bindings)
extern (C)
struct cef_menu_model_t {
extern (System)
int function(cef_menu_model_t* self) nothrow is_sub_menu;
extern (System)
int function(cef_menu_model_t* self) nothrow clear;
extern (System)
size_t function(cef_menu_model_t* self) nothrow get_count;
}

Members

Variables

add_check_item
int function(cef_menu_model_t* self, int command_id, const(cef_string_t)* label) nothrow add_check_item;

Add a check item to the menu. Returns true (1) on success.

add_item
int function(cef_menu_model_t* self, int command_id, const(cef_string_t)* label) nothrow add_item;

Add an item to the menu. Returns true (1) on success.

add_radio_item
int function(cef_menu_model_t* self, int command_id, const(cef_string_t)* label, int group_id) nothrow add_radio_item;

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.

add_separator
int function(cef_menu_model_t* self) nothrow add_separator;
add_sub_menu
cef_menu_model_t* function(cef_menu_model_t* self, int command_id, const(cef_string_t)* label) nothrow add_sub_menu;

Add a sub-menu to the menu. The new sub-menu is returned.

base
cef_base_ref_counted_t base;

Base structure.

get_accelerator
int function(cef_menu_model_t* self, int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, int* alt_pressed) nothrow get_accelerator;

Retrieves the keyboard accelerator for the specified |command_id|. Returns true (1) on success.

get_accelerator_at
int function(cef_menu_model_t* self, size_t index, int* key_code, int* shift_pressed, int* ctrl_pressed, int* alt_pressed) nothrow get_accelerator_at;

Retrieves the keyboard accelerator for the specified |index|. Returns true (1) on success.

get_color
int function(cef_menu_model_t* self, int command_id, cef_menu_color_type_t color_type, cef_color_t* color) nothrow get_color;

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.

get_color_at
int function(cef_menu_model_t* self, int index, cef_menu_color_type_t color_type, cef_color_t* color) nothrow get_color_at;

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.

get_command_id_at
int function(cef_menu_model_t* self, size_t index) nothrow get_command_id_at;

Returns the command id at the specified |index| or -1 if not found due to invalid range or the index being a separator.

get_group_id
int function(cef_menu_model_t* self, int command_id) nothrow get_group_id;

Returns the group id for the specified |command_id| or -1 if invalid.

get_group_id_at
int function(cef_menu_model_t* self, size_t index) nothrow get_group_id_at;

Returns the group id at the specified |index| or -1 if invalid.

get_index_of
int function(cef_menu_model_t* self, int command_id) nothrow get_index_of;

Returns the index associated with the specified |command_id| or -1 if not found due to the command id not existing in the menu.

get_label
cef_string_userfree_t function(cef_menu_model_t* self, int command_id) nothrow get_label;

Returns the label for the specified |command_id| or NULL if not found.

get_label_at
cef_string_userfree_t function(cef_menu_model_t* self, size_t index) nothrow get_label_at;

Returns the label at the specified |index| or NULL if not found due to invalid range or the index being a separator.

get_sub_menu
cef_menu_model_t* function(cef_menu_model_t* self, int command_id) nothrow get_sub_menu;

Returns the submenu for the specified |command_id| or NULL if invalid.

get_sub_menu_at
cef_menu_model_t* function(cef_menu_model_t* self, size_t index) nothrow get_sub_menu_at;

Returns the submenu at the specified |index| or NULL if invalid.

get_type
cef_menu_item_type_t function(cef_menu_model_t* self, int command_id) nothrow get_type;

Returns the item type for the specified |command_id|.

get_type_at
cef_menu_item_type_t function(cef_menu_model_t* self, size_t index) nothrow get_type_at;

Returns the item type at the specified |index|.

has_accelerator
int function(cef_menu_model_t* self, int command_id) nothrow has_accelerator;

Returns true (1) if the specified |command_id| has a keyboard accelerator assigned.

has_accelerator_at
int function(cef_menu_model_t* self, size_t index) nothrow has_accelerator_at;

Returns true (1) if the specified |index| has a keyboard accelerator assigned.

insert_check_item_at
int function(cef_menu_model_t* self, size_t index, int command_id, const(cef_string_t)* label) nothrow insert_check_item_at;

Insert a check item in the menu at the specified |index|. Returns true (1) on success.

insert_item_at
int function(cef_menu_model_t* self, size_t index, int command_id, const(cef_string_t)* label) nothrow insert_item_at;

Insert an item in the menu at the specified |index|. Returns true (1) on success.

insert_radio_item_at
int function(cef_menu_model_t* self, size_t index, int command_id, const(cef_string_t)* label, int group_id) nothrow insert_radio_item_at;

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.

insert_separator_at
int function(cef_menu_model_t* self, size_t index) nothrow insert_separator_at;

Insert a separator in the menu at the specified |index|. Returns true (1) on success.

insert_sub_menu_at
cef_menu_model_t* function(cef_menu_model_t* self, size_t index, int command_id, const(cef_string_t)* label) nothrow insert_sub_menu_at;

Insert a sub-menu in the menu at the specified |index|. The new sub-menu is returned.

is_checked
int function(cef_menu_model_t* self, int command_id) nothrow is_checked;

Returns true (1) if the specified |command_id| is checked. Only applies to check and radio items.

is_checked_at
int function(cef_menu_model_t* self, size_t index) nothrow is_checked_at;

Returns true (1) if the specified |index| is checked. Only applies to check and radio items.

is_enabled
int function(cef_menu_model_t* self, int command_id) nothrow is_enabled;

Returns true (1) if the specified |command_id| is enabled.

is_enabled_at
int function(cef_menu_model_t* self, size_t index) nothrow is_enabled_at;

Returns true (1) if the specified |index| is enabled.

is_visible
int function(cef_menu_model_t* self, int command_id) nothrow is_visible;

Returns true (1) if the specified |command_id| is visible.

is_visible_at
int function(cef_menu_model_t* self, size_t index) nothrow is_visible_at;

Returns true (1) if the specified |index| is visible.

remove
int function(cef_menu_model_t* self, int command_id) nothrow remove;

Removes the item with the specified |command_id|. Returns true (1) on success.

remove_accelerator
int function(cef_menu_model_t* self, int command_id) nothrow remove_accelerator;

Remove the keyboard accelerator for the specified |command_id|. Returns true (1) on success.

remove_accelerator_at
int function(cef_menu_model_t* self, size_t index) nothrow remove_accelerator_at;

Remove the keyboard accelerator at the specified |index|. Returns true (1) on success.

remove_at
int function(cef_menu_model_t* self, size_t index) nothrow remove_at;

Removes the item at the specified |index|. Returns true (1) on success.

set_accelerator
int function(cef_menu_model_t* self, int command_id, int key_code, int shift_pressed, int ctrl_pressed, int alt_pressed) nothrow set_accelerator;

Set the keyboard accelerator for the specified |command_id|. |key_code| can be any virtual key or character value. Returns true (1) on success.

set_accelerator_at
int function(cef_menu_model_t* self, size_t index, int key_code, int shift_pressed, int ctrl_pressed, int alt_pressed) nothrow set_accelerator_at;

Set the keyboard accelerator at the specified |index|. |key_code| can be any virtual key or character value. Returns true (1) on success.

set_checked
int function(cef_menu_model_t* self, int command_id, int checked) nothrow set_checked;

Check the specified |command_id|. Only applies to check and radio items. Returns true (1) on success.

set_checked_at
int function(cef_menu_model_t* self, size_t index, int checked) nothrow set_checked_at;

Check the specified |index|. Only applies to check and radio items. Returns true (1) on success.

set_color
int function(cef_menu_model_t* self, int command_id, cef_menu_color_type_t color_type, cef_color_t color) nothrow set_color;

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.

set_color_at
int function(cef_menu_model_t* self, int index, cef_menu_color_type_t color_type, cef_color_t color) nothrow set_color_at;

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.

set_command_id_at
int function(cef_menu_model_t* self, size_t index, int command_id) nothrow set_command_id_at;

Sets the command id at the specified |index|. Returns true (1) on success.

set_enabled
int function(cef_menu_model_t* self, int command_id, int enabled) nothrow set_enabled;

Change the enabled status of the specified |command_id|. Returns true (1) on success.

set_enabled_at
int function(cef_menu_model_t* self, size_t index, int enabled) nothrow set_enabled_at;

Change the enabled status at the specified |index|. Returns true (1) on success.

set_font_list
int function(cef_menu_model_t* self, int command_id, const(cef_string_t)* font_list) nothrow set_font_list;

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".

set_font_list_at
int function(cef_menu_model_t* self, int index, const(cef_string_t)* font_list) nothrow set_font_list_at;

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 - 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".

set_group_id
int function(cef_menu_model_t* self, int command_id, int group_id) nothrow set_group_id;

Sets the group id for the specified |command_id|. Returns true (1) on success.

set_group_id_at
int function(cef_menu_model_t* self, size_t index, int group_id) nothrow set_group_id_at;

Sets the group id at the specified |index|. Returns true (1) on success.

set_label
int function(cef_menu_model_t* self, int command_id, const(cef_string_t)* label) nothrow set_label;

Sets the label for the specified |command_id|. Returns true (1) on success.

set_label_at
int function(cef_menu_model_t* self, size_t index, const(cef_string_t)* label) nothrow set_label_at;

Set the label at the specified |index|. Returns true (1) on success.

set_visible
int function(cef_menu_model_t* self, int command_id, int visible) nothrow set_visible;

Change the visibility of the specified |command_id|. Returns true (1) on success.

set_visible_at
int function(cef_menu_model_t* self, size_t index, int visible) nothrow set_visible_at;

Change the visibility at the specified |index|. Returns true (1) on success.

Meta