Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwindowsuiagriditemprovider.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <QtGui/qtguiglobal.h>
5#if QT_CONFIG(accessibility)
6
9#include "qwindowsuiautils.h"
10#include "qwindowscontext.h"
11
12#include <QtGui/qaccessible.h>
13#include <QtCore/qloggingcategory.h>
14#include <QtCore/qstring.h>
15
17
18using namespace QWindowsUiAutomation;
19
20
21QWindowsUiaGridItemProvider::QWindowsUiaGridItemProvider(QAccessible::Id id) :
22 QWindowsUiaBaseProvider(id)
23{
24}
25
26QWindowsUiaGridItemProvider::~QWindowsUiaGridItemProvider()
27{
28}
29
30// Returns the row index of the item.
31HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_Row(int *pRetVal)
32{
33 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
34
35 if (!pRetVal)
36 return E_INVALIDARG;
37 *pRetVal = 0;
38
39 QAccessibleInterface *accessible = accessibleInterface();
40 if (!accessible)
41 return UIA_E_ELEMENTNOTAVAILABLE;
42
43 QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
44 if (!tableCellInterface)
45 return UIA_E_ELEMENTNOTAVAILABLE;
46
47 *pRetVal = tableCellInterface->rowIndex();
48 return S_OK;
49}
50
51// Returns the column index of the item.
52HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_Column(int *pRetVal)
53{
54 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
55
56 if (!pRetVal)
57 return E_INVALIDARG;
58 *pRetVal = 0;
59
60 QAccessibleInterface *accessible = accessibleInterface();
61 if (!accessible)
62 return UIA_E_ELEMENTNOTAVAILABLE;
63
64 QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
65 if (!tableCellInterface)
66 return UIA_E_ELEMENTNOTAVAILABLE;
67
68 *pRetVal = tableCellInterface->columnIndex();
69 return S_OK;
70}
71
72// Returns the number of rows occupied by the item.
73HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_RowSpan(int *pRetVal)
74{
75 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
76
77 if (!pRetVal)
78 return E_INVALIDARG;
79 *pRetVal = 0;
80
81 QAccessibleInterface *accessible = accessibleInterface();
82 if (!accessible)
83 return UIA_E_ELEMENTNOTAVAILABLE;
84
85 QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
86 if (!tableCellInterface)
87 return UIA_E_ELEMENTNOTAVAILABLE;
88
89 *pRetVal = tableCellInterface->rowExtent();
90 return S_OK;
91}
92
93// Returns the number of columns occupied by the item.
94HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_ColumnSpan(int *pRetVal)
95{
96 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
97
98 if (!pRetVal)
99 return E_INVALIDARG;
100 *pRetVal = 0;
101
102 QAccessibleInterface *accessible = accessibleInterface();
103 if (!accessible)
104 return UIA_E_ELEMENTNOTAVAILABLE;
105
106 QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
107 if (!tableCellInterface)
108 return UIA_E_ELEMENTNOTAVAILABLE;
109
110 *pRetVal = tableCellInterface->columnExtent();
111 return S_OK;
112}
113
114// Returns the provider for the containing table/tree.
115HRESULT STDMETHODCALLTYPE QWindowsUiaGridItemProvider::get_ContainingGrid(IRawElementProviderSimple **pRetVal)
116{
117 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
118
119 if (!pRetVal)
120 return E_INVALIDARG;
121 *pRetVal = nullptr;
122
123 QAccessibleInterface *accessible = accessibleInterface();
124 if (!accessible)
125 return UIA_E_ELEMENTNOTAVAILABLE;
126
127 QAccessibleTableCellInterface *tableCellInterface = accessible->tableCellInterface();
128 if (!tableCellInterface)
129 return UIA_E_ELEMENTNOTAVAILABLE;
130
131 if (QAccessibleInterface *table = tableCellInterface->table()) {
132 *pRetVal = QWindowsUiaMainProvider::providerForAccessible(table);
133 }
134 return S_OK;
135}
136
138
139#endif // QT_CONFIG(accessibility)
Combined button and popup list for selecting options.
#define qCDebug(category,...)
GLenum GLuint id
[7]
GLenum GLenum GLsizei void * table
long HRESULT