| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
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
- newtype ContextMenuItem = ContextMenuItem (ManagedPtr ContextMenuItem)
- class (GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o
- toContextMenuItem :: (MonadIO m, IsContextMenuItem o) => o -> m ContextMenuItem
- contextMenuItemGetAction :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m (Maybe Action)
- contextMenuItemGetGaction :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m (Maybe Action)
- contextMenuItemGetStockAction :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m ContextMenuAction
- contextMenuItemGetSubmenu :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m (Maybe ContextMenu)
- contextMenuItemIsSeparator :: (HasCallStack, MonadIO m, IsContextMenuItem a) => a -> m Bool
- contextMenuItemNew :: (HasCallStack, MonadIO m, IsAction a) => a -> m ContextMenuItem
- contextMenuItemNewFromGaction :: (HasCallStack, MonadIO m, IsAction a) => a -> Text -> Maybe GVariant -> m ContextMenuItem
- contextMenuItemNewFromStockAction :: (HasCallStack, MonadIO m) => ContextMenuAction -> m ContextMenuItem
- contextMenuItemNewFromStockActionWithLabel :: (HasCallStack, MonadIO m) => ContextMenuAction -> Text -> m ContextMenuItem
- contextMenuItemNewSeparator :: (HasCallStack, MonadIO m) => m ContextMenuItem
- contextMenuItemNewWithSubmenu :: (HasCallStack, MonadIO m, IsContextMenu a) => Text -> a -> m ContextMenuItem
- contextMenuItemSetSubmenu :: (HasCallStack, MonadIO m, IsContextMenuItem a, IsContextMenu b) => a -> Maybe b -> m ()
Exported types
newtype ContextMenuItem Source #
Memory-managed wrapper type.
Constructors
| ContextMenuItem (ManagedPtr ContextMenuItem) |
Instances
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
| (GObject o, IsDescendantOf ContextMenuItem o) => IsContextMenuItem o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isSeparator, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getAction, getData, getGaction, getProperty, getQdata, getStockAction, getSubmenu.
Setters
getAction
contextMenuItemGetAction Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
| => a |
|
| -> m (Maybe Action) | Returns: the |
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 |
|
| -> m (Maybe Action) | Returns: the |
Gets the action associated to item as a Action.
Since: 2.18
getStockAction
contextMenuItemGetStockAction Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
| => a |
|
| -> m ContextMenuAction | Returns: the |
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 |
|
| -> m (Maybe ContextMenu) | Returns: the |
Gets the submenu of item.
isSeparator
contextMenuItemIsSeparator Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContextMenuItem a) | |
| => a |
|
| -> m Bool |
Checks whether item is a separator.
new
Arguments
| :: (HasCallStack, MonadIO m, IsAction a) | |
| => a |
|
| -> m ContextMenuItem | Returns: the newly created |
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 |
|
| -> Text |
|
| -> Maybe GVariant |
|
| -> m ContextMenuItem | Returns: the newly created |
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 |
|
| -> m ContextMenuItem | Returns: the newly created |
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 |
|
| -> Text |
|
| -> m ContextMenuItem | Returns: the newly created |
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 |
Creates a new ContextMenuItem representing a separator.
newWithSubmenu
contextMenuItemNewWithSubmenu Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContextMenu a) | |
| => Text |
|
| -> a |
|
| -> m ContextMenuItem | Returns: the newly created |
Creates a new ContextMenuItem using the given label with a submenu.
setSubmenu
contextMenuItemSetSubmenu Source #
Arguments
| :: (HasCallStack, MonadIO m, IsContextMenuItem a, IsContextMenu b) | |
| => a |
|
| -> Maybe b |
|
| -> m () |
Sets or replaces the item submenu.
If submenu is Nothing the current
submenu of item is removed.