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