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