michael@0: /* ATK - Accessibility Toolkit michael@0: * Copyright 2001 Sun Microsystems Inc. michael@0: * michael@0: * This library is free software; you can redistribute it and/or michael@0: * modify it under the terms of the GNU Library General Public michael@0: * License as published by the Free Software Foundation; either michael@0: * version 2 of the License, or (at your option) any later version. michael@0: * michael@0: * This library is distributed in the hope that it will be useful, michael@0: * but WITHOUT ANY WARRANTY; without even the implied warranty of michael@0: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU michael@0: * Library General Public License for more details. michael@0: * michael@0: * You should have received a copy of the GNU Library General Public michael@0: * License along with this library; if not, write to the michael@0: * Free Software Foundation, Inc., 59 Temple Place - Suite 330, michael@0: * Boston, MA 02111-1307, USA. michael@0: */ michael@0: michael@0: #ifndef __ATK_RELATION_H__ michael@0: #define __ATK_RELATION_H__ michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif /* __cplusplus */ michael@0: michael@0: #include michael@0: #include michael@0: michael@0: /* michael@0: * An AtkRelation describes a relation between the object and one or more michael@0: * other objects. The actual relations that an object has with other objects michael@0: * are defined as an AtkRelationSet, which is a set of AtkRelations. michael@0: */ michael@0: michael@0: #define ATK_TYPE_RELATION (atk_relation_get_type ()) michael@0: #define ATK_RELATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_RELATION, AtkRelation)) michael@0: #define ATK_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_RELATION, AtkRelationClass)) michael@0: #define ATK_IS_RELATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_RELATION)) michael@0: #define ATK_IS_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_RELATION)) michael@0: #define ATK_RELATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_RELATION, AtkRelationClass)) michael@0: michael@0: typedef struct _AtkRelation AtkRelation; michael@0: typedef struct _AtkRelationClass AtkRelationClass; michael@0: michael@0: struct _AtkRelation michael@0: { michael@0: GObject parent; michael@0: michael@0: GPtrArray *target; michael@0: AtkRelationType relationship; michael@0: }; michael@0: michael@0: struct _AtkRelationClass michael@0: { michael@0: GObjectClass parent; michael@0: }; michael@0: michael@0: GType atk_relation_get_type (void); michael@0: michael@0: AtkRelationType atk_relation_type_register (const gchar *name); michael@0: G_CONST_RETURN gchar* atk_relation_type_get_name (AtkRelationType type); michael@0: AtkRelationType atk_relation_type_for_name (const gchar *name); michael@0: michael@0: /* michael@0: * Create a new relation for the specified key and the specified list michael@0: * of targets. michael@0: */ michael@0: AtkRelation* atk_relation_new (AtkObject **targets, michael@0: gint n_targets, michael@0: AtkRelationType relationship); michael@0: /* michael@0: * Returns the type of a relation. michael@0: */ michael@0: AtkRelationType atk_relation_get_relation_type (AtkRelation *relation); michael@0: /* michael@0: * Returns the target list of a relation. michael@0: */ michael@0: GPtrArray* atk_relation_get_target (AtkRelation *relation); michael@0: void atk_relation_add_target (AtkRelation *relation, michael@0: AtkObject *target); michael@0: michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif /* __cplusplus */ michael@0: michael@0: #endif /* __ATK_RELATION_H__ */