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
qwindowsuiagridprovider.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
21QWindowsUiaGridProvider::QWindowsUiaGridProvider(QAccessible::Id id) :
22 QWindowsUiaBaseProvider(id)
23{
24}
25
26QWindowsUiaGridProvider::~QWindowsUiaGridProvider()
27{
28}
29
30// Returns the provider for an item within a table/tree.
31HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::GetItem(int row, int column, IRawElementProviderSimple **pRetVal)
32{
33 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
34
35 if (!pRetVal)
36 return E_INVALIDARG;
37 *pRetVal = nullptr;
38
39 QAccessibleInterface *accessible = accessibleInterface();
40 if (!accessible)
41 return UIA_E_ELEMENTNOTAVAILABLE;
42
43 QAccessibleTableInterface *tableInterface = accessible->tableInterface();
44 if (!tableInterface)
45 return UIA_E_ELEMENTNOTAVAILABLE;
46
47 if ((row >= 0) && (row < tableInterface->rowCount()) && (column >= 0) && (column < tableInterface->columnCount())) {
48 if (QAccessibleInterface *cell = tableInterface->cellAt(row, column)) {
49 *pRetVal = QWindowsUiaMainProvider::providerForAccessible(cell);
50 }
51 }
52 return S_OK;
53}
54
55// Returns the number of rows.
56HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::get_RowCount(int *pRetVal)
57{
58 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
59
60 if (!pRetVal)
61 return E_INVALIDARG;
62 *pRetVal = 0;
63
64 QAccessibleInterface *accessible = accessibleInterface();
65 if (!accessible)
66 return UIA_E_ELEMENTNOTAVAILABLE;
67
68 QAccessibleTableInterface *tableInterface = accessible->tableInterface();
69 if (!tableInterface)
70 return UIA_E_ELEMENTNOTAVAILABLE;
71
72 *pRetVal = tableInterface->rowCount();
73 return S_OK;
74}
75
76// Returns the number of columns.
77HRESULT STDMETHODCALLTYPE QWindowsUiaGridProvider::get_ColumnCount(int *pRetVal)
78{
79 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
80
81 if (!pRetVal)
82 return E_INVALIDARG;
83 *pRetVal = 0;
84
85 QAccessibleInterface *accessible = accessibleInterface();
86 if (!accessible)
87 return UIA_E_ELEMENTNOTAVAILABLE;
88
89 QAccessibleTableInterface *tableInterface = accessible->tableInterface();
90 if (!tableInterface)
91 return UIA_E_ELEMENTNOTAVAILABLE;
92
93 *pRetVal = tableInterface->columnCount();
94 return S_OK;
95}
96
98
99#endif // QT_CONFIG(accessibility)
Combined button and popup list for selecting options.
#define qCDebug(category,...)
GLenum GLuint id
[7]
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
long HRESULT