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 gtk.AccessibleT; 26 27 public import gobject.Value; 28 public import gtk.c.functions; 29 public import gtk.c.types; 30 31 32 /** 33 * `GtkAccessible` is an interface for describing UI elements for 34 * Assistive Technologies. 35 * 36 * Every accessible implementation has: 37 * 38 * - a “role”, represented by a value of the [enum@Gtk.AccessibleRole] 39 * enumeration 40 * - an “attribute”, represented by a set of [enum@Gtk.AccessibleState], 41 * [enum@Gtk.AccessibleProperty] and [enum@Gtk.AccessibleRelation] values 42 * 43 * The role cannot be changed after instantiating a `GtkAccessible` 44 * implementation. 45 * 46 * The attributes are updated every time a UI element's state changes in 47 * a way that should be reflected by assistive technologies. For instance, 48 * if a `GtkWidget` visibility changes, the %GTK_ACCESSIBLE_STATE_HIDDEN 49 * state will also change to reflect the [property@Gtk.Widget:visible] property. 50 */ 51 public template AccessibleT(TStruct) 52 { 53 /** Get the main Gtk struct */ 54 public GtkAccessible* getAccessibleStruct(bool transferOwnership = false) 55 { 56 if (transferOwnership) 57 ownedRef = false; 58 return cast(GtkAccessible*)getStruct(); 59 } 60 61 62 /** 63 * Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. 64 * 65 * Returns: a `GtkAccessibleRole` 66 */ 67 public GtkAccessibleRole getAccessibleRole() 68 { 69 return gtk_accessible_get_accessible_role(getAccessibleStruct()); 70 } 71 72 /** 73 * Resets the accessible @property to its default value. 74 * 75 * Params: 76 * property = a `GtkAccessibleProperty` 77 */ 78 public void resetProperty(GtkAccessibleProperty property) 79 { 80 gtk_accessible_reset_property(getAccessibleStruct(), property); 81 } 82 83 /** 84 * Resets the accessible @relation to its default value. 85 * 86 * Params: 87 * relation = a `GtkAccessibleRelation` 88 */ 89 public void resetRelation(GtkAccessibleRelation relation) 90 { 91 gtk_accessible_reset_relation(getAccessibleStruct(), relation); 92 } 93 94 /** 95 * Resets the accessible @state to its default value. 96 * 97 * Params: 98 * state = a `GtkAccessibleState` 99 */ 100 public void resetState(GtkAccessibleState state) 101 { 102 gtk_accessible_reset_state(getAccessibleStruct(), state); 103 } 104 105 /** 106 * Updates an array of accessible properties. 107 * 108 * This function should be called by `GtkWidget` types whenever an accessible 109 * property change must be communicated to assistive technologies. 110 * 111 * This function is meant to be used by language bindings. 112 * 113 * Params: 114 * properties = an array of `GtkAccessibleProperty` 115 * values = an array of `GValues`, one for each property 116 */ 117 public void updatePropertyValue(GtkAccessibleProperty[] properties, Value[] values) 118 { 119 GValue[] valuesArray = new GValue[values.length]; 120 for ( int i = 0; i < values.length; i++ ) 121 { 122 valuesArray[i] = *(values[i].getValueStruct()); 123 } 124 125 gtk_accessible_update_property_value(getAccessibleStruct(), cast(int)values.length, properties.ptr, valuesArray.ptr); 126 } 127 128 /** 129 * Updates an array of accessible relations. 130 * 131 * This function should be called by `GtkWidget` types whenever an accessible 132 * relation change must be communicated to assistive technologies. 133 * 134 * This function is meant to be used by language bindings. 135 * 136 * Params: 137 * relations = an array of `GtkAccessibleRelation` 138 * values = an array of `GValues`, one for each relation 139 */ 140 public void updateRelationValue(GtkAccessibleRelation[] relations, Value[] values) 141 { 142 GValue[] valuesArray = new GValue[values.length]; 143 for ( int i = 0; i < values.length; i++ ) 144 { 145 valuesArray[i] = *(values[i].getValueStruct()); 146 } 147 148 gtk_accessible_update_relation_value(getAccessibleStruct(), cast(int)values.length, relations.ptr, valuesArray.ptr); 149 } 150 151 /** 152 * Updates an array of accessible states. 153 * 154 * This function should be called by `GtkWidget` types whenever an accessible 155 * state change must be communicated to assistive technologies. 156 * 157 * This function is meant to be used by language bindings. 158 * 159 * Params: 160 * states = an array of `GtkAccessibleState` 161 * values = an array of `GValues`, one for each state 162 */ 163 public void updateStateValue(GtkAccessibleState[] states, Value[] values) 164 { 165 GValue[] valuesArray = new GValue[values.length]; 166 for ( int i = 0; i < values.length; i++ ) 167 { 168 valuesArray[i] = *(values[i].getValueStruct()); 169 } 170 171 gtk_accessible_update_state_value(getAccessibleStruct(), cast(int)values.length, states.ptr, valuesArray.ptr); 172 } 173 }