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
qwindowsuiatextprovider.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 QWINDOWSUIATEXTPROVIDER_H
6#define QWINDOWSUIATEXTPROVIDER_H
7
8#include <QtGui/qtguiglobal.h>
9#if QT_CONFIG(accessibility)
10
11#include "qwindowsuiabaseprovider.h"
12#include "qwindowsuiatextrangeprovider.h"
13
14QT_BEGIN_NAMESPACE
15
16namespace QtPrivate {
17
18template <>
19struct QComObjectTraits<ITextProvider2>
20{
21 static constexpr bool isGuidOf(REFIID riid) noexcept
22 {
23 return QComObjectTraits<ITextProvider2, ITextProvider>::isGuidOf(riid);
24 }
25};
26
27} // namespace QtPrivate
28
29// Implements the Text control pattern provider. Used for text controls.
30class QWindowsUiaTextProvider : public QWindowsUiaBaseProvider, public QComObject<ITextProvider2>
31{
32 Q_DISABLE_COPY_MOVE(QWindowsUiaTextProvider)
33public:
34 explicit QWindowsUiaTextProvider(QAccessible::Id id);
35 ~QWindowsUiaTextProvider();
36
37 // ITextProvider
38 HRESULT STDMETHODCALLTYPE GetSelection(SAFEARRAY **pRetVal) override;
39 HRESULT STDMETHODCALLTYPE GetVisibleRanges(SAFEARRAY **pRetVal) override;
40 HRESULT STDMETHODCALLTYPE RangeFromChild(IRawElementProviderSimple *childElement, ITextRangeProvider **pRetVal) override;
41 HRESULT STDMETHODCALLTYPE RangeFromPoint(UiaPoint point, ITextRangeProvider **pRetVal) override;
42 HRESULT STDMETHODCALLTYPE get_DocumentRange(ITextRangeProvider **pRetVal) override;
43 HRESULT STDMETHODCALLTYPE get_SupportedTextSelection(SupportedTextSelection *pRetVal) override;
44
45 // ITextProvider2
46 HRESULT STDMETHODCALLTYPE RangeFromAnnotation(IRawElementProviderSimple *annotationElement, ITextRangeProvider **pRetVal) override;
47 HRESULT STDMETHODCALLTYPE GetCaretRange(BOOL *isActive, ITextRangeProvider **pRetVal) override;
48};
49
50QT_END_NAMESPACE
51
52#endif // QT_CONFIG(accessibility)
53
54#endif // QWINDOWSUIATEXTPROVIDER_H