summaryrefslogtreecommitdiff
path: root/idl/Accessibility_Accessible.idl
blob: ac56f68f7d81a553b51e6c3815a23b8df5b84626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
/* 
 * AT-SPI - Assistive Technology Service Provider Interface 
 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
 *
 * Copyright 2001 Sun Microsystems Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef _ACCESSIBILITY_ACCESSIBLE_IDL
#define _ACCESSIBILITY_ACCESSIBLE_IDL

#include "Accessibility_Relation.idl"
#include "Accessibility_State.idl"
#include "Accessibility_Role.idl"

module Accessibility {
  
  /** used by Text and Document: these correspond to the POSIX setlocale() enum values. **/
  enum LOCALE_TYPE {
      LOCALE_TYPE_MESSAGES,
      LOCALE_TYPE_COLLATE,
      LOCALE_TYPE_CTYPE,
      LOCALE_TYPE_MONETARY,
      LOCALE_TYPE_NUMERIC,
      LOCALE_TYPE_TIME
  };

    /** A list of Relations, which may be many-to-many. */
  typedef sequence<Relation> RelationSet;

    /** 
     * A list of name-value pairs, returned as a sequence of strings; 
     * the name and value are separated by a colon. 
     * @note "Attributes" returned in AttributeSet lists are distinct from, 
     * and should not be confused with, "attribute" members of interfaces
     * as defined by the IDL "attribute" keyword.  IDL attributes are
     * strongly-typed values which are individually obtained via
     * language-specific bindings whose syntax is dictated by the OMG's
     * IDL language bindings.  For instance using the C language,
     * the "Accessible::name" attribute is queried using
     * \c Accessibility_Accessible__get_name (obj, &ev);
     * Name-value pairs associated with Accessible instances are not
     * normally redundant with these IDL attributes, i.e. there is no
     * "accessible-name" attribute in the AttributeSet returned from
     * Accessible::getAttributes().
     *
     * Where possible, the names and values in the name-value pairs
     * should be chosen from well-established attribute namespaces
     * using standard semantics.  For example, metadata namespace and
     * values should be chosen from the 'Dublin Core' Metadata
     * namespace using Dublin Core semantics:
     * http://dublincore.org/dcregistry/
     * Similarly, relevant structural metadata should be exposed
     * using attribute names and values chosen from the CSS2 and WICD specification:
     * http://www.w3.org/TR/1998/REC-CSS2-19980512
     * WICD (http://www.w3.org/TR/2005/WD-WICD-20051121/).
     * 
     * Finally, note that typographic, semantic, and presentational annotations which
     * are associated with text content, in particular which are associated with particular
     * text ranges, should be exposed via Accessibility::Text::getAttributeRun instead of
     * via these more general 'Object attributes'.
     *
     * @since AT-SPI 1.7.0
     */
  typedef sequence<string> AttributeSet;

    /** 
     * A list of accessible roles 
     * @since AT-SPI 1.7.0
     **/
  typedef sequence<Role> RoleSet;

    /** Used by Component and Text, a struct defining a bounding rectangle. 
     * The relevant coordinate system is determined by the context of the
     * API call which returned or receives the value.
     */
  struct BoundingBox {
          long x; /**< the value corresponding to the minimum or leftmost x position. */
          long y; /**< the value corresponding to the minimum y value.  */
          long width; /**< the horizontal extent of the bounding box,
		       * that is, the difference between the maximum and minimum
		       * x coordinate bounds.
		       */
          long height; /**< the vertical extent of the bounding box, 
			* that is, the difference between the maximum and minimum
			* y coordinate bounds.
			*/
  };

    
  interface Application; /**< defined in Accessibility_Application.idl **/

  /** 
   * The base interface which is implemented by all accessible objects. 
   * All objects support interfaces for querying their contained 'children' 
   * and position in the accessible-object hierarchy, whether or not they
   * actually have children.
   *
   * @note Events that may be emitted by instances of Accessible include:
   * \li \c "object:property-change" A base (strongly-typed) object attribute has changed,
   *         for instance "object:property-change:accessible-name".
   *         Notifed property subtypes include accessible-name, accessible-description,
   *         and accessible-parent. 
   *
   * \li \c "object:children-changed" The number or identity of an object's children
   *         has changed.
   * \li \c "object:state-changed" The object's StateSet has had a state added
   *         or removed.
   * \li \c "object:active-descendant-changed" If the object includes 
   *         STATE_MANAGES_DESCENDANTS, this event is fired to indicate that the 
   *         descendant having STATE_ACTIVE has changed; this corresponds to
   *         "micro" keyboard focus when the containing/emitting object has
   *         "macro" or technical keyboard focus.  For instance, this event is
   *         usually emitted while traversing tables and/or spreadsheet cells.
   * \li \c "object:attribute-change" A weakly-typed property, as contained in the
   *         AttributeSet returned by Accessible::getAttributes, has changed in value,
   *         been added, or been removed from the object.
   *         ("object:attribute-change" notifications were added in AT-SPI 1.7.0)
   */
  interface Accessible : Bonobo::Unknown {

    /**
     * a (short) \c string representing the object's name.
     **/
    attribute string name;

    /**
     * a \c string describing the object in more detail than \a name.
     **/
    attribute string description;

    /**
     * an ::Accessible object which is this object's containing object.
     **/
    readonly attribute Accessibility::Accessible parent;

    /**
     * childCount: the number of children contained by this object.
     **/
    readonly attribute long    	childCount;

    /**
     * Determine whether an ::Accessible refers to the same object as another.
     * This method should be used rather than brute-force comparison of
     * object references (i.e. "by-value" comparison), as two object references
     * may have different apparent values yet refer to the same object.
     *
     * @param obj: an ::Accessible object reference to compare to
     * @returns: a \c boolean indicating whether the two object references
     *         point to the same object. 
     **/
    boolean isEqual (in Accessible obj);

    /**
     * Get the accessible child of this object at \c index.
     * @param index: an in parameter indicating which child is requested (zero-indexed).
     * @returns: the 'nth' ::Accessible child of this object.
     **/
    Accessible 	getChildAtIndex (in long index);

    /**
     * Get the index of this object in its parent's child list.
     * @returns: a long integer indicating this object's index in the parent's list.
     **/
    long		getIndexInParent ();

    /**
     * Get a set defining this object's relationship to other accessible objects.
     * @returns: a ::RelationSet defining this object's relationships.
     **/
    RelationSet	getRelationSet ();

    /**
     * Get the ::Role indicating the type of UI role played by this object.
     *
     * @returns: a ::Role indicating the type of UI role played by this object.
     **/
    Role		getRole ();

    /**
     * Get a string indicating the type of UI role played by this object.
     *
     * @returns: a UTF-8 string indicating the type of UI role played by this object.
     **/
    string		getRoleName ();

    /**
     * Get a string indicating the type of UI role played by this object,
     * translated to the current locale.
     *
     * @returns: a UTF-8 string indicating the type of UI role played by this object.
     **/
    string		getLocalizedRoleName ();

    /**
     * Get the current state of the object as a ::StateSet.
     * @returns: a ::StateSet encapsulating the currently true states of the object.
     **/
    StateSet	getState ();

    /**
     * Get a list of properties applied to this object as a whole, as an 
     * ::AttributeSet consisting of name-value pairs.  As such these attributes
     * may be considered weakly-typed properties or annotations, as distinct
     * from the strongly-typed interface instance data declared using the IDL 
     * "attribute" keyword.
     *
     * Not all objects have explicit "name-value pair" AttributeSet properties.  
     *
     * Attribute names and values may have any UTF-8 string value, however where possible,
     * in order to facilitate consistent use and exposure of "attribute" properties by
     * applications and AT clients, attribute names and values should chosen from  
     * a publicly-specified namespace where appropriate.
     *
     * Where possible, the names and values in the name-value pairs
     * should be chosen from well-established attribute namespaces
     * using standard semantics.       
     * For example, attributes of ::Accessible objects corresponding to XHTML content 
     * elements should correspond to attribute names and values specified in the w3c 
     * XHTML specification, at http://www.w3.org/TR/xhtml2, where such values are not 
     * already exposed via a more strongly-typed aspect of the AT-SPI API.
     * Metadata names and
     * values should be chosen from the 'Dublin Core' Metadata
     * namespace using Dublin Core semantics:
     * http://dublincore.org/dcregistry/
     * Similarly, relevant structural metadata should be exposed
     * using attribute names and values chosen from the CSS2 and WICD specification:
     * http://www.w3.org/TR/1998/REC-CSS2-19980512
     * WICD (http://www.w3.org/TR/2005/WD-WICD-20051121/).
     *
     * @note Clients seeking semantic or typographical attributes associated with
     * specific character spans of text content should use ::Text::getAttributeRun instead.
     * The attributes returned by Accessible::getAttributes do not include
     * "text attributes".
     *
     * @see ::Accessibility::Text::getAttributeRun
     *
     * @returns: an ::AttributeSet encapsulating any "attribute values" currently 
     * defined for the object.
     *
     * @since AT-SPI 1.7.0
     **/
    AttributeSet	getAttributes ();

    /**
     * Get the containing Application for this object.
     *
     * @returns the Application instance to which this object belongs.
     * @since AT-SPI 1.7.0
     **/
    Application getApplication ();

     /** /cond future expansion */
     void unimplemented ();
     /** /endcond */

  };
};

#endif