gi-webkit2-4.0.31: WebKit2 bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.WebKit2.Objects.ContextMenuItem

Description

One item of a ContextMenu.

The ContextMenu is composed of ContextMenuItems. These items can be created from a Action, from a ContextMenuAction or from a ContextMenuAction and a label. These ContextMenuActions denote stock actions for the items. You can also create separators and submenus.

Synopsis

Exported types

newtype ContextMenuItem Source #

Memory-managed wrapper type.

Constructors

ContextMenuItem (ManagedPtr ContextMenuItem) 

Instances

Instances details
Eq ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

GObject ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

ManagedPtrNewtype ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

TypedObject ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

Methods

glibType :: IO GType

HasParentTypes ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

IsGValue (Maybe ContextMenuItem) Source #

Convert ContextMenuItem to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ContextMenuItem -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ContextMenuItem)

type ParentTypes ContextMenuItem Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

type ParentTypes ContextMenuItem = '[Object]

class (GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o Source #

Type class for types which can be safely cast to ContextMenuItem, for instance with toContextMenuItem.

Instances

Instances details
(GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o Source # 
Instance details

Defined in GI.WebKit2.Objects.ContextMenuItem

toContextMenuItem :: (MonadIO m, IsContextMenuItem o) => o -> m ContextMenuItem Source #

Cast to ContextMenuItem, for types for which this is known to be safe. For general casts, use castTo.

Methods

getAction

contextMenuItemGetAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a) 
=> a

item: a ContextMenuItem

-> m (Maybe Action)

Returns: the Action associated to the ContextMenuItem, or Nothing if item is a separator.

Deprecated: (Since version 2.18)Use contextMenuItemGetGaction instead.

Gets the action associated to item as a Action.

getGaction

contextMenuItemGetGaction Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a) 
=> a

item: a ContextMenuItem

-> m (Maybe Action)

Returns: the Action associated to the ContextMenuItem, or Nothing if item is a separator.

Gets the action associated to item as a Action.

Since: 2.18

getStockAction

contextMenuItemGetStockAction Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a) 
=> a

item: a ContextMenuItem

-> m ContextMenuAction

Returns: the ContextMenuAction of item

Gets the ContextMenuAction of item.

If the ContextMenuItem was not created for a stock action ContextMenuActionCustom will be returned. If the ContextMenuItem is a separator ContextMenuActionNoAction will be returned.

getSubmenu

contextMenuItemGetSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a) 
=> a

item: a ContextMenuItem

-> m (Maybe ContextMenu)

Returns: the ContextMenu representing the submenu of item or Nothing if item doesn't have a submenu.

Gets the submenu of item.

isSeparator

contextMenuItemIsSeparator Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a) 
=> a

item: a ContextMenuItem

-> m Bool

Returns: True is item is a separator or False otherwise

Checks whether item is a separator.

new

contextMenuItemNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsAction a) 
=> a

action: a Action

-> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Deprecated: (Since version 2.18)Use contextMenuItemNewFromGaction instead.

Creates a new ContextMenuItem for the given action.

newFromGaction

contextMenuItemNewFromGaction Source #

Arguments

:: (HasCallStack, MonadIO m, IsAction a) 
=> a

action: a Action

-> Text

label: the menu item label text

-> Maybe GVariant

target: a GVariant to use as the action target

-> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Creates a new ContextMenuItem for the given action and label.

On activation target will be passed as parameter to the callback.

Since: 2.18

newFromStockAction

contextMenuItemNewFromStockAction Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ContextMenuAction

action: a ContextMenuAction stock action

-> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Creates a new ContextMenuItem for the given stock action.

Stock actions are handled automatically by WebKit so that, for example, when a menu item created with a ContextMenuActionStop is activated the action associated will be handled by WebKit and the current load operation will be stopped. You can get the Action of a ContextMenuItem created with a ContextMenuAction with contextMenuItemGetGaction and connect to the SimpleAction::activate signal to be notified when the item is activated, but you can't prevent the associated action from being performed.

newFromStockActionWithLabel

contextMenuItemNewFromStockActionWithLabel Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> ContextMenuAction

action: a ContextMenuAction stock action

-> Text

label: a custom label text to use instead of the predefined one

-> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Creates a new ContextMenuItem for the given stock action using the given label.

Stock actions have a predefined label, this method can be used to create a ContextMenuItem for a ContextMenuAction but using a custom label.

newSeparator

contextMenuItemNewSeparator Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Creates a new ContextMenuItem representing a separator.

newWithSubmenu

contextMenuItemNewWithSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenu a) 
=> Text

label: the menu item label text

-> a

submenu: a ContextMenu to set

-> m ContextMenuItem

Returns: the newly created ContextMenuItem object.

Creates a new ContextMenuItem using the given label with a submenu.

setSubmenu

contextMenuItemSetSubmenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsContextMenuItem a, IsContextMenu b) 
=> a

item: a ContextMenuItem

-> Maybe b

submenu: a ContextMenu

-> m () 

Sets or replaces the item submenu.

If submenu is Nothing the current submenu of item is removed.