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