90a9240aeaf4e50662a7d01f6fbad13c56df09f3
[platform/core/uifw/at-spi2-atk.git] / pyatspi / text.py
1 #Copyright (C) 2008 Codethink Ltd
2
3 #This library is free software; you can redistribute it and/or
4 #modify it under the terms of the GNU Lesser General Public
5 #License version 2 as published by the Free Software Foundation.
6
7 #This program is distributed in the hope that it will be useful,
8 #but WITHOUT ANY WARRANTY; without even the implied warranty of
9 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 #GNU General Public License for more details.
11 #You should have received a copy of the GNU Lesser General Public License
12 #along with this program; if not, write to the Free Software
13 #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
14
15 import dbus
16
17 from interfaces import *
18 from accessible import Accessible
19 from base import Enum, _repack_tuple
20 from factory import accessible_factory
21
22 __all__ = [
23            "Text",
24            "TEXT_BOUNDARY_TYPE",
25            "TEXT_BOUNDARY_CHAR",
26            "TEXT_BOUNDARY_WORD_START",
27            "TEXT_BOUNDARY_WORD_END",
28            "TEXT_BOUNDARY_SENTENCE_START",
29            "TEXT_BOUNDARY_SENTENCE_END",
30            "TEXT_BOUNDARY_LINE_START",
31            "TEXT_BOUNDARY_LINE_END",
32            "TEXT_CLIP_TYPE",
33            "TEXT_CLIP_NONE",
34            "TEXT_CLIP_MIN",
35            "TEXT_CLIP_MAX",
36            "TEXT_CLIP_BOTH",
37           ]
38
39 #------------------------------------------------------------------------------
40
41 class TEXT_BOUNDARY_TYPE(Enum):
42         _enum_lookup = {
43                 0:'TEXT_BOUNDARY_CHAR',
44                 1:'TEXT_BOUNDARY_WORD_START',
45                 2:'TEXT_BOUNDARY_WORD_END',
46                 3:'TEXT_BOUNDARY_SENTENCE_START',
47                 4:'TEXT_BOUNDARY_SENTENCE_END',
48                 5:'TEXT_BOUNDARY_LINE_START',
49                 6:'TEXT_BOUNDARY_LINE_END',
50         }
51
52 TEXT_BOUNDARY_CHAR = TEXT_BOUNDARY_TYPE(0)
53 TEXT_BOUNDARY_LINE_END = TEXT_BOUNDARY_TYPE(6)
54 TEXT_BOUNDARY_LINE_START = TEXT_BOUNDARY_TYPE(5)
55 TEXT_BOUNDARY_SENTENCE_END = TEXT_BOUNDARY_TYPE(4)
56 TEXT_BOUNDARY_SENTENCE_START = TEXT_BOUNDARY_TYPE(3)
57 TEXT_BOUNDARY_WORD_END = TEXT_BOUNDARY_TYPE(2)
58 TEXT_BOUNDARY_WORD_START = TEXT_BOUNDARY_TYPE(1)
59
60 #------------------------------------------------------------------------------
61
62 class TEXT_CLIP_TYPE(Enum):
63         _enum_lookup = {
64                 0:'TEXT_CLIP_NONE',
65                 1:'TEXT_CLIP_MIN',
66                 2:'TEXT_CLIP_MAX',
67                 3:'TEXT_CLIP_BOTH',
68         }
69
70 TEXT_CLIP_BOTH = TEXT_CLIP_TYPE(3)
71 TEXT_CLIP_MAX = TEXT_CLIP_TYPE(2)
72 TEXT_CLIP_MIN = TEXT_CLIP_TYPE(1)
73 TEXT_CLIP_NONE = TEXT_CLIP_TYPE(0)
74
75 #------------------------------------------------------------------------------
76
77 class Text(Accessible):
78         """
79         The text interface should be implemented by objects which place
80         textual information onscreen as character strings or glyphs.
81         The text interface allows access to textual content, including
82         display attributes and semantic hints associated with runs of
83         text, and access to bounding box information for glyphs and substrings.
84         It also allows portions of textual content to be selected, if
85         the object's StateSet includes STATE_SELECTABLE_TEXT.
86         In some cases a Text object may have, as its content, an empty
87         string. In particular this can occur in the case of Hypertext
88         objects which do not display explicitly textual information onscreen,
89         as Hypertext is derived from the Text interface. 
90         Typographic and semantic attributes of onscreen textual content,
91         for instance typeface, weight, language, and such qualities as
92         'emphasis' or 'blockquote', are represented as text attributes.
93         Contiguous sequences of characters over which these attributes
94         are unchanged are referred to as "attribute runs", and are available
95         via Text::getAttributeRun. Where possible, implementing clients
96         will report textual attributes which are the same over the entire
97         text object, for instance those inherited from a default or document-scope
98         style, via getDefaultAttributes instead of reporting them explicitly
99         for each character. Therefore, for any span of text, the attributes
100         in effect are the union of the set returned by Text::getDefaultAttributes,
101         and the set returned at a particular character offset via Text::getAttributeRun.
102         """
103
104         def addSelection(self, *args, **kwargs):
105                 """
106                 The result of calling addSelection on objects which already have
107                 one selection present, and which do not include STATE_MULTISELECTABLE,
108                 is undefined, other than the return value. 
109                 @return True of the selection was successfully added, False otherwise.
110                 Selection may fail if the object does not support selection of
111                 text (see STATE_SELECTABLE_TEXT), if the object does not support
112                 multiple selections and a selection is already defined, or for
113                 other reasons (for instance if the user does not have permission
114                 to copy the text into the relevant selection buffer).
115                 """
116                 func = self.get_dbus_method("addSelection", dbus_interface=ATSPI_TEXT)
117                 return func(*args, **kwargs)
118
119         def getAttributeRun(self, offset, startOffset, endOffset, includeDefaults):
120                 """
121                 Query a particular text object for the text attributes defined
122                 at a given offset, obtaining the start and end of the "attribute
123                 run" over which these attributes are currently invariant. Text
124                 attributes are those presentational, typographic, or semantic
125                 attributes or qualitites which apply to a range of text specifyable
126                 by starting and ending offsets. Attributes relevant to localization
127                 should be provided in accordance with the w3c "Internationalization
128                 and Localization Markup Requirements", http://www.w3.org/TR/2005/WD-itsreq-20051122/
129                 Other text attributes should choose their names and value semantics
130                 in accordance with relevant standards such as CSS level 2 (http://www.w3.org/TR/1998/REC-CSS2-19980512),
131                 XHTML 1.0 (http://www.w3.org/TR/2002/REC-xhtml1-20020801), and
132                 WICD (http://www.w3.org/TR/2005/WD-WICD-20051121/). Those attributes
133                 from the aforementioned specifications and recommendations which
134                 do not concern typographic, presentational, or semantic aspects
135                 of text should be exposed via the more general Accessible::getAttributes()
136                 API (if at all).
137                 For example, CSS attributes which should be exposed on text (either
138                 as default attributes, or as explicitly-set attributes when non-default
139                 values are specified in the content view) include the Font attributes
140                 (i.e. "css2:font-weight", "css2:font-style"), the "css2:color"
141                 and "css2:background-color" attributes, and "css2:text-decoration"
142                 attribute.
143                 If includeDefaults is TRUE, then this AttributeSet should include
144                 the default attributes as well as those which are explicitly
145                 assigned to the attribute run in question. startOffset and endOffset
146                 will be back-filled to indicate the start and end of the attribute
147                 run which contains 'offset' - an attribute run is a contiguous
148                 section of text whose attributes are homogeneous. 
149                 @param : offset
150                 the offset of the character whose attributes will be reported.
151                 @param : startOffset
152                 backfilled with the starting offset of the character range over
153                 which all text attributes match those of offset, i.e. the start
154                 of the homogeneous attribute run including offset. 
155                 @param : endOffset
156                 backfilled with the offset of the first character past the character
157                 range over which all text attributes match those of offset, i.e.
158                 the character immediately after the homogeneous attribute run
159                 including offset. 
160                 @param : includeDefaults
161                 if False, the call should only return those attributes which
162                 are explicitly set on the current attribute run, omitting any
163                 attributes which are inherited from the default values. See also
164                 Text::getDefaultAttributes.
165                 @return the AttributeSet defined at offset, optionally including
166                 the 'default' attributes.
167                 """
168                 func = self.get_dbus_method("getAttributeRun", dbus_interface=ATSPI_TEXT)
169                 attr = func(offset, startOffset, endOffset, includeDefaults)
170                 return [key + ':' + value for key, value in attr.values()]
171
172         def getAttributeValue(self, *args, **kwargs):
173                 """
174                 Get the string value of a named attribute at a given offset,
175                 if defined. 
176                 @param : offset
177                 the offset of the character for which the attribute run is to
178                 be obtained. 
179                 @param : attributeName
180                 the name of the attribute for which the value is to be returned,
181                 if defined. 
182                 @param : startOffset
183                 back-filled with the offset of the first character in the attribute
184                 run containing the character at offset. 
185                 @param : endOffset
186                 back-filled with the offset of the first character past the end
187                 of the attribute run containing the character at offset. 
188                 @param : defined
189                 back-filled with True if the attributeName has a defined value
190                 at offset, False otherwise. 
191                 @return the value of attribute (name-value pair) corresponding
192                 to "name", if defined.
193                 """
194                 func = self.get_dbus_method("getAttributeValue", dbus_interface=ATSPI_TEXT)
195                 return func(*args, **kwargs)
196
197         def getAttributes(self, offset):
198                 """
199                 getAttributes is deprecated in favor of getAttributeRun. 
200                 @return the attributes at offset, as a semicolon-delimited set
201                 of colon-delimited name-value pairs.
202                 """
203                 func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_TEXT)
204                 return [key + ':' + value for key, value in func(dbus.Int32(offset)).values()]
205
206         def getBoundedRanges(self, *args, **kwargs):
207                 #TODO Return a list of range structures
208                 """
209                 Return the text content within a bounding box, as a list of Range
210                 structures. Depending on the TEXT_CLIP_TYPE parameters, glyphs
211                 which are clipped by the bounding box (i.e. which lie partially
212                 inside and partially outside it) may or may not be included in
213                 the ranges returned. 
214                 @param : x
215                 the minimum x ( i.e. leftmost) coordinate of the bounding box.
216                 @param : y
217                 the minimum y coordinate of the bounding box. 
218                 @param : width
219                 the horizontal size of the bounding box. The rightmost bound
220                 of the bounding box is (x + width); 
221                 @param : height
222                 the vertical size of the bounding box. The maximum y value of
223                 the bounding box is (y + height); 
224                 @param : coordType
225                 If 0, the above coordinates are interpreted as pixels relative
226                 to corner of the screen; if 1, the coordinates are interpreted
227                 as pixels relative to the corner of the containing toplevel window.
228                 @param : xClipType
229                 determines whether text which intersects the bounding box in
230                 the x direction is included. 
231                 @param : yClipType
232                 determines whether text which intersects the bounding box in
233                 the y direction is included.
234                 """
235                 func = self.get_dbus_method("getBoundedRanges", dbus_interface=ATSPI_TEXT)
236                 return func(*args, **kwargs)
237
238         def getCharacterAtOffset(self, *args, **kwargs):
239                 """
240                 @return an unsigned long integer whose value corresponds to the
241                 UCS-4 representation of the character at the specified text offset,
242                 or 0 if offset is out of range.
243                 """
244                 func = self.get_dbus_method("getCharacterAtOffset", dbus_interface=ATSPI_TEXT)
245                 return func(*args, **kwargs)
246
247         def getCharacterExtents(self, *args, **kwargs):
248                 """
249                 Obtain a the bounding box, as x, y, width, and height, of the
250                 character or glyph at a particular character offset in this object's
251                 text content. The coordinate system in which the results are
252                 reported is specified by coordType. If an onscreen glyph corresponds
253                 to multiple character offsets, for instance if the glyph is a
254                 ligature, the bounding box reported will include the entire glyph
255                 and therefore may apply to more than one character offset. 
256                 @param : offset
257                 the character offset of the character or glyph being queried.
258                 @param : x
259                 the minimum horizontal coordinate of the bounding box of the
260                 glyph representing the character at offset. 
261                 @param : y
262                 the minimum vertical coordinate of the bounding box of the glyph
263                 representing the character at offset. 
264                 @param : width
265                 the horizontal extent of the bounding box of the glyph representing
266                 the character at offset. 
267                 @param : height
268                 the vertical extent of the bounding box of the glyph representing
269                 the character at offset. 
270                 @param : coordType
271                 If 0, the results will be reported in screen coordinates, i.e.
272                 in pixels relative to the upper-left corner of the screen, with
273                 the x axis pointing right and the y axis pointing down. If 1,
274                 the results will be reported relative to the containing toplevel
275                 window, with the x axis pointing right and the y axis pointing
276                 down.
277                 """
278                 func = self.get_dbus_method("getCharacterExtents", dbus_interface=ATSPI_TEXT)
279                 return func(*args, **kwargs)
280
281         def getDefaultAttributeSet(self):
282                 """
283                 Return an AttributeSet containing the text attributes which apply
284                 to all text in the object by virtue of the default settings of
285                 the document, view, or user agent; e.g. those attributes which
286                 are implied rather than explicitly applied to the text object.
287                 For instance, an object whose entire text content has been explicitly
288                 marked as 'bold' will report the 'bold' attribute via getAttributeRun(),
289                 whereas an object whose text weight is inspecified may report
290                 the default or implied text weight in the default AttributeSet.
291                 """
292                 func = self.get_dbus_method("getDefaultAttributeSet", dbus_interface=ATSPI_TEXT)
293                 return [key + ':' + value for key, value in func().values()]
294
295         def getDefaultAttributes(self):
296                 """
297                 Deprecated in favor of getDefaultAttributeSet. 
298                 @return the attributes which apply to the entire text content,
299                 but which were not explicitly specified by the content creator.
300                 """
301                 func = self.get_dbus_method("getDefaultAttributes", dbus_interface=ATSPI_TEXT)
302                 return [key + ':' + value for key, value in func().values()]
303
304         def getNSelections(self, *args, **kwargs):
305                 """
306                 Obtain the number of separate, contiguous selections in the current
307                 Text object. Text objects which do not implement selection of
308                 discontiguous text regions will always return '0' or '1'. Note
309                 that "contiguous" is defined by continuity of the offsets, i.e.
310                 a text 'selection' is defined by a start/end offset pair. In
311                 the case of bidirectional text, this means that a continguous
312                 selection may appear visually discontiguous, and vice-versa.
313                 @return the number of contiguous selections in the current Text
314                 object.
315                 """
316                 func = self.get_dbus_method("getNSelections", dbus_interface=ATSPI_TEXT)
317                 return func(*args, **kwargs)
318
319         def getOffsetAtPoint(self, *args, **kwargs):
320                 """
321                 Get the offset of the character at a given onscreen coordinate.
322                 The coordinate system used to interpret x and y is determined
323                 by parameter coordType. 
324                 @param : x
325                 @param : y
326                 @param : coordType
327                 if 0, the input coordinates are interpreted relative to the entire
328                 screen, if 1, they are relative to the toplevel window containing
329                 this Text object. 
330                 @return the text offset (as an offset into the character array)
331                 of the glyph whose onscreen bounds contain the point x,y, or
332                 -1 if the point is outside the bounds of any glyph.
333                 """
334                 func = self.get_dbus_method("getOffsetAtPoint", dbus_interface=ATSPI_TEXT)
335                 return func(*args, **kwargs)
336
337         def getRangeExtents(self, *args, **kwargs):
338                 """
339                 Obtain the bounding box which entirely contains a given text
340                 range. Negative values may be returned for the bounding box parameters
341                 in the event that all or part of the text range is offscreen
342                 or not mapped to the screen. 
343                 @param : startOffset
344                 the offset of the first character in the specified range. 
345                 @param : endOffset
346                 the offset of the character immediately after the last character
347                 in the specified range. 
348                 @param : x
349                 an integer parameter which is back-filled with the minimum horizontal
350                 coordinate of the resulting bounding box. 
351                 @param : y
352                 an integer parameter which is back-filled with the minimum vertical
353                 coordinate of the resulting bounding box. 
354                 @param : width
355                 an integer parameter which is back-filled with the horizontal
356                 extent of the bounding box. 
357                 @param : height
358                 an integer parameter which is back-filled with the vertical extent
359                 of the bounding box. 
360                 @param : coordType
361                 If 0, the above coordinates are reported in pixels relative to
362                 corner of the screen; if 1, the coordinates are reported relative
363                 to the corner of the containing toplevel window.
364                 """
365                 func = self.get_dbus_method("getRangeExtents", dbus_interface=ATSPI_TEXT)
366                 return func(*args, **kwargs)
367
368         def getSelection(self, *args, **kwargs):
369                 """
370                 The result of calling getSelection with an out-of-range selectionNum
371                 (i.e. for a selection which does not exist) is not strictly defined,
372                 but should set endOffset equal to startOffset.
373                 """
374                 func = self.get_dbus_method("getSelection", dbus_interface=ATSPI_TEXT)
375                 return func(*args, **kwargs)
376
377         def getText(self, startOffset, endOffset):
378                 """
379                 Obtain all or part of the onscreen textual content of a Text
380                 object. If endOffset is specified as "-1", then this method will
381                 return the entire onscreen textual contents of the Text object.
382                 @return the textual content of the current Text object beginning
383                 startOffset (inclusive) up to but not including the character
384                 at endOffset.
385                 """
386                 func = self.get_dbus_method("getText", dbus_interface=ATSPI_TEXT)
387                 if not endOffset:
388                         endOffset = -1
389                 return func(dbus.Int32(startOffset), dbus.Int32(endOffset))
390
391         def getTextAfterOffset(self, *args, **kwargs):
392                 """
393                 Obtain a subset of the text content of an object which entirely
394                 follows offset, delimited by character, word, line, or sentence
395                 boundaries as specified by type. The starting and ending offsets
396                 of the resulting substring are returned in startOffset and endOffset.
397                 By definition, if such a substring exists, startOffset must be
398                 greater than offset. 
399                 @param : offset
400                 the offset from which the substring search begins, and which
401                 must lie before the returned substring. 
402                 @param : type
403                 the text-boundary delimiter which determines whether the returned
404                 text constitures a character, word, line, or sentence (and possibly
405                 attendant whitespace), and whether the start or ending of such
406                 a substring forms the boundary condition. 
407                 @param : startOffset
408                 back-filled with the starting offset of the resulting substring,
409                 if one exists. 
410                 @param : endOffset
411                 back-filled with the offset of the character immediately following
412                 the resulting substring, if one exists. 
413                 @return a string which is a substring of the text content of
414                 the object, delimited by the specified boundary condition.
415                 """
416                 func = self.get_dbus_method("getTextAfterOffset", dbus_interface=ATSPI_TEXT)
417                 return func(*args, **kwargs)
418
419         def getTextAtOffset(self, offset, type):
420                 """
421                 Obtain a subset of the text content of an object which includes
422                 the specified offset, delimited by character, word, line, or
423                 sentence boundaries as specified by type. The starting and ending
424                 offsets of the resulting substring are returned in startOffset
425                 and endOffset. 
426                 @param : offset
427                 the offset from which the substring search begins, and which
428                 must lie within the returned substring. 
429                 @param : type
430                 the text-boundary delimiter which determines whether the returned
431                 text constitures a character, word, line, or sentence (and possibly
432                 attendant whitespace), and whether the start or ending of such
433                 a substring forms the boundary condition. 
434                 @param : startOffset
435                 back-filled with the starting offset of the resulting substring,
436                 if one exists. 
437                 @param : endOffset
438                 back-filled with the offset of the character immediately following
439                 the resulting substring, if one exists. 
440                 @return a string which is a substring of the text content of
441                 the object, delimited by the specified boundary condition.
442                 """
443                 func = self.get_dbus_method("getTextAtOffset", dbus_interface=ATSPI_TEXT)
444                 return _repack_tuple(func(offset, type))
445
446         def getTextBeforeOffset(self, *args, **kwargs):
447                 """
448                 Obtain a subset of the text content of an object which entirely
449                 precedes offset, delimited by character, word, line, or sentence
450                 boundaries as specified by type. The starting and ending offsets
451                 of the resulting substring are returned in startOffset and endOffset.
452                 By definition, if such a substring exists, endOffset is less
453                 than or equal to offset. 
454                 @param : offset
455                 the offset from which the substring search begins. 
456                 @param : type
457                 the text-boundary delimiter which determines whether the returned
458                 text constitures a character, word, line, or sentence (and possibly
459                 attendant whitespace), and whether the start or ending of such
460                 a substring forms the boundary condition. 
461                 @param : startOffset
462                 back-filled with the starting offset of the resulting substring,
463                 if one exists. 
464                 @param : endOffset
465                 back-filled with the offset of the character immediately following
466                 the resulting substring, if one exists. 
467                 @return a string which is a substring of the text content of
468                 the object, delimited by the specified boundary condition.
469                 """
470                 func = self.get_dbus_method("getTextBeforeOffset", dbus_interface=ATSPI_TEXT)
471                 return func(*args, **kwargs)
472
473         def removeSelection(self, *args, **kwargs):
474                 """
475                 Deselect the text contained in the specified selectionNum, if
476                 such a selection exists, otherwise do nothing. Removal of a non-existant
477                 selectionNum has no effect. 
478                 @return True if the selection was successfully removed, False
479                 otherwise.
480                 """
481                 func = self.get_dbus_method("removeSelection", dbus_interface=ATSPI_TEXT)
482                 return func(*args, **kwargs)
483
484         def setCaretOffset(self, *args, **kwargs):
485                 """
486                 Programmatically move the text caret (visible or virtual, as
487                 above) to a given position. 
488                 @param : offset
489                 a long int indicating the desired character offset. Not all implementations
490                 of Text will honor setCaretOffset requests, so the return value
491                 below should be checked by the client. 
492                 @return TRUE if the request was carried out, or FALSE if the
493                 caret could not be moved to the requested position.
494                 """
495                 func = self.get_dbus_method("setCaretOffset", dbus_interface=ATSPI_TEXT)
496                 return func(*args, **kwargs)
497
498         def setSelection(self, *args, **kwargs):
499                 """
500                 Modify an existing selection's start or ending offset.
501                 Calling setSelection for a selectionNum that is not already defined
502                 has no effect. The result of calling setSelection with a selectionNum
503                 greater than 0 for objects that do not include STATE_MULTISELECTABLE
504                 is undefined. 
505                 @param : selectionNum
506                 indicates which of a set of non-contiguous selections to modify.
507                 @param : startOffset
508                 the new starting offset for the selection 
509                 @param : endOffset
510                 the new ending offset for the selection 
511                 @return True if the selection corresponding to selectionNum is
512                 successfully modified, False otherwise.
513                 """
514                 func = self.get_dbus_method("setSelection", dbus_interface=ATSPI_TEXT)
515                 return func(*args, **kwargs)
516
517         def get_caretOffset(self):
518                 return dbus.Int32(self._pgetter(self._dbus_interface, "caretOffset"))
519         _caretOffsetDoc = \
520                 """
521                 The current offset of the text caret in the Text object. This
522                 caret may be virtual, e.g. non-visual and notional-only, but
523                 if an onscreen representation of the caret position is visible,
524                 it will correspond to this offset. The caret offset is given
525                 as a character offset, as opposed to a byte offset into a text
526                 buffer or a column offset.
527                 """
528         caretOffset = property(fget=get_caretOffset, doc=_caretOffsetDoc)
529
530         def get_characterCount(self):
531                 return dbus.Int32(self._pgetter(self._dbus_interface, "characterCount"))
532         _characterCountDoc = \
533                 """
534                 The total current number of characters in the Text object, including
535                 whitespace and non-spacing characters.
536                 """
537         characterCount = property(fget=get_characterCount, doc=_characterCountDoc)
538
539         class Range(list):
540                 def __new__(cls, startOffset, endOffset, content, data):
541                         list.__new__(cls, (startOffset, endOffset, content, data))
542                 def __init__(self, startOffset, endOffset, content, data):
543                         list.__init__(self, (startOffset, endOffset, content, data))
544
545                 def _get_startOffset(self):
546                         return self[0]
547                 def _set_startOffset(self, val):
548                         self[0] = val
549                 startOffset = property(fget=_get_startOffset, fset=_set_startOffset)
550                 def _get_endOffset(self):
551                         return self[1]
552                 def _set_endOffset(self, val):
553                         self[1] = val
554                 endOffset = property(fget=_get_endOffset, fset=_set_endOffset)
555                 def _get_content(self):
556                         return self[2]
557                 def _set_content(self, val):
558                         self[2] = val
559                 content = property(fget=_get_content, fset=_set_content)
560                 def _get_data(self):
561                         return self[3]
562                 def _set_data(self, val):
563                         self[3] = val
564                 data = property(fget=_get_data, fset=_set_data)
565
566 # Register the accessible class with the factory.
567 accessible_factory.register_accessible_class(ATSPI_TEXT, Text)
568
569 #END----------------------------------------------------------------------------