Package AccessEngine :: Package AEAccAdapters :: Package ATSPI :: Module HypertextAdapter
[hide private]
[frames] | no frames]

Module HypertextAdapter

source code

Defines AEAccAdapter.AEAccAdapters for AT-SPI hypertext accessibles potentially containing embedded objects.


Authors:
Peter Parente, Frank Zenker
Organizations: Copyright: License:
Classes [hide private]
  HypertextNavAdapter
Overrides DefaultNavAdapter to provide navigation over hypertext embedded objects as items and children.
  HypertextAccInfoAdapter
Overrides DefaultNavAdapter to provide information about hypertext objects.
  HypertextEventHandlerAdapter
Overrides DefaultEventHandlerAdapter to create proper AEPors for hypertext objects having embed characters.
Functions [hide private]
integer
_getPrevItem(acc, char)
Gets the offset of the start of the previous item.
source code
integer
_getNextEmbedCharOffset(acc, char)
Gets the offset of the start of the next item.
source code
integer
_getEmbedCharOffset(acc, index)
Gets the character offset of the embedded character at the given index.
source code
Variables [hide private]
unicode EMBED_CHAR = u'\ufffc'
Unicode embed character u'\u0xfffc'
integer EMBED_VAL = 0xfffc
Unicode embed character value 0xfffc
_sre.SRE_Pattern embed_rex = re.compile(EMBED_CHAR)
Compiled regular expression for finding embed characters
Function Details [hide private]

_getPrevItem(acc, char)

source code 

Gets the offset of the start of the previous item. The first of the following rules satisfied working backward from the offset in char defines the start of the previous item:

1) the previous embed 2) the beginning of a wrapped line 3) the character one greater than the previous embed on the previous line
Parameters:
  • acc (pyatspi.Accessibility.Accessible) - Accessible object supporting embed characters
  • char (integer) - Starting offset relative to the start of all text in the object
Returns: integer
Index of the start of the previous item relative to the start of all text in the object
Raises:
  • IndexError - When no previous item is available in this object

_getNextEmbedCharOffset(acc, char)

source code 

Gets the offset of the start of the next item. The first of the following rules satisfied working forward from the offset in char defines the start of the next item:

1) the next embed 2) the beginning of a wrapped line
Parameters:
  • acc (pyatspi.Accessibility.Accessible) - Accessible object supporting embed characters
  • char (integer) - Starting offset relative to the start of all text in the object
Returns: integer
Index of the start of the next item relative to the start of all text in the object
Raises:
  • IndexError - When no next item is available in this object

_getEmbedCharOffset(acc, index)

source code 
Gets the character offset of the embedded character at the given index.
Parameters:
  • acc (pyatspi.Accessibility.Accessible) - Accessible which should be searched for embed characters
  • index (integer) - Index of the embedded character in the count of all embedded characters
Returns: integer
Offset in characters of the embedded character
Raises:
  • IndexError - When the given index is outside the bounds of the number of embed characters in the text