Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qwindowsuiamainprovider.h
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#ifndef QWINDOWSUIAMAINPROVIDER_H
5#define QWINDOWSUIAMAINPROVIDER_H
6
7#include <QtGui/qtguiglobal.h>
8#if QT_CONFIG(accessibility)
9
10#include "qwindowsuiabaseprovider.h"
11
12#include <QtCore/qpointer.h>
13#include <QtCore/qsharedpointer.h>
14#include <QtCore/qmutex.h>
15#include <QtCore/qt_windows.h>
16#include <QtGui/qaccessible.h>
17#include <QtCore/private/qcomptr_p.h>
18
19QT_BEGIN_NAMESPACE
20
21// The main UI Automation class.
22class QWindowsUiaMainProvider :
23 public QWindowsUiaBaseProvider,
24 public QComObject<IRawElementProviderSimple, IRawElementProviderFragment, IRawElementProviderFragmentRoot>
25{
26 Q_OBJECT
27 Q_DISABLE_COPY_MOVE(QWindowsUiaMainProvider)
28public:
29 static ComPtr<QWindowsUiaMainProvider> providerForAccessible(QAccessibleInterface *accessible);
30 explicit QWindowsUiaMainProvider(QAccessibleInterface *a);
31 virtual ~QWindowsUiaMainProvider();
32 static void notifyFocusChange(QAccessibleEvent *event);
33 static void notifyStateChange(QAccessibleStateChangeEvent *event);
34 static void notifyValueChange(QAccessibleValueChangeEvent *event);
35 static void notifyNameChange(QAccessibleEvent *event);
36 static void notifyRoleChange(QAccessibleEvent *event);
37 static void notifySelectionChange(QAccessibleEvent *event);
38 static void notifyTextChange(QAccessibleEvent *event);
39 static void raiseNotification(QAccessibleAnnouncementEvent *event);
40
41 // IUnknown
42 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) override;
43
44 // IRawElementProviderSimple methods
45 HRESULT STDMETHODCALLTYPE get_ProviderOptions(ProviderOptions *pRetVal) override;
46 HRESULT STDMETHODCALLTYPE GetPatternProvider(PATTERNID idPattern, IUnknown **pRetVal) override;
47 HRESULT STDMETHODCALLTYPE GetPropertyValue(PROPERTYID idProp, VARIANT *pRetVal) override;
48 HRESULT STDMETHODCALLTYPE get_HostRawElementProvider(IRawElementProviderSimple **pRetVal) override;
49
50 // IRawElementProviderFragment methods
51 HRESULT STDMETHODCALLTYPE Navigate(NavigateDirection direction, IRawElementProviderFragment **pRetVal) override;
52 HRESULT STDMETHODCALLTYPE GetRuntimeId(SAFEARRAY **pRetVal) override;
53 HRESULT STDMETHODCALLTYPE get_BoundingRectangle(UiaRect *pRetVal) override;
54 HRESULT STDMETHODCALLTYPE GetEmbeddedFragmentRoots(SAFEARRAY **pRetVal) override;
55 HRESULT STDMETHODCALLTYPE SetFocus() override;
56 HRESULT STDMETHODCALLTYPE get_FragmentRoot(IRawElementProviderFragmentRoot **pRetVal) override;
57
58 // IRawElementProviderFragmentRoot methods
59 HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(double x, double y, IRawElementProviderFragment **pRetVal) override;
60 HRESULT STDMETHODCALLTYPE GetFocus(IRawElementProviderFragment **pRetVal) override;
61
62private:
63 static void setLabelledBy(QAccessibleInterface *accessible, VARIANT *pRetVal);
64 static void fillVariantArrayForRelation(QAccessibleInterface *accessible, QAccessible::Relation relation, VARIANT *pRetVal);
65 static void setAriaProperties(QAccessibleInterface *accessible, VARIANT *pRetVal);
66 static void setStyle(QAccessibleInterface *accessible, VARIANT *pRetVal);
67 /** Returns the UIA style ID for a heading level from 1 to 9. */
68 static int styleIdForHeadingLevel(int headingLevel);
69};
70
71QT_END_NAMESPACE
72
73#endif // QT_CONFIG(accessibility)
74
75#endif // QWINDOWSUIAMAINPROVIDER_H