type Gaction_Group is new Glib.Types.GType_Interface;
type Cb_Gaction_Group_UTF8_String_Void is not null access procedure (Self : Gaction_Group; Action_Name : UTF8_String);
type Cb_GObject_UTF8_String_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Action_Name : UTF8_String);
type Cb_Gaction_Group_UTF8_String_Boolean_Void is not null access procedure (Self : Gaction_Group; Action_Name : UTF8_String; Enabled : Boolean);
type Cb_GObject_UTF8_String_Boolean_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Action_Name : UTF8_String; Enabled : Boolean);
type Cb_Gaction_Group_UTF8_String_Gvariant_Void is not null access procedure (Self : Gaction_Group; Action_Name : UTF8_String; Value : Glib.Variant.Gvariant);
type Cb_GObject_UTF8_String_Gvariant_Void is not null access procedure (Self : access Glib.Object.GObject_Record'Class; Action_Name : UTF8_String; Value : Glib.Variant.Gvariant);
Null_Gaction_Group : constant Gaction_Group;
Signal_Action_Added : constant Glib.Signal_Name := "action-added";
Signal_Action_Enabled_Changed : constant Glib.Signal_Name := "action-enabled-changed";
Signal_Action_Removed : constant Glib.Signal_Name := "action-removed";
Signal_Action_State_Changed : constant Glib.Signal_Name := "action-state-changed";
function Get_Type return Glib.GType;
procedure Action_Added
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String); |
procedure Action_Enabled_Changed
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String; | |
Enabled | : Boolean); |
procedure Action_Removed
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String); |
procedure Action_State_Changed
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String; | |
State | : Glib.Variant.Gvariant); |
procedure Activate_Action
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String; | |
Parameter | : Glib.Variant.Gvariant); |
procedure Change_Action_State
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String; | |
Value | : Glib.Variant.Gvariant); |
function Get_Action_Enabled
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Boolean; |
function Get_Action_Parameter_Type
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant_Type; |
function Get_Action_State
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant; |
function Get_Action_State_Hint
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant; |
function Get_Action_State_Type
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Glib.Variant.Gvariant_Type; |
function Has_Action
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String) return Boolean; |
function List_Actions
( | Self | : Gaction_Group) return GNAT.Strings.String_List; |
function Query_Action
( | Self | : Gaction_Group; |
Action_Name | : UTF8_String; | |
Enabled | : access Boolean; | |
Parameter_Type | : access Glib.Variant.Gvariant_Type; | |
State_Type | : access Glib.Variant.Gvariant_Type; | |
State_Hint | : access Glib.Variant.Gvariant; | |
State | : access Glib.Variant.Gvariant) return Boolean; |
procedure On_Action_Added
( | Self | : Gaction_Group; |
Call | : Cb_Gaction_Group_UTF8_String_Void; | |
After | : Boolean := False); |
procedure On_Action_Added
( | Self | : Gaction_Group; |
Call | : Cb_GObject_UTF8_String_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Action_Enabled_Changed
( | Self | : Gaction_Group; |
Call | : Cb_Gaction_Group_UTF8_String_Boolean_Void; | |
After | : Boolean := False); |
procedure On_Action_Enabled_Changed
( | Self | : Gaction_Group; |
Call | : Cb_GObject_UTF8_String_Boolean_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Action_Removed
( | Self | : Gaction_Group; |
Call | : Cb_Gaction_Group_UTF8_String_Void; | |
After | : Boolean := False); |
procedure On_Action_Removed
( | Self | : Gaction_Group; |
Call | : Cb_GObject_UTF8_String_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
procedure On_Action_State_Changed
( | Self | : Gaction_Group; |
Call | : Cb_Gaction_Group_UTF8_String_Gvariant_Void; | |
After | : Boolean := False); |
procedure On_Action_State_Changed
( | Self | : Gaction_Group; |
Call | : Cb_GObject_UTF8_String_Gvariant_Void; | |
Slot | : not null access Glib.Object.GObject_Record'Class; | |
After | : Boolean := False); |
function "+"
( | W | : Gaction_Group) return Gaction_Group; |
Glib.Action_Group.Gaction_Group represents a group of actions. Actions can be used to expose functionality in a structured way, either from one part of a program to another, or to the outside world. Action groups are often used together with a Glib.Menu_Model.Gmenu_Model that provides additional representation data for displaying the actions to the user, e.g. in a menu.
The main way to interact with the actions in a GActionGroup is to activate them with Glib.Action_Group.Activate_Action. Activating an action may require a Glib.Variant.Gvariant parameter. The required type of the parameter can be inquired with Glib.Action_Group.Get_Action_Parameter_Type.
Actions may be disabled, see Glib.Action_Group.Get_Action_Enabled.
Activating a disabled action has no effect.
Actions may optionally have a state in the form of a Glib.Variant.Gvariant. The current state of an action can be inquired with Glib.Action_Group.Get_Action_State. Activating a stateful action may change its state, but it is also possible to set the state by calling Glib.Action_Group.Change_Action_State.
As typical example, consider a text editing application which has an option to change the current font to 'bold'. A good way to represent this would be a stateful action, with a boolean state. Activating the action would toggle the state.
Each action in the group has a unique name (which is a string). All method calls, except Glib.Action_Group.List_Actions take the name of an action as an argument.
The Glib.Action_Group.Gaction_Group API is meant to be the 'public' API to the action group. The calls here are exactly the interaction that 'external forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have with actions. 'Internal' APIs (ie: ones meant only to be accessed by the action group implementation) are found on subclasses. This is why you will find - for example - Glib.Action_Group.Get_Action_Enabled but not an equivalent <function>set</function> call.
Signals are emitted on the action group in response to state changes on individual actions.
Implementations of Glib.Action_Group.Gaction_Group should provide implementations for the virtual functions Glib.Action_Group.List_Actions and Glib.Action_Group.Query_Action. The other virtual functions should not be implemented - their "wrappers" are actually implemented with calls to Glib.Action_Group.Query_Action.