gio.simple_action

Module for [SimpleAction] class

Types 3

A gio.simple_action.SimpleAction is the obvious simple implementation of the gio.action.Action interface. This is the easiest way to create an action for purposes of adding it to a gio.simple_action_group.SimpleActionGroup.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
SimpleAction self() nothrowReturns `this`, for use in `with` statements.
SimpleActionGidBuilder builder() static nothrowGet builder for [gio.simple_action.SimpleAction] Returns: New builder object
bool enabled() @property nothrowGet `enabled` property. Returns: If @action is currently enabled.
void enabled(bool propval) @property nothrowSet `enabled` property. Params: propval = If @action is currently enabled.
string name() @property nothrowGet `name` property. Returns: The name of the action. This is mostly meaningful for identifying the action once it has been added to a #GSimpleActionGroup.
glib.variant_type.VariantType parameterType() @property nothrowGet `parameterType` property. Returns: The type of the parameter that must be given when activating the action.
glib.variant.Variant state() @property nothrowGet `state` property. Returns: The state of the action, or null if the action is stateless.
void state(glib.variant.Variant propval) @property nothrowSet `state` property. Params: propval = The state of the action, or null if the action is stateless.
glib.variant_type.VariantType stateType() @property nothrowGet `stateType` property. Returns: The #GVariantType of the state that the action has, or null if the action is stateless.
gio.simple_action.SimpleAction newStateful(string name, glib.variant_type.VariantType parameterType, glib.variant.Variant state) static nothrowCreates a new stateful action.
void setEnabled(bool enabled) nothrowSets the action as enabled or not.
void setState(glib.variant.Variant value) nothrowSets the state of the action.
void setStateHint(glib.variant.Variant stateHint = null) nothrowSets the state hint for the action.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == glib.variant.Variant))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.simple_action.SimpleAction))) && Parameters!T.length < 3) nothrowConnect to `Activate` signal.
gulong connectChangeState(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == glib.variant.Variant))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gio.simple_action.SimpleAction))) && Parameters!T.length < 3) nothrowConnect to `ChangeState` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(string name, glib.variant_type.VariantType parameterType = null)Creates a new action.

Fluent builder implementation template for gio.simple_action.SimpleAction

Methods
T enabled(bool propval) nothrowSet `enabled` property. Params: propval = If @action is currently enabled.
T name(string propval) nothrowSet `name` property. Params: propval = The name of the action. This is mostly meaningful for identifying the action once it has been added to a #GSimpleActionGroup. Returns: Builder instance for fl...
T parameterType(glib.variant_type.VariantType propval) nothrowSet `parameterType` property. Params: propval = The type of the parameter that must be given when activating the action. Returns: Builder instance for fluent chaining
T state(glib.variant.Variant propval) nothrowSet `state` property. Params: propval = The state of the action, or null if the action is stateless. Returns: Builder instance for fluent chaining
Methods
SimpleAction build() nothrowCreate object from builder. Returns: New object