You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

90 lines
3.4 KiB

  1. /* ATK - Accessibility Toolkit
  2. * Copyright 2001 Sun Microsystems Inc.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library 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 GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
  20. #error "Only <atk/atk.h> can be included directly."
  21. #endif
  22. #ifndef __ATK_RELATION_H__
  23. #define __ATK_RELATION_H__
  24. G_BEGIN_DECLS
  25. #include <glib-object.h>
  26. #include <atk/atkrelationtype.h>
  27. /*
  28. * An AtkRelation describes a relation between the object and one or more
  29. * other objects. The actual relations that an object has with other objects
  30. * are defined as an AtkRelationSet, which is a set of AtkRelations.
  31. */
  32. #define ATK_TYPE_RELATION (atk_relation_get_type ())
  33. #define ATK_RELATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_RELATION, AtkRelation))
  34. #define ATK_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATK_TYPE_RELATION, AtkRelationClass))
  35. #define ATK_IS_RELATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_RELATION))
  36. #define ATK_IS_RELATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATK_TYPE_RELATION))
  37. #define ATK_RELATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATK_TYPE_RELATION, AtkRelationClass))
  38. typedef struct _AtkRelation AtkRelation;
  39. typedef struct _AtkRelationClass AtkRelationClass;
  40. struct _AtkRelation
  41. {
  42. GObject parent;
  43. GPtrArray *target;
  44. AtkRelationType relationship;
  45. };
  46. struct _AtkRelationClass
  47. {
  48. GObjectClass parent;
  49. };
  50. GType atk_relation_get_type (void);
  51. AtkRelationType atk_relation_type_register (const gchar *name);
  52. G_CONST_RETURN gchar* atk_relation_type_get_name (AtkRelationType type);
  53. AtkRelationType atk_relation_type_for_name (const gchar *name);
  54. /*
  55. * Create a new relation for the specified key and the specified list
  56. * of targets.
  57. */
  58. AtkRelation* atk_relation_new (AtkObject **targets,
  59. gint n_targets,
  60. AtkRelationType relationship);
  61. /*
  62. * Returns the type of a relation.
  63. */
  64. AtkRelationType atk_relation_get_relation_type (AtkRelation *relation);
  65. /*
  66. * Returns the target list of a relation.
  67. */
  68. GPtrArray* atk_relation_get_target (AtkRelation *relation);
  69. void atk_relation_add_target (AtkRelation *relation,
  70. AtkObject *target);
  71. gboolean atk_relation_remove_target (AtkRelation *relation,
  72. AtkObject *target);
  73. G_END_DECLS
  74. #endif /* __ATK_RELATION_H__ */