The OpenD Programming Language

cef_context_menu_handler_t

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

version(cef && embedded_cef_bindings)
extern (C)
struct cef_context_menu_handler_t {}

Members

Variables

base
cef_base_ref_counted_t base;

Base structure.

on_before_context_menu
void function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* params, cef_menu_model_t* model) nothrow on_before_context_menu;

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.

on_context_menu_command
int function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* params, int command_id, cef_event_flags_t event_flags) nothrow on_context_menu_command;

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
void function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame) nothrow on_context_menu_dismissed;

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

on_quick_menu_command
int function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, int command_id, cef_event_flags_t event_flags) nothrow on_quick_menu_command;

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
void function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame) nothrow on_quick_menu_dismissed;

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

run_context_menu
int function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_context_menu_params_t* params, cef_menu_model_t* model, cef_run_context_menu_callback_t* callback) nothrow run_context_menu;

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.

run_quick_menu
int function(cef_context_menu_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, const(cef_point_t)* location, const(cef_size_t)* size, cef_quick_menu_edit_state_flags_t edit_state_flags, cef_run_quick_menu_callback_t* callback) nothrow run_quick_menu;

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.

Meta