Package Adapters :: Package ATSPI :: Module DefaultNav :: Class DefaultNavAdapter
[hide private]
[frames] | no frames]

Class DefaultNavAdapter

source code

      object --+        
               |        
AccAdapt.Adapter --+    
                   |    
 AccAdapt.PORAdapter --+
                       |
                      DefaultNavAdapter

Adapts all AT-SPI accessibles to the IAccessibleNav and IItemNav interfaces. No condition for adaptation is given implying that this adapter is used as a default by AccAdapt when no better adapter is available. Expects the subject to be a POR.

Instance Methods [hide private]
POR
getNextItem(self, only_visible=True)
Always raises IndexError as this default adapter assumes the subject has only one item.
source code
POR
getPrevItem(self, only_visible=True)
Always raises IndexError as this default adapter assumes the subject has only one item.
source code
POR
getFirstItem(self, only_visible=True)
Gets a POR pointing to the first item in the subject POR.
source code
POR
getLastItem(self, only_visible=True)
Gets a POR pointing to the first item in the subject POR since it is assumed to be the only item in this default adapter.
source code
POR
getAccAsItem(self, por)
Always raises IndexError as this default adapter assumes the subject has only one item.
source code
POR
getNextAcc(self)
Gets the next peer accessible object if possible and if it exists.
source code
POR
getPrevAcc(self)
Gets the previous peer accessible object if possible and if it exists.
source code
POR
getParentAcc(self)
Gets the parent accessible object if possible and if it exists.
source code
POR
getFirstAccChild(self)
Gets the first accessible child relative to the subject accessible.
source code
POR
getLastAccChild(self)
Gets the last accessible child relative to the subject accessible.
source code
POR
getChildAcc(self, index)
Gets the child accessible at the given index relative to the one providing this interface.
source code
POR
findDescendantAcc(self, predicate, depth_first)
Searches all descendants for one matching the given predicate.
source code
POR
findAncestorAcc(self, predicate)
Searches all ancestors for one matching the given predicate.
source code

Inherited from AccAdapt.PORAdapter: __call__, __init__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
list of Interface provides = [IAccessibleNav, IItemNav]
Interfaces provided by this adapter

Inherited from AccAdapt.Adapter: singleton, when

Instance Variables [hide private]

Inherited from AccAdapt.PORAdapter: accessible, char_offset, item_offset

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getNextItem(self, only_visible=True)

source code 

Always raises IndexError as this default adapter assumes the subject has only one item.

Parameters:
  • only_visible (boolean) - True when Item in the returned POR must be visible
Returns: POR
Point of regard to the next item in the same accessible
Raises:
  • IndexError - When there is no next item

getPrevItem(self, only_visible=True)

source code 

Always raises IndexError as this default adapter assumes the subject has only one item.

Parameters:
  • only_visible (boolean) - True when Item in the returned POR must be visible
Returns: POR
Point of regard to the previous item in the same accessible
Raises:
  • IndexError - When there is no previous item

getFirstItem(self, only_visible=True)

source code 

Gets a POR pointing to the first item in the subject POR. Ignores the only visible flag.

Parameters:
  • only_visible (boolean) - True when Item in the returned POR must be visible
Returns: POR
Point of regard to the first item in the same accessible
Raises:
  • IndexError - When there is no first item

getLastItem(self, only_visible=True)

source code 

Gets a POR pointing to the first item in the subject POR since it is assumed to be the only item in this default adapter. Ignores the only visible flag.

Parameters:
  • only_visible (boolean) - True when Item in the returned POR must be visible
Returns: POR
Point of regard to the last item in the same accessible
Raises:
  • IndexError - When there is no last item

getAccAsItem(self, por)

source code 

Always raises IndexError as this default adapter assumes the subject has only one item.

Parameters:
  • por (POR) - Point of regard to a child of the subject
Returns: POR
Point of regard to an item of the subject
Raises:
  • IndexError - When there is no next item

getNextAcc(self)

source code 

Gets the next peer accessible object if possible and if it exists.

Returns: POR
Point of regard to the next accessible, or None if there is no next peer
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • IndexError - When there is no next accessible
  • LookupError - When lookup for the next accessible fails even though it may exist

getPrevAcc(self)

source code 

Gets the previous peer accessible object if possible and if it exists.

Returns: POR
Point of regard to the previous accessible
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • IndexError - When there is no previous accessible
  • LookupError - When lookup for the previous accessible fails even though it may exist

getParentAcc(self)

source code 

Gets the parent accessible object if possible and if it exists.

Returns: POR
Point of regard to the parent accessible
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • LookupError - When lookup for the parent accessible fails because it does not exist

getFirstAccChild(self)

source code 

Gets the first accessible child relative to the subject accessible.

Returns: POR
Point of regard to the first child accessible
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • LookupError - When lookup for child fails because it does not exist

getLastAccChild(self)

source code 

Gets the last accessible child relative to the subject accessible.

Returns: POR
Point of regard to the last child accessible
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • LookupError - When lookup for child fails because it does not exist

getChildAcc(self, index)

source code 

Gets the child accessible at the given index relative to the one providing this interface.

Parameters:
  • index (integer) - Index of the child to retrieve
Returns: POR
Point of regard to the child accessible
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • IndexError - When there is no child at the given index
  • LookupError - When the lookup for the child fails even though it may exist

findDescendantAcc(self, predicate, depth_first)

source code 

Searches all descendants for one matching the given predicate.

Parameters:
  • predicate (callable) - Search predicate
  • depth_first (boolean) - Perform the search in depth-first (True) or breadth first (False) order?
Returns: POR
Point of regard to the target or None if not found
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • LookupError - When the lookup fails during the search

Warning: The predicate is currently supplied with accessibles, not PORs. This behavior will likely change in the future.

findAncestorAcc(self, predicate)

source code 

Searches all ancestors for one matching the given predicate.

Parameters:
  • predicate (callable) - Search predicate
Returns: POR
Point of regard to the target or None if not found
Decorators:
  • @pyLinAcc.errorToLookupError
Raises:
  • LookupError - When the lookup fails during the search

Warning: The predicate is currently supplied with accessibles, not PORs. This behavior will likely change in the future.