2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkAction.html
56 import tango
.io
.Stdout
; // use the tango loging?
60 private import gtkc
.atktypes
;
62 private import gtkc
.atk
;
65 private import glib
.Str
;
72 * AtkAction should be implemented by instances of AtkObject classes with
73 * which the user can interact directly, i.e. buttons, checkboxes,
74 * scrollbars, e.g. components which are not "passive"
75 * providers of UI information.
76 * Exceptions: when the user interaction is already covered by
77 * another appropriate interface such as AtkEditableText (insert/delete
78 * test, etc.) or AtkValue (set value) then these actions should not be
79 * exposed by AtkAction as well.
80 * Also note that the AtkAction API is limited in that parameters may not
81 * be passed to the object being activated; thus the action must be
82 * self-contained and specifiable via only a single "verb". Concrete
83 * examples include "press", "release", "click" for buttons, "drag"
84 * (meaning initiate drag) and "drop" for drag sources and drop targets,
86 * Though most UI interactions on components should be invocable via
87 * keyboard as well as mouse, there will generally be a close mapping
88 * between "mouse actions" that are possible on a component and the
89 * AtkActions. Where mouse and keyboard actions are redundant in effect,
90 * AtkAction should expose only one action rather than exposing redundant
91 * actions if possible. By convention we have been using "mouse centric"
92 * terminology for AtkAction names.
97 /** the main Gtk struct */
98 protected AtkAction
* atkAction
;
101 public AtkAction
* getActionStruct()
107 /** the main Gtk struct as a void* */
108 protected void* getStruct()
110 return cast(void*)atkAction
;
114 * Sets our main struct and passes it to the parent class
116 public this (AtkAction
* atkAction
)
120 if ( atkAction
is null )
125 Stdout("struct atkAction is null on constructor").newline
;
129 printf("struct atkAction is null on constructor");
136 assert(atkAction
!is null, "struct atkAction is null on constructor");
138 this.atkAction
= atkAction
;
146 * Perform the specified action on the object.
148 * a GObject instance that implements AtkActionIface
150 * the action index corresponding to the action to be performed
152 * TRUE if success, FALSE otherwise
154 public int doAction(int i
)
156 // gboolean atk_action_do_action (AtkAction *action, gint i);
157 return atk_action_do_action(atkAction
, i
);
161 * Gets the number of accessible actions available on the object.
162 * If there are more than one, the first one is considered the
163 * "default" action of the object.
165 * a GObject instance that implements AtkActionIface
167 * a the number of actions, or 0 if action does not
168 * implement this interface.
170 public int getNActions()
172 // gint atk_action_get_n_actions (AtkAction *action);
173 return atk_action_get_n_actions(atkAction
);
177 * Returns a description of the specified action of the object.
179 * a GObject instance that implements AtkActionIface
181 * the action index corresponding to the action to be performed
183 * a description string, or NULL
184 * if action does not implement this interface.
186 public char[] getDescription(int i
)
188 // const gchar* atk_action_get_description (AtkAction *action, gint i);
189 return Str
.toString(atk_action_get_description(atkAction
, i
) );
193 * Returns a non-localized string naming the specified action of the
194 * object. This name is generally not descriptive of the end result
195 * of the action, but instead names the 'interaction type' which the
196 * object supports. By convention, the above strings should be used to
197 * represent the actions which correspond to the common point-and-click
198 * interaction techniques of the same name: i.e.
199 * "click", "press", "release", "drag", "drop", "popup", etc.
200 * The "popup" action should be used to pop up a context menu for the
201 * object, if one exists.
202 * For technical reasons, some toolkits cannot guarantee that the
203 * reported action is actually 'bound' to a nontrivial user event;
204 * i.e. the result of some actions via atk_action_do_action() may be
207 * a GObject instance that implements AtkActionIface
209 * the action index corresponding to the action to be performed
211 * a name string, or NULL
212 * if action does not implement this interface.
214 public char[] getName(int i
)
216 // const gchar* atk_action_get_name (AtkAction *action, gint i);
217 return Str
.toString(atk_action_get_name(atkAction
, i
) );
221 * Returns the localized name of the specified action of the object.
223 * a GObject instance that implements AtkActionIface
225 * the action index corresponding to the action to be performed
227 * a name string, or NULL
228 * if action does not implement this interface.
230 public char[] getLocalizedName(int i
)
232 // const gchar* atk_action_get_localized_name (AtkAction *action, gint i);
233 return Str
.toString(atk_action_get_localized_name(atkAction
, i
) );
237 * Returns a keybinding associated with this action, if one exists.
238 * The returned string is in the format "<a>;<b>;<c>"
239 * (i.e. semicolon-delimited), where <a> is the keybinding which
240 * activates the object if it is presently enabled onscreen,
241 * <b> corresponds to the keybinding or sequence of keys
242 * which invokes the action even if the relevant element is not
243 * currently posted on screen (for instance, for a menu item it
244 * posts the parent menus before invoking). The last token in the
245 * above string, if non-empty, represents a keyboard shortcut which
246 * invokes the same action without posting the component or its
247 * enclosing menus or dialogs.
249 * a GObject instance that implements AtkActionIface
251 * the action index corresponding to the action to be performed
253 * a string representing the available keybindings, or NULL
254 * if there is no keybinding for this action.
256 public char[] getKeybinding(int i
)
258 // const gchar* atk_action_get_keybinding (AtkAction *action, gint i);
259 return Str
.toString(atk_action_get_keybinding(atkAction
, i
) );
263 * Sets a description of the specified action of the object.
265 * a GObject instance that implements AtkActionIface
267 * the action index corresponding to the action to be performed
269 * the description to be assigned to this action
271 * a gboolean representing if the description was successfully set;
273 public int setDescription(int i
, char[] desc
)
275 // gboolean atk_action_set_description (AtkAction *action, gint i, const gchar *desc);
276 return atk_action_set_description(atkAction
, i
, Str
.toStringz(desc
));