ContextMenuItem

The #WebKitContextMenu is composed of #WebKitContextMenuItem<!-- -->s. These items can be created from a #GtkAction, from a #WebKitContextMenuAction or from a #WebKitContextMenuAction and a label. These #WebKitContextMenuAction<!-- -->s denote stock actions for the items. You can also create separators and submenus.

Constructors

this
this(WebKitContextMenuItem* webKitContextMenuItem, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(Action action)

Creates a new #WebKitContextMenuItem for the given @action.

this
this(ActionIF action, string label, Variant target)

Creates a new #WebKitContextMenuItem for the given @action and @label. On activation @target will be passed as parameter to the callback.

this
this(WebKitContextMenuAction action)

Creates a new #WebKitContextMenuItem for the given stock action. Stock actions are handled automatically by WebKit so that, for example, when a menu item created with a %WEBKIT_CONTEXT_MENU_ACTION_STOP is activated the action associated will be handled by WebKit and the current load operation will be stopped. You can get the #GAction of a #WebKitContextMenuItem created with a #WebKitContextMenuAction with webkit_context_menu_item_get_gaction() and connect to the #GSimpleAction::activate signal to be notified when the item is activated, but you can't prevent the associated action from being performed.

this
this(WebKitContextMenuAction action, string label)

Creates a new #WebKitContextMenuItem for the given stock action using the given @label. Stock actions have a predefined label, this method can be used to create a #WebKitContextMenuItem for a #WebKitContextMenuAction but using a custom label.

this
this()

Creates a new #WebKitContextMenuItem representing a separator.

this
this(string label, ContextMenu submenu)

Creates a new #WebKitContextMenuItem using the given @label with a submenu.

Members

Functions

getAction
Action getAction()

Gets the action associated to @item as a #GtkAction.

getContextMenuItemStruct
WebKitContextMenuItem* getContextMenuItemStruct(bool transferOwnership)

Get the main Gtk struct

getGaction
ActionIF getGaction()

Gets the action associated to @item as a #GAction.

getStockAction
WebKitContextMenuAction getStockAction()

Gets the #WebKitContextMenuAction of @item. If the #WebKitContextMenuItem was not created for a stock action %WEBKIT_CONTEXT_MENU_ACTION_CUSTOM will be returned. If the #WebKitContextMenuItem is a separator %WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION will be returned.

getStruct
void* getStruct()

the main Gtk struct as a void*

getSubmenu
ContextMenu getSubmenu()

Gets the submenu of @item.

isSeparator
bool isSeparator()

Checks whether @item is a separator.

setSubmenu
void setSubmenu(ContextMenu submenu)

Sets or replaces the @item submenu. If @submenu is %NULL the current submenu of @item is removed.

Static functions

getType
GType getType()

Variables

webKitContextMenuItem
WebKitContextMenuItem* webKitContextMenuItem;

the main Gtk struct

Meta