add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / atk / atkmm / relation.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_RELATION_H
4 #define _ATKMM_RELATION_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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 typedef struct _AtkRelation AtkRelation;
31 typedef struct _AtkRelationClass AtkRelationClass;
32 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
33
34
35 namespace Atk
36 { class Relation_Class; } // namespace Atk
37 namespace Atk
38 {
39
40
41 /** @addtogroup atkmmEnums Enums and Flags */
42
43 /**
44  * @ingroup atkmmEnums
45  */
46 enum RelationType
47 {
48   RELATION_NULL,
49   RELATION_CONTROLLED_BY,
50   RELATION_CONTROLLER_FOR,
51   RELATION_LABEL_FOR,
52   RELATION_LABELLED_BY,
53   RELATION_MEMBER_OF,
54   RELATION_NODE_CHILD_OF,
55   RELATION_FLOWS_TO,
56   RELATION_FLOWS_FROM,
57   RELATION_SUBWINDOW_OF,
58   RELATION_EMBEDS,
59   RELATION_EMBEDDED_BY,
60   RELATION_POPUP_FOR,
61   RELATION_PARENT_WINDOW_OF,
62   RELATION_LAST_DEFINED
63 };
64
65 } // namespace Atk
66
67
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69 namespace Glib
70 {
71
72 template <>
73 class Value<Atk::RelationType> : public Glib::Value_Enum<Atk::RelationType>
74 {
75 public:
76   static GType value_type() G_GNUC_CONST;
77 };
78
79 } // namespace Glib
80 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
81
82
83 namespace Atk
84 {
85
86
87 class Object;
88
89 /** An Atk::Relation describes a relation between an object and one or more other objects.
90  * The actual relations that an object has with other objects are defined as an Atk::RelationSet,
91  * which is a set of Atk::Relations.
92  */
93
94 class Relation : public Glib::Object
95 {
96   
97 #ifndef DOXYGEN_SHOULD_SKIP_THIS
98
99 public:
100   typedef Relation CppObjectType;
101   typedef Relation_Class CppClassType;
102   typedef AtkRelation BaseObjectType;
103   typedef AtkRelationClass BaseClassType;
104
105 private:  friend class Relation_Class;
106   static CppClassType relation_class_;
107
108 private:
109   // noncopyable
110   Relation(const Relation&);
111   Relation& operator=(const Relation&);
112
113 protected:
114   explicit Relation(const Glib::ConstructParams& construct_params);
115   explicit Relation(AtkRelation* castitem);
116
117 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
118
119 public:
120   virtual ~Relation();
121
122 #ifndef DOXYGEN_SHOULD_SKIP_THIS
123   static GType get_type()      G_GNUC_CONST;
124   static GType get_base_type() G_GNUC_CONST;
125 #endif
126
127   ///Provides access to the underlying C GObject.
128   AtkRelation*       gobj()       { return reinterpret_cast<AtkRelation*>(gobject_); }
129
130   ///Provides access to the underlying C GObject.
131   const AtkRelation* gobj() const { return reinterpret_cast<AtkRelation*>(gobject_); }
132
133   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
134   AtkRelation* gobj_copy();
135
136 private:
137
138
139 protected:
140   explicit Relation(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets,
141                     RelationType relationship);
142
143 public:
144   
145   static Glib::RefPtr<Relation> create(const Glib::ArrayHandle< Glib::RefPtr<Atk::Object> >& targets, RelationType relationship =  RELATION_NULL);
146
147
148   /** Gets the type of @a relation 
149    * @return The type of @a relation .
150    */
151   RelationType get_relation_type() const;
152
153   Glib::ArrayHandle< Glib::RefPtr<Atk::Object> > get_target();
154   Glib::ArrayHandle< Glib::RefPtr<const Atk::Object> > get_target() const;
155   
156   
157   /** Adds the specified AtkObject to the target for the relation, if it is
158    * not already present.
159    * 
160    * Since: 1.9
161    * @param target An Atk::Object.
162    */
163   void add_target(const Glib::RefPtr<Atk::Object>& target);
164
165
166 public:
167
168 public:
169   //C++ methods used to invoke GTK+ virtual functions:
170 #ifdef GLIBMM_VFUNCS_ENABLED
171 #endif //GLIBMM_VFUNCS_ENABLED
172
173 protected:
174   //GTK+ Virtual Functions (override these to change behaviour):
175 #ifdef GLIBMM_VFUNCS_ENABLED
176 #endif //GLIBMM_VFUNCS_ENABLED
177
178   //Default Signal Handlers::
179 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
180 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
181
182
183 };
184
185 } // namespace Atk
186
187
188 namespace Glib
189 {
190   /** A Glib::wrap() method for this object.
191    * 
192    * @param object The C instance.
193    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
194    * @result A C++ instance that wraps this C instance.
195    *
196    * @relates Atk::Relation
197    */
198   Glib::RefPtr<Atk::Relation> wrap(AtkRelation* object, bool take_copy = false);
199 }
200
201
202 #endif /* _ATKMM_RELATION_H */
203