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