Module POR :: Class POR
[hide private]
[frames] | no frames]

Class POR

source code

object --+
         |
        POR

Stores point-of-regard data for accessibles, the user, a Tier's focus, etc.


Note: This class is a structure and based on the LSR coding conventions its members (except for the adapters dictionary) can be accessed directly.

Instance Methods [hide private]
 
__init__(self, accessible=None, item_offset=None, char_offset=0, incomplete=False)
Stores the provided accessible, offset to an item within the accessible, and offset to a character within the accessible.
source code
 
getAdapter(self, interface)
Gets a cached instead of an adapter for this POR to one of the AEInterfaces.
source code
 
cacheAdapter(self, interface, adapter)
Caches an adapter instance that has been previously used for this POR to provide the given interface.
source code
 
__eq__(self, other)
Compares this POR to the one provided based on all their properties.
source code
integer
__hash__(self)
Hashes based on the accessible, item offset, and character offset rather than the ID of the POR itself.
source code
 
__ne__(self, other)
Compares this POR to the one provided based on all their properties.
source code
string
__str__(self)
Gets a string describing this POR in terms of its accessible, item_offset, and char_offset
source code
boolean
isSameChar(self, other)
Checks if the character offset in this POR is the same as the one in the given POR.
source code
boolean
isSameItem(self, other)
Checks if the item offset in this POR is the same as the one in the given POR.
source code
boolean
isSameAcc(self, other)
Checks if the accessible object in this POR is the same as the one in the given POR.
source code
boolean
isCharAfter(self, other)
Checks if the character offset in this POR is after the one in the given POR.
source code
boolean
isCharBefore(self, other)
Checks if the character offset in this POR is before the one in the given POR.
source code
boolean
isItemBefore(self, other)
Checks if the item offset in this POR is before the one in the given POR.
source code
boolean
isItemAfter(self, other)
Checks if the item offset in this POR is after the one in the given POR.
source code

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

Instance Variables [hide private]
pyLinAcc.Accessible accessible
The accessible of the control which has the point of regard.
dictionary adapters
Cached adapters for AEInterfaces for this POR
integer char_offset
Offset of the character at the caret or virtual cursor within the accessible and the item which has the point of regard.
boolean incomplete
Indicates that a POR might need additional processing before it is used when True.
integer or None item_offset
Offset of the Item within the accessible which has the point of regard.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, accessible=None, item_offset=None, char_offset=0, incomplete=False)
(Constructor)

source code 

Stores the provided accessible, offset to an item within the accessible, and offset to a character within the accessible.

Parameters:
  • accessible (pyLinAcc.Accessible) - Accessible of the control which has the point of regard.
  • item_offset (integer or None) - Offset of the Item within the accessible which has the point of regard. Set to None to indicate the accessible has only 1 item. When restricting to visible, this offset will still be relative to total. For example, when the first item in a table is not visble, but the first item is requested, this index will not be 0 (the first in the table), but instead will be the index of the first visible cell. For text, this will be the character index of the first character in the line requested (i.e. the first visible line in the example above).
  • char_offset (integer) - Offset of the character at the caret or virtual cursor within the accessible which has the point of regard.
  • incomplete (boolean) - Indicates that a POR might need additional processing before it is used when True. Some AEInterfaces.IEventHandler may create PORs that have an item in the accessible slot instead of its parent as the accessible and its index as the item_offset in order to save time for events that may never be handled. This flag indicates this situation and suggests that the POR be corrected properly before it reaches a Perk and its Tasks for processing.
Overrides: object.__init__

getAdapter(self, interface)

source code 

Gets a cached instead of an adapter for this POR to one of the AEInterfaces.

Parameters:

cacheAdapter(self, interface, adapter)

source code 

Caches an adapter instance that has been previously used for this POR to provide the given interface.

Parameters:

__eq__(self, other)
(Equality operator)

source code 

Compares this POR to the one provided based on all their properties.

Parameters:
  • other (POR) - Point of regard to compare

__hash__(self)
(Hashing function)

source code 

Hashes based on the accessible, item offset, and character offset rather than the ID of the POR itself.

Returns: integer
Immutable hash code based on the attributes of the POR
Overrides: object.__hash__

__ne__(self, other)

source code 

Compares this POR to the one provided based on all their properties.

Parameters:
  • other (POR) - Point of regard to compare

__str__(self)
(Informal representation operator)

source code 

Gets a string describing this POR in terms of its accessible, item_offset, and char_offset

Returns: string
String representation
Overrides: object.__str__

isSameChar(self, other)

source code 

Checks if the character offset in this POR is the same as the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the character offset to compare
Returns: boolean
Same character offset?

isSameItem(self, other)

source code 

Checks if the item offset in this POR is the same as the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the item offset to compare
Returns: boolean
Same item offset?

isSameAcc(self, other)

source code 

Checks if the accessible object in this POR is the same as the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the accessible to compare
Returns: boolean
Same accessible?

isCharAfter(self, other)

source code 

Checks if the character offset in this POR is after the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the character offset to compare
Returns: boolean
Character after the other?

isCharBefore(self, other)

source code 

Checks if the character offset in this POR is before the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the character offset to compare
Returns: boolean
Character before the other?

isItemBefore(self, other)

source code 

Checks if the item offset in this POR is before the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the item offset to compare
Returns: boolean
Item before the other?

isItemAfter(self, other)

source code 

Checks if the item offset in this POR is after the one in the given POR.

Parameters:
  • other (POR) - Point of regard with the item offset to compare
Returns: boolean
Item after the other?

Instance Variable Details [hide private]

incomplete

Indicates that a POR might need additional processing before it is used when True. Some AEInterfaces.IEventHandler may create PORs that have an item in the accessible slot instead of its parent as the accessible and its index as the item_offset in order to save time for events that may never be handled. This flag indicates this situation and suggests that the POR be corrected properly before it reaches a Perk and its Tasks for processing.
Type:
boolean

item_offset

Offset of the Item within the accessible which has the point of regard. Set to None to indicate the accessible has only 1 item. When restricting to visible, this offset will still be relative to total. For example, when the first item in a table is not visible, but the first item is requested, this index will not be 0 (the first in the table), but instead will be the index of the first visible cell. For text, this will be the character index of the first character in the line requested (i.e. the first visible line in the example above).
Type:
integer or None