Module controlTypes
[hide private]

Module controlTypes

source code

Functions [hide private]
set
processPositiveStates(role, states, reason, positiveStates=None)
Processes the states for an object and returns the positive states to output for a specified reason.
source code
set
processNegativeStates(role, states, reason, negativeStates=None)
Processes the states for an object and returns the negative states to output for a specified reason.
source code
[str, ...]
processAndLabelStates(role, states, reason, positiveStates=None, negativeStates=None, positiveStateLabelDict={}, negativeStateLabelDict={})
Processes the states for an object and returns the appropriate state labels for both positive and negative states.
source code
Variables [hide private]
  ROLE_UNKNOWN = 0
  ROLE_WINDOW = 1
  ROLE_TITLEBAR = 2
  ROLE_PANE = 3
  ROLE_DIALOG = 4
  ROLE_CHECKBOX = 5
  ROLE_RADIOBUTTON = 6
  ROLE_STATICTEXT = 7
  ROLE_EDITABLETEXT = 8
  ROLE_BUTTON = 9
  ROLE_MENUBAR = 10
  ROLE_MENUITEM = 11
  ROLE_POPUPMENU = 12
  ROLE_COMBOBOX = 13
  ROLE_LIST = 14
  ROLE_LISTITEM = 15
  ROLE_GRAPHIC = 16
  ROLE_HELPBALLOON = 17
  ROLE_TOOLTIP = 18
  ROLE_LINK = 19
  ROLE_TREEVIEW = 20
  ROLE_TREEVIEWITEM = 21
  ROLE_TAB = 22
  ROLE_TABCONTROL = 23
  ROLE_SLIDER = 24
  ROLE_PROGRESSBAR = 25
  ROLE_SCROLLBAR = 26
  ROLE_STATUSBAR = 27
  ROLE_TABLE = 28
  ROLE_TABLECELL = 29
  ROLE_TABLECOLUMN = 30
  ROLE_TABLEROW = 31
  ROLE_TABLECOLUMNHEADER = 32
  ROLE_TABLEROWHEADER = 33
  ROLE_FRAME = 34
  ROLE_TOOLBAR = 35
  ROLE_DROPDOWNBUTTON = 36
  ROLE_CLOCK = 37
  ROLE_SEPARATOR = 38
  ROLE_FORM = 39
  ROLE_HEADING = 40
  ROLE_HEADING1 = 41
  ROLE_HEADING2 = 42
  ROLE_HEADING3 = 43
  ROLE_HEADING4 = 44
  ROLE_HEADING5 = 45
  ROLE_HEADING6 = 46
  ROLE_PARAGRAPH = 47
  ROLE_BLOCKQUOTE = 48
  ROLE_TABLEHEADER = 49
  ROLE_TABLEBODY = 50
  ROLE_TABLEFOOTER = 51
  ROLE_DOCUMENT = 52
  ROLE_ANIMATION = 53
  ROLE_APPLICATION = 54
  ROLE_BOX = 55
  ROLE_GROUPING = 56
  ROLE_PROPERTYPAGE = 57
  ROLE_CANVAS = 58
  ROLE_CAPTION = 59
  ROLE_CHECKMENUITEM = 60
  ROLE_DATEEDITOR = 61
  ROLE_ICON = 62
  ROLE_DIRECTORYPANE = 63
  ROLE_EMBEDDEDOBJECT = 64
  ROLE_ENDNOTE = 65
  ROLE_FOOTER = 66
  ROLE_FOOTNOTE = 67
  ROLE_GLASSPANE = 69
  ROLE_HEADER = 70
  ROLE_IMAGEMAP = 71
  ROLE_INPUTWINDOW = 72
  ROLE_LABEL = 73
  ROLE_NOTE = 74
  ROLE_PAGE = 75
  ROLE_RADIOMENUITEM = 76
  ROLE_LAYEREDPANE = 77
  ROLE_REDUNDANTOBJECT = 78
  ROLE_ROOTPANE = 79
  ROLE_EDITBAR = 80
  ROLE_TERMINAL = 82
  ROLE_RICHEDIT = 83
  ROLE_RULER = 84
  ROLE_SCROLLPANE = 85
  ROLE_SECTION = 86
  ROLE_SHAPE = 87
  ROLE_SPLITPANE = 88
  ROLE_VIEWPORT = 89
  ROLE_TEAROFFMENU = 90
  ROLE_TEXTFRAME = 91
  ROLE_TOGGLEBUTTON = 92
  ROLE_BORDER = 93
  ROLE_CARET = 94
  ROLE_CHARACTER = 95
  ROLE_CHART = 96
  ROLE_CURSOR = 97
  ROLE_DIAGRAM = 98
  ROLE_DIAL = 99
  ROLE_DROPLIST = 100
  ROLE_SPLITBUTTON = 101
  ROLE_MENUBUTTON = 102
  ROLE_DROPDOWNBUTTONGRID = 103
  ROLE_MATH = 104
  ROLE_EQUATION = 104
  ROLE_GRIP = 105
  ROLE_HOTKEYFIELD = 106
  ROLE_INDICATOR = 107
  ROLE_SPINBUTTON = 108
  ROLE_SOUND = 109
  ROLE_WHITESPACE = 110
  ROLE_TREEVIEWBUTTON = 111
  ROLE_IPADDRESS = 112
  ROLE_DESKTOPICON = 113
  ROLE_INTERNALFRAME = 115
  ROLE_DESKTOPPANE = 116
  ROLE_OPTIONPANE = 117
  ROLE_COLORCHOOSER = 118
  ROLE_FILECHOOSER = 119
  ROLE_FILLER = 120
  ROLE_MENU = 121
  ROLE_PANEL = 122
  ROLE_PASSWORDEDIT = 123
  ROLE_FONTCHOOSER = 124
  ROLE_LINE = 125
  ROLE_FONTNAME = 126
  ROLE_FONTSIZE = 127
  ROLE_BOLD = 128
  ROLE_ITALIC = 129
  ROLE_UNDERLINE = 130
  ROLE_FGCOLOR = 131
  ROLE_BGCOLOR = 132
  ROLE_SUPERSCRIPT = 133
  ROLE_SUBSCRIPT = 134
  ROLE_STYLE = 135
  ROLE_INDENT = 136
  ROLE_ALIGNMENT = 137
  ROLE_ALERT = 138
  ROLE_DATAGRID = 139
  ROLE_DATAITEM = 140
  ROLE_HEADERITEM = 141
  ROLE_THUMB = 142
  ROLE_CALENDAR = 143
  ROLE_VIDEO = 144
  ROLE_AUDIO = 145
  ROLE_CHARTELEMENT = 146
  ROLE_DELETED_CONTENT = 147
  ROLE_INSERTED_CONTENT = 148
  STATE_UNAVAILABLE = 0X1
  STATE_FOCUSED = 0X2
  STATE_SELECTED = 0X4
  STATE_BUSY = 0X8
  STATE_PRESSED = 0X10
  STATE_CHECKED = 0X20
  STATE_HALFCHECKED = 0X40
  STATE_READONLY = 0X80
  STATE_EXPANDED = 0X100
  STATE_COLLAPSED = 0X200
  STATE_INVISIBLE = 0X400
  STATE_VISITED = 0X800
  STATE_LINKED = 0X1000
  STATE_HASPOPUP = 0X2000
  STATE_PROTECTED = 0X4000
  STATE_REQUIRED = 0X8000
  STATE_DEFUNCT = 0X10000
  STATE_INVALID_ENTRY = 0X20000
  STATE_MODAL = 0X40000
  STATE_AUTOCOMPLETE = 0x80000
  STATE_MULTILINE = 0X100000
  STATE_ICONIFIED = 0x200000
  STATE_OFFSCREEN = 0x400000
  STATE_SELECTABLE = 0x800000
  STATE_FOCUSABLE = 0x1000000
  STATE_CLICKABLE = 0x2000000
  STATE_EDITABLE = 0x4000000
  STATE_CHECKABLE = 0x8000000
  STATE_DRAGGABLE = 0x10000000
  STATE_DRAGGING = 0x20000000
  STATE_DROPTARGET = 0x40000000
  STATE_SORTED = 0x80000000
  STATE_SORTED_ASCENDING = 0x100000000
  STATE_SORTED_DESCENDING = 0x200000000
  STATES_SORTED = frozenset([STATE_SORTED, STATE_SORTED_ASCENDIN...
  STATE_HASLONGDESC = 0x400000000
  STATE_PINNED = 0x800000000
  STATE_HASFORMULA = 0x1000000000
  STATE_HASCOMMENT = 0X2000000000
  STATE_OBSCURED = 0x4000000000
  STATE_CROPPED = 0x8000000000
  STATE_OVERFLOWING = 0x10000000000
  STATE_UNLOCKED = 0x20000000000
  roleLabels = {ROLE_UNKNOWN: _("unknown"), ROLE_WINDOW: _("wind...
  stateLabels = {STATE_UNAVAILABLE: _("unavailable"), STATE_FOCU...
  negativeStateLabels = {STATE_SELECTED: _("not selected"), STAT...
  silentRolesOnFocus = {ROLE_PANE, ROLE_ROOTPANE, ROLE_FRAME, RO...
  silentValuesForRoles = {ROLE_CHECKBOX, ROLE_RADIOBUTTON, ROLE_...
  isCurrentLabels = {True: _("current"), "page": _("current page...
Text to use for 'current' values.
    Output reasons
  REASON_FOCUS = "focus"
An object to be reported due to a focus change or similar.
  REASON_FOCUSENTERED = "focusEntered"
An ancestor of the focus object to be reported due to a focus change or similar.
  REASON_MOUSE = "mouse"
An item under the mouse.
  REASON_QUERY = "query"
A response to a user query.
  REASON_CHANGE = "change"
Reporting a change to an object.
  REASON_MESSAGE = "message"
A generic, screen reader specific message.
  REASON_SAYALL = "sayAll"
Text reported as part of a say all.
  REASON_CARET = "caret"
Content reported due to caret movement or similar.
  REASON_ONLYCACHE = "onlyCache"
No output, but any state should be cached as if output had occurred.
Function Details [hide private]

processPositiveStates(role, states, reason, positiveStates=None)

source code 

Processes the states for an object and returns the positive states to output for a specified reason. For example, if STATE_CHECKED is in the returned states, it means that the processed object is checked.

Parameters:
  • role (int) - The role of the object to process states for (e.g. ROLE_CHECKBOX.
  • states (set) - The raw states for an object to process.
  • reason (str) - The reason to process the states (e.g. REASON_FOCUS.
  • positiveStates (set) - Used for REASON_CHANGE, specifies states changed from negative to positive;
Returns: set
The processed positive states.

processNegativeStates(role, states, reason, negativeStates=None)

source code 

Processes the states for an object and returns the negative states to output for a specified reason. For example, if STATE_CHECKED is in the returned states, it means that the processed object is not checked.

Parameters:
  • role (int) - The role of the object to process states for (e.g. ROLE_CHECKBOX.
  • states (set) - The raw states for an object to process.
  • reason (str) - The reason to process the states (e.g. REASON_FOCUS.
  • negativeStates (set) - Used for REASON_CHANGE, specifies states changed from positive to negative;
Returns: set
The processed negative states.

processAndLabelStates(role, states, reason, positiveStates=None, negativeStates=None, positiveStateLabelDict={}, negativeStateLabelDict={})

source code 

Processes the states for an object and returns the appropriate state labels for both positive and negative states.

Parameters:
  • role (int) - The role of the object to process states for (e.g. ROLE_CHECKBOX.
  • states (set) - The raw states for an object to process.
  • reason (str) - The reason to process the states (e.g. REASON_FOCUS.
  • positiveStates (set) - Used for REASON_CHANGE, specifies states changed from negative to positive;
  • negativeStates (setpositiveStateLabelDict={}, negativeStateLabelDict) - Used for REASON_CHANGE, specifies states changed from positive to negative;
  • positiveStateLabelDict (dict) - Dictionary containing state identifiers as keys and associated positive labels as their values.
  • negativeStateLabelDict (dict) - Dictionary containing state identifiers as keys and associated negative labels as their values.
Returns: [str, ...]
The labels of the relevant positive and negative states.

Variables Details [hide private]

STATES_SORTED

Value:
frozenset([STATE_SORTED, STATE_SORTED_ASCENDING, STATE_SORTED_DESCENDI\
NG])

roleLabels

Value:
{ROLE_UNKNOWN: _("unknown"), ROLE_WINDOW: _("window"), ROLE_TITLEBAR: \
_("title bar"), ROLE_PANE: _("pane"), ROLE_DIALOG: _("dialog"), ROLE_C\
HECKBOX: _("check box"), ROLE_RADIOBUTTON: _("radio button"), ROLE_STA\
TICTEXT: _("text"), ROLE_EDITABLETEXT: _("edit"), ROLE_BUTTON: _("butt\
on"), ROLE_MENUBAR: _("menu bar"), ROLE_MENUITEM: _("menu item"), ROLE\
_POPUPMENU: _("menu"), ROLE_COMBOBOX: _("combo box"), ROLE_LIST: _("li\
st"), ROLE_LISTITEM: _("list item"), ROLE_GRAPHIC: _("graphic"), ROLE_\
HELPBALLOON: _("help balloon"), ROLE_TOOLTIP: _("tool tip"), ROLE_LINK\
...

stateLabels

Value:
{STATE_UNAVAILABLE: _("unavailable"), STATE_FOCUSED: _("focused"), STA\
TE_SELECTED: _("selected"), STATE_BUSY: _("busy"), STATE_PRESSED: _("p\
ressed"), STATE_CHECKED: _("checked"), STATE_HALFCHECKED: _("half chec\
ked"), STATE_READONLY: _("read only"), STATE_EXPANDED: _("expanded"), \
STATE_COLLAPSED: _("collapsed"), STATE_INVISIBLE: _("invisible"), STAT\
E_VISITED: _("visited"), STATE_LINKED: _("linked"), STATE_HASPOPUP: _(\
"subMenu"), STATE_PROTECTED: _("protected"), STATE_REQUIRED: _("requir\
ed"), STATE_DEFUNCT: _("defunct"), STATE_INVALID_ENTRY: _("invalid ent\
...

negativeStateLabels

Value:
{STATE_SELECTED: _("not selected"), STATE_PRESSED: _("not pressed"), S\
TATE_CHECKED: _("not checked"), STATE_DROPTARGET: _("done dragging"),}

silentRolesOnFocus

Value:
{ROLE_PANE, ROLE_ROOTPANE, ROLE_FRAME, ROLE_UNKNOWN, ROLE_APPLICATION,\
 ROLE_TABLECELL, ROLE_LISTITEM, ROLE_MENUITEM, ROLE_CHECKMENUITEM, ROL\
E_TREEVIEWITEM, ROLE_STATICTEXT, ROLE_BORDER,}

silentValuesForRoles

Value:
{ROLE_CHECKBOX, ROLE_RADIOBUTTON, ROLE_LINK, ROLE_MENUITEM, ROLE_APPLI\
CATION,}

isCurrentLabels

Text to use for 'current' values. These describe if an item is the current item within a particular kind of selection.

Value:
{True: _("current"), "page": _("current page"), "step": _("current ste\
p"), "location": _("current location"), "date": _("current date"), "ti\
me": _("current time"),}