4#ifndef QWINDOWSUIAMAINPROVIDER_H
5#define QWINDOWSUIAMAINPROVIDER_H
7#include <QtGui/qtguiglobal.h>
8#if QT_CONFIG(accessibility)
10#include "qwindowsuiabaseprovider.h"
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>
22class QWindowsUiaMainProvider :
23 public QWindowsUiaBaseProvider,
24 public QComObject<IRawElementProviderSimple, IRawElementProviderFragment, IRawElementProviderFragmentRoot>
27 Q_DISABLE_COPY_MOVE(QWindowsUiaMainProvider)
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);
42 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) override;
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;
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;
59 HRESULT STDMETHODCALLTYPE ElementProviderFromPoint(
double x,
double y, IRawElementProviderFragment **pRetVal) override;
60 HRESULT STDMETHODCALLTYPE GetFocus(IRawElementProviderFragment **pRetVal) override;
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);
68 static int styleIdForHeadingLevel(
int headingLevel);