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 glib.Str; 28 private import gtkc.atk; 29 public import gtkc.atktypes; 30 31 32 /** 33 * #AtkAction should be implemented by instances of #AtkObject classes 34 * with which the user can interact directly, i.e. buttons, 35 * checkboxes, scrollbars, e.g. components which are not "passive" 36 * providers of UI information. 37 * 38 * Exceptions: when the user interaction is already covered by another 39 * appropriate interface such as #AtkEditableText (insert/delete text, 40 * etc.) or #AtkValue (set value) then these actions should not be 41 * exposed by #AtkAction as well. 42 * 43 * Though most UI interactions on components should be invocable via 44 * keyboard as well as mouse, there will generally be a close mapping 45 * between "mouse actions" that are possible on a component and the 46 * AtkActions. Where mouse and keyboard actions are redundant in 47 * effect, #AtkAction should expose only one action rather than 48 * exposing redundant actions if possible. By convention we have been 49 * using "mouse centric" terminology for #AtkAction names. 50 */ 51 public interface ActionIF{ 52 /** Get the main Gtk struct */ 53 public AtkAction* getActionStruct(); 54 55 /** the main Gtk struct as a void* */ 56 protected void* getStruct(); 57 58 59 /** 60 * Perform the specified action on the object. 61 * 62 * Params: 63 * i = the action index corresponding to the action to be performed 64 * 65 * Return: %TRUE if success, %FALSE otherwise 66 */ 67 public bool doAction(int i); 68 69 /** 70 * Returns a description of the specified action of the object. 71 * 72 * Params: 73 * i = the action index corresponding to the action to be performed 74 * 75 * Return: a description string, or %NULL if @action does 76 * not implement this interface. 77 */ 78 public string getDescription(int i); 79 80 /** 81 * Gets the keybinding which can be used to activate this action, if one 82 * exists. The string returned should contain localized, human-readable, 83 * key sequences as they would appear when displayed on screen. It must 84 * be in the format "mnemonic;sequence;shortcut". 85 * 86 * - The mnemonic key activates the object if it is presently enabled onscreen. 87 * This typically corresponds to the underlined letter within the widget. 88 * Example: "n" in a traditional "New..." menu item or the "a" in "Apply" for 89 * a button. 90 * - The sequence is the full list of keys which invoke the action even if the 91 * relevant element is not currently shown on screen. For instance, for a menu 92 * item the sequence is the keybindings used to open the parent menus before 93 * invoking. The sequence string is colon-delimited. Example: "Alt+F:N" in a 94 * traditional "New..." menu item. 95 * - The shortcut, if it exists, will invoke the same action without showing 96 * the component or its enclosing menus or dialogs. Example: "Ctrl+N" in a 97 * traditional "New..." menu item. 98 * 99 * Example: For a traditional "New..." menu item, the expected return value 100 * would be: "N;Alt+F:N;Ctrl+N" for the English locale and "N;Alt+D:N;Strg+N" 101 * for the German locale. If, hypothetically, this menu item lacked a mnemonic, 102 * it would be represented by ";;Ctrl+N" and ";;Strg+N" respectively. 103 * 104 * Params: 105 * i = the action index corresponding to the action to be performed 106 * 107 * Return: the keybinding which can be used to activate 108 * this action, or %NULL if there is no keybinding for this action. 109 */ 110 public string getKeybinding(int i); 111 112 /** 113 * Returns the localized name of the specified action of the object. 114 * 115 * Params: 116 * i = the action index corresponding to the action to be performed 117 * 118 * Return: a name string, or %NULL if @action does not 119 * implement this interface. 120 */ 121 public string getLocalizedName(int i); 122 123 /** 124 * Gets the number of accessible actions available on the object. 125 * If there are more than one, the first one is considered the 126 * "default" action of the object. 127 * 128 * Return: a the number of actions, or 0 if @action does not 129 * implement this interface. 130 */ 131 public int getNActions(); 132 133 /** 134 * Returns a non-localized string naming the specified action of the 135 * object. This name is generally not descriptive of the end result 136 * of the action, but instead names the 'interaction type' which the 137 * object supports. By convention, the above strings should be used to 138 * represent the actions which correspond to the common point-and-click 139 * interaction techniques of the same name: i.e. 140 * "click", "press", "release", "drag", "drop", "popup", etc. 141 * The "popup" action should be used to pop up a context menu for the 142 * object, if one exists. 143 * 144 * For technical reasons, some toolkits cannot guarantee that the 145 * reported action is actually 'bound' to a nontrivial user event; 146 * i.e. the result of some actions via atk_action_do_action() may be 147 * NIL. 148 * 149 * Params: 150 * i = the action index corresponding to the action to be performed 151 * 152 * Return: a name string, or %NULL if @action does not 153 * implement this interface. 154 */ 155 public string getName(int i); 156 157 /** 158 * Sets a description of the specified action of the object. 159 * 160 * Params: 161 * i = the action index corresponding to the action to be performed 162 * desc = the description to be assigned to this action 163 * 164 * Return: a gboolean representing if the description was successfully set; 165 */ 166 public bool setDescription(int i, string desc); 167 }