1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module atk.ActionIF;
26 
27 private import atk.c.functions;
28 public  import atk.c.types;
29 private import glib.Str;
30 public  import gtkc.atktypes;
31 
32 
33 /**
34  * #AtkAction should be implemented by instances of #AtkObject classes
35  * with which the user can interact directly, i.e. buttons,
36  * checkboxes, scrollbars, e.g. components which are not "passive"
37  * providers of UI information.
38  * 
39  * Exceptions: when the user interaction is already covered by another
40  * appropriate interface such as #AtkEditableText (insert/delete text,
41  * etc.) or #AtkValue (set value) then these actions should not be
42  * exposed by #AtkAction as well.
43  * 
44  * Though most UI interactions on components should be invocable via
45  * keyboard as well as mouse, there will generally be a close mapping
46  * between "mouse actions" that are possible on a component and the
47  * AtkActions.  Where mouse and keyboard actions are redundant in
48  * effect, #AtkAction should expose only one action rather than
49  * exposing redundant actions if possible.  By convention we have been
50  * using "mouse centric" terminology for #AtkAction names.
51  */
52 public interface ActionIF{
53 	/** Get the main Gtk struct */
54 	public AtkAction* getActionStruct(bool transferOwnership = false);
55 
56 	/** the main Gtk struct as a void* */
57 	protected void* getStruct();
58 
59 
60 	/** */
61 	public static GType getType()
62 	{
63 		return atk_action_get_type();
64 	}
65 
66 	/**
67 	 * Perform the specified action on the object.
68 	 *
69 	 * Params:
70 	 *     i = the action index corresponding to the action to be performed
71 	 *
72 	 * Returns: %TRUE if success, %FALSE otherwise
73 	 */
74 	public bool doAction(int i);
75 
76 	/**
77 	 * Returns a description of the specified action of the object.
78 	 *
79 	 * Params:
80 	 *     i = the action index corresponding to the action to be performed
81 	 *
82 	 * Returns: a description string, or %NULL if @action does
83 	 *     not implement this interface.
84 	 */
85 	public string getDescription(int i);
86 
87 	/**
88 	 * Gets the keybinding which can be used to activate this action, if one
89 	 * exists. The string returned should contain localized, human-readable,
90 	 * key sequences as they would appear when displayed on screen. It must
91 	 * be in the format "mnemonic;sequence;shortcut".
92 	 *
93 	 * - The mnemonic key activates the object if it is presently enabled onscreen.
94 	 * This typically corresponds to the underlined letter within the widget.
95 	 * Example: "n" in a traditional "New..." menu item or the "a" in "Apply" for
96 	 * a button.
97 	 * - The sequence is the full list of keys which invoke the action even if the
98 	 * relevant element is not currently shown on screen. For instance, for a menu
99 	 * item the sequence is the keybindings used to open the parent menus before
100 	 * invoking. The sequence string is colon-delimited. Example: "Alt+F:N" in a
101 	 * traditional "New..." menu item.
102 	 * - The shortcut, if it exists, will invoke the same action without showing
103 	 * the component or its enclosing menus or dialogs. Example: "Ctrl+N" in a
104 	 * traditional "New..." menu item.
105 	 *
106 	 * Example: For a traditional "New..." menu item, the expected return value
107 	 * would be: "N;Alt+F:N;Ctrl+N" for the English locale and "N;Alt+D:N;Strg+N"
108 	 * for the German locale. If, hypothetically, this menu item lacked a mnemonic,
109 	 * it would be represented by ";;Ctrl+N" and ";;Strg+N" respectively.
110 	 *
111 	 * Params:
112 	 *     i = the action index corresponding to the action to be performed
113 	 *
114 	 * Returns: the keybinding which can be used to activate
115 	 *     this action, or %NULL if there is no keybinding for this action.
116 	 */
117 	public string getKeybinding(int i);
118 
119 	/**
120 	 * Returns the localized name of the specified action of the object.
121 	 *
122 	 * Params:
123 	 *     i = the action index corresponding to the action to be performed
124 	 *
125 	 * Returns: a name string, or %NULL if @action does not
126 	 *     implement this interface.
127 	 */
128 	public string getLocalizedName(int i);
129 
130 	/**
131 	 * Gets the number of accessible actions available on the object.
132 	 * If there are more than one, the first one is considered the
133 	 * "default" action of the object.
134 	 *
135 	 * Returns: a the number of actions, or 0 if @action does not
136 	 *     implement this interface.
137 	 */
138 	public int getNActions();
139 
140 	/**
141 	 * Returns a non-localized string naming the specified action of the
142 	 * object. This name is generally not descriptive of the end result
143 	 * of the action, but instead names the 'interaction type' which the
144 	 * object supports. By convention, the above strings should be used to
145 	 * represent the actions which correspond to the common point-and-click
146 	 * interaction techniques of the same name: i.e.
147 	 * "click", "press", "release", "drag", "drop", "popup", etc.
148 	 * The "popup" action should be used to pop up a context menu for the
149 	 * object, if one exists.
150 	 *
151 	 * For technical reasons, some toolkits cannot guarantee that the
152 	 * reported action is actually 'bound' to a nontrivial user event;
153 	 * i.e. the result of some actions via atk_action_do_action() may be
154 	 * NIL.
155 	 *
156 	 * Params:
157 	 *     i = the action index corresponding to the action to be performed
158 	 *
159 	 * Returns: a name string, or %NULL if @action does not
160 	 *     implement this interface.
161 	 */
162 	public string getName(int i);
163 
164 	/**
165 	 * Sets a description of the specified action of the object.
166 	 *
167 	 * Params:
168 	 *     i = the action index corresponding to the action to be performed
169 	 *     desc = the description to be assigned to this action
170 	 *
171 	 * Returns: a gboolean representing if the description was successfully set;
172 	 */
173 	public bool setDescription(int i, string desc);
174 }