#[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(self_: *mut _cef_menu_model_t) -> c_int>,
pub clear: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> c_int>,
pub get_count: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> usize>,
pub add_separator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> c_int>,
pub add_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>,
pub add_check_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>,
pub add_radio_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t, group_id: c_int) -> c_int>,
pub add_sub_menu: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> *mut _cef_menu_model_t>,
pub insert_separator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub insert_item_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t) -> c_int>,
pub insert_check_item_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t) -> c_int>,
pub insert_radio_item_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t, group_id: c_int) -> c_int>,
pub insert_sub_menu_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t) -> *mut _cef_menu_model_t>,
pub remove: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub remove_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub get_index_of: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub get_command_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_command_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int) -> c_int>,
pub get_label: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> cef_string_userfree_t>,
pub get_label_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> cef_string_userfree_t>,
pub set_label: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>,
pub set_label_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, label: *const cef_string_t) -> c_int>,
pub get_type: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> cef_menu_item_type_t>,
pub get_type_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> cef_menu_item_type_t>,
pub get_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub get_group_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, group_id: c_int) -> c_int>,
pub set_group_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, group_id: c_int) -> c_int>,
pub get_sub_menu: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> *mut _cef_menu_model_t>,
pub get_sub_menu_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> *mut _cef_menu_model_t>,
pub is_visible: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub is_visible_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_visible: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, visible: c_int) -> c_int>,
pub set_visible_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, visible: c_int) -> c_int>,
pub is_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub is_enabled_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, enabled: c_int) -> c_int>,
pub set_enabled_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, enabled: c_int) -> c_int>,
pub is_checked: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub is_checked_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_checked: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, checked: c_int) -> c_int>,
pub set_checked_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, checked: c_int) -> c_int>,
pub has_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub has_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub set_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, key_code: c_int, shift_pressed: c_int, ctrl_pressed: c_int, alt_pressed: c_int) -> c_int>,
pub set_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, key_code: c_int, shift_pressed: c_int, ctrl_pressed: c_int, alt_pressed: c_int) -> c_int>,
pub remove_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>,
pub remove_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>,
pub get_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, key_code: *mut c_int, shift_pressed: *mut c_int, ctrl_pressed: *mut c_int, alt_pressed: *mut c_int) -> c_int>,
pub get_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, key_code: *mut c_int, shift_pressed: *mut c_int, ctrl_pressed: *mut c_int, alt_pressed: *mut c_int) -> c_int>,
pub set_color: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, color_type: cef_menu_color_type_t, color: cef_color_t) -> c_int>,
pub set_color_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: c_int, color_type: cef_menu_color_type_t, color: cef_color_t) -> c_int>,
pub get_color: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, color_type: cef_menu_color_type_t, color: *mut cef_color_t) -> c_int>,
pub get_color_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: c_int, color_type: cef_menu_color_type_t, color: *mut cef_color_t) -> c_int>,
pub set_font_list: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, font_list: *const cef_string_t) -> c_int>,
pub set_font_list_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: c_int, font_list: *const cef_string_t) -> c_int>,
}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.
Fields§
§base: cef_base_ref_counted_tBase structure.
Returns true (1) if this menu is a submenu.
clear: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> c_int>Clears the menu. Returns true (1) on success.
get_count: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> usize>Returns the number of items in this menu.
add_separator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t) -> c_int>Add a separator to the menu. Returns true (1) on success.
add_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>Add an item to the menu. Returns true (1) on success.
add_check_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>Add a check item to the menu. Returns true (1) on success.
add_radio_item: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t, group_id: c_int) -> c_int>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 a sub-menu to the menu. The new sub-menu is returned.
insert_separator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Insert a separator in the menu at the specified |index|. Returns true (1) on success.
insert_item_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t) -> c_int>Insert an item in the menu at the specified |index|. Returns true (1) on success.
insert_check_item_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t) -> c_int>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(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int, label: *const cef_string_t, group_id: c_int) -> c_int>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 a sub-menu in the menu at the specified |index|. The new sub-menu is returned.
remove: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Removes the item with the specified |command_id|. Returns true (1) on success.
remove_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Removes the item at the specified |index|. Returns true (1) on success.
get_index_of: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_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.
get_command_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>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(self_: *mut _cef_menu_model_t, index: usize, command_id: c_int) -> c_int>Sets the command id at the specified |index|. Returns true (1) on success.
get_label: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> cef_string_userfree_t>Returns the label for the specified |command_id| or NULL if not found.
get_label_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> cef_string_userfree_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(self_: *mut _cef_menu_model_t, command_id: c_int, label: *const cef_string_t) -> c_int>Sets the label for the specified |command_id|. Returns true (1) on success.
set_label_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, label: *const cef_string_t) -> c_int>Set the label at the specified |index|. Returns true (1) on success.
get_type: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> cef_menu_item_type_t>Returns the item type for the specified |command_id|.
get_type_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> cef_menu_item_type_t>Returns the item type at the specified |index|.
get_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Returns the group id for the specified |command_id| or -1 if invalid.
get_group_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Returns the group id at the specified |index| or -1 if invalid.
set_group_id: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, group_id: c_int) -> c_int>Sets the group id for the specified |command_id|. Returns true (1) on success.
set_group_id_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, group_id: c_int) -> c_int>Sets the group id at the specified |index|. Returns true (1) on success.
Returns the submenu for the specified |command_id| or NULL if invalid.
Returns the submenu at the specified |index| or NULL if invalid.
is_visible: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Returns true (1) if the specified |command_id| is visible.
is_visible_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Returns true (1) if the specified |index| is visible.
set_visible: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, visible: c_int) -> c_int>Change the visibility of the specified |command_id|. Returns true (1) on success.
set_visible_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, visible: c_int) -> c_int>Change the visibility at the specified |index|. Returns true (1) on success.
is_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Returns true (1) if the specified |command_id| is enabled.
is_enabled_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Returns true (1) if the specified |index| is enabled.
set_enabled: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, enabled: c_int) -> c_int>Change the enabled status of the specified |command_id|. Returns true (1) on success.
set_enabled_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, enabled: c_int) -> c_int>Change the enabled status at the specified |index|. Returns true (1) on success.
is_checked: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>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(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Returns true (1) if the specified |index| is checked. Only applies to check and radio items.
set_checked: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, checked: c_int) -> c_int>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(self_: *mut _cef_menu_model_t, index: usize, checked: c_int) -> c_int>Check the specified |index|. Only applies to check and radio items. Returns true (1) on success.
has_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Returns true (1) if the specified |command_id| has a keyboard accelerator assigned.
has_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Returns true (1) if the specified |index| has a keyboard accelerator assigned.
set_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, key_code: c_int, shift_pressed: c_int, ctrl_pressed: c_int, alt_pressed: c_int) -> c_int>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(self_: *mut _cef_menu_model_t, index: usize, key_code: c_int, shift_pressed: c_int, ctrl_pressed: c_int, alt_pressed: c_int) -> c_int>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(self_: *mut _cef_menu_model_t, command_id: c_int) -> c_int>Remove the keyboard accelerator for the specified |command_id|. Returns true (1) on success.
remove_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize) -> c_int>Remove the keyboard accelerator at the specified |index|. Returns true (1) on success.
get_accelerator: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, key_code: *mut c_int, shift_pressed: *mut c_int, ctrl_pressed: *mut c_int, alt_pressed: *mut c_int) -> c_int>Retrieves the keyboard accelerator for the specified |command_id|. Returns true (1) on success.
get_accelerator_at: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, index: usize, key_code: *mut c_int, shift_pressed: *mut c_int, ctrl_pressed: *mut c_int, alt_pressed: *mut c_int) -> c_int>Retrieves the keyboard accelerator for the specified |index|. Returns true (1) on success.
set_color: Option<unsafe extern "C" fn(self_: *mut _cef_menu_model_t, command_id: c_int, color_type: cef_menu_color_type_t, color: cef_color_t) -> c_int>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(self_: *mut _cef_menu_model_t, index: c_int, color_type: cef_menu_color_type_t, color: cef_color_t) -> c_int>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(self_: *mut _cef_menu_model_t, command_id: c_int, color_type: cef_menu_color_type_t, color: *mut cef_color_t) -> c_int>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(self_: *mut _cef_menu_model_t, index: c_int, color_type: cef_menu_color_type_t, color: *mut cef_color_t) -> c_int>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(self_: *mut _cef_menu_model_t, command_id: c_int, font_list: *const cef_string_t) -> c_int>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]
- 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(self_: *mut _cef_menu_model_t, index: c_int, font_list: *const cef_string_t) -> c_int>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”
Trait Implementations§
Source§fn clone(&self) -> _cef_menu_model_t
fn clone(&self) -> _cef_menu_model_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more