Main Page - Header
Author: The Inti Development Team

Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# relation.h

Go to the documentation of this file.

    00001 /*  Inti: Integrated Foundation Classes
    00002  *  Copyright (C) 2002-2003 The Inti Development Team.
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU Library General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  */
    00018
    00024
    00025 #ifndef INTI_ATK_RELATION_H
    00026 #define INTI_ATK_RELATION_H
    00027
    00028 #ifndef INTI_G_OBJECT_H
    00029 #include <inti/glib/object.h>
    00030 #endif
    00031
    00032 #ifndef INTI_ATK_UTIL_H
    00033 #include <inti/atk/util.h>
    00034 #endif
    00035
    00036 #ifndef __ATK_RELATION_H__
    00037 #include <atk/atkrelationset.h>
    00038 #endif
    00039
    00040 #ifndef _CPP_VECTOR
    00041 #include <vector>
    00042 #endif
    00043
    00044 namespace Inti {
    00045
    00046 namespace Atk {
    00047
    00048 class Object;
    00049 class RelationClass;
    00050 class RelationSetClass;
    00051
    00058
    00059 class Relation : public G::Object
    00060 {
    00061         friend class G::Object;
    00062         friend class RelationClass;
    00063
    00064         Relation(const Relation&);
    00065         Relation& operator=(const Relation&);
    00066
    00067 protected:
    00070
    00071         explicit Relation(AtkRelation *relation, bool reference = true);
    00078
    00080
    00081 public:
    00084
    00085         Relation(const std::vector<Atk::Object*>& targets, AtkRelationType relationship);
    00090
    00091         virtual ~Relation();
    00093
    00097
    00098         AtkRelation* atk_relation() const { return (AtkRelation*)instance; }
    00100
    00101         AtkRelationClass* atk_relation_class() const;
    00103
    00104         operator AtkRelation* () const;
    00106
    00107         AtkRelationType get_relation_type() const;
    00110
    00111         bool get_target(std::vector<Atk::Object*>& targets) const;
    00115
    00117 };
    00118
    00123
    00124 class RelationSet : public G::Object
    00125 {
    00126         friend class G::Object;
    00127         friend class RelationSetClass;
    00128
    00129         RelationSet(const RelationSet&);
    00130         RelationSet& operator=(const RelationSet&);
    00131
    00132 protected:
    00135
    00136         explicit RelationSet(AtkRelationSet *set, bool reference = true);
    00143
    00145
    00146 public:
    00149
    00150         RelationSet();
    00152
    00153         virtual ~RelationSet();
    00155
    00159
    00160         AtkRelationSet* atk_relation_set() const { return (AtkRelationSet*)instance; }
    00162
    00163         AtkRelationSetClass* atk_relation_set_class() const;
    00165
    00166         operator AtkRelationSet* () const;
    00168
    00169         bool contains(RelationType relationship) const;
    00174
    00175         int get_n_relations() const;
    00178
    00179         Relation* get_relation(int index) const;
    00183
    00184         Relation* get_relation(RelationType relationship) const;
    00188
    00192
    00193         void add(Relation& relation);
    00196
    00197         void remove(Relation& relation);
    00203
    00205 };
    00206
    00207 } // namespace Atk
    00208
    00209 } // namespace Inti
    00210
    00211 #endif // INTI_ATK_RELATION_H
    00212

Main Page - Footer