alternative to assert
[gtkD.git] / src / atk / Action.d
blobacb38ce3903a8ebd2196cedb4cb0bffe5db8a1a8
1 /*
2 * This file is part of duit.
4 * duit 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 * duit 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 duit; 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
26 * outPack = atk
27 * outFile = Action
28 * strct = AtkAction
29 * realStrct=
30 * ctorStrct=
31 * clss = Action
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_action_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module atk.Action;
51 private import atk.atktypes;
53 private import lib.atk;
55 private import glib.Str;
57 /**
58 * Description
59 * AtkAction should be implemented by instances of AtkObject classes with
60 * which the user can interact directly, i.e. buttons, checkboxes,
61 * scrollbars, e.g. components which are not "passive"
62 * providers of UI information.
63 * Exceptions: when the user interaction is already covered by
64 * another appropriate interface such as AtkEditableText (insert/delete
65 * test, etc.) or AtkValue (set value) then these actions should not be
66 * exposed by AtkAction as well.
67 * Also note that the AtkAction API is limited in that parameters may not
68 * be passed to the object being activated; thus the action must be
69 * self-contained and specifiable via only a single "verb". Concrete
70 * examples include "press", "release", "click" for buttons, "drag"
71 * (meaning initiate drag) and "drop" for drag sources and drop targets,
72 * etc.
73 * Though most UI interactions on components should be invocable via
74 * keyboard as well as mouse, there will generally be a close mapping
75 * between "mouse actions" that are possible on a component and the
76 * AtkActions. Where mouse and keyboard actions are redundant in effect,
77 * AtkAction should expose only one action rather than exposing redundant
78 * actions if possible. By convention we have been using "mouse centric"
79 * terminology for AtkAction names.
81 public class Action
84 /** the main Gtk struct */
85 protected AtkAction* atkAction;
88 public AtkAction* getActionStruct()
90 return atkAction;
94 /** the main Gtk struct as a void* */
95 protected void* getStruct()
97 return cast(void*)atkAction;
101 * Sets our main struct and passes it to the parent class
103 public this (AtkAction* atkAction)
105 this.atkAction = atkAction;
113 * Perform the specified action on the object.
114 * action:
115 * a GObject instance that implements AtkActionIface
116 * i:
117 * the action index corresponding to the action to be performed
118 * Returns:
119 * TRUE if success, FALSE otherwise
121 public int doAction(int i)
123 // gboolean atk_action_do_action (AtkAction *action, gint i);
124 return atk_action_do_action(atkAction, i);
128 * Gets the number of accessible actions available on the object.
129 * If there are more than one, the first one is considered the
130 * "default" action of the object.
131 * action:
132 * a GObject instance that implements AtkActionIface
133 * Returns:
134 * a the number of actions, or 0 if action does not
135 * implement this interface.
137 public int getNActions()
139 // gint atk_action_get_n_actions (AtkAction *action);
140 return atk_action_get_n_actions(atkAction);
144 * Returns a description of the specified action of the object.
145 * action:
146 * a GObject instance that implements AtkActionIface
147 * i:
148 * the action index corresponding to the action to be performed
149 * Returns:
150 * a description string, or NULL
151 * if action does not implement this interface.
153 public char[] getDescription(int i)
155 // const gchar* atk_action_get_description (AtkAction *action, gint i);
156 return Str.toString(atk_action_get_description(atkAction, i) );
160 * Returns the name of the specified action of the object.
161 * action:
162 * a GObject instance that implements AtkActionIface
163 * i:
164 * the action index corresponding to the action to be performed
165 * Returns:
166 * a name string, or NULL
167 * if action does not implement this interface.
169 public char[] getName(int i)
171 // const gchar* atk_action_get_name (AtkAction *action, gint i);
172 return Str.toString(atk_action_get_name(atkAction, i) );
176 * Returns the localized name of the specified action of the object.
177 * action:
178 * a GObject instance that implements AtkActionIface
179 * i:
180 * the action index corresponding to the action to be performed
181 * Returns:
182 * a name string, or NULL
183 * if action does not implement this interface.
185 public char[] getLocalizedName(int i)
187 // const gchar* atk_action_get_localized_name (AtkAction *action, gint i);
188 return Str.toString(atk_action_get_localized_name(atkAction, i) );
192 * Returns a keybinding associated with this action, if one exists.
193 * action:
194 * a GObject instance that implements AtkActionIface
195 * i:
196 * the action index corresponding to the action to be performed
197 * Returns:
198 * a string representing the keybinding, or NULL
199 * if there is no keybinding for this action.
201 public char[] getKeybinding(int i)
203 // const gchar* atk_action_get_keybinding (AtkAction *action, gint i);
204 return Str.toString(atk_action_get_keybinding(atkAction, i) );
208 * Sets a description of the specified action of the object.
209 * action:
210 * a GObject instance that implements AtkActionIface
211 * i:
212 * the action index corresponding to the action to be performed
213 * desc:
214 * the description to be assigned to this action
215 * Returns:
216 * a gboolean representing if the description was successfully set;
218 public int setDescription(int i, char[] desc)
220 // gboolean atk_action_set_description (AtkAction *action, gint i, const gchar *desc);
221 return atk_action_set_description(atkAction, i, Str.toStringz(desc));