gi-gio-2.0.35: Gio bindings

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.Gio.Structs.ActionEntry

Contents

- Exported types
- Methods
- Properties
  - activate
  - changeState
  - name
  - parameterType
  - state

Description

This struct defines a single action. It is for use with `actionMapAddActionEntries`.

The order of the items in the structure are intended to reflect frequency of use. It is permissible to use an incomplete initialiser in order to leave some of the later values as `NULL`. All values after `name` are optional. Additional optional fields may be added in the future.

See `actionMapAddActionEntries` for an example.

Synopsis

- newtype ActionEntry = ActionEntry (ManagedPtr ActionEntry)
- newZeroActionEntry :: MonadIO m => m ActionEntry
- clearActionEntryActivate :: MonadIO m => ActionEntry -> m ()
- getActionEntryActivate :: MonadIO m => ActionEntry -> m (Maybe ActionEntryActivateFieldCallback_WithClosures)
- setActionEntryActivate :: MonadIO m => ActionEntry -> FunPtr C_ActionEntryActivateFieldCallback -> m ()
- clearActionEntryChangeState :: MonadIO m => ActionEntry -> m ()
- getActionEntryChangeState :: MonadIO m => ActionEntry -> m (Maybe ActionEntryChangeStateFieldCallback_WithClosures)
- setActionEntryChangeState :: MonadIO m => ActionEntry -> FunPtr C_ActionEntryChangeStateFieldCallback -> m ()
- clearActionEntryName :: MonadIO m => ActionEntry -> m ()
- getActionEntryName :: MonadIO m => ActionEntry -> m (Maybe Text)
- setActionEntryName :: MonadIO m => ActionEntry -> CString -> m ()
- clearActionEntryParameterType :: MonadIO m => ActionEntry -> m ()
- getActionEntryParameterType :: MonadIO m => ActionEntry -> m (Maybe Text)
- setActionEntryParameterType :: MonadIO m => ActionEntry -> CString -> m ()
- clearActionEntryState :: MonadIO m => ActionEntry -> m ()
- getActionEntryState :: MonadIO m => ActionEntry -> m (Maybe Text)
- setActionEntryState :: MonadIO m => ActionEntry -> CString -> m ()

# Exported types

newtype ActionEntry Source #

Memory-managed wrapper type.

Constructors

ActionEntry (ManagedPtr ActionEntry) |

#### Instances

Instances details

Eq ActionEntry Source # |
Instance details Defined in GI.Gio.Structs.ActionEntry Methods (==) :: ActionEntry -> ActionEntry -> Bool Source # (/=) :: ActionEntry -> ActionEntry -> Bool Source #
BoxedPtr ActionEntry Source # |
Instance details Defined in GI.Gio.Structs.ActionEntry Methods boxedPtrCopy :: ActionEntry -> IO ActionEntry Source # boxedPtrFree :: ActionEntry -> IO () Source #
CallocPtr ActionEntry Source # |
Instance details Defined in GI.Gio.Structs.ActionEntry Methods boxedPtrCalloc :: IO (Ptr ActionEntry) Source #
ManagedPtrNewtype ActionEntry Source # |
Instance details Defined in GI.Gio.Structs.ActionEntry Methods toManagedPtr :: ActionEntry -> ManagedPtr ActionEntry Source #
tag ~ 'AttrSet => Constructible ActionEntry tag Source # |
Instance details Defined in GI.Gio.Structs.ActionEntry Methods new :: MonadIO m => (ManagedPtr ActionEntry -> ActionEntry) -> [AttrOp ActionEntry tag] -> m ActionEntry Source #

newZeroActionEntry :: MonadIO m => m ActionEntry Source #

Construct a `ActionEntry` struct initialized to zero.

# Methods

# Properties

## activate

the callback to connect to the "activate" signal of the action. Since GLib 2.40, this can be `NULL` for stateful actions, in which case the default handler is used. For boolean-stated actions with no parameter, this is a toggle. For other state types (and parameter type equal to the state type) this will be a function that just calls `changeState` (which you should provide).

clearActionEntryActivate :: MonadIO m => ActionEntry -> m () Source #

Set the value of the “`activate`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #activate

getActionEntryActivate :: MonadIO m => ActionEntry -> m (Maybe ActionEntryActivateFieldCallback_WithClosures) Source #

Get the value of the “`activate`” field. When overloading is enabled, this is equivalent to

    get actionEntry #activate

setActionEntryActivate :: MonadIO m => ActionEntry -> FunPtr C_ActionEntryActivateFieldCallback -> m () Source #

Set the value of the “`activate`” field. When overloading is enabled, this is equivalent to

    set actionEntry [ #activate := value ]

## changeState

the callback to connect to the "change-state" signal of the action. All stateful actions should provide a handler here; stateless actions should not.

clearActionEntryChangeState :: MonadIO m => ActionEntry -> m () Source #

Set the value of the “`change_state`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #changeState

getActionEntryChangeState :: MonadIO m => ActionEntry -> m (Maybe ActionEntryChangeStateFieldCallback_WithClosures) Source #

Get the value of the “`change_state`” field. When overloading is enabled, this is equivalent to

    get actionEntry #changeState

setActionEntryChangeState :: MonadIO m => ActionEntry -> FunPtr C_ActionEntryChangeStateFieldCallback -> m () Source #

Set the value of the “`change_state`” field. When overloading is enabled, this is equivalent to

    set actionEntry [ #changeState := value ]

## name

the name of the action

clearActionEntryName :: MonadIO m => ActionEntry -> m () Source #

Set the value of the “`name`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #name

getActionEntryName :: MonadIO m => ActionEntry -> m (Maybe Text) Source #

Get the value of the “`name`” field. When overloading is enabled, this is equivalent to

    get actionEntry #name

setActionEntryName :: MonadIO m => ActionEntry -> CString -> m () Source #

Set the value of the “`name`” field. When overloading is enabled, this is equivalent to

    set actionEntry [ #name := value ]

## parameterType

the type of the parameter that must be passed to the activate function for this action, given as a single GVariant type string (or `NULL` for no parameter)

clearActionEntryParameterType :: MonadIO m => ActionEntry -> m () Source #

Set the value of the “`parameter_type`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #parameterType

getActionEntryParameterType :: MonadIO m => ActionEntry -> m (Maybe Text) Source #

Get the value of the “`parameter_type`” field. When overloading is enabled, this is equivalent to

    get actionEntry #parameterType

setActionEntryParameterType :: MonadIO m => ActionEntry -> CString -> m () Source #

Set the value of the “`parameter_type`” field. When overloading is enabled, this is equivalent to

    set actionEntry [ #parameterType := value ]

## state

the initial state for this action, given in GVariant text format. The state is parsed with no extra type information, so type tags must be added to the string if they are necessary. Stateless actions should give `NULL` here.

clearActionEntryState :: MonadIO m => ActionEntry -> m () Source #

Set the value of the “`state`” field to `Nothing`. When overloading is enabled, this is equivalent to

    clear #state

getActionEntryState :: MonadIO m => ActionEntry -> m (Maybe Text) Source #

Get the value of the “`state`” field. When overloading is enabled, this is equivalent to

    get actionEntry #state

setActionEntryState :: MonadIO m => ActionEntry -> CString -> m () Source #

Set the value of the “`state`” field. When overloading is enabled, this is equivalent to

    set actionEntry [ #state := value ]