cef_menu_model_t

Type Alias cef_menu_model_t 

Source
pub type cef_menu_model_t = _cef_menu_model_t;
Expand description

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.

NOTE: This struct is allocated DLL-side.

Aliased Type§

#[repr(C)]
pub struct cef_menu_model_t {
Show 57 fields pub base: _cef_base_ref_counted_t, pub is_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>, pub clear: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>, pub get_count: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> usize>, pub add_separator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>, pub add_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>, pub add_check_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>, pub add_radio_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t, i32) -> i32>, pub add_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> *mut _cef_menu_model_t>, pub insert_separator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub insert_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> i32>, pub insert_check_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> i32>, pub insert_radio_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t, i32) -> i32>, pub insert_sub_menu_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> *mut _cef_menu_model_t>, pub remove: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub remove_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub get_index_of: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub get_command_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_command_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>, pub get_label: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> *mut _cef_string_utf16_t>, pub get_label_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> *mut _cef_string_utf16_t>, pub set_label: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>, pub set_label_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, *const _cef_string_utf16_t) -> i32>, pub get_type: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> cef_menu_item_type_t>, pub get_type_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> cef_menu_item_type_t>, pub get_group_id: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub get_group_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_group_id: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>, pub set_group_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>, pub get_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> *mut _cef_menu_model_t>, pub get_sub_menu_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> *mut _cef_menu_model_t>, pub is_visible: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub is_visible_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_visible: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>, pub set_visible_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>, pub is_enabled: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub is_enabled_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_enabled: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>, pub set_enabled_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>, pub is_checked: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub is_checked_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_checked: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>, pub set_checked_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>, pub has_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub has_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub set_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32, i32, i32, i32) -> i32>, pub set_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, i32, i32, i32) -> i32>, pub remove_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>, pub remove_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>, pub get_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *mut i32, *mut i32, *mut i32, *mut i32) -> i32>, pub get_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, *mut i32, *mut i32, *mut i32, *mut i32) -> i32>, pub set_color: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, u32) -> i32>, pub set_color_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, u32) -> i32>, pub get_color: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, *mut u32) -> i32>, pub get_color_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, *mut u32) -> i32>, pub set_font_list: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>, pub set_font_list_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>,
}

Fields§

§base: _cef_base_ref_counted_t

Base structure.

§is_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>

Returns true (1) if this menu is a submenu.

§clear: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>

Clears the menu. Returns true (1) on success.

§get_count: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> usize>

Returns the number of items in this menu.

§add_separator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t) -> i32>

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

§add_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>

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

§add_check_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>

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

§add_radio_item: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t, i32) -> i32>

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_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> *mut _cef_menu_model_t>

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

§insert_separator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§insert_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> i32>

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

§insert_check_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> i32>

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

§insert_radio_item_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t, i32) -> i32>

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_sub_menu_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, *const _cef_string_utf16_t) -> *mut _cef_menu_model_t>

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

§remove: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§remove_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§get_index_of: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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_command_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_command_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>

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

§get_label: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> *mut _cef_string_utf16_t>

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

§get_label_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> *mut _cef_string_utf16_t>

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

§set_label: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>

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

§set_label_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, *const _cef_string_utf16_t) -> i32>

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

§get_type: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> cef_menu_item_type_t>

Returns the item type for the specified |command_id|.

§get_type_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> cef_menu_item_type_t>

Returns the item type at the specified |index|.

§get_group_id: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§get_group_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_group_id: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>

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

§set_group_id_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>

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

§get_sub_menu: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> *mut _cef_menu_model_t>

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

§get_sub_menu_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> *mut _cef_menu_model_t>

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

§is_visible: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§is_visible_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_visible: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>

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

§set_visible_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>

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

§is_enabled: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§is_enabled_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_enabled: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>

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

§set_enabled_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>

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

§is_checked: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§is_checked_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_checked: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32) -> i32>

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

§set_checked_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32) -> i32>

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

§has_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§has_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§set_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, i32, i32, i32, i32) -> i32>

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: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, i32, i32, i32, i32) -> i32>

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

§remove_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32) -> i32>

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

§remove_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize) -> i32>

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

§get_accelerator: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *mut i32, *mut i32, *mut i32, *mut i32) -> i32>

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

§get_accelerator_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, usize, *mut i32, *mut i32, *mut i32, *mut i32) -> i32>

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

§set_color: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, u32) -> i32>

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: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, u32) -> i32>

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.

§get_color: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, *mut u32) -> i32>

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: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, cef_menu_color_type_t, *mut u32) -> i32>

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.

§set_font_list: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>

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] ”, 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”
§set_font_list_at: Option<unsafe extern "C" fn(*mut _cef_menu_model_t, i32, *const _cef_string_utf16_t) -> i32>

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

Here are examples of valid font description strings:

  • “Arial, Helvetica, Bold Italic 14px”
  • “Arial, 14px”