Next: , Previous: Overview, Up: Top


2 AtkAction

The ATK interface provided by UI components which the user can activate/interact with,

2.1 Overview

<atk-action> should be implemented by instances of <atk-object> classes with which the user can interact directly, i.e. buttons, checkboxes, scrollbars, e.g. components which are not "passive" providers of UI information.

Exceptions: when the user interaction is already covered by another appropriate interface such as <atk-editable-text> (insert/delete test, etc.) or <atk-value> (set value) then these actions should not be exposed by <atk-action> as well.

Also note that the <atk-action> API is limited in that parameters may not be passed to the object being activated; thus the action must be self-contained and specifiable via only a single "verb". Concrete examples include "press", "release", "click" for buttons, "drag" (meaning initiate drag) and "drop" for drag sources and drop targets, etc.

Though most UI interactions on components should be invocable via keyboard as well as mouse, there will generally be a close mapping between "mouse actions" that are possible on a component and the AtkActions. Where mouse and keyboard actions are redundant in effect, <atk-action> should expose only one action rather than exposing redundant actions if possible. By convention we have been using "mouse centric" terminology for <atk-action> names.

2.2 Usage

— Class: <atk-action>

Derives from <ginterface>.

This class defines no direct slots.

— Function: atk-action-do-action (self <atk-action>) (int) ⇒  (ret bool)
— Method: do-action

Perform the specified action on the object.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
ret
#t’ if success, ‘#f’ otherwise
— Function: atk-action-get-n-actions (self <atk-action>) ⇒  (ret int)
— Method: get-n-actions

Gets the number of accessible actions available on the object. If there are more than one, the first one is considered the "default" action of the object.

action
a <gobject> instance that implements AtkActionIface
ret
a the number of actions, or 0 if action does not implement this interface.
— Function: atk-action-get-description (self <atk-action>) (int) ⇒  (ret mchars)
— Method: get-description

Returns a description of the specified action of the object.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
ret
a description string, or ‘#f’ if action does not implement this interface.
— Function: atk-action-get-name (self <atk-action>) (int) ⇒  (ret mchars)
— Method: get-name

Returns the name of the specified action of the object.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
ret
a name string, or ‘#f’ if action does not implement this interface.
— Function: atk-action-get-localized-name (self <atk-action>) (int) ⇒  (ret mchars)
— Method: get-localized-name

Returns the localized name of the specified action of the object.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
ret
a name string, or ‘#f’ if action does not implement this interface.
— Function: atk-action-get-keybinding (self <atk-action>) (int) ⇒  (ret mchars)
— Method: get-keybinding

Returns a keybinding associated with this action, if one exists.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
ret
a string representing the keybinding, or ‘#f’ if there is no keybinding for this action.
— Function: atk-action-set-description (self <atk-action>) (int) (desc mchars) ⇒  (ret bool)
— Method: set-description

Sets a description of the specified action of the object.

action
a <gobject> instance that implements AtkActionIface
i
the action index corresponding to the action to be performed
desc
the description to be assigned to this action
ret
a gboolean representing if the description was successfully set;