Class

WPEWebKitContextMenu

Description [src]

class WPEWebKit.ContextMenu : GObject.Object {
  parent: GObject
}

Represents the context menu in a WebKitWebView.

WebKitContextMenu represents a context menu containing WebKitContextMenuItems in a WebKitWebView.

When a WebKitWebView is about to display the context menu, it emits the WebKitWebView::context-menu signal, which has the WebKitContextMenu as an argument. You can modify it, adding new submenus that you can create with webkit_context_menu_new(), adding new WebKitContextMenuItems with webkit_context_menu_prepend(), webkit_context_menu_append() or webkit_context_menu_insert(), maybe after having removed the existing ones with webkit_context_menu_remove_all().

Hierarchy

hierarchy this WebKitContextMenu ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

webkit_context_menu_new

Creates a new WebKitContextMenu object to be used as a submenu of an existing WebKitContextMenu. The context menu of a WebKitWebView is created by the view and passed as an argument of WebKitWebView::context-menu signal. To add items to the menu use webkit_context_menu_prepend(), webkit_context_menu_append() or webkit_context_menu_insert(). See also webkit_context_menu_new_with_items() to create a WebKitContextMenu with a list of initial items.

webkit_context_menu_new_with_items

Creates a new WebKitContextMenu object to be used as a submenu of an existing WebKitContextMenu with the given initial items. See also webkit_context_menu_new()

Instance methods

webkit_context_menu_append

Adds item at the end of the menu.

webkit_context_menu_first

Gets the first item in the menu.

webkit_context_menu_get_item_at_position

Gets the item at the given position in the menu.

webkit_context_menu_get_items

Returns the item list of menu.

webkit_context_menu_get_n_items

Gets the length of the menu.

webkit_context_menu_get_user_data

Gets the user data of menu. This function can be used from the UI Process to get user data previously set from the Web Process with webkit_context_menu_set_user_data().

Available since: 2.8

webkit_context_menu_insert

Inserts item into the menu at the given position. If position is negative, or is larger than the number of items in the WebKitContextMenu, the item is added on to the end of the menu. The first position is 0.

webkit_context_menu_last

Gets the last item in the menu.

webkit_context_menu_move_item

Moves item to the given position in the menu. If position is negative, or is larger than the number of items in the WebKitContextMenu, the item is added on to the end of the menu. The first position is 0.

webkit_context_menu_prepend

Adds item at the beginning of the menu.

webkit_context_menu_remove

Removes item from the menu. See also webkit_context_menu_remove_all() to remove all items.

webkit_context_menu_remove_all

Removes all items of the menu.

webkit_context_menu_set_user_data

Sets user data to menu. This function can be used from a Web Process extension to set user data that can be retrieved from the UI Process using webkit_context_menu_get_user_data(). If the user_data GVariant is floating, it is consumed.

Available since: 2.8

Methods inherited from GObject (42)

Please see GObject for a full list of methods.

Signals

Signals inherited from GObject (1)
GObject.Object::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct WPEWebKitContextMenuClass {
  GObjectClass parent_class;
  void (* _webkit_reserved0) (
void
  );
  void (* _webkit_reserved1) (
void
  );
  void (* _webkit_reserved2) (
void
  );
  void (* _webkit_reserved3) (
void
  );
  
}
Class members
parent_class
GObjectClass
  No description available.
_webkit_reserved0
void (* _webkit_reserved0) (
void
  )
  No description available.
_webkit_reserved1
void (* _webkit_reserved1) (
void
  )
  No description available.
_webkit_reserved2
void (* _webkit_reserved2) (
void
  )
  No description available.
_webkit_reserved3
void (* _webkit_reserved3) (
void
  )
  No description available.