alternative to assert
[gtkD.git] / gtkD / src / atk / RelationSet.d
blob46944a325e19a6a5611a41fc81524f0241e33b50
1 /*
2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = AtkRelationSet.html
26 * outPack = atk
27 * outFile = RelationSet
28 * strct = AtkRelationSet
29 * realStrct=
30 * ctorStrct=
31 * clss = RelationSet
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_relationSet_
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.PtrArray
45 * structWrap:
46 * - GPtrArray* -> PtrArray
47 * module aliases:
48 * local aliases:
51 module atk.RelationSet;
53 version(noAssert)
55 version(Tango)
57 import tango.io.Stdout; // use the tango loging?
61 private import gtkc.atktypes;
63 private import gtkc.atk;
66 private import glib.PtrArray;
71 /**
72 * Description
73 * The AtkRelationSet held by an object establishes its relationships with
74 * objects beyond the normal "parent/child" hierarchical relationships that all
75 * user interface objects have. AtkRelationSets establish whether objects are
76 * labelled or controlled by other components, share group membership with other
77 * components (for instance within a radio-button group), or share content which
78 * "flows" between them, among other types of possible relationships.
80 private import gobject.ObjectG;
81 public class RelationSet : ObjectG
84 /** the main Gtk struct */
85 protected AtkRelationSet* atkRelationSet;
88 public AtkRelationSet* getRelationSetStruct()
90 return atkRelationSet;
94 /** the main Gtk struct as a void* */
95 protected void* getStruct()
97 return cast(void*)atkRelationSet;
101 * Sets our main struct and passes it to the parent class
103 public this (AtkRelationSet* atkRelationSet)
105 version(noAssert)
107 if ( atkRelationSet is null )
109 int zero = 0;
110 version(Tango)
112 Stdout("struct atkRelationSet is null on constructor").newline;
114 else
116 printf("struct atkRelationSet is null on constructor");
118 zero = zero / zero;
121 else
123 assert(atkRelationSet !is null, "struct atkRelationSet is null on constructor");
125 super(cast(GObject*)atkRelationSet);
126 this.atkRelationSet = atkRelationSet;
134 * Creates a new empty relation set.
135 * Returns:
136 * a new AtkRelationSet
138 public static AtkRelationSet* atkRelationSetNew()
140 // AtkRelationSet* atk_relation_set_new (void);
141 return atk_relation_set_new();
145 * Determines whether the relation set contains a relation that matches the
146 * specified type.
147 * set:
148 * an AtkRelationSet
149 * relationship:
150 * an AtkRelationType
151 * Returns:
152 * TRUE if relationship is the relationship type of a relation
153 * in set, FALSE otherwise
155 public int atkRelationSetContains(AtkRelationType relationship)
157 // gboolean atk_relation_set_contains (AtkRelationSet *set, AtkRelationType relationship);
158 return atk_relation_set_contains(atkRelationSet, relationship);
162 * Removes a relation from the relation set.
163 * This function unref's the AtkRelation so it will be deleted unless there
164 * is another reference to it.
165 * set:
166 * an AtkRelationSet
167 * relation:
168 * an AtkRelation
170 public void atkRelationSetRemove(AtkRelation* relation)
172 // void atk_relation_set_remove (AtkRelationSet *set, AtkRelation *relation);
173 atk_relation_set_remove(atkRelationSet, relation);
177 * Add a new relation to the current relation set if it is not already
178 * present.
179 * This function ref's the AtkRelation so the caller of this function
180 * should unref it to ensure that it will be destroyed when the AtkRelationSet
181 * is destroyed.
182 * set:
183 * an AtkRelationSet
184 * relation:
185 * an AtkRelation
187 public void atkRelationSetAdd(AtkRelation* relation)
189 // void atk_relation_set_add (AtkRelationSet *set, AtkRelation *relation);
190 atk_relation_set_add(atkRelationSet, relation);
194 * Determines the number of relations in a relation set.
195 * set:
196 * an AtkRelationSet
197 * Returns:
198 * an integer representing the number of relations in the set.
200 public int atkRelationSetGetNRelations()
202 // gint atk_relation_set_get_n_relations (AtkRelationSet *set);
203 return atk_relation_set_get_n_relations(atkRelationSet);
207 * Determines the relation at the specified position in the relation set.
208 * set:
209 * an AtkRelationSet
210 * i:
211 * a gint representing a position in the set, starting from 0.
212 * Returns:
213 * a AtkRelation, which is the relation at position i in the set.
215 public AtkRelation* atkRelationSetGetRelation(int i)
217 // AtkRelation* atk_relation_set_get_relation (AtkRelationSet *set, gint i);
218 return atk_relation_set_get_relation(atkRelationSet, i);
222 * Finds a relation that matches the specified type.
223 * set:
224 * an AtkRelationSet
225 * relationship:
226 * an AtkRelationType
227 * Returns:
228 * an AtkRelation, which is a relation matching the specified type.
230 public AtkRelation* atkRelationSetGetRelationByType(AtkRelationType relationship)
232 // AtkRelation* atk_relation_set_get_relation_by_type (AtkRelationSet *set, AtkRelationType relationship);
233 return atk_relation_set_get_relation_by_type(atkRelationSet, relationship);
237 * Add a new relation of the specified type with the specified target to
238 * the current relation set if the relation set does not contain a relation
239 * of that type. If it is does contain a relation of that typea the target
240 * is added to the relation.
241 * set:
242 * an AtkRelationSet
243 * relationship:
244 * an AtkRelationType
245 * target:
246 * an AtkObject
247 * Since ATK 1.9
249 public void atkRelationSetAddRelationByType(AtkRelationType relationship, AtkObject* target)
251 // void atk_relation_set_add_relation_by_type (AtkRelationSet *set, AtkRelationType relationship, AtkObject *target);
252 atk_relation_set_add_relation_by_type(atkRelationSet, relationship, target);