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