alternative to assert
[gtkD.git] / src / atk / StateSet.d
blob647469244b0894ed2f94090f2624cd7bc19be3de
1 /*
2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = atk-AtkStateSet.html
26 * outPack = atk
27 * outFile = StateSet
28 * strct = AtkStateSet
29 * realStrct=
30 * ctorStrct=
31 * clss = StateSet
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_state_set_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module atk.StateSet;
51 private import atk.atktypes;
53 private import lib.atk;
55 private import glib.Str;
57 /**
58 * Description
59 * An AtkStateSet determines a component's state set. It is composed of a set
60 * of AtkStates.
62 public class StateSet
65 /** the main Gtk struct */
66 protected AtkStateSet* atkStateSet;
69 public AtkStateSet* getStateSetStruct()
71 return atkStateSet;
75 /** the main Gtk struct as a void* */
76 protected void* getStruct()
78 return cast(void*)atkStateSet;
81 /**
82 * Sets our main struct and passes it to the parent class
84 public this (AtkStateSet* atkStateSet)
86 this.atkStateSet = atkStateSet;
89 /**
92 /**
93 * Creates a new empty state set.
94 * Returns:
95 * a new AtkStateSet
97 public this ()
99 // AtkStateSet* atk_state_set_new (void);
100 this(cast(AtkStateSet*)atk_state_set_new() );
104 * Checks whether the state set is empty, i.e. has no states set.
105 * set:
106 * an AtkStateType
107 * Returns:
108 * TRUE if set has no states set, otherwise FALSE
110 public int isEmpty()
112 // gboolean atk_state_set_is_empty (AtkStateSet *set);
113 return atk_state_set_is_empty(atkStateSet);
117 * Add a new state for the specified type to the current state set if
118 * it is not already present.
119 * set:
120 * an AtkStateSet
121 * type:
122 * an AtkStateType
123 * Returns:
124 * TRUE if the state for type is not already in set.
126 public int addState(AtkStateType type)
128 // gboolean atk_state_set_add_state (AtkStateSet *set, AtkStateType type);
129 return atk_state_set_add_state(atkStateSet, type);
133 * Add the states for the specified types to the current state set.
134 * set:
135 * an AtkStateSet
136 * types:
137 * an array of AtkStateType
138 * n_types:
139 * The number of elements in the array
141 public void addStates(AtkStateType* types, int nTypes)
143 // void atk_state_set_add_states (AtkStateSet *set, AtkStateType *types, gint n_types);
144 atk_state_set_add_states(atkStateSet, types, nTypes);
148 * Removes all states from the state set.
149 * set:
150 * an AtkStateSet
152 public void clearStates()
154 // void atk_state_set_clear_states (AtkStateSet *set);
155 atk_state_set_clear_states(atkStateSet);
159 * Checks whether the state for the specified type is in the specified set.
160 * set:
161 * an AtkStateSet
162 * type:
163 * an AtkStateType
164 * Returns:
165 * TRUE if type is the state type is in set.
167 public int containsState(AtkStateType type)
169 // gboolean atk_state_set_contains_state (AtkStateSet *set, AtkStateType type);
170 return atk_state_set_contains_state(atkStateSet, type);
174 * Checks whether the states for all the specified types are in the
175 * specified set.
176 * set:
177 * an AtkStateSet
178 * types:
179 * an array of AtkStateType
180 * n_types:
181 * The number of elements in the array
182 * Returns:
183 * TRUE if all the states for type are in set.
185 public int containsStates(AtkStateType* types, int nTypes)
187 // gboolean atk_state_set_contains_states (AtkStateSet *set, AtkStateType *types, gint n_types);
188 return atk_state_set_contains_states(atkStateSet, types, nTypes);
192 * Removes the state for the specified type from the state set.
193 * set:
194 * an AtkStateSet
195 * type:
196 * an AtkType
197 * Returns:
198 * TRUE if type was the state type is in set.
200 public int removeState(AtkStateType type)
202 // gboolean atk_state_set_remove_state (AtkStateSet *set, AtkStateType type);
203 return atk_state_set_remove_state(atkStateSet, type);
207 * Constructs the intersection of the two sets, returning NULL if the
208 * intersection is empty.
209 * set:
210 * an AtkStateSet
211 * compare_set:
212 * another AtkStateSet
213 * Returns:
214 * a new AtkStateSet which is the intersection of the two sets.
216 public AtkStateSet* andSets(AtkStateSet* compareSet)
218 // AtkStateSet* atk_state_set_and_sets (AtkStateSet *set, AtkStateSet *compare_set);
219 return atk_state_set_and_sets(atkStateSet, compareSet);
223 * Constructs the union of the two sets.
224 * set:
225 * an AtkStateSet
226 * compare_set:
227 * another AtkStateSet
228 * Returns:
229 * a new AtkStateSet which is the union of the two sets,
230 * returning NULL is empty.
232 public AtkStateSet* orSets(AtkStateSet* compareSet)
234 // AtkStateSet* atk_state_set_or_sets (AtkStateSet *set, AtkStateSet *compare_set);
235 return atk_state_set_or_sets(atkStateSet, compareSet);
239 * Constructs the exclusive-or of the two sets, returning NULL is empty.
240 * The set returned by this operation contains the states in exactly
241 * one of the two sets.
242 * set:
243 * an AtkStateSet
244 * compare_set:
245 * another AtkStateSet
246 * Returns:
247 * a new AtkStateSet which contains the states which are
248 * in exactly one of the two sets.
250 public AtkStateSet* xorSets(AtkStateSet* compareSet)
252 // AtkStateSet* atk_state_set_xor_sets (AtkStateSet *set, AtkStateSet *compare_set);
253 return atk_state_set_xor_sets(atkStateSet, compareSet);