1 #Copyright (C) 2008 Codethink Ltd
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.
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.
15 from base import _BaseProxy, _Enum
16 from base import Accessible as _Accessible
20 from factory import add_accessible_class
22 class Action(_BaseProxy):
24 An interface through which a user-actionable user interface component
25 can be manipulated. Components which react to mouse or keyboard
26 input from the user, (with the exception of pure text entry fields
27 with no other function), should implement this interface. Typical
28 actions include "click", "press", "release" (for instance for
29 buttons), "menu" (for objects which have context menus invokable
30 from mouse or keyboard), "open" for icons representing files
35 def doAction(self, *args, **kwargs):
39 the 0-based index of the action to perform.
40 Causes the object to perform the specified action.
41 @return : a boolean indicating success or failure.
43 func = self.get_dbus_method("doAction")
44 return func(*args, **kwargs)
46 def getDescription(self, *args, **kwargs):
50 the index of the action for which a description is desired.
51 Get the description of the specified action. The description
52 of an action may provide information about the result of action
53 invocation, unlike the action name.
54 @return : a string containing the description of the specified
57 func = self.get_dbus_method("getDescription")
58 return func(*args, **kwargs)
60 def getKeyBinding(self, *args, **kwargs):
64 the 0-based index of the action for which a key binding is requested.
65 Get the key binding associated with a specific action.
66 @return : a string containing the key binding for the specified
67 action, or an empty string ("") if none exists.
69 func = self.get_dbus_method("getKeyBinding")
70 return func(*args, **kwargs)
72 def getName(self, *args, **kwargs):
76 the index of the action whose name is requested.
77 Get the name of the specified action. Action names generally
78 describe the user action, i.e. "click" or "press", rather then
79 the result of invoking the action.
80 @return : a string containing the name of the specified action.
82 func = self.get_dbus_method("getName")
83 return func(*args, **kwargs)
85 def get_nActions(self):
86 self._pgetter(self._dbus_interface, "nActions")
87 def set_nActions(self, value):
88 self._psetter(self._dbus_interface, "nActions", value)
91 nActions: a long containing the number of actions this object
94 nActions = property(fget=get_nActions, fset=set_nActions, doc=_nActionsDoc)
97 #------------------------------------------------------------------------------
99 class BoundingBox(list):
100 def __new__(cls, x, y, width, height):
101 list.__new__(cls, (x, y, width, height))
102 def __init__(self, x, y, width, height):
103 list.__init__(self, (x, y, width, height))
107 def _set_x(self, val):
109 x = property(fget=_get_x, fset=_set_x)
112 def _set_y(self, val):
114 y = property(fget=_get_y, fset=_set_y)
115 def _get_width(self):
117 def _set_width(self, val):
119 width = property(fget=_get_width, fset=_set_width)
120 def _get_height(self):
122 def _set_height(self, val):
124 height = property(fget=_get_height, fset=_set_height)
127 class Collection(_BaseProxy):
129 def createMatchRule(self, *args, **kwargs):
130 func = self.get_dbus_method("createMatchRule")
131 return func(*args, **kwargs)
133 def freeMatchRule(self, *args, **kwargs):
134 func = self.get_dbus_method("freeMatchRule")
135 return func(*args, **kwargs)
137 def getActiveDescendant(self, *args, **kwargs):
138 func = self.get_dbus_method("getActiveDescendant")
139 return func(*args, **kwargs)
141 def getMatches(self, *args, **kwargs):
142 func = self.get_dbus_method("getMatches")
143 return func(*args, **kwargs)
145 def getMatchesFrom(self, *args, **kwargs):
146 func = self.get_dbus_method("getMatchesFrom")
147 return func(*args, **kwargs)
149 def getMatchesTo(self, *args, **kwargs):
150 func = self.get_dbus_method("getMatchesTo")
151 return func(*args, **kwargs)
153 def isAncestorOf(self, *args, **kwargs):
154 func = self.get_dbus_method("isAncestorOf")
155 return func(*args, **kwargs)
157 def unImplemented(self, *args, **kwargs):
158 func = self.get_dbus_method("unImplemented")
159 return func(*args, **kwargs)
161 def unImplemented2(self, *args, **kwargs):
162 func = self.get_dbus_method("unImplemented2")
163 return func(*args, **kwargs)
165 def unImplemented3(self, *args, **kwargs):
166 func = self.get_dbus_method("unImplemented3")
167 return func(*args, **kwargs)
169 def unImplemented4(self, *args, **kwargs):
170 func = self.get_dbus_method("unImplemented4")
171 return func(*args, **kwargs)
173 class MatchType(_Enum):
180 5:'MATCH_LAST_DEFINED',
183 MATCH_ALL = MatchType(1)
185 MATCH_ANY = MatchType(2)
187 MATCH_EMPTY = MatchType(4)
189 MATCH_INVALID = MatchType(0)
191 MATCH_LAST_DEFINED = MatchType(5)
193 MATCH_NONE = MatchType(3)
195 class SortOrder(_Enum):
197 0:'SORT_ORDER_INVALID',
198 1:'SORT_ORDER_CANONICAL',
201 4:'SORT_ORDER_REVERSE_CANONICAL',
202 5:'SORT_ORDER_REVERSE_FLOW',
203 6:'SORT_ORDER_REVERSE_TAB',
204 7:'SORT_ORDER_LAST_DEFINED',
207 SORT_ORDER_CANONICAL = SortOrder(1)
209 SORT_ORDER_FLOW = SortOrder(2)
211 SORT_ORDER_INVALID = SortOrder(0)
213 SORT_ORDER_LAST_DEFINED = SortOrder(7)
215 SORT_ORDER_REVERSE_CANONICAL = SortOrder(4)
217 SORT_ORDER_REVERSE_FLOW = SortOrder(5)
219 SORT_ORDER_REVERSE_TAB = SortOrder(6)
221 SORT_ORDER_TAB = SortOrder(3)
223 class TreeTraversalType(_Enum):
225 0:'TREE_RESTRICT_CHILDREN',
226 1:'TREE_RESTRICT_SIBLING',
228 3:'TREE_LAST_DEFINED',
231 TREE_INORDER = TreeTraversalType(2)
233 TREE_LAST_DEFINED = TreeTraversalType(3)
235 TREE_RESTRICT_CHILDREN = TreeTraversalType(0)
237 TREE_RESTRICT_SIBLING = TreeTraversalType(1)
240 def __new__(cls, name, id):
241 list.__new__(cls, (name, id))
242 def __init__(self, name, id):
243 list.__init__(self, (name, id))
247 def _set_name(self, val):
249 name = property(fget=_get_name, fset=_set_name)
252 def _set_id(self, val):
254 id = property(fget=_get_id, fset=_set_id)
256 class CommandListener(_BaseProxy):
258 An interface which should be implemented by assistive technologies
259 or other clients of the Selector interface, over which notifications
260 to the list of available commands is made. The notifyCommands()
261 method of the client is then called by the Selector instance.
265 def notifyCommands(self, *args, **kwargs):
267 Notify the CommandListener instance of changes to the currently
268 available commands, by sending the current CommandList.
270 The newly-available list of Command objects which may be invoked
273 func = self.get_dbus_method("notifyCommands")
274 return func(*args, **kwargs)
278 class ComponentLayer(_Enum):
281 1:'LAYER_BACKGROUND',
288 8:'LAYER_LAST_DEFINED',
292 class ContentStream(_BaseProxy):
294 An interface by which the requested data from a StreamableContent
295 object may be read by the client.
298 def close(self, *args, **kwargs):
300 close the stream and release associated resources. A client should
301 not perform further operations on a StreamableContent::Stream
302 object after closing it.
304 func = self.get_dbus_method("close")
305 return func(*args, **kwargs)
307 def read(self, *args, **kwargs):
309 Request/read a specified amount of data from a Stream.
310 @return the number of bytes actually read into the client buffer.
312 func = self.get_dbus_method("read")
313 return func(*args, **kwargs)
315 def seek(self, *args, **kwargs):
317 Seek to a specified position in the Stream.
319 an offset specifying the requested position in the stream, relative
320 to the SeekType specified in whence.
322 a SeekType specifying the reference point from which the seek
323 offset is calculated. Some forms of seek are not supported by
324 certain implementations of Stream, in which case a NotSupported
325 exception will be raised.
326 @return the actual resulting offset, if no exception was raised.
328 func = self.get_dbus_method("seek")
329 return func(*args, **kwargs)
331 def unimplemented(self, *args, **kwargs):
335 func = self.get_dbus_method("unimplemented")
336 return func(*args, **kwargs)
338 def unimplemented2(self, *args, **kwargs):
339 func = self.get_dbus_method("unimplemented2")
340 return func(*args, **kwargs)
342 class IOError(Exception):
345 class NoPermission(Exception):
348 class NotSupported(Exception):
351 class SeekType(_Enum):
353 Specifies the meaning of a seek 'offset'. Not all SeekTypes are
354 supported by all StreamableContent data sources, for instance
355 some streams may not support seeking from the beginning or other
356 types of 'backwards' seeks.
364 SEEK_CURRENT = SeekType(1)
366 SEEK_END = SeekType(2)
368 SEEK_SET = SeekType(0)
370 class DeviceEvent(list):
371 def __new__(cls, type, id, hw_code, modifiers, timestamp, event_string, is_text):
372 list.__new__(cls, (type, id, hw_code, modifiers, timestamp, event_string, is_text))
373 def __init__(self, type, id, hw_code, modifiers, timestamp, event_string, is_text):
374 list.__init__(self, (type, id, hw_code, modifiers, timestamp, event_string, is_text))
378 def _set_type(self, val):
380 type = property(fget=_get_type, fset=_set_type)
383 def _set_id(self, val):
385 id = property(fget=_get_id, fset=_set_id)
386 def _get_hw_code(self):
388 def _set_hw_code(self, val):
390 hw_code = property(fget=_get_hw_code, fset=_set_hw_code)
391 def _get_modifiers(self):
393 def _set_modifiers(self, val):
395 modifiers = property(fget=_get_modifiers, fset=_set_modifiers)
396 def _get_timestamp(self):
398 def _set_timestamp(self, val):
400 timestamp = property(fget=_get_timestamp, fset=_set_timestamp)
401 def _get_event_string(self):
403 def _set_event_string(self, val):
405 event_string = property(fget=_get_event_string, fset=_set_event_string)
406 def _get_is_text(self):
408 def _set_is_text(self, val):
410 is_text = property(fget=_get_is_text, fset=_set_is_text)
412 class DeviceEventController(_BaseProxy):
414 The interface via which clients request notification of device
415 events, and through which device events may be simulated.
418 def deregisterDeviceEventListener(self, *args, **kwargs):
420 De-register a previously registered keyboard eventlistener.
422 a DeviceEventListener which will intercept events.
424 an EventTypeSeq indicating which event types to stop listening
427 func = self.get_dbus_method("deregisterDeviceEventListener")
428 return func(*args, **kwargs)
430 def deregisterKeystrokeListener(self, *args, **kwargs):
432 De-register a previously registered keyboard eventlistener.
434 a DeviceEventListener which will intercept key events.
436 a KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
438 a ControllerEventMask filtering the intercepted key events.
440 an EventType mask that may created by ORing event types together.
442 func = self.get_dbus_method("deregisterKeystrokeListener")
443 return func(*args, **kwargs)
445 def generateKeyboardEvent(self, *args, **kwargs):
447 Synthesize a keyboard event.
449 a long integer indicating the keycode of the keypress to be synthesized.
451 an optional UTF-8 string indicating a complex keyboard input
454 a KeySynthType indicating the type of event(s) to be synthesized:
455 a key press, release, press-release pair, or a complex input
456 string (for instance from an internationalized or complex text
457 input method, or a composed character).
459 func = self.get_dbus_method("generateKeyboardEvent")
460 return func(*args, **kwargs)
462 def generateMouseEvent(self, *args, **kwargs):
464 Synthesize a mouse event.
466 a long integer indicating the screen x coord for the mouse event.
468 a long integer indicating the screen y coord for the mouse event.
470 a string indicating the type of mouse event, e.g. "button1up"
472 func = self.get_dbus_method("generateMouseEvent")
473 return func(*args, **kwargs)
475 def notifyListenersAsync(self, *args, **kwargs):
477 Notify the Registry instance that a device event has taken place
478 in an asynchronous manner. This is the method used by accessibility
479 bridges to forward "toolkit dependent" device events to the Registry
480 from the application's process space. If the event in question
481 is potentially pre-emptible. notifyListenersSync should be used
484 func = self.get_dbus_method("notifyListenersAsync")
485 return func(*args, **kwargs)
487 def notifyListenersSync(self, *args, **kwargs):
489 Notify the Registry instance that a device event has taken place,
490 and allow pre-emptive listeners the opportunity to 'consume'
491 the event and thus prevent its further issuance/forwarding. This
492 is the method used by accessibility bridges to forward "toolkit
493 dependent" device events to the Registry from the application's
495 @return True if the event was consumed by a (pre-emptive) listener,
496 False if not (in which case the device event will be forwarded
497 as normal to any application which would normally receive it,
498 e.g. the currently active application in the case of mouse or
501 func = self.get_dbus_method("notifyListenersSync")
502 return func(*args, **kwargs)
504 def registerDeviceEventListener(self, *args, **kwargs):
506 Register to intercept events, and either pass them on or consume
507 them. To listen to keyboard events use registerKeystrokeListener
510 a DeviceEventListener which will intercept events.
512 an EventTypeSeq indicating which event types to listen for.
513 @return True if successful, False if not
515 func = self.get_dbus_method("registerDeviceEventListener")
516 return func(*args, **kwargs)
518 def registerKeystrokeListener(self, *args, **kwargs):
520 Register to intercept keyboard events, and either pass them on
523 a DeviceEventListener which will intercept key events.
525 a KeySet indicating which keys to intercept, or KEYSET_ALL_KEYS.
527 a ControllerEventMask filtering the intercepted key events.
529 a KeyEventTypeSeq that may created by ORing event types together.
531 an EventListenerMode indicating whether the listener should receive
532 the events synchronously, potentially consuming them, or just
533 be notified asynchronously of those events that have been generated.
534 @return True if the DeviceEventListener was successfully registered
535 for the requested KeySet, ControllerEventMask, event types, and
536 EventListenerMode; otherwise returns False.
538 func = self.get_dbus_method("registerKeystrokeListener")
539 return func(*args, **kwargs)
541 class DeviceEventListener(_BaseProxy):
543 This interface should be implemented by AT-SPI clients who wish
544 to make use of the DeviceEventController to receive device event
545 notifications. DeviceEvents include keyboard events and mouse
546 button/motion events.
549 def notifyEvent(self, *args, **kwargs):
551 Notify an interested DeviceEventListener that a DeviceEvent has
553 @return True if the recipient/consumer wishes to consume the
554 event, i.e. prevent it from being delivered to the desktop, False
555 if the event should continue to be delivered as normal.
557 func = self.get_dbus_method("notifyEvent")
558 return func(*args, **kwargs)
560 class Document(_BaseProxy):
562 Primarily a 'tagging' interface which indicates the start of
563 document content in the Accessibility hierarchy. Accessible objects
564 below the node implementing Document are normally assumed to
565 be part of the document content. Attributes of Document are those
566 attributes associated with the document as a whole. Objects that
567 implement Document are normally expected to implement Collection
571 def getAttributeValue(self, *args, **kwargs):
573 Gets the value of a single attribute, if specified for the document
575 @param : attributename
576 a string indicating the name of a specific attribute (name-value
578 @return a string corresponding to the value of the specified
579 attribute, or an empty string if the attribute is unspecified
582 func = self.get_dbus_method("getAttributeValue")
583 return func(*args, **kwargs)
585 def getAttributes(self, *args, **kwargs):
587 Gets all attributes specified for a document as a whole. For
588 attributes which change within the document content, see Accessibility::Text::getAttributes
590 @return an AttributeSet containing the attributes of the document,
593 func = self.get_dbus_method("getAttributes")
594 return func(*args, **kwargs)
596 def getLocale(self, *args, **kwargs):
598 Gets the locale associated with the document's content. e.g.
599 the locale for LOCALE_TYPE_MESSAGES.
600 @return a string compliant with the POSIX standard for locale
603 func = self.get_dbus_method("getLocale")
604 return func(*args, **kwargs)
606 def unImplemented2_(self, *args, **kwargs):
607 func = self.get_dbus_method("unImplemented2_")
608 return func(*args, **kwargs)
610 def unImplemented3_(self, *args, **kwargs):
611 func = self.get_dbus_method("unImplemented3_")
612 return func(*args, **kwargs)
614 def unImplemented4_(self, *args, **kwargs):
615 func = self.get_dbus_method("unImplemented4_")
616 return func(*args, **kwargs)
618 def unImplemented_(self, *args, **kwargs):
619 func = self.get_dbus_method("unImplemented_")
620 return func(*args, **kwargs)
622 class Text(_BaseProxy):
624 The text interface should be implemented by objects which place
625 textual information onscreen as character strings or glyphs.
626 The text interface allows access to textual content, including
627 display attributes and semantic hints associated with runs of
628 text, and access to bounding box information for glyphs and substrings.
629 It also allows portions of textual content to be selected, if
630 the object's StateSet includes STATE_SELECTABLE_TEXT.
631 In some cases a Text object may have, as its content, an empty
632 string. In particular this can occur in the case of Hypertext
633 objects which do not display explicitly textual information onscreen,
634 as Hypertext is derived from the Text interface.
635 Typographic and semantic attributes of onscreen textual content,
636 for instance typeface, weight, language, and such qualities as
637 'emphasis' or 'blockquote', are represented as text attributes.
638 Contiguous sequences of characters over which these attributes
639 are unchanged are referred to as "attribute runs", and are available
640 via Text::getAttributeRun. Where possible, implementing clients
641 will report textual attributes which are the same over the entire
642 text object, for instance those inherited from a default or document-scope
643 style, via getDefaultAttributes instead of reporting them explicitly
644 for each character. Therefore, for any span of text, the attributes
645 in effect are the union of the set returned by Text::getDefaultAttributes,
646 and the set returned at a particular character offset via Text::getAttributeRun.
650 def addSelection(self, *args, **kwargs):
652 The result of calling addSelection on objects which already have
653 one selection present, and which do not include STATE_MULTISELECTABLE,
654 is undefined, other than the return value.
655 @return True of the selection was successfully added, False otherwise.
656 Selection may fail if the object does not support selection of
657 text (see STATE_SELECTABLE_TEXT), if the object does not support
658 multiple selections and a selection is already defined, or for
659 other reasons (for instance if the user does not have permission
660 to copy the text into the relevant selection buffer).
662 func = self.get_dbus_method("addSelection")
663 return func(*args, **kwargs)
665 def getAttributeRun(self, *args, **kwargs):
667 Query a particular text object for the text attributes defined
668 at a given offset, obtaining the start and end of the "attribute
669 run" over which these attributes are currently invariant. Text
670 attributes are those presentational, typographic, or semantic
671 attributes or qualitites which apply to a range of text specifyable
672 by starting and ending offsets. Attributes relevant to localization
673 should be provided in accordance with the w3c "Internationalization
674 and Localization Markup Requirements", http://www.w3.org/TR/2005/WD-itsreq-20051122/
675 Other text attributes should choose their names and value semantics
676 in accordance with relevant standards such as CSS level 2 (http://www.w3.org/TR/1998/REC-CSS2-19980512),
677 XHTML 1.0 (http://www.w3.org/TR/2002/REC-xhtml1-20020801), and
678 WICD (http://www.w3.org/TR/2005/WD-WICD-20051121/). Those attributes
679 from the aforementioned specifications and recommendations which
680 do not concern typographic, presentational, or semantic aspects
681 of text should be exposed via the more general Accessible::getAttributes()
683 For example, CSS attributes which should be exposed on text (either
684 as default attributes, or as explicitly-set attributes when non-default
685 values are specified in the content view) include the Font attributes
686 (i.e. "css2:font-weight", "css2:font-style"), the "css2:color"
687 and "css2:background-color" attributes, and "css2:text-decoration"
689 If includeDefaults is TRUE, then this AttributeSet should include
690 the default attributes as well as those which are explicitly
691 assigned to the attribute run in question. startOffset and endOffset
692 will be back-filled to indicate the start and end of the attribute
693 run which contains 'offset' - an attribute run is a contiguous
694 section of text whose attributes are homogeneous.
696 the offset of the character whose attributes will be reported.
698 backfilled with the starting offset of the character range over
699 which all text attributes match those of offset, i.e. the start
700 of the homogeneous attribute run including offset.
702 backfilled with the offset of the first character past the character
703 range over which all text attributes match those of offset, i.e.
704 the character immediately after the homogeneous attribute run
706 @param : includeDefaults
707 if False, the call should only return those attributes which
708 are explicitly set on the current attribute run, omitting any
709 attributes which are inherited from the default values. See also
710 Text::getDefaultAttributes.
711 @return the AttributeSet defined at offset, optionally including
712 the 'default' attributes.
714 func = self.get_dbus_method("getAttributeRun")
715 return func(*args, **kwargs)
717 def getAttributeValue(self, *args, **kwargs):
719 Get the string value of a named attribute at a given offset,
722 the offset of the character for which the attribute run is to
724 @param : attributeName
725 the name of the attribute for which the value is to be returned,
728 back-filled with the offset of the first character in the attribute
729 run containing the character at offset.
731 back-filled with the offset of the first character past the end
732 of the attribute run containing the character at offset.
734 back-filled with True if the attributeName has a defined value
735 at offset, False otherwise.
736 @return the value of attribute (name-value pair) corresponding
737 to "name", if defined.
739 func = self.get_dbus_method("getAttributeValue")
740 return func(*args, **kwargs)
742 def getAttributes(self, *args, **kwargs):
744 getAttributes is deprecated in favor of getAttributeRun.
745 @return the attributes at offset, as a semicolon-delimited set
746 of colon-delimited name-value pairs.
748 func = self.get_dbus_method("getAttributes")
749 return func(*args, **kwargs)
751 def getBoundedRanges(self, *args, **kwargs):
753 Return the text content within a bounding box, as a list of Range
754 structures. Depending on the TEXT_CLIP_TYPE parameters, glyphs
755 which are clipped by the bounding box (i.e. which lie partially
756 inside and partially outside it) may or may not be included in
759 the minimum x ( i.e. leftmost) coordinate of the bounding box.
761 the minimum y coordinate of the bounding box.
763 the horizontal size of the bounding box. The rightmost bound
764 of the bounding box is (x + width);
766 the vertical size of the bounding box. The maximum y value of
767 the bounding box is (y + height);
769 If 0, the above coordinates are interpreted as pixels relative
770 to corner of the screen; if 1, the coordinates are interpreted
771 as pixels relative to the corner of the containing toplevel window.
773 determines whether text which intersects the bounding box in
774 the x direction is included.
776 determines whether text which intersects the bounding box in
777 the y direction is included.
779 func = self.get_dbus_method("getBoundedRanges")
780 return func(*args, **kwargs)
782 def getCharacterAtOffset(self, *args, **kwargs):
784 @return an unsigned long integer whose value corresponds to the
785 UCS-4 representation of the character at the specified text offset,
786 or 0 if offset is out of range.
788 func = self.get_dbus_method("getCharacterAtOffset")
789 return func(*args, **kwargs)
791 def getCharacterExtents(self, *args, **kwargs):
793 Obtain a the bounding box, as x, y, width, and height, of the
794 character or glyph at a particular character offset in this object's
795 text content. The coordinate system in which the results are
796 reported is specified by coordType. If an onscreen glyph corresponds
797 to multiple character offsets, for instance if the glyph is a
798 ligature, the bounding box reported will include the entire glyph
799 and therefore may apply to more than one character offset.
801 the character offset of the character or glyph being queried.
803 the minimum horizontal coordinate of the bounding box of the
804 glyph representing the character at offset.
806 the minimum vertical coordinate of the bounding box of the glyph
807 representing the character at offset.
809 the horizontal extent of the bounding box of the glyph representing
810 the character at offset.
812 the vertical extent of the bounding box of the glyph representing
813 the character at offset.
815 If 0, the results will be reported in screen coordinates, i.e.
816 in pixels relative to the upper-left corner of the screen, with
817 the x axis pointing right and the y axis pointing down. If 1,
818 the results will be reported relative to the containing toplevel
819 window, with the x axis pointing right and the y axis pointing
822 func = self.get_dbus_method("getCharacterExtents")
823 return func(*args, **kwargs)
825 def getDefaultAttributeSet(self, *args, **kwargs):
827 Return an AttributeSet containing the text attributes which apply
828 to all text in the object by virtue of the default settings of
829 the document, view, or user agent; e.g. those attributes which
830 are implied rather than explicitly applied to the text object.
831 For instance, an object whose entire text content has been explicitly
832 marked as 'bold' will report the 'bold' attribute via getAttributeRun(),
833 whereas an object whose text weight is inspecified may report
834 the default or implied text weight in the default AttributeSet.
836 func = self.get_dbus_method("getDefaultAttributeSet")
837 return func(*args, **kwargs)
839 def getDefaultAttributes(self, *args, **kwargs):
841 Deprecated in favor of getDefaultAttributeSet.
842 @return the attributes which apply to the entire text content,
843 but which were not explicitly specified by the content creator.
845 func = self.get_dbus_method("getDefaultAttributes")
846 return func(*args, **kwargs)
848 def getNSelections(self, *args, **kwargs):
850 Obtain the number of separate, contiguous selections in the current
851 Text object. Text objects which do not implement selection of
852 discontiguous text regions will always return '0' or '1'. Note
853 that "contiguous" is defined by continuity of the offsets, i.e.
854 a text 'selection' is defined by a start/end offset pair. In
855 the case of bidirectional text, this means that a continguous
856 selection may appear visually discontiguous, and vice-versa.
857 @return the number of contiguous selections in the current Text
860 func = self.get_dbus_method("getNSelections")
861 return func(*args, **kwargs)
863 def getOffsetAtPoint(self, *args, **kwargs):
865 Get the offset of the character at a given onscreen coordinate.
866 The coordinate system used to interpret x and y is determined
867 by parameter coordType.
871 if 0, the input coordinates are interpreted relative to the entire
872 screen, if 1, they are relative to the toplevel window containing
874 @return the text offset (as an offset into the character array)
875 of the glyph whose onscreen bounds contain the point x,y, or
876 -1 if the point is outside the bounds of any glyph.
878 func = self.get_dbus_method("getOffsetAtPoint")
879 return func(*args, **kwargs)
881 def getRangeExtents(self, *args, **kwargs):
883 Obtain the bounding box which entirely contains a given text
884 range. Negative values may be returned for the bounding box parameters
885 in the event that all or part of the text range is offscreen
886 or not mapped to the screen.
888 the offset of the first character in the specified range.
890 the offset of the character immediately after the last character
891 in the specified range.
893 an integer parameter which is back-filled with the minimum horizontal
894 coordinate of the resulting bounding box.
896 an integer parameter which is back-filled with the minimum vertical
897 coordinate of the resulting bounding box.
899 an integer parameter which is back-filled with the horizontal
900 extent of the bounding box.
902 an integer parameter which is back-filled with the vertical extent
905 If 0, the above coordinates are reported in pixels relative to
906 corner of the screen; if 1, the coordinates are reported relative
907 to the corner of the containing toplevel window.
909 func = self.get_dbus_method("getRangeExtents")
910 return func(*args, **kwargs)
912 def getSelection(self, *args, **kwargs):
914 The result of calling getSelection with an out-of-range selectionNum
915 (i.e. for a selection which does not exist) is not strictly defined,
916 but should set endOffset equal to startOffset.
918 func = self.get_dbus_method("getSelection")
919 return func(*args, **kwargs)
921 def getText(self, *args, **kwargs):
923 Obtain all or part of the onscreen textual content of a Text
924 object. If endOffset is specified as "-1", then this method will
925 return the entire onscreen textual contents of the Text object.
926 @return the textual content of the current Text object beginning
927 startOffset (inclusive) up to but not including the character
930 func = self.get_dbus_method("getText")
931 return func(*args, **kwargs)
933 def getTextAfterOffset(self, *args, **kwargs):
935 Obtain a subset of the text content of an object which entirely
936 follows offset, delimited by character, word, line, or sentence
937 boundaries as specified by type. The starting and ending offsets
938 of the resulting substring are returned in startOffset and endOffset.
939 By definition, if such a substring exists, startOffset must be
942 the offset from which the substring search begins, and which
943 must lie before the returned substring.
945 the text-boundary delimiter which determines whether the returned
946 text constitures a character, word, line, or sentence (and possibly
947 attendant whitespace), and whether the start or ending of such
948 a substring forms the boundary condition.
950 back-filled with the starting offset of the resulting substring,
953 back-filled with the offset of the character immediately following
954 the resulting substring, if one exists.
955 @return a string which is a substring of the text content of
956 the object, delimited by the specified boundary condition.
958 func = self.get_dbus_method("getTextAfterOffset")
959 return func(*args, **kwargs)
961 def getTextAtOffset(self, *args, **kwargs):
963 Obtain a subset of the text content of an object which includes
964 the specified offset, delimited by character, word, line, or
965 sentence boundaries as specified by type. The starting and ending
966 offsets of the resulting substring are returned in startOffset
969 the offset from which the substring search begins, and which
970 must lie within the returned substring.
972 the text-boundary delimiter which determines whether the returned
973 text constitures a character, word, line, or sentence (and possibly
974 attendant whitespace), and whether the start or ending of such
975 a substring forms the boundary condition.
977 back-filled with the starting offset of the resulting substring,
980 back-filled with the offset of the character immediately following
981 the resulting substring, if one exists.
982 @return a string which is a substring of the text content of
983 the object, delimited by the specified boundary condition.
985 func = self.get_dbus_method("getTextAtOffset")
986 return func(*args, **kwargs)
988 def getTextBeforeOffset(self, *args, **kwargs):
990 Obtain a subset of the text content of an object which entirely
991 precedes offset, delimited by character, word, line, or sentence
992 boundaries as specified by type. The starting and ending offsets
993 of the resulting substring are returned in startOffset and endOffset.
994 By definition, if such a substring exists, endOffset is less
995 than or equal to offset.
997 the offset from which the substring search begins.
999 the text-boundary delimiter which determines whether the returned
1000 text constitures a character, word, line, or sentence (and possibly
1001 attendant whitespace), and whether the start or ending of such
1002 a substring forms the boundary condition.
1003 @param : startOffset
1004 back-filled with the starting offset of the resulting substring,
1007 back-filled with the offset of the character immediately following
1008 the resulting substring, if one exists.
1009 @return a string which is a substring of the text content of
1010 the object, delimited by the specified boundary condition.
1012 func = self.get_dbus_method("getTextBeforeOffset")
1013 return func(*args, **kwargs)
1015 def removeSelection(self, *args, **kwargs):
1017 Deselect the text contained in the specified selectionNum, if
1018 such a selection exists, otherwise do nothing. Removal of a non-existant
1019 selectionNum has no effect.
1020 @return True if the selection was successfully removed, False
1023 func = self.get_dbus_method("removeSelection")
1024 return func(*args, **kwargs)
1026 def setCaretOffset(self, *args, **kwargs):
1028 Programmatically move the text caret (visible or virtual, as
1029 above) to a given position.
1031 a long int indicating the desired character offset. Not all implementations
1032 of Text will honor setCaretOffset requests, so the return value
1033 below should be checked by the client.
1034 @return TRUE if the request was carried out, or FALSE if the
1035 caret could not be moved to the requested position.
1037 func = self.get_dbus_method("setCaretOffset")
1038 return func(*args, **kwargs)
1040 def setSelection(self, *args, **kwargs):
1042 Modify an existing selection's start or ending offset.
1043 Calling setSelection for a selectionNum that is not already defined
1044 has no effect. The result of calling setSelection with a selectionNum
1045 greater than 0 for objects that do not include STATE_MULTISELECTABLE
1047 @param : selectionNum
1048 indicates which of a set of non-contiguous selections to modify.
1049 @param : startOffset
1050 the new starting offset for the selection
1052 the new ending offset for the selection
1053 @return True if the selection corresponding to selectionNum is
1054 successfully modified, False otherwise.
1056 func = self.get_dbus_method("setSelection")
1057 return func(*args, **kwargs)
1059 def get_caretOffset(self):
1060 self._pgetter(self._dbus_interface, "caretOffset")
1061 def set_caretOffset(self, value):
1062 self._psetter(self._dbus_interface, "caretOffset", value)
1065 The current offset of the text caret in the Text object. This
1066 caret may be virtual, e.g. non-visual and notional-only, but
1067 if an onscreen representation of the caret position is visible,
1068 it will correspond to this offset. The caret offset is given
1069 as a character offset, as opposed to a byte offset into a text
1070 buffer or a column offset.
1072 caretOffset = property(fget=get_caretOffset, fset=set_caretOffset, doc=_caretOffsetDoc)
1074 def get_characterCount(self):
1075 self._pgetter(self._dbus_interface, "characterCount")
1076 def set_characterCount(self, value):
1077 self._psetter(self._dbus_interface, "characterCount", value)
1078 _characterCountDoc = \
1080 The total current number of characters in the Text object, including
1081 whitespace and non-spacing characters.
1083 characterCount = property(fget=get_characterCount, fset=set_characterCount, doc=_characterCountDoc)
1086 def __new__(cls, startOffset, endOffset, content, data):
1087 list.__new__(cls, (startOffset, endOffset, content, data))
1088 def __init__(self, startOffset, endOffset, content, data):
1089 list.__init__(self, (startOffset, endOffset, content, data))
1091 def _get_startOffset(self):
1093 def _set_startOffset(self, val):
1095 startOffset = property(fget=_get_startOffset, fset=_set_startOffset)
1096 def _get_endOffset(self):
1098 def _set_endOffset(self, val):
1100 endOffset = property(fget=_get_endOffset, fset=_set_endOffset)
1101 def _get_content(self):
1103 def _set_content(self, val):
1105 content = property(fget=_get_content, fset=_set_content)
1106 def _get_data(self):
1108 def _set_data(self, val):
1110 data = property(fget=_get_data, fset=_set_data)
1113 class EditableText(Text):
1115 Derived from interface Text, EditableText provides methods for
1116 modifying textual content of components which support editing.
1117 EditableText also interacts with the system clipboard via copyText,
1118 cutText, and pasteText.
1121 def copyText(self, *args, **kwargs):
1123 Copy a range of text into the system clipboard.
1125 the character offset of the first character in the range of text
1128 the offset of the first character past the end of the range of
1131 func = self.get_dbus_method("copyText")
1132 return func(*args, **kwargs)
1134 def cutText(self, *args, **kwargs):
1136 Excise a range of text from a Text object, copying it into the
1139 the character offset of the first character in the range of text
1142 the offset of the first character past the end of the range of
1144 @return True if the text was successfully cut, False otherwise.
1146 func = self.get_dbus_method("cutText")
1147 return func(*args, **kwargs)
1149 def deleteText(self, *args, **kwargs):
1151 Excise a range of text from a Text object without copying it
1152 into the system clipboard.
1154 the character offset of the first character in the range of text
1157 the offset of the first character past the end of the range of
1159 @return True if the text was successfully deleted, False otherwise.
1161 func = self.get_dbus_method("deleteText")
1162 return func(*args, **kwargs)
1164 def insertText(self, *args, **kwargs):
1166 Insert new text contents into an existing text object at a given
1167 location, while retaining the old contents.
1169 the character offset into the Text implementor's content at which
1170 the new content will be inserted.
1172 a UTF-8 string of which length characters will be inserted into
1173 the text object's text buffer.
1175 the number of characters of text to insert. If the character
1176 count of text is less than or equal to length, the entire contents
1177 of text will be inserted.
1178 @return True if the text content was successfully inserted, False
1181 func = self.get_dbus_method("insertText")
1182 return func(*args, **kwargs)
1184 def pasteText(self, *args, **kwargs):
1186 Copy the text contents of the system clipboard, if any, into
1187 a Text object, inserting it at a particular character offset.
1189 the character offset before which the text will be inserted.
1190 @return True if the text was successfully pasted into the Text
1191 object, False otherwise.
1193 func = self.get_dbus_method("pasteText")
1194 return func(*args, **kwargs)
1196 def setAttributes(self, *args, **kwargs):
1198 Apply a particular set of attributes to a range of text.
1199 @return True if the text attributes were successfully modified,
1202 func = self.get_dbus_method("setAttributes")
1203 return func(*args, **kwargs)
1205 def setTextContents(self, *args, **kwargs):
1207 Replace the text contents with a new string, discarding the old
1209 @param : newContents
1210 a UTF-8 string with which the text object's contents will be
1212 @return True if the text content was successfully changed, False
1215 func = self.get_dbus_method("setTextContents")
1216 return func(*args, **kwargs)
1218 def unImplemented10(self, *args, **kwargs):
1219 func = self.get_dbus_method("unImplemented10")
1220 return func(*args, **kwargs)
1222 def unImplemented11(self, *args, **kwargs):
1223 func = self.get_dbus_method("unImplemented11")
1224 return func(*args, **kwargs)
1226 def unImplemented12(self, *args, **kwargs):
1227 func = self.get_dbus_method("unImplemented12")
1228 return func(*args, **kwargs)
1230 def unImplemented5(self, *args, **kwargs):
1233 placeholders for future expansion. Note that these are named
1234 'unimplemented5 and unimplemented6' to avoid conflict with placeholders
1235 from Accessibility::Text.
1237 func = self.get_dbus_method("unImplemented5")
1238 return func(*args, **kwargs)
1240 def unImplemented6(self, *args, **kwargs):
1241 func = self.get_dbus_method("unImplemented6")
1242 return func(*args, **kwargs)
1244 def unImplemented9(self, *args, **kwargs):
1245 func = self.get_dbus_method("unImplemented9")
1246 return func(*args, **kwargs)
1249 def __new__(cls, type, source, detail1, detail2, any_data):
1250 list.__new__(cls, (type, source, detail1, detail2, any_data))
1251 def __init__(self, type, source, detail1, detail2, any_data):
1252 list.__init__(self, (type, source, detail1, detail2, any_data))
1254 def _get_type(self):
1256 def _set_type(self, val):
1258 type = property(fget=_get_type, fset=_set_type)
1259 def _get_source(self):
1261 def _set_source(self, val):
1263 source = property(fget=_get_source, fset=_set_source)
1264 def _get_detail1(self):
1266 def _set_detail1(self, val):
1268 detail1 = property(fget=_get_detail1, fset=_set_detail1)
1269 def _get_detail2(self):
1271 def _set_detail2(self, val):
1273 detail2 = property(fget=_get_detail2, fset=_set_detail2)
1274 def _get_any_data(self):
1276 def _set_any_data(self, val):
1278 any_data = property(fget=_get_any_data, fset=_set_any_data)
1281 class EventDetails(list):
1282 def __new__(cls, host_application, source_role, source_name, any_data):
1283 list.__new__(cls, (host_application, source_role, source_name, any_data))
1284 def __init__(self, host_application, source_role, source_name, any_data):
1285 list.__init__(self, (host_application, source_role, source_name, any_data))
1287 def _get_host_application(self):
1289 def _set_host_application(self, val):
1291 host_application = property(fget=_get_host_application, fset=_set_host_application)
1292 def _get_source_role(self):
1294 def _set_source_role(self, val):
1296 source_role = property(fget=_get_source_role, fset=_set_source_role)
1297 def _get_source_name(self):
1299 def _set_source_name(self, val):
1301 source_name = property(fget=_get_source_name, fset=_set_source_name)
1302 def _get_any_data(self):
1304 def _set_any_data(self, val):
1306 any_data = property(fget=_get_any_data, fset=_set_any_data)
1308 class EventListener(_BaseProxy):
1310 A generic interface implemented by objects for the receipt of
1311 event notifications. EventListener is the interface from which
1312 Accessibility::Registry is derived, and via which clients of
1313 the Registry receive notification of changes to an application's
1314 user interface and content.
1317 def notifyEvent(self, *args, **kwargs):
1319 Synchronously notify an EventListener that an event has occurred,
1320 by passing it an Event struct.
1322 The Event about which the listener is being notified.
1324 func = self.get_dbus_method("notifyEvent")
1325 return func(*args, **kwargs)
1327 def unImplemented2_(self, *args, **kwargs):
1328 func = self.get_dbus_method("unImplemented2_")
1329 return func(*args, **kwargs)
1331 def unImplemented3_(self, *args, **kwargs):
1332 func = self.get_dbus_method("unImplemented3_")
1333 return func(*args, **kwargs)
1335 def unImplemented4_(self, *args, **kwargs):
1336 func = self.get_dbus_method("unImplemented4_")
1337 return func(*args, **kwargs)
1339 def unImplemented_(self, *args, **kwargs):
1340 func = self.get_dbus_method("unImplemented_")
1341 return func(*args, **kwargs)
1344 class EventListenerMode(list):
1345 def __new__(cls, synchronous, preemptive, global_):
1346 list.__new__(cls, (synchronous, preemptive, global_))
1347 def __init__(self, synchronous, preemptive, global_):
1348 list.__init__(self, (synchronous, preemptive, global_))
1350 def _get_synchronous(self):
1352 def _set_synchronous(self, val):
1354 synchronous = property(fget=_get_synchronous, fset=_set_synchronous)
1355 def _get_preemptive(self):
1357 def _set_preemptive(self, val):
1359 preemptive = property(fget=_get_preemptive, fset=_set_preemptive)
1360 def _get_global_(self):
1362 def _set_global_(self, val):
1364 global_ = property(fget=_get_global_, fset=_set_global_)
1367 class EventType(_Enum):
1369 0:'KEY_PRESSED_EVENT',
1370 1:'KEY_RELEASED_EVENT',
1371 2:'BUTTON_PRESSED_EVENT',
1372 3:'BUTTON_RELEASED_EVENT',
1375 class Hyperlink(_BaseProxy):
1377 Instances of Hyperlink are returned by Hypertext objects, and
1378 are the means by which end users and clients interact with linked,
1379 and in some cases embedded, content. Hyperlinks may have multiple
1380 "anchors", where an anchor corresponds to a reference to a particular
1381 resource with a corresponding resource identified (URI). Hyperlinks
1382 may be queried for their URIs, or queried for the objects corresponding
1383 to their anchors. The objects thus obtained are instances of
1384 Accessible, and may be queried, and manipulated via the Action
1388 def getObject(self, *args, **kwargs):
1390 Gets the i'th object, (where i is an integer between 0 and Hyperlink::numAnchors
1391 - 1, inclusive) associated with a Hyperlink. The objects returned
1392 are usually actionable (i.e. they should implement Accessibility::Action),
1393 and the available actions often include "open", "bookmark", "save
1394 link as", etc. They may also implement Accessibility::StreamableContent,
1395 although clients can normally use getURI to obtain a resource
1396 locator via which the object's data may be accessed.
1397 @return an Accessible object instance representing the Hyperlink's
1398 ith anchor, or through which the content associated with the
1399 ith anchor can be accessed.
1401 func = self.get_dbus_method("getObject")
1402 return func(*args, **kwargs)
1404 def getURI(self, *args, **kwargs):
1406 Obtain a resource locator ('URI') which can be used to access
1407 the content to which this link "points" or is connected.
1408 @return a string corresponding to the URI of the Hyperlink's
1409 'ith' anchor, if one exists, or a NIL string otherwise.
1411 func = self.get_dbus_method("getURI")
1412 return func(*args, **kwargs)
1414 def isValid(self, *args, **kwargs):
1416 Check the hyperlink to see if a connection to its backing content
1417 can be established, or if its URI is valid.
1418 @return True if the object's content is available, or False if
1419 the hyperlink's URI is invalid, or a connection to the resource
1420 can not be established.
1422 func = self.get_dbus_method("isValid")
1423 return func(*args, **kwargs)
1425 def unImplemented(self, *args, **kwargs):
1426 func = self.get_dbus_method("unImplemented")
1427 return func(*args, **kwargs)
1429 def unImplemented2(self, *args, **kwargs):
1430 func = self.get_dbus_method("unImplemented2")
1431 return func(*args, **kwargs)
1433 def unImplemented3(self, *args, **kwargs):
1434 func = self.get_dbus_method("unImplemented3")
1435 return func(*args, **kwargs)
1437 def unImplemented4(self, *args, **kwargs):
1438 func = self.get_dbus_method("unImplemented4")
1439 return func(*args, **kwargs)
1441 def get_endIndex(self):
1442 self._pgetter(self._dbus_interface, "endIndex")
1443 def set_endIndex(self, value):
1444 self._psetter(self._dbus_interface, "endIndex", value)
1447 the ending offset within the containing Hypertext content with
1448 which this Hyperlink is associated; that is, the offset of the
1449 first element past the range within the Hypertext associated
1450 with this Hyperlink.
1452 endIndex = property(fget=get_endIndex, fset=set_endIndex, doc=_endIndexDoc)
1454 def get_nAnchors(self):
1455 self._pgetter(self._dbus_interface, "nAnchors")
1456 def set_nAnchors(self, value):
1457 self._psetter(self._dbus_interface, "nAnchors", value)
1460 the number of separate anchors associated with this Hyperlink
1462 nAnchors = property(fget=get_nAnchors, fset=set_nAnchors, doc=_nAnchorsDoc)
1464 def get_startIndex(self):
1465 self._pgetter(self._dbus_interface, "startIndex")
1466 def set_startIndex(self, value):
1467 self._psetter(self._dbus_interface, "startIndex", value)
1470 the starting offset within the containing Hypertext content with
1471 which this Hyperlink is associated
1473 startIndex = property(fget=get_startIndex, fset=set_startIndex, doc=_startIndexDoc)
1476 class Hypertext(_BaseProxy):
1478 An interface used for objects which implement linking between
1479 multiple resource or content locations, or multiple 'markers'
1480 within a single document. A Hypertext instance is associated
1481 with one or more Hyperlinks, which are associated with particular
1482 offsets within the Hypertext's included content.
1485 def getLink(self, *args, **kwargs):
1487 Get one of the Hyperlinks associated with this Hypertext object,
1490 an integer from 0 to getNLinks() - 1.
1491 @return the Hyperlink in this Hypertext object.
1493 func = self.get_dbus_method("getLink")
1494 return func(*args, **kwargs)
1496 def getLinkIndex(self, *args, **kwargs):
1498 Get the hyperlink index, if any, associated with a particular
1499 character offset in the Hypertext object. For Hypertext implementors
1500 without textual content, all hyperlinks are associated with character
1502 @return the index of the Hyperlink associated with character
1503 offset characterIndex, or -1 if no Hyperlink is associated with
1504 that character offset.
1506 func = self.get_dbus_method("getLinkIndex")
1507 return func(*args, **kwargs)
1509 def getNLinks(self, *args, **kwargs):
1511 Query the hypertext object for the number of Hyperlinks it contains.
1512 @return the number of Hyperlinks associated with this Hypertext
1513 object, as a long integer.
1515 func = self.get_dbus_method("getNLinks")
1516 return func(*args, **kwargs)
1518 class Image(_BaseProxy):
1520 An interface implemented by objects which render image data or
1521 pictorial information to the screen. When onscreen components
1522 include graphical information that is not purely intended to
1523 enhance "3d effect" or visual layout, but which conveys some
1524 semantic or informational content to the sighted user, they should
1525 implement Image, and that semantic content should be conveyed
1526 textually to the extent possible via the image description, as
1527 well as the Accessible::name and Accessible::description properties.
1530 def getImageExtents(self, *args, **kwargs):
1532 Obtain a bounding box which entirely contains the image contents,
1533 as displayed on screen. The bounds returned do not account for
1534 any viewport clipping or the fact that the image may be partially
1535 or wholly obscured by other onscreen content.
1537 If 0, the returned bounding box position is returned relative
1538 to the screen; if 1, the bounding box position is returned relative
1539 to the containing window.
1540 @return a BoundingBox enclosing the image's onscreen representation.
1542 func = self.get_dbus_method("getImageExtents")
1543 return func(*args, **kwargs)
1545 def getImagePosition(self, *args, **kwargs):
1547 Get the coordinates of the current image position on screen.
1549 Back-filled with the x coordinate of the onscreen image (i.e.
1550 the minimum x coordinate)
1552 Back-filled with the y coordinate of the onscreen image (i.e.
1553 the minimum y coordinate)
1555 If 0, the returned x and y coordinates are returned relative
1556 to the screen; if 1, they are returned relative to the containing
1559 func = self.get_dbus_method("getImagePosition")
1560 return func(*args, **kwargs)
1562 def getImageSize(self, *args, **kwargs):
1564 Obtain the width and height of the current onscreen view of the
1565 image. The extents returned do not account for any viewport clipping
1566 or the fact that the image may be partially or wholly obscured
1567 by other onscreen content.
1569 Back-filled with the x extents of the onscreen image (i.e. the
1570 image width in pixels)
1572 Back-filled with the y extents of the onscreen image (i.e. the
1573 image height in pixels)
1575 func = self.get_dbus_method("getImageSize")
1576 return func(*args, **kwargs)
1578 def get_imageDescription(self):
1579 self._pgetter(self._dbus_interface, "imageDescription")
1580 def set_imageDescription(self, value):
1581 self._psetter(self._dbus_interface, "imageDescription", value)
1582 _imageDescriptionDoc = \
1584 A UTF-8 string providing a textual description of what is visually
1585 depicted in the image.
1587 imageDescription = property(fget=get_imageDescription, fset=set_imageDescription, doc=_imageDescriptionDoc)
1589 def get_imageLocale(self):
1590 self._pgetter(self._dbus_interface, "imageLocale")
1591 def set_imageLocale(self, value):
1592 self._psetter(self._dbus_interface, "imageLocale", value)
1595 A string corresponding to the POSIX LC_MESSAGES locale used by
1596 the imageDescription.
1598 imageLocale = property(fget=get_imageLocale, fset=set_imageLocale, doc=_imageLocaleDoc)
1601 class KeyDefinition(list):
1602 def __new__(cls, keycode, keysym, keystring, unused):
1603 list.__new__(cls, (keycode, keysym, keystring, unused))
1604 def __init__(self, keycode, keysym, keystring, unused):
1605 list.__init__(self, (keycode, keysym, keystring, unused))
1607 def _get_keycode(self):
1609 def _set_keycode(self, val):
1611 keycode = property(fget=_get_keycode, fset=_set_keycode)
1612 def _get_keysym(self):
1614 def _set_keysym(self, val):
1616 keysym = property(fget=_get_keysym, fset=_set_keysym)
1617 def _get_keystring(self):
1619 def _set_keystring(self, val):
1621 keystring = property(fget=_get_keystring, fset=_set_keystring)
1622 def _get_unused(self):
1624 def _set_unused(self, val):
1626 unused = property(fget=_get_unused, fset=_set_unused)
1628 class KeyEventType(_Enum):
1634 class KeySynthType(_Enum):
1638 2:'KEY_PRESSRELEASE',
1643 class LOCALE_TYPE(_Enum):
1645 0:'LOCALE_TYPE_MESSAGES',
1646 1:'LOCALE_TYPE_COLLATE',
1647 2:'LOCALE_TYPE_CTYPE',
1648 3:'LOCALE_TYPE_MONETARY',
1649 4:'LOCALE_TYPE_NUMERIC',
1650 5:'LOCALE_TYPE_TIME',
1653 class LoginHelper(_BaseProxy):
1655 An interface for use by assistive technologies by which they
1656 can access system information and services on a 'need to know'
1657 basis while the screen is locked, during user authentication,
1658 or during other sensitive operations.
1659 This interface is intended for use by assistive technologies
1660 and related user-enabling services, and by applications and utilities
1661 which may wish to restrict access to certain system devices and
1662 services during security-sensitive states, e.g. when the screen
1663 is locked or during authentication into some secure service.
1664 Such 'applications' (for instance, screen lock dialogs and security-enabled
1665 web browsers) use the LoginHelper client interfaces, and the
1666 bonobo-activation query service, to query for assistive technologies
1667 which advertise the LoginHelper service. The client then queries
1668 these assistive technologies for their device I/O requirements,
1669 via the getDeviceReqs call. The client may then issue the advisory
1670 request setSafe (TRUE), which requests that the LoginHelper -implementing
1671 service make a best-effort attempt to make itself more secure
1672 (for instance, an onscreen keyboard might turn off word prediction,
1673 and a screenreader may turn off keyboard echo via speech). The
1674 return value of setSafe is an advisory indication of whether
1675 this attempt was successful (no specific guarantees are implied).
1676 Once the 'security sensitive' state is exited, the client should
1677 call setSafe (FALSE).
1678 The return values from getDeviceReqs inform the client of which
1679 services the LoginHelper service (e. g. assistive technology)
1680 needs in order to do its job. The client may use this information
1681 to loosen any restrictions on access which it may currently have
1682 in place (for instance, keyboard grabs, etc.). If it does not
1683 do so, the likely outcome is that the end-user will experience
1684 loss of access to the system.
1687 def getDeviceReqs(self, *args, **kwargs):
1690 Query a LoginHelper for the types of device I/O it requires,
1691 in order to do its job. For instance, a LoginHelper which needs
1692 to receive keyboard events will include Accessibility_LoginHelper_CORE_KEYBOARD
1694 @return : A sequence of LoginHelper_DeviceReq indicating the
1695 device I/O required in order to facilitate end-user access to
1698 func = self.get_dbus_method("getDeviceReqs")
1699 return func(*args, **kwargs)
1701 def getRaiseWindows(self, *args, **kwargs):
1704 Get a list of window IDs that need raising on login.
1705 @return : a sequence containing window IDS for toplevels which
1706 need to be raised/made visible during user authentication, in
1707 order for the LoginHelper to facilitate end-user access to the
1710 func = self.get_dbus_method("getRaiseWindows")
1711 return func(*args, **kwargs)
1713 def setSafe(self, *args, **kwargs):
1717 TRUE if the client is requesting that 'safe mode' be initiated,
1718 FALSE if the client is advising that 'safe mode' may be exited,
1719 i.e. normal operation may be resumed.
1720 Request a LoginHelper to enter "safe" mode, or inform LoginHelper
1721 that "safe" mode may be exited. If safe_mode is TRUE, but the
1722 return value is FALSE, the requesting client may wish to deny
1723 services to the LoginHelper, for instance avoid raising its toplevels.
1724 The return value is purely advisory, and no guarantees are intended
1725 about what the implementing LoginHelper will do to improve security
1726 when in "safe" mode.
1727 @return : whether the LoginHelper is now "safe" or not.
1729 func = self.get_dbus_method("setSafe")
1730 return func(*args, **kwargs)
1732 class DeviceReq(_Enum):
1747 AUDIO_IN = DeviceReq(6)
1749 AUDIO_OUT = DeviceReq(5)
1751 CORE_KEYBOARD = DeviceReq(1)
1753 CORE_POINTER = DeviceReq(2)
1755 EXT_INPUT = DeviceReq(3)
1757 GUI_EVENTS = DeviceReq(0)
1759 LOCALHOST = DeviceReq(8)
1761 NETWORK = DeviceReq(7)
1763 POST_WINDOWS = DeviceReq(4)
1765 SERIAL_IN = DeviceReq(10)
1767 SERIAL_OUT = DeviceReq(9)
1769 class WindowInfo(list):
1770 def __new__(cls, winID):
1771 list.__new__(cls, (winID))
1772 def __init__(self, winID):
1773 list.__init__(self, (winID))
1775 def _get_winID(self):
1777 def _set_winID(self, val):
1779 winID = property(fget=_get_winID, fset=_set_winID)
1781 class ModifierType(_Enum):
1784 1:'MODIFIER_SHIFTLOCK',
1785 2:'MODIFIER_CONTROL',
1790 7:'MODIFIER_NUMLOCK',
1793 class Registry(EventListener):
1795 The Registry is a service through which applications providing
1796 accessibility services (servers) can rendezvous with consumers
1797 of those services (Assistive Technologies). The Registry is the
1798 first "port of call" for accessible applications and for assistive
1799 technologies wishing to query and interact with those applications.
1800 The Registry service provides four basic functions to Assistive
1801 Technology (AT) clients:
1802 it provides a list of the applications who have registered with
1803 the AT-SPI framework, thereby announcing their participation
1804 in the AT-SPI framework;
1805 it allows AT clients to register for notification of changes
1806 in application state (at-spi Events);
1807 it dispatches/relays said events from participating applications
1808 to the registered listeners;
1809 it gives access to system device events via the associated DeviceEventController
1811 From the point of view of accessible applications (i.e. AT-SPI
1812 service producers), the Registry is primarily a registration
1813 and event delivery service. Applications normally only call the
1814 registerApplication and deregisterApplication Registry methods,
1815 and its inherited EventListener::notifyEvent method.
1816 The Registry normally lives in its own process space; communication
1817 via Registry and both application services and AT clients takes
1818 place via IPC. A process space diagram illustrating the relationship
1819 between applications, Registry, and AT is shown below.
1822 def deregisterApplication(self, *args, **kwargs):
1824 De-register an application previously registered with the broker.
1825 deregisterApplication:
1827 a reference to the Application to be deregistered.
1829 func = self.get_dbus_method("deregisterApplication")
1830 return func(*args, **kwargs)
1832 def deregisterGlobalEventListener(self, *args, **kwargs):
1834 deregisterGlobalEventListener:
1836 the requesting EventListener
1838 a string indicating the type of events
1839 Request that a previously registered client stop receiving global
1840 notifications for events of a certain type.
1842 func = self.get_dbus_method("deregisterGlobalEventListener")
1843 return func(*args, **kwargs)
1845 def deregisterGlobalEventListenerAll(self, *args, **kwargs):
1847 deregisterGlobalEventListenerAll:
1849 the requesting EventListener
1850 Request that a previously registered client stop receiving global
1851 notifications for all events for which it was registered.
1853 func = self.get_dbus_method("deregisterGlobalEventListenerAll")
1854 return func(*args, **kwargs)
1856 def getDesktop(self, *args, **kwargs):
1859 : the index of the requested Desktop.
1860 Get the nth accessible desktop.
1861 @return a reference to the requested Desktop.
1863 func = self.get_dbus_method("getDesktop")
1864 return func(*args, **kwargs)
1866 def getDesktopCount(self, *args, **kwargs):
1868 event types: "Window" "Desktop" "Window:Create" "Window:Destroy"
1869 "Window:Iconify" "Window:Restore" "Window:Fullscreen" "Window:Resize"
1870 "Desktop:Create" "Desktop:Destroy" "Desktop:Focus" "Desktop:Defocus"
1871 "Desktop:Reorder" "Focus" "GtkWidget:show" "GObject:notify:<propertyname>"
1872 ( not sure we should allow these last 2 forms, since they are
1873 toolkit-specific, but they're powerful ) getDesktopCount:
1874 Get the current number of desktops.
1875 @return a short integer indicating the current number of Desktops.
1877 func = self.get_dbus_method("getDesktopCount")
1878 return func(*args, **kwargs)
1880 def getDesktopList(self, *args, **kwargs):
1882 Get a list of accessible desktops.
1883 @return : a sequence containing references to the Desktops.
1885 func = self.get_dbus_method("getDesktopList")
1886 return func(*args, **kwargs)
1888 def getDeviceEventController(self, *args, **kwargs):
1890 Obtain an object which can be used to request device event notifications.
1891 @return : an object implementing DeviceEventController
1893 func = self.get_dbus_method("getDeviceEventController")
1894 return func(*args, **kwargs)
1896 def registerApplication(self, *args, **kwargs):
1898 Register a new application with the accessibility broker.
1900 a reference to the requesting Application
1902 func = self.get_dbus_method("registerApplication")
1903 return func(*args, **kwargs)
1905 def registerGlobalEventListener(self, *args, **kwargs):
1907 Register a client's interest in (all) application events of a
1910 a reference to the requesting EventListener.
1912 a string which indicates the type of events about which the client
1913 desires notification.
1915 func = self.get_dbus_method("registerGlobalEventListener")
1916 return func(*args, **kwargs)
1923 1:'ROLE_ACCELERATOR_LABEL',
1930 8:'ROLE_CHECK_MENU_ITEM',
1931 9:'ROLE_COLOR_CHOOSER',
1932 10:'ROLE_COLUMN_HEADER',
1933 11:'ROLE_COMBO_BOX',
1934 12:'ROLE_DATE_EDITOR',
1935 13:'ROLE_DESKTOP_ICON',
1936 14:'ROLE_DESKTOP_FRAME',
1939 17:'ROLE_DIRECTORY_PANE',
1940 18:'ROLE_DRAWING_AREA',
1941 19:'ROLE_FILE_CHOOSER',
1943 21:'ROLE_FOCUS_TRAVERSABLE',
1944 22:'ROLE_FONT_CHOOSER',
1946 24:'ROLE_GLASS_PANE',
1947 25:'ROLE_HTML_CONTAINER',
1950 28:'ROLE_INTERNAL_FRAME',
1952 30:'ROLE_LAYERED_PANE',
1954 32:'ROLE_LIST_ITEM',
1957 35:'ROLE_MENU_ITEM',
1958 36:'ROLE_OPTION_PANE',
1960 38:'ROLE_PAGE_TAB_LIST',
1962 40:'ROLE_PASSWORD_TEXT',
1963 41:'ROLE_POPUP_MENU',
1964 42:'ROLE_PROGRESS_BAR',
1965 43:'ROLE_PUSH_BUTTON',
1966 44:'ROLE_RADIO_BUTTON',
1967 45:'ROLE_RADIO_MENU_ITEM',
1968 46:'ROLE_ROOT_PANE',
1969 47:'ROLE_ROW_HEADER',
1970 48:'ROLE_SCROLL_BAR',
1971 49:'ROLE_SCROLL_PANE',
1972 50:'ROLE_SEPARATOR',
1974 52:'ROLE_SPIN_BUTTON',
1975 53:'ROLE_SPLIT_PANE',
1976 54:'ROLE_STATUS_BAR',
1978 56:'ROLE_TABLE_CELL',
1979 57:'ROLE_TABLE_COLUMN_HEADER',
1980 58:'ROLE_TABLE_ROW_HEADER',
1981 59:'ROLE_TEAROFF_MENU_ITEM',
1984 62:'ROLE_TOGGLE_BUTTON',
1988 66:'ROLE_TREE_TABLE',
1995 73:'ROLE_PARAGRAPH',
1997 75:'ROLE_APPLICATION',
1998 76:'ROLE_AUTOCOMPLETE',
2004 82:'ROLE_DOCUMENT_FRAME',
2008 86:'ROLE_REDUNDANT_OBJECT',
2011 89:'ROLE_INPUT_METHOD_WINDOW',
2012 90:'ROLE_LAST_DEFINED',
2015 class Selection(_BaseProxy):
2017 An interface which indicates that an object exposes a 'selection'
2018 model, allowing the selection of one or more of its children.
2019 Read-only Selection instances are possible, in which case the
2020 interface is used to programmatically determine the selected-ness
2021 of its children. A selected child has State::STATE_SELECTED,
2022 and a child which may hypothetically be selected (though possibly
2023 not programmatically selectable) has State::STATE_SELECTABLE.
2026 def clearSelection(self, *args, **kwargs):
2028 Attempt to clear all selections (i.e. deselect all children)
2029 of a Selection. Not all Selection implementations allow the removal
2031 @return True if the selections were successfully cleared, False
2034 func = self.get_dbus_method("clearSelection")
2035 return func(*args, **kwargs)
2037 def deselectChild(self, *args, **kwargs):
2039 Remove a child from the selected children list of a Selection,
2040 if the child is currently selected.
2042 a long integer (the zero offset index into the Accessible object's
2043 list of children) indicating which child of the Selection is
2045 @return True if the child was successfully selected, False otherwise.
2047 func = self.get_dbus_method("deselectChild")
2048 return func(*args, **kwargs)
2050 def deselectSelectedChild(self, *args, **kwargs):
2052 Remove a child to the selected children list of a Selection.
2053 @param : selectedChildIndex
2054 a long integer indicating which of the selected children of the
2055 Selection is to be deselected. The index is a zero-offset index
2056 into the 'selected child list', not a zero-offset index into
2057 the list of all children of the Selection.
2058 @return True if the child was successfully deselected, False
2061 func = self.get_dbus_method("deselectSelectedChild")
2062 return func(*args, **kwargs)
2064 def getSelectedChild(self, *args, **kwargs):
2066 Get the i-th selected Accessible child of a Selection.
2067 @param : selectedChildIndex
2068 a long integer indicating which of the selected children of an
2069 object is being requested.
2070 @return a pointer to a selected Accessible child object, specified
2071 by selectedChildIndex.
2073 func = self.get_dbus_method("getSelectedChild")
2074 return func(*args, **kwargs)
2076 def isChildSelected(self, *args, **kwargs):
2078 Determine whether a particular child of an Selection implementor
2079 is currently selected. Note that childIndex is the zero-offset
2080 index into the standard Accessible container's list of children.
2082 an index into the Selection's list of children.
2083 @return True if the specified child is currently selected, False
2086 func = self.get_dbus_method("isChildSelected")
2087 return func(*args, **kwargs)
2089 def selectAll(self, *args, **kwargs):
2091 Attempt to select all of the children of a Selection implementor.
2092 Not all Selection implementors support this operation (for instance,
2093 implementations which support only "single selection" do not
2094 support this operation).
2095 @return True if successful, False otherwise.
2097 func = self.get_dbus_method("selectAll")
2098 return func(*args, **kwargs)
2100 def selectChild(self, *args, **kwargs):
2102 Add a child to the selected children list of a Selection.
2104 a long integer indicating which child of the Selection is to
2106 @return True if the child was successfully selected, False otherwise.
2108 func = self.get_dbus_method("selectChild")
2109 return func(*args, **kwargs)
2111 def unImplemented(self, *args, **kwargs):
2114 placeholders for future expansion.
2116 func = self.get_dbus_method("unImplemented")
2117 return func(*args, **kwargs)
2119 def unImplemented2(self, *args, **kwargs):
2120 func = self.get_dbus_method("unImplemented2")
2121 return func(*args, **kwargs)
2123 def unImplemented3(self, *args, **kwargs):
2124 func = self.get_dbus_method("unImplemented3")
2125 return func(*args, **kwargs)
2127 def get_nSelectedChildren(self):
2128 self._pgetter(self._dbus_interface, "nSelectedChildren")
2129 def set_nSelectedChildren(self, value):
2130 self._psetter(self._dbus_interface, "nSelectedChildren", value)
2131 _nSelectedChildrenDoc = \
2133 The number of children of a Selection implementor which are currently
2136 nSelectedChildren = property(fget=get_nSelectedChildren, fset=set_nSelectedChildren, doc=_nSelectedChildrenDoc)
2139 class Selector(_BaseProxy):
2141 This interface is intended for use by assistive technologies
2142 and related user-agents. Via this interface, an assistive technology
2143 or user agent may expose a series of choices or selections in
2144 textual form, which can be activated on demand by a client of
2145 the Selector interface.
2146 Examples of the use of this interface include voice-command and
2147 remote-control applications, in which the user interaction is
2148 wholly or partly delegated by the implementor to an external
2152 def activateCommand(self, *args, **kwargs):
2154 Request that the Selector invoke the specified Command.
2156 the Command to activate/invoke.
2157 @return a CommandResult indicating whether the request was honored,
2158 and the reason for failure if the Command could not be activated
2161 func = self.get_dbus_method("activateCommand")
2162 return func(*args, **kwargs)
2164 def deregisterChangeListener(self, *args, **kwargs):
2166 Tell the Selector instance to cease notifying the specified CommandListener
2167 of changes to the command list.
2169 the CommandListener to remove from the notification list.
2171 func = self.get_dbus_method("deregisterChangeListener")
2172 return func(*args, **kwargs)
2174 def getCommands(self, *args, **kwargs):
2176 Query the Selector for the current CommandList.
2177 @return the currently available CommandList
2179 func = self.get_dbus_method("getCommands")
2180 return func(*args, **kwargs)
2182 def refreshCommands(self, *args, **kwargs):
2184 Ask the Selector to re-calculate its CommandList.
2185 @return TRUE if the CommandList changed.
2187 func = self.get_dbus_method("refreshCommands")
2188 return func(*args, **kwargs)
2190 def registerChangeListener(self, *args, **kwargs):
2192 Register a :CommandListener instance for notification of changes
2195 the CommandListener to be notified of changes.
2197 func = self.get_dbus_method("registerChangeListener")
2198 return func(*args, **kwargs)
2200 def replaceCommands(self, *args, **kwargs):
2202 @return TRUE if the replacement request was successful, FALSE
2203 if the request could not be honored.
2205 func = self.get_dbus_method("replaceCommands")
2206 return func(*args, **kwargs)
2208 def get_supportsReplace(self):
2209 self._pgetter(self._dbus_interface, "supportsReplace")
2210 def set_supportsReplace(self, value):
2211 self._psetter(self._dbus_interface, "supportsReplace", value)
2212 _supportsReplaceDoc = \
2214 This attribute is TRUE if this Selector allows its CommandList
2215 to be specified by the client
2217 supportsReplace = property(fget=get_supportsReplace, fset=set_supportsReplace, doc=_supportsReplaceDoc)
2219 class CommandResult(_Enum):
2221 A code returned by a call to activateCommand, indicating the
2222 result of the activation request.
2225 0:'COMMAND_RESULT_INVALID',
2226 1:'COMMAND_RESULT_SUCCESS',
2227 2:'COMMAND_RESULT_FAILED',
2228 3:'COMMAND_RESULT_OBSOLETE',
2229 4:'COMMAND_RESULT_LAST_DEFINED',
2232 COMMAND_RESULT_FAILED = CommandResult(2)
2234 COMMAND_RESULT_INVALID = CommandResult(0)
2236 COMMAND_RESULT_LAST_DEFINED = CommandResult(4)
2238 COMMAND_RESULT_OBSOLETE = CommandResult(3)
2240 COMMAND_RESULT_SUCCESS = CommandResult(1)
2242 class StreamableContent(_BaseProxy):
2244 An interface whereby an object allows its backing content to
2245 be streamed to clients. Negotiation of content type is allowed.
2246 Clients may examine the backing data and transform, convert,
2247 or parse the content in order to present it in an alternate form
2251 def getContent(self, *args, **kwargs):
2253 DEPRECATED, use getStream instead. getContent: Retrieve this
2254 object's content, in a format appropriate to a requested mimetype.
2255 long Bonobo::Stream:seek (in long offset, in SeekType
2257 raises (NoPermission, IOError)
2258 void Bonobo::Stream:read (in long count, out iobuf buffer)
2259 raises (NoPermission, IOError)
2261 @return a Bonobo::Stream whose mimetype matches contentType,
2262 if available, or NIL.
2264 func = self.get_dbus_method("getContent")
2265 return func(*args, **kwargs)
2267 def getContentTypes(self, *args, **kwargs):
2270 @return the list of available mimetypes for this object's content.
2272 func = self.get_dbus_method("getContentTypes")
2273 return func(*args, **kwargs)
2275 def getStream(self, *args, **kwargs):
2277 Retrieve this object's content, in a format appropriate to a
2278 requested mimetype, as a ContentStream instance.
2279 @param : contentType
2280 a string specifying the desired mimetype for the content stream.
2281 @return a Stream whose mimetype matches contentType, if available,
2284 func = self.get_dbus_method("getStream")
2285 return func(*args, **kwargs)
2287 def getURI(self, *args, **kwargs):
2289 Get a URI pointing to the content of the specified type, if such
2290 a URI can be obtained. Not all streamable content providers have
2291 URI representations.
2292 @param : contentType
2293 a string specifying the desired mimetype for the content stream.
2294 If NULL, then a URI for the default content type will be returned,
2296 @return a string which constitutes a URI for a stream of the
2297 specified content type, or NULL if no such URI can be obtained.
2299 func = self.get_dbus_method("getURI")
2300 return func(*args, **kwargs)
2302 def unImplemented(self, *args, **kwargs):
2303 func = self.get_dbus_method("unImplemented")
2304 return func(*args, **kwargs)
2306 def unImplemented2(self, *args, **kwargs):
2307 func = self.get_dbus_method("unImplemented2")
2308 return func(*args, **kwargs)
2311 class TEXT_BOUNDARY_TYPE(_Enum):
2313 0:'TEXT_BOUNDARY_CHAR',
2314 1:'TEXT_BOUNDARY_WORD_START',
2315 2:'TEXT_BOUNDARY_WORD_END',
2316 3:'TEXT_BOUNDARY_SENTENCE_START',
2317 4:'TEXT_BOUNDARY_SENTENCE_END',
2318 5:'TEXT_BOUNDARY_LINE_START',
2319 6:'TEXT_BOUNDARY_LINE_END',
2322 class TEXT_CLIP_TYPE(_Enum):
2330 class Table(_BaseProxy):
2332 An interface used by containers whose contained data is arranged
2333 in a "tabular" (i.e. row-column) fashion. Tables may resemble
2334 a two-dimensional grid, as in a spreadsheet, or may feature objects
2335 which span multiple rows and/or columns, but whose bounds are
2336 aligned on a row/column matrix. Thus, the Table interface may
2337 be used to represent "spreadsheets" as well as "frames".
2338 Objects within tables are children of the Table instance, and
2339 they may be referenced either via a child index or via a row/column
2340 pair. Their role may be ROLE_TABLE_CELL, but table 'cells' may
2341 have other roles as well. These 'cells' may implement other interfaces,
2342 such as Text, Action, Image, and Component, and should do so
2343 as appropriate to their onscreen representation and/or behavior.
2346 def addColumnSelection(self, *args, **kwargs):
2348 Select the specified column, adding it to the current column
2349 selection, if the table's selection model permits it.
2351 @return True if the specified column was successfully selected,
2354 func = self.get_dbus_method("addColumnSelection")
2355 return func(*args, **kwargs)
2357 def addRowSelection(self, *args, **kwargs):
2359 Select the specified row, adding it to the current row selection,
2360 if the table's selection model permits it.
2362 @return True if the specified row was successfully selected,
2365 func = self.get_dbus_method("addRowSelection")
2366 return func(*args, **kwargs)
2368 def getAccessibleAt(self, *args, **kwargs):
2370 Get the table cell at the specified row and column indices.
2372 the specified table row, zero-indexed.
2374 the specified table column, zero-indexed.
2375 @return an Accessible object representing the specified table
2378 func = self.get_dbus_method("getAccessibleAt")
2379 return func(*args, **kwargs)
2381 def getColumnAtIndex(self, *args, **kwargs):
2383 Get the table column index occupied by the child at a particular
2386 the specified child index, zero-indexed.
2387 @return a long integer indicating the first column spanned by
2388 the child of a table, at the specified 1-D (zero-offset) index.
2390 func = self.get_dbus_method("getColumnAtIndex")
2391 return func(*args, **kwargs)
2393 def getColumnDescription(self, *args, **kwargs):
2395 Get a text description of a particular table column. This differs
2396 from AccessibleTable_getColumnHeader, which returns an Accessible.
2398 the specified table column, zero-indexed.
2399 @return a UTF-8 string describing the specified table column,
2402 func = self.get_dbus_method("getColumnDescription")
2403 return func(*args, **kwargs)
2405 def getColumnExtentAt(self, *args, **kwargs):
2407 Get the number of columns spanned by the table cell at the specific
2408 row and column. (some tables can have cells which span multiple
2409 rows and/or columns).
2411 the specified table row, zero-indexed.
2413 the specified table column, zero-indexed.
2414 @return a long integer indicating the number of columns spanned
2415 by the specified cell.
2417 func = self.get_dbus_method("getColumnExtentAt")
2418 return func(*args, **kwargs)
2420 def getColumnHeader(self, *args, **kwargs):
2422 Get the header associated with a table column, if available,
2423 as an instance of Accessible. This differs from getColumnDescription,
2424 which returns a string.
2426 the specified table column, zero-indexed.
2427 @return an Accessible representatin of the specified table column,
2430 func = self.get_dbus_method("getColumnHeader")
2431 return func(*args, **kwargs)
2433 def getIndexAt(self, *args, **kwargs):
2435 Get the 1-D child index corresponding to the specified 2-D row
2438 the specified table row, zero-indexed.
2440 the specified table column, zero-indexed.
2441 @return a long integer which serves as the index of a specified
2442 cell in the table, in a form usable by Accessible::getChildAtIndex.
2444 func = self.get_dbus_method("getIndexAt")
2445 return func(*args, **kwargs)
2447 def getRowAtIndex(self, *args, **kwargs):
2449 Get the table row index occupied by the child at a particular
2452 the specified child index, zero-indexed.
2453 @return a long integer indicating the first row spanned by the
2454 child of a table, at the specified 1-D (zero-offset) index.
2456 func = self.get_dbus_method("getRowAtIndex")
2457 return func(*args, **kwargs)
2459 def getRowColumnExtentsAtIndex(self, *args, **kwargs):
2461 Given a child index, determine the row and column indices and
2462 extents, and whether the cell is currently selected. If the child
2463 at index is not a cell (for instance, if it is a summary, caption,
2464 etc.), False is returned.
2466 the index of the Table child whose row/column extents are requested.
2468 back-filled with the first table row associated with the cell
2469 with child index index.
2471 back-filled with the first table column associated with the cell
2472 with child index index.
2473 @param : row_extents
2474 back-filled with the number of table rows across which child
2476 @param : col_extents
2477 back-filled with the number of table columns across which child
2479 @param : is_selected
2480 a boolean which is back-filled with True if the child at index
2481 i corresponds to a selected table cell, False otherwise.
2482 Example: If the Table child at index '6' extends across columns
2483 5 and 6 of row 2 of a Table instance, and is currently selected,
2484 then retval=table::getRowColumnExtentsAtIndex(6,row,col,
2488 will return True, and after the call row, col, row_extents,
2489 col_extents, and is_selected will contain 2, 5, 1, 2, and True,
2491 @return True if the index is associated with a valid table cell,
2492 False if the index does not correspond to a cell. If False is
2493 returned, the values of the out parameters are undefined.
2495 func = self.get_dbus_method("getRowColumnExtentsAtIndex")
2496 return func(*args, **kwargs)
2498 def getRowDescription(self, *args, **kwargs):
2500 Get a text description of a particular table row. This differs
2501 from AccessibleTable_getRowHeader, which returns an Accessible.
2503 the specified table row, zero-indexed.
2504 @return a UTF-8 string describing the specified table row, if
2507 func = self.get_dbus_method("getRowDescription")
2508 return func(*args, **kwargs)
2510 def getRowExtentAt(self, *args, **kwargs):
2512 Get the number of rows spanned by the table cell at the specific
2513 row and column. (some tables can have cells which span multiple
2514 rows and/or columns).
2516 the specified table row, zero-indexed.
2518 the specified table column, zero-indexed.
2519 @return a long integer indicating the number of rows spanned
2520 by the specified cell.
2522 func = self.get_dbus_method("getRowExtentAt")
2523 return func(*args, **kwargs)
2525 def getRowHeader(self, *args, **kwargs):
2527 Get the header associated with a table row, if available. This
2528 differs from getRowDescription, which returns a string.
2530 the specified table row, zero-indexed.
2531 @return an Accessible representatin of the specified table row,
2534 func = self.get_dbus_method("getRowHeader")
2535 return func(*args, **kwargs)
2537 def getSelectedColumns(self, *args, **kwargs):
2539 Obtain the indices of all columns which are currently selected.
2540 @return a sequence of integers comprising the indices of columns
2543 func = self.get_dbus_method("getSelectedColumns")
2544 return func(*args, **kwargs)
2546 def getSelectedRows(self, *args, **kwargs):
2548 Obtain the indices of all rows which are currently selected.
2549 @return a sequence of integers comprising the indices of rows
2552 func = self.get_dbus_method("getSelectedRows")
2553 return func(*args, **kwargs)
2555 def isColumnSelected(self, *args, **kwargs):
2557 Determine whether a table column is selected.
2559 the column being queried.
2560 @return True if the specified column is currently selected, False
2563 func = self.get_dbus_method("isColumnSelected")
2564 return func(*args, **kwargs)
2566 def isRowSelected(self, *args, **kwargs):
2568 Determine whether a table row is selected.
2570 the row being queried.
2571 @return True if the specified row is currently selected, False
2574 func = self.get_dbus_method("isRowSelected")
2575 return func(*args, **kwargs)
2577 def isSelected(self, *args, **kwargs):
2579 Determine whether the cell at a specific row and column is selected.
2581 a row occupied by the cell whose state is being queried.
2583 a column occupied by the cell whose state is being queried.
2584 @return True if the specified cell is currently selected, False
2587 func = self.get_dbus_method("isSelected")
2588 return func(*args, **kwargs)
2590 def removeColumnSelection(self, *args, **kwargs):
2592 Remove the specified column from current column selection, if
2593 the table's selection model permits it.
2595 @return True if the specified column was successfully de-selected,
2598 func = self.get_dbus_method("removeColumnSelection")
2599 return func(*args, **kwargs)
2601 def removeRowSelection(self, *args, **kwargs):
2603 Remove the specified row from current row selection, if the table's
2604 selection model permits it.
2606 @return True if the specified row was successfully de-selected,
2609 func = self.get_dbus_method("removeRowSelection")
2610 return func(*args, **kwargs)
2612 def unImplemented(self, *args, **kwargs):
2613 func = self.get_dbus_method("unImplemented")
2614 return func(*args, **kwargs)
2616 def unImplemented2(self, *args, **kwargs):
2617 func = self.get_dbus_method("unImplemented2")
2618 return func(*args, **kwargs)
2620 def unImplemented3(self, *args, **kwargs):
2621 func = self.get_dbus_method("unImplemented3")
2622 return func(*args, **kwargs)
2624 def unImplemented4(self, *args, **kwargs):
2625 func = self.get_dbus_method("unImplemented4")
2626 return func(*args, **kwargs)
2628 def unImplemented5(self, *args, **kwargs):
2629 func = self.get_dbus_method("unImplemented5")
2630 return func(*args, **kwargs)
2632 def unImplemented6(self, *args, **kwargs):
2633 func = self.get_dbus_method("unImplemented6")
2634 return func(*args, **kwargs)
2636 def unImplemented7(self, *args, **kwargs):
2637 func = self.get_dbus_method("unImplemented7")
2638 return func(*args, **kwargs)
2640 def get_caption(self):
2641 self._pgetter(self._dbus_interface, "caption")
2642 def set_caption(self, value):
2643 self._psetter(self._dbus_interface, "caption", value)
2646 An Accessible which represents of a caption for a Table.
2648 caption = property(fget=get_caption, fset=set_caption, doc=_captionDoc)
2650 def get_nColumns(self):
2651 self._pgetter(self._dbus_interface, "nColumns")
2652 def set_nColumns(self, value):
2653 self._psetter(self._dbus_interface, "nColumns", value)
2656 The total number of columns in this table (including empty columns),
2657 exclusive of columns which are programmatically hidden. Columns
2658 which are scrolled out of view or clipped by the current viewport
2661 nColumns = property(fget=get_nColumns, fset=set_nColumns, doc=_nColumnsDoc)
2663 def get_nRows(self):
2664 self._pgetter(self._dbus_interface, "nRows")
2665 def set_nRows(self, value):
2666 self._psetter(self._dbus_interface, "nRows", value)
2669 The total number of rows in this table (including empty rows),
2670 exclusive of any rows which are programmatically hidden. Rows
2671 which are merely scrolled out of view are included.
2673 nRows = property(fget=get_nRows, fset=set_nRows, doc=_nRowsDoc)
2675 def get_nSelectedColumns(self):
2676 self._pgetter(self._dbus_interface, "nSelectedColumns")
2677 def set_nSelectedColumns(self, value):
2678 self._psetter(self._dbus_interface, "nSelectedColumns", value)
2679 _nSelectedColumnsDoc = \
2681 The number of columns currently selected. A selected column is
2682 one in which all included cells are selected.
2684 nSelectedColumns = property(fget=get_nSelectedColumns, fset=set_nSelectedColumns, doc=_nSelectedColumnsDoc)
2686 def get_nSelectedRows(self):
2687 self._pgetter(self._dbus_interface, "nSelectedRows")
2688 def set_nSelectedRows(self, value):
2689 self._psetter(self._dbus_interface, "nSelectedRows", value)
2690 _nSelectedRowsDoc = \
2692 The number of rows currently selected. A selected row is one
2693 in which all included cells are selected.
2695 nSelectedRows = property(fget=get_nSelectedRows, fset=set_nSelectedRows, doc=_nSelectedRowsDoc)
2697 def get_summary(self):
2698 self._pgetter(self._dbus_interface, "summary")
2699 def set_summary(self, value):
2700 self._psetter(self._dbus_interface, "summary", value)
2703 An accessible object which summarizes the contents of a Table.
2704 This object is frequently itself a Table instance, albeit a simplified
2707 summary = property(fget=get_summary, fset=set_summary, doc=_summaryDoc)
2711 class Value(_BaseProxy):
2713 An interface supporting controls which allow a one-dimensional,
2714 scalar quantity to be modified or which reflect a scalar quantity.
2715 (If STATE_EDITABLE is not present, the valuator is treated as
2719 def unImplemented(self, *args, **kwargs):
2720 func = self.get_dbus_method("unImplemented")
2721 return func(*args, **kwargs)
2723 def unImplemented2(self, *args, **kwargs):
2724 func = self.get_dbus_method("unImplemented2")
2725 return func(*args, **kwargs)
2727 def unImplemented3(self, *args, **kwargs):
2728 func = self.get_dbus_method("unImplemented3")
2729 return func(*args, **kwargs)
2731 def unImplemented4(self, *args, **kwargs):
2732 func = self.get_dbus_method("unImplemented4")
2733 return func(*args, **kwargs)
2735 def get_currentValue(self):
2736 self._pgetter(self._dbus_interface, "currentValue")
2737 def set_currentValue(self, value):
2738 self._psetter(self._dbus_interface, "currentValue", value)
2739 _currentValueDoc = \
2741 The current value of the valuator.
2743 currentValue = property(fget=get_currentValue, fset=set_currentValue, doc=_currentValueDoc)
2745 def get_maximumValue(self):
2746 self._pgetter(self._dbus_interface, "maximumValue")
2747 def set_maximumValue(self, value):
2748 self._psetter(self._dbus_interface, "maximumValue", value)
2749 _maximumValueDoc = \
2751 The maximum value allowed by this valuator.
2753 maximumValue = property(fget=get_maximumValue, fset=set_maximumValue, doc=_maximumValueDoc)
2755 def get_minimumIncrement(self):
2756 self._pgetter(self._dbus_interface, "minimumIncrement")
2757 def set_minimumIncrement(self, value):
2758 self._psetter(self._dbus_interface, "minimumIncrement", value)
2759 _minimumIncrementDoc = \
2761 The smallest incremental change which this valuator allows. If
2762 0, the incremental changes to the valuator are limited only by
2763 the precision of a double precision value on the platform.
2765 minimumIncrement = property(fget=get_minimumIncrement, fset=set_minimumIncrement, doc=_minimumIncrementDoc)
2767 def get_minimumValue(self):
2768 self._pgetter(self._dbus_interface, "minimumValue")
2769 def set_minimumValue(self, value):
2770 self._psetter(self._dbus_interface, "minimumValue", value)
2771 _minimumValueDoc = \
2773 The minimum value allowed by this valuator.
2775 minimumValue = property(fget=get_minimumValue, fset=set_minimumValue, doc=_minimumValueDoc)
2777 BUTTON_PRESSED_EVENT = EventType(2)
2779 BUTTON_RELEASED_EVENT = EventType(3)
2781 KEY_PRESS = KeySynthType(0)
2783 KEY_PRESSED = KeyEventType(0)
2785 KEY_PRESSED_EVENT = EventType(0)
2787 KEY_PRESSRELEASE = KeySynthType(2)
2789 KEY_RELEASE = KeySynthType(1)
2791 KEY_RELEASED = KeyEventType(1)
2793 KEY_RELEASED_EVENT = EventType(1)
2795 KEY_STRING = KeySynthType(4)
2797 KEY_SYM = KeySynthType(3)
2799 LAYER_BACKGROUND = ComponentLayer(1)
2801 LAYER_CANVAS = ComponentLayer(2)
2803 LAYER_INVALID = ComponentLayer(0)
2805 LAYER_LAST_DEFINED = ComponentLayer(8)
2807 LAYER_MDI = ComponentLayer(4)
2809 LAYER_OVERLAY = ComponentLayer(6)
2811 LAYER_POPUP = ComponentLayer(5)
2813 LAYER_WIDGET = ComponentLayer(3)
2815 LAYER_WINDOW = ComponentLayer(7)
2817 LOCALE_TYPE_COLLATE = LOCALE_TYPE(1)
2819 LOCALE_TYPE_CTYPE = LOCALE_TYPE(2)
2821 LOCALE_TYPE_MESSAGES = LOCALE_TYPE(0)
2823 LOCALE_TYPE_MONETARY = LOCALE_TYPE(3)
2825 LOCALE_TYPE_NUMERIC = LOCALE_TYPE(4)
2827 LOCALE_TYPE_TIME = LOCALE_TYPE(5)
2829 MODIFIER_ALT = ModifierType(3)
2831 MODIFIER_CONTROL = ModifierType(2)
2833 MODIFIER_META = ModifierType(4)
2835 MODIFIER_META2 = ModifierType(5)
2837 MODIFIER_META3 = ModifierType(6)
2839 MODIFIER_NUMLOCK = ModifierType(7)
2841 MODIFIER_SHIFT = ModifierType(0)
2843 MODIFIER_SHIFTLOCK = ModifierType(1)
2846 ROLE_ACCELERATOR_LABEL = Role(1)
2848 ROLE_ALERT = Role(2)
2850 ROLE_ANIMATION = Role(3)
2852 ROLE_APPLICATION = Role(75)
2854 ROLE_ARROW = Role(4)
2856 ROLE_AUTOCOMPLETE = Role(76)
2858 ROLE_CALENDAR = Role(5)
2860 ROLE_CANVAS = Role(6)
2862 ROLE_CAPTION = Role(81)
2864 ROLE_CHART = Role(80)
2866 ROLE_CHECK_BOX = Role(7)
2868 ROLE_CHECK_MENU_ITEM = Role(8)
2870 ROLE_COLOR_CHOOSER = Role(9)
2872 ROLE_COLUMN_HEADER = Role(10)
2874 ROLE_COMBO_BOX = Role(11)
2876 ROLE_DATE_EDITOR = Role(12)
2878 ROLE_DESKTOP_FRAME = Role(14)
2880 ROLE_DESKTOP_ICON = Role(13)
2882 ROLE_DIAL = Role(15)
2884 ROLE_DIALOG = Role(16)
2886 ROLE_DIRECTORY_PANE = Role(17)
2888 ROLE_DOCUMENT_FRAME = Role(82)
2890 ROLE_DRAWING_AREA = Role(18)
2892 ROLE_EDITBAR = Role(77)
2894 ROLE_EMBEDDED = Role(78)
2896 ROLE_ENTRY = Role(79)
2898 ROLE_EXTENDED = Role(70)
2900 ROLE_FILE_CHOOSER = Role(19)
2902 ROLE_FILLER = Role(20)
2904 ROLE_FOCUS_TRAVERSABLE = Role(21)
2906 ROLE_FONT_CHOOSER = Role(22)
2908 ROLE_FOOTER = Role(72)
2910 ROLE_FORM = Role(87)
2912 ROLE_FRAME = Role(23)
2914 ROLE_GLASS_PANE = Role(24)
2916 ROLE_HEADER = Role(71)
2918 ROLE_HEADING = Role(83)
2920 ROLE_HTML_CONTAINER = Role(25)
2922 ROLE_ICON = Role(26)
2924 ROLE_IMAGE = Role(27)
2926 ROLE_INPUT_METHOD_WINDOW = Role(89)
2928 ROLE_INTERNAL_FRAME = Role(28)
2930 ROLE_INVALID = Role(0)
2932 ROLE_LABEL = Role(29)
2934 ROLE_LAST_DEFINED = Role(90)
2936 ROLE_LAYERED_PANE = Role(30)
2938 ROLE_LINK = Role(88)
2940 ROLE_LIST = Role(31)
2942 ROLE_LIST_ITEM = Role(32)
2944 ROLE_MENU = Role(33)
2946 ROLE_MENU_BAR = Role(34)
2948 ROLE_MENU_ITEM = Role(35)
2950 ROLE_OPTION_PANE = Role(36)
2952 ROLE_PAGE = Role(84)
2954 ROLE_PAGE_TAB = Role(37)
2956 ROLE_PAGE_TAB_LIST = Role(38)
2958 ROLE_PANEL = Role(39)
2960 ROLE_PARAGRAPH = Role(73)
2962 ROLE_PASSWORD_TEXT = Role(40)
2964 ROLE_POPUP_MENU = Role(41)
2966 ROLE_PROGRESS_BAR = Role(42)
2968 ROLE_PUSH_BUTTON = Role(43)
2970 ROLE_RADIO_BUTTON = Role(44)
2972 ROLE_RADIO_MENU_ITEM = Role(45)
2974 ROLE_REDUNDANT_OBJECT = Role(86)
2976 ROLE_ROOT_PANE = Role(46)
2978 ROLE_ROW_HEADER = Role(47)
2980 ROLE_RULER = Role(74)
2982 ROLE_SCROLL_BAR = Role(48)
2984 ROLE_SCROLL_PANE = Role(49)
2986 ROLE_SECTION = Role(85)
2988 ROLE_SEPARATOR = Role(50)
2990 ROLE_SLIDER = Role(51)
2992 ROLE_SPIN_BUTTON = Role(52)
2994 ROLE_SPLIT_PANE = Role(53)
2996 ROLE_STATUS_BAR = Role(54)
2998 ROLE_TABLE = Role(55)
3000 ROLE_TABLE_CELL = Role(56)
3002 ROLE_TABLE_COLUMN_HEADER = Role(57)
3004 ROLE_TABLE_ROW_HEADER = Role(58)
3006 ROLE_TEAROFF_MENU_ITEM = Role(59)
3008 ROLE_TERMINAL = Role(60)
3010 ROLE_TEXT = Role(61)
3012 ROLE_TOGGLE_BUTTON = Role(62)
3014 ROLE_TOOL_BAR = Role(63)
3016 ROLE_TOOL_TIP = Role(64)
3018 ROLE_TREE = Role(65)
3020 ROLE_TREE_TABLE = Role(66)
3022 ROLE_UNKNOWN = Role(67)
3024 ROLE_VIEWPORT = Role(68)
3026 ROLE_WINDOW = Role(69)
3028 TEXT_BOUNDARY_CHAR = TEXT_BOUNDARY_TYPE(0)
3030 TEXT_BOUNDARY_LINE_END = TEXT_BOUNDARY_TYPE(6)
3032 TEXT_BOUNDARY_LINE_START = TEXT_BOUNDARY_TYPE(5)
3034 TEXT_BOUNDARY_SENTENCE_END = TEXT_BOUNDARY_TYPE(4)
3036 TEXT_BOUNDARY_SENTENCE_START = TEXT_BOUNDARY_TYPE(3)
3038 TEXT_BOUNDARY_WORD_END = TEXT_BOUNDARY_TYPE(2)
3040 TEXT_BOUNDARY_WORD_START = TEXT_BOUNDARY_TYPE(1)
3042 TEXT_CLIP_BOTH = TEXT_CLIP_TYPE(3)
3044 TEXT_CLIP_MAX = TEXT_CLIP_TYPE(2)
3046 TEXT_CLIP_MIN = TEXT_CLIP_TYPE(1)
3048 TEXT_CLIP_NONE = TEXT_CLIP_TYPE(0)