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.ComponentIF; 26 27 private import atk.ObjectAtk; 28 private import atk.Rectangle; 29 private import atk.c.functions; 30 public import atk.c.types; 31 private import gobject.ObjectG; 32 private import gobject.Signals; 33 private import std.algorithm; 34 35 36 /** 37 * #AtkComponent should be implemented by most if not all UI elements 38 * with an actual on-screen presence, i.e. components which can be 39 * said to have a screen-coordinate bounding box. Virtually all 40 * widgets will need to have #AtkComponent implementations provided 41 * for their corresponding #AtkObject class. In short, only UI 42 * elements which are *not* GUI elements will omit this ATK interface. 43 * 44 * A possible exception might be textual information with a 45 * transparent background, in which case text glyph bounding box 46 * information is provided by #AtkText. 47 */ 48 public interface ComponentIF{ 49 /** Get the main Gtk struct */ 50 public AtkComponent* getComponentStruct(bool transferOwnership = false); 51 52 /** the main Gtk struct as a void* */ 53 protected void* getStruct(); 54 55 56 /** */ 57 public static GType getType() 58 { 59 return atk_component_get_type(); 60 } 61 62 /** 63 * Add the specified handler to the set of functions to be called 64 * when this object receives focus events (in or out). If the handler is 65 * already added it is not added again 66 * 67 * Deprecated: If you need to track when an object gains or 68 * lose the focus, use the #AtkObject::state-change "focused" notification instead. 69 * 70 * Params: 71 * handler = The #AtkFocusHandler to be attached to @component 72 * 73 * Returns: a handler id which can be used in atk_component_remove_focus_handler() 74 * or zero if the handler was already added. 75 */ 76 public uint addFocusHandler(AtkFocusHandler handler); 77 78 /** 79 * Checks whether the specified point is within the extent of the @component. 80 * 81 * Toolkit implementor note: ATK provides a default implementation for 82 * this virtual method. In general there are little reason to 83 * re-implement it. 84 * 85 * Params: 86 * x = x coordinate 87 * y = y coordinate 88 * coordType = specifies whether the coordinates are relative to the screen 89 * or to the components top level window 90 * 91 * Returns: %TRUE or %FALSE indicating whether the specified point is within 92 * the extent of the @component or not 93 */ 94 public bool contains(int x, int y, AtkCoordType coordType); 95 96 /** 97 * Returns the alpha value (i.e. the opacity) for this 98 * @component, on a scale from 0 (fully transparent) to 1.0 99 * (fully opaque). 100 * 101 * Returns: An alpha value from 0 to 1.0, inclusive. 102 * 103 * Since: 1.12 104 */ 105 public double getAlpha(); 106 107 /** 108 * Gets the rectangle which gives the extent of the @component. 109 * 110 * If the extent can not be obtained (e.g. a non-embedded plug or missing 111 * support), all of x, y, width, height are set to -1. 112 * 113 * Params: 114 * x = address of #gint to put x coordinate 115 * y = address of #gint to put y coordinate 116 * width = address of #gint to put width 117 * height = address of #gint to put height 118 * coordType = specifies whether the coordinates are relative to the screen 119 * or to the components top level window 120 */ 121 public void getExtents(out int x, out int y, out int width, out int height, AtkCoordType coordType); 122 123 /** 124 * Gets the layer of the component. 125 * 126 * Returns: an #AtkLayer which is the layer of the component 127 */ 128 public AtkLayer getLayer(); 129 130 /** 131 * Gets the zorder of the component. The value G_MININT will be returned 132 * if the layer of the component is not ATK_LAYER_MDI or ATK_LAYER_WINDOW. 133 * 134 * Returns: a gint which is the zorder of the component, i.e. the depth at 135 * which the component is shown in relation to other components in the same 136 * container. 137 */ 138 public int getMdiZorder(); 139 140 /** 141 * Gets the position of @component in the form of 142 * a point specifying @component's top-left corner. 143 * 144 * If the position can not be obtained (e.g. a non-embedded plug or missing 145 * support), x and y are set to -1. 146 * 147 * Deprecated: Since 2.12. Use atk_component_get_extents() instead. 148 * 149 * Params: 150 * x = address of #gint to put x coordinate position 151 * y = address of #gint to put y coordinate position 152 * coordType = specifies whether the coordinates are relative to the screen 153 * or to the components top level window 154 */ 155 public void getPosition(out int x, out int y, AtkCoordType coordType); 156 157 /** 158 * Gets the size of the @component in terms of width and height. 159 * 160 * If the size can not be obtained (e.g. a non-embedded plug or missing 161 * support), width and height are set to -1. 162 * 163 * Deprecated: Since 2.12. Use atk_component_get_extents() instead. 164 * 165 * Params: 166 * width = address of #gint to put width of @component 167 * height = address of #gint to put height of @component 168 */ 169 public void getSize(out int width, out int height); 170 171 /** 172 * Grabs focus for this @component. 173 * 174 * Returns: %TRUE if successful, %FALSE otherwise. 175 */ 176 public bool grabFocus(); 177 178 /** 179 * Gets a reference to the accessible child, if one exists, at the 180 * coordinate point specified by @x and @y. 181 * 182 * Params: 183 * x = x coordinate 184 * y = y coordinate 185 * coordType = specifies whether the coordinates are relative to the screen 186 * or to the components top level window 187 * 188 * Returns: a reference to the accessible 189 * child, if one exists 190 */ 191 public ObjectAtk refAccessibleAtPoint(int x, int y, AtkCoordType coordType); 192 193 /** 194 * Remove the handler specified by @handler_id from the list of 195 * functions to be executed when this object receives focus events 196 * (in or out). 197 * 198 * Deprecated: If you need to track when an object gains or 199 * lose the focus, use the #AtkObject::state-change "focused" notification instead. 200 * 201 * Params: 202 * handlerId = the handler id of the focus handler to be removed 203 * from @component 204 */ 205 public void removeFocusHandler(uint handlerId); 206 207 /** 208 * Makes @component visible on the screen by scrolling all necessary parents. 209 * 210 * Contrary to atk_component_set_position, this does not actually move 211 * @component in its parent, this only makes the parents scroll so that the 212 * object shows up on the screen, given its current position within the parents. 213 * 214 * Params: 215 * type = specify where the object should be made visible. 216 * 217 * Returns: whether scrolling was successful. 218 * 219 * Since: 2.30 220 */ 221 public bool scrollTo(AtkScrollType type); 222 223 /** 224 * Move the top-left of @component to a given position of the screen by 225 * scrolling all necessary parents. 226 * 227 * Params: 228 * coords = specify whether coordinates are relative to the screen or to the 229 * parent object. 230 * x = x-position where to scroll to 231 * y = y-position where to scroll to 232 * 233 * Returns: whether scrolling was successful. 234 * 235 * Since: 2.30 236 */ 237 public bool scrollToPoint(AtkCoordType coords, int x, int y); 238 239 /** 240 * Sets the extents of @component. 241 * 242 * Params: 243 * x = x coordinate 244 * y = y coordinate 245 * width = width to set for @component 246 * height = height to set for @component 247 * coordType = specifies whether the coordinates are relative to the screen 248 * or to the components top level window 249 * 250 * Returns: %TRUE or %FALSE whether the extents were set or not 251 */ 252 public bool setExtents(int x, int y, int width, int height, AtkCoordType coordType); 253 254 /** 255 * Sets the position of @component. 256 * 257 * Contrary to atk_component_scroll_to, this does not trigger any scrolling, 258 * this just moves @component in its parent. 259 * 260 * Params: 261 * x = x coordinate 262 * y = y coordinate 263 * coordType = specifies whether the coordinates are relative to the screen 264 * or to the component's top level window 265 * 266 * Returns: %TRUE or %FALSE whether or not the position was set or not 267 */ 268 public bool setPosition(int x, int y, AtkCoordType coordType); 269 270 /** 271 * Set the size of the @component in terms of width and height. 272 * 273 * Params: 274 * width = width to set for @component 275 * height = height to set for @component 276 * 277 * Returns: %TRUE or %FALSE whether the size was set or not 278 */ 279 public bool setSize(int width, int height); 280 281 /** 282 * The 'bounds-changed" signal is emitted when the bposition or 283 * size of the component changes. 284 * 285 * Params: 286 * arg1 = The AtkRectangle giving the new position and size. 287 */ 288 gulong addOnBoundsChanged(void delegate(Rectangle, ComponentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0); 289 }