_cef_context_menu_handler_t

Struct _cef_context_menu_handler_t 

Source
#[repr(C)]
pub struct _cef_context_menu_handler_t { pub base: cef_base_ref_counted_t, pub on_before_context_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, model: *mut _cef_menu_model_t)>, pub run_context_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, model: *mut _cef_menu_model_t, callback: *mut _cef_run_context_menu_callback_t) -> c_int>, pub on_context_menu_command: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, command_id: c_int, event_flags: cef_event_flags_t) -> c_int>, pub on_context_menu_dismissed: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t)>, pub run_quick_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, location: *const cef_point_t, size: *const cef_size_t, edit_state_flags: cef_quick_menu_edit_state_flags_t, callback: *mut _cef_run_quick_menu_callback_t) -> c_int>, pub on_quick_menu_command: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, command_id: c_int, event_flags: cef_event_flags_t) -> c_int>, pub on_quick_menu_dismissed: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t)>, }
Expand description

Implement this structure to handle context menu events. The functions of this structure will be called on the UI thread.

NOTE: This struct is allocated client-side.

Fields§

§base: cef_base_ref_counted_t

Base structure.

§on_before_context_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, model: *mut _cef_menu_model_t)>

Called before a context menu is displayed. |params| provides information about the context menu state. |model| initially contains the default context menu. The |model| can be cleared to show no context menu or modified to show a custom menu. Do not keep references to |params| or |model| outside of this callback.

§run_context_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, model: *mut _cef_menu_model_t, callback: *mut _cef_run_context_menu_callback_t) -> c_int>

Called to allow custom display of the context menu. |params| provides information about the context menu state. |model| contains the context menu model resulting from OnBeforeContextMenu. For custom display return true (1) and execute |callback| either synchronously or asynchronously with the selected command ID. For default display return false (0). Do not keep references to |params| or |model| outside of this callback.

§on_context_menu_command: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, params: *mut _cef_context_menu_params_t, command_id: c_int, event_flags: cef_event_flags_t) -> c_int>

Called to execute a command selected from the context menu. Return true (1) if the command was handled or false (0) for the default implementation. 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. |params| will have the same values as what was passed to on_before_context_menu(). Do not keep a reference to |params| outside of this callback.

§on_context_menu_dismissed: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t)>

Called when the context menu is dismissed irregardless of whether the menu was canceled or a command was selected.

§run_quick_menu: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, location: *const cef_point_t, size: *const cef_size_t, edit_state_flags: cef_quick_menu_edit_state_flags_t, callback: *mut _cef_run_quick_menu_callback_t) -> c_int>

Called to allow custom display of the quick menu for a windowless browser. |location| is the top left corner of the selected region. |size| is the size of the selected region. |edit_state_flags| is a combination of flags that represent the state of the quick menu. Return true (1) if the menu will be handled and execute |callback| either synchronously or asynchronously with the selected command ID. Return false (0) to cancel the menu.

§on_quick_menu_command: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t, command_id: c_int, event_flags: cef_event_flags_t) -> c_int>

Called to execute a command selected from the quick menu for a windowless browser. Return true (1) if the command was handled or false (0) for the default implementation. See cef_menu_id_t for command IDs that have default implementations.

§on_quick_menu_dismissed: Option<unsafe extern "C" fn(self_: *mut _cef_context_menu_handler_t, browser: *mut _cef_browser_t, frame: *mut _cef_frame_t)>

Called when the quick menu for a windowless browser is dismissed irregardless of whether the menu was canceled or a command was selected.

Trait Implementations§

Source§

impl Clone for _cef_context_menu_handler_t

Source§

fn clone(&self) -> _cef_context_menu_handler_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for _cef_context_menu_handler_t

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for _cef_context_menu_handler_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.