Gio::SimpleAction Class Reference

SimpleAction - A simple Action implementation. More...

`#include <giomm/simpleaction.h>`

Inheritance diagram for Gio::SimpleAction:
[legend]

List of all members.

## Public Member Functions

virtual | ~SimpleAction ()
GSimpleAction* | gobj ()
| Provides access to the underlying C GObject.
const GSimpleAction* | gobj () const
| Provides access to the underlying C GObject.
GSimpleAction* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | set_enabled (bool enabled)
| Sets the action as enabled or not.
void | set_state (const Glib::VariantBase&value)
Glib::PropertyProxy_ReadOnly < bool > | property_enabled () const
| If the action can be activated.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_name () const
| The name used to invoke the action.
Glib::PropertyProxy_ReadOnly < Glib::VariantType > | property_parameter_type () const
| The type of GVariant passed to activate().
Glib::PropertyProxy_ReadOnly < Glib::VariantBase > | property_state () const
| The state the action is in.
Glib::PropertyProxy_ReadOnly < Glib::VariantType > | property_state_type () const
| The type of the state kept by the action.
Glib::SignalProxy1< void, const Glib::VariantBase& > | signal_activate ()
Glib::SignalProxy1< void, const Glib::VariantBase& > | signal_change_state ()

## Static Public Member Functions

static Glib::RefPtr< SimpleAction > | create (const Glib::ustring& name, const Glib::VariantType& parameter_type)
| Creates a new action.
static Glib::RefPtr< SimpleAction > | create (const Glib::ustring& name, const Glib::VariantType& parameter_type, const Glib::VariantBase& sate)
| Creates a new stateful action.

## Protected Member Functions

| SimpleAction (const Glib::ustring& name, const Glib::VariantType& parameter_type)
| SimpleAction (const Glib::ustring& name, const Glib::VariantType& parameter_type, const Glib::VariantBase& sate)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr< Gio::SimpleAction > | wrap (GSimpleAction* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

SimpleAction - A simple Action implementation.

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

See also Gtk::Action.

Since glibmm 2.32:

## Constructor & Destructor Documentation

virtual Gio::SimpleAction::~SimpleAction | ( |  | ) | `[virtual]`

Gio::SimpleAction::SimpleAction | ( | const Glib::ustring& | name,
|  | const Glib::VariantType& | parameter_type
| ) |  | `[explicit, protected]`

Gio::SimpleAction::SimpleAction | ( | const Glib::ustring& | name,
|  | const Glib::VariantType& | parameter_type,
|  | const Glib::VariantBase& | sate
| ) |  | `[explicit, protected]`

## Member Function Documentation

static Glib::RefPtr<SimpleAction> Gio::SimpleAction::create | ( | const Glib::ustring& | name,
|  | const Glib::VariantType& | parameter_type
| ) |  | `[static]`

Creates a new action.

The created action is stateless. See g_simple_action_new_stateful().

Since glibmm 2.28:

Parameters:

  name | The name of the action.
  parameter_type | The type of parameter to the activate function.

Returns:
  A new SimpleAction.

static Glib::RefPtr<SimpleAction> Gio::SimpleAction::create | ( | const Glib::ustring& | name,
|  | const Glib::VariantType& | parameter_type,
|  | const Glib::VariantBase& | sate
| ) |  | `[static]`

Creates a new stateful action.

state is the initial state of the action. All future state values must have the same VariantType as the initial state.

If the state GVariant is floating, it is consumed.

Since glibmm 2.28:

Parameters:

  name | The name of the action.
  parameter_type | The type of the parameter to the activate function.
  state | The initial state of the action.

Returns:
  A new SimpleAction.

const GSimpleAction* Gio::SimpleAction::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Action.

GSimpleAction* Gio::SimpleAction::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gio::Action.

GSimpleAction* Gio::SimpleAction::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Glib::PropertyProxy_ReadOnly<bool> Gio::SimpleAction::property_enabled | ( |  | ) | const

If the action can be activated.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Reimplemented from Gio::Action.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gio::SimpleAction::property_name | ( |  | ) | const

The name used to invoke the action.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Reimplemented from Gio::Action.

Glib::PropertyProxy_ReadOnly<Glib::VariantType> Gio::SimpleAction::property_parameter_type | ( |  | ) | const

The type of GVariant passed to activate().

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Reimplemented from Gio::Action.

Glib::PropertyProxy_ReadOnly<Glib::VariantBase> Gio::SimpleAction::property_state | ( |  | ) | const

The state the action is in.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Reimplemented from Gio::Action.

Glib::PropertyProxy_ReadOnly<Glib::VariantType> Gio::SimpleAction::property_state_type | ( |  | ) | const

The type of the state kept by the action.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Reimplemented from Gio::Action.

void Gio::SimpleAction::set_enabled | ( | bool | enabled | ) |

Sets the action as enabled or not.

An action must be enabled in order to be activated or in order to have its state changed from outside callers.

Since glibmm 2.28:

Parameters:

  enabled | Whether the action is enabled.

void Gio::SimpleAction::set_state | ( | const Glib::VariantBase& | value | ) |

Glib::SignalProxy1< void,const Glib::VariantBase& > Gio::SimpleAction::signal_activate | ( |  | ) |

Prototype:
  `void on_my_activate(const Glib::VariantBase& parameter)`

Glib::SignalProxy1< void,const Glib::VariantBase& > Gio::SimpleAction::signal_change_state | ( |  | ) |

Prototype:
  `void on_my_change_state(const Glib::VariantBase& value)`

## Friends And Related Function Documentation

Glib::RefPtr< Gio::SimpleAction > wrap | ( | GSimpleAction * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.