4#include <QtGui/qtguiglobal.h>
5#if QT_CONFIG(accessibility)
11#include <QtGui/qwindow.h>
12#include <QtGui/private/qhighdpiscaling_p.h>
17namespace QWindowsUiAutomation {
20QWindow *windowForAccessible(
const QAccessibleInterface *accessible)
24 const QAccessibleInterface *acc = accessible;
25 const QAccessibleInterface *par = accessible->parent();
26 while (par && par->isValid() && !
window) {
35 if (QAccessibleInterface *root =
w->accessibleRoot()) {
36 int count = root->childCount();
38 if (root->child(
i) == acc)
50HWND hwndForAccessible(
const QAccessibleInterface *accessible)
53 if (!accessible->parent() || (accessible->parent()->window() !=
window)) {
60void clearVariant(VARIANT *
variant)
86 return SysAllocString(
reinterpret_cast<const wchar_t *
>(
value.utf16()));
100 uiaRect->left =
r.x();
101 uiaRect->top =
r.y();
102 uiaRect->width =
r.width();
103 uiaRect->height =
r.height();
108void nativeUiaPointToPoint(
const UiaPoint &uiaPoint,
const QWindow *
w,
QPoint *point)
115long roleToControlTypeId(QAccessible::Role role)
117 static const QHash<QAccessible::Role, long>
mapping {
118 {QAccessible::TitleBar, UIA_TitleBarControlTypeId},
119 {QAccessible::MenuBar, UIA_MenuBarControlTypeId},
120 {QAccessible::ScrollBar, UIA_ScrollBarControlTypeId},
121 {QAccessible::Grip, UIA_ThumbControlTypeId},
122 {QAccessible::Sound, UIA_CustomControlTypeId},
123 {QAccessible::Cursor, UIA_CustomControlTypeId},
124 {QAccessible::Caret, UIA_CustomControlTypeId},
125 {QAccessible::AlertMessage, UIA_WindowControlTypeId},
126 {QAccessible::Window, UIA_WindowControlTypeId},
127 {QAccessible::Client, UIA_GroupControlTypeId},
128 {QAccessible::PopupMenu, UIA_MenuControlTypeId},
129 {QAccessible::MenuItem, UIA_MenuItemControlTypeId},
130 {QAccessible::ToolTip, UIA_ToolTipControlTypeId},
131 {QAccessible::Application, UIA_CustomControlTypeId},
132 {QAccessible::Document, UIA_DocumentControlTypeId},
133 {QAccessible::Pane, UIA_PaneControlTypeId},
134 {QAccessible::Chart, UIA_CustomControlTypeId},
135 {QAccessible::Dialog, UIA_WindowControlTypeId},
136 {QAccessible::Border, UIA_CustomControlTypeId},
137 {QAccessible::Grouping, UIA_GroupControlTypeId},
138 {QAccessible::Separator, UIA_SeparatorControlTypeId},
139 {QAccessible::ToolBar, UIA_ToolBarControlTypeId},
140 {QAccessible::StatusBar, UIA_StatusBarControlTypeId},
141 {QAccessible::Table, UIA_TableControlTypeId},
142 {QAccessible::ColumnHeader, UIA_HeaderControlTypeId},
143 {QAccessible::RowHeader, UIA_HeaderControlTypeId},
144 {QAccessible::Column, UIA_HeaderItemControlTypeId},
145 {QAccessible::Row, UIA_HeaderItemControlTypeId},
146 {QAccessible::Cell, UIA_DataItemControlTypeId},
147 {QAccessible::Link, UIA_HyperlinkControlTypeId},
148 {QAccessible::HelpBalloon, UIA_ToolTipControlTypeId},
149 {QAccessible::Assistant, UIA_CustomControlTypeId},
150 {QAccessible::List, UIA_ListControlTypeId},
151 {QAccessible::ListItem, UIA_ListItemControlTypeId},
152 {QAccessible::Tree, UIA_TreeControlTypeId},
153 {QAccessible::TreeItem, UIA_TreeItemControlTypeId},
154 {QAccessible::PageTab, UIA_TabItemControlTypeId},
155 {QAccessible::PropertyPage, UIA_CustomControlTypeId},
156 {QAccessible::Indicator, UIA_CustomControlTypeId},
157 {QAccessible::Graphic, UIA_ImageControlTypeId},
158 {QAccessible::StaticText, UIA_TextControlTypeId},
159 {QAccessible::EditableText, UIA_EditControlTypeId},
160 {QAccessible::Button, UIA_ButtonControlTypeId},
161 {QAccessible::CheckBox, UIA_CheckBoxControlTypeId},
162 {QAccessible::RadioButton, UIA_RadioButtonControlTypeId},
163 {QAccessible::ComboBox, UIA_ComboBoxControlTypeId},
164 {QAccessible::ProgressBar, UIA_ProgressBarControlTypeId},
165 {QAccessible::Dial, UIA_CustomControlTypeId},
166 {QAccessible::HotkeyField, UIA_CustomControlTypeId},
167 {QAccessible::Slider, UIA_SliderControlTypeId},
168 {QAccessible::SpinBox, UIA_SpinnerControlTypeId},
169 {QAccessible::Canvas, UIA_CustomControlTypeId},
170 {QAccessible::Animation, UIA_CustomControlTypeId},
171 {QAccessible::Equation, UIA_CustomControlTypeId},
172 {QAccessible::ButtonDropDown, UIA_ButtonControlTypeId},
173 {QAccessible::ButtonMenu, UIA_ButtonControlTypeId},
174 {QAccessible::ButtonDropGrid, UIA_ButtonControlTypeId},
175 {QAccessible::Whitespace, UIA_CustomControlTypeId},
176 {QAccessible::PageTabList, UIA_TabControlTypeId},
177 {QAccessible::Clock, UIA_CustomControlTypeId},
178 {QAccessible::Splitter, UIA_CustomControlTypeId},
179 {QAccessible::Paragraph, UIA_TextControlTypeId},
180 {QAccessible::WebDocument, UIA_DocumentControlTypeId},
181 {QAccessible::Heading, UIA_TextControlTypeId},
184 return mapping.value(role, UIA_CustomControlTypeId);
188bool isTextUnitSeparator(TextUnit unit,
const QChar &
ch)
190 return (((unit == TextUnit_Word) || (unit == TextUnit_Format)) &&
ch.isSpace())
191 || ((unit == TextUnit_Line) && (
ch.toLatin1() ==
'\n'));
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
static HWND handleOf(const QWindow *w)
T toNativePixels(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLfloat GLfloat GLfloat w
[0]
GLenum GLenum GLsizei count
GLenum GLenum GLenum GLenum mapping