import dbus
-import interfaces
-from base import BaseProxy, Enum
+from interfaces import *
+from accessible import Accessible
+from base import Enum
from factory import accessible_factory
__all__ = [
#------------------------------------------------------------------------------
-class Text(BaseProxy):
+class Text(Accessible):
"""
The text interface should be implemented by objects which place
textual information onscreen as character strings or glyphs.
other reasons (for instance if the user does not have permission
to copy the text into the relevant selection buffer).
"""
- func = self.get_dbus_method("addSelection")
+ func = self.get_dbus_method("addSelection", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getAttributeRun(self, *args, **kwargs):
@return the AttributeSet defined at offset, optionally including
the 'default' attributes.
"""
- func = self.get_dbus_method("getAttributeRun")
+ func = self.get_dbus_method("getAttributeRun", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getAttributeValue(self, *args, **kwargs):
@return the value of attribute (name-value pair) corresponding
to "name", if defined.
"""
- func = self.get_dbus_method("getAttributeValue")
+ func = self.get_dbus_method("getAttributeValue", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getAttributes(self, offset):
@return the attributes at offset, as a semicolon-delimited set
of colon-delimited name-value pairs.
"""
- func = self.get_dbus_method("getAttributes")
+ func = self.get_dbus_method("getAttributes", dbus_interface=ATSPI_TEXT)
return func(dbus.Int32(offset))
def getBoundedRanges(self, *args, **kwargs):
determines whether text which intersects the bounding box in
the y direction is included.
"""
- func = self.get_dbus_method("getBoundedRanges")
+ func = self.get_dbus_method("getBoundedRanges", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getCharacterAtOffset(self, *args, **kwargs):
UCS-4 representation of the character at the specified text offset,
or 0 if offset is out of range.
"""
- func = self.get_dbus_method("getCharacterAtOffset")
+ func = self.get_dbus_method("getCharacterAtOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getCharacterExtents(self, *args, **kwargs):
window, with the x axis pointing right and the y axis pointing
down.
"""
- func = self.get_dbus_method("getCharacterExtents")
+ func = self.get_dbus_method("getCharacterExtents", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getDefaultAttributeSet(self, *args, **kwargs):
whereas an object whose text weight is inspecified may report
the default or implied text weight in the default AttributeSet.
"""
- func = self.get_dbus_method("getDefaultAttributeSet")
+ func = self.get_dbus_method("getDefaultAttributeSet", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getDefaultAttributes(self, *args, **kwargs):
@return the attributes which apply to the entire text content,
but which were not explicitly specified by the content creator.
"""
- func = self.get_dbus_method("getDefaultAttributes")
+ func = self.get_dbus_method("getDefaultAttributes", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getNSelections(self, *args, **kwargs):
@return the number of contiguous selections in the current Text
object.
"""
- func = self.get_dbus_method("getNSelections")
+ func = self.get_dbus_method("getNSelections", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getOffsetAtPoint(self, *args, **kwargs):
of the glyph whose onscreen bounds contain the point x,y, or
-1 if the point is outside the bounds of any glyph.
"""
- func = self.get_dbus_method("getOffsetAtPoint")
+ func = self.get_dbus_method("getOffsetAtPoint", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getRangeExtents(self, *args, **kwargs):
corner of the screen; if 1, the coordinates are reported relative
to the corner of the containing toplevel window.
"""
- func = self.get_dbus_method("getRangeExtents")
+ func = self.get_dbus_method("getRangeExtents", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getSelection(self, *args, **kwargs):
(i.e. for a selection which does not exist) is not strictly defined,
but should set endOffset equal to startOffset.
"""
- func = self.get_dbus_method("getSelection")
+ func = self.get_dbus_method("getSelection", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getText(self, startOffset, endOffset):
startOffset (inclusive) up to but not including the character
at endOffset.
"""
- func = self.get_dbus_method("getText")
+ func = self.get_dbus_method("getText", dbus_interface=ATSPI_TEXT)
if not endOffset:
endOffset = -1
return func(dbus.Int32(startOffset), dbus.Int32(endOffset))
@return a string which is a substring of the text content of
the object, delimited by the specified boundary condition.
"""
- func = self.get_dbus_method("getTextAfterOffset")
+ func = self.get_dbus_method("getTextAfterOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getTextAtOffset(self, *args, **kwargs):
@return a string which is a substring of the text content of
the object, delimited by the specified boundary condition.
"""
- func = self.get_dbus_method("getTextAtOffset")
+ func = self.get_dbus_method("getTextAtOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def getTextBeforeOffset(self, *args, **kwargs):
@return a string which is a substring of the text content of
the object, delimited by the specified boundary condition.
"""
- func = self.get_dbus_method("getTextBeforeOffset")
+ func = self.get_dbus_method("getTextBeforeOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def removeSelection(self, *args, **kwargs):
@return True if the selection was successfully removed, False
otherwise.
"""
- func = self.get_dbus_method("removeSelection")
+ func = self.get_dbus_method("removeSelection", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def setCaretOffset(self, *args, **kwargs):
@return TRUE if the request was carried out, or FALSE if the
caret could not be moved to the requested position.
"""
- func = self.get_dbus_method("setCaretOffset")
+ func = self.get_dbus_method("setCaretOffset", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def setSelection(self, *args, **kwargs):
@return True if the selection corresponding to selectionNum is
successfully modified, False otherwise.
"""
- func = self.get_dbus_method("setSelection")
+ func = self.get_dbus_method("setSelection", dbus_interface=ATSPI_TEXT)
return func(*args, **kwargs)
def get_caretOffset(self):
data = property(fget=_get_data, fset=_set_data)
# Register the accessible class with the factory.
-accessible_factory.register_accessible_class(interfaces.ATSPI_TEXT, Text)
+accessible_factory.register_accessible_class(ATSPI_TEXT, Text)
#END----------------------------------------------------------------------------