add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / atk / atkmm / relationset.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_RELATIONSET_H
4 #define _ATKMM_RELATIONSET_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* Copyright (C) 1998-2002 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28
29 #include <atkmm/relation.h>
30 #include <atkmm/object.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _AtkRelationSet AtkRelationSet;
35 typedef struct _AtkRelationSetClass AtkRelationSetClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Atk
40 { class RelationSet_Class; } // namespace Atk
41 namespace Atk
42 {
43
44 /** A set of Atk::Relations, normally the set of AtkRelations which an Atk::Object has.
45  */
46
47 class RelationSet : public Glib::Object
48 {
49   
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51
52 public:
53   typedef RelationSet CppObjectType;
54   typedef RelationSet_Class CppClassType;
55   typedef AtkRelationSet BaseObjectType;
56   typedef AtkRelationSetClass BaseClassType;
57
58 private:  friend class RelationSet_Class;
59   static CppClassType relationset_class_;
60
61 private:
62   // noncopyable
63   RelationSet(const RelationSet&);
64   RelationSet& operator=(const RelationSet&);
65
66 protected:
67   explicit RelationSet(const Glib::ConstructParams& construct_params);
68   explicit RelationSet(AtkRelationSet* castitem);
69
70 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
71
72 public:
73   virtual ~RelationSet();
74
75 #ifndef DOXYGEN_SHOULD_SKIP_THIS
76   static GType get_type()      G_GNUC_CONST;
77   static GType get_base_type() G_GNUC_CONST;
78 #endif
79
80   ///Provides access to the underlying C GObject.
81   AtkRelationSet*       gobj()       { return reinterpret_cast<AtkRelationSet*>(gobject_); }
82
83   ///Provides access to the underlying C GObject.
84   const AtkRelationSet* gobj() const { return reinterpret_cast<AtkRelationSet*>(gobject_); }
85
86   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
87   AtkRelationSet* gobj_copy();
88
89 private:
90
91 protected:
92   RelationSet();
93
94 public:
95   
96   static Glib::RefPtr<RelationSet> create();
97
98
99   /** Determines whether the relation set contains a relation that matches the
100    * specified type.
101    * @param relationship An Atk::RelationType.
102    * @return <tt>true</tt> if @a relationship  is the relationship type of a relation
103    * in @a set , <tt>false</tt> otherwise.
104    */
105   bool set_contains(RelationType relationship);
106   
107   /** Removes a relation from the relation set.
108    * This function unref's the Atk::Relation so it will be deleted unless there
109    * is another reference to it.
110    * @param relation An Atk::Relation.
111    */
112   void set_remove(const Glib::RefPtr<Relation>& relation);
113   
114   /** Add a new relation to the current relation set if it is not already
115    * present.
116    * This function ref's the AtkRelation so the caller of this function
117    * should unref it to ensure that it will be destroyed when the AtkRelationSet
118    * is destroyed.
119    * @param relation An Atk::Relation.
120    */
121   void set_add(const Glib::RefPtr<Relation>& relation);
122   
123   /** Determines the number of relations in a relation set.
124    * @return An integer representing the number of relations in the set.
125    */
126   int get_n_relations() const;
127   
128   /** Determines the relation at the specified position in the relation set.
129    * @param i A <tt>int</tt> representing a position in the set, starting from 0.
130    * @return A Atk::Relation, which is the relation at position i in the set.
131    */
132   Glib::RefPtr<Relation> get_relation(gint i);
133   
134   /** Finds a relation that matches the specified type.
135    * @param relationship An Atk::RelationType.
136    * @return An Atk::Relation, which is a relation matching the specified type.
137    */
138   Glib::RefPtr<Relation> get_relation(RelationType relationship);
139   
140   
141   /** Add a new relation of the specified type with the specified target to 
142    * the current relation set if the relation set does not contain a relation
143    * of that type. If it is does contain a relation of that typea the target
144    * is added to the relation.
145    * 
146    * Since: 1.9
147    * @param relationship An Atk::RelationType.
148    * @param target An Atk::Object.
149    */
150   void add_relation_by_type(RelationType relationship, const Glib::RefPtr<Atk::Object>& target);
151
152
153 public:
154
155 public:
156   //C++ methods used to invoke GTK+ virtual functions:
157 #ifdef GLIBMM_VFUNCS_ENABLED
158 #endif //GLIBMM_VFUNCS_ENABLED
159
160 protected:
161   //GTK+ Virtual Functions (override these to change behaviour):
162 #ifdef GLIBMM_VFUNCS_ENABLED
163 #endif //GLIBMM_VFUNCS_ENABLED
164
165   //Default Signal Handlers::
166 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
167 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
168
169
170 };
171
172 } // namespace Atk
173
174
175 namespace Glib
176 {
177   /** A Glib::wrap() method for this object.
178    * 
179    * @param object The C instance.
180    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
181    * @result A C++ instance that wraps this C instance.
182    *
183    * @relates Atk::RelationSet
184    */
185   Glib::RefPtr<Atk::RelationSet> wrap(AtkRelationSet* object, bool take_copy = false);
186 }
187
188
189 #endif /* _ATKMM_RELATIONSET_H */
190