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
qwindowsuiainvokeprovider.cpp
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#include <QtGui/qtguiglobal.h>
6#if QT_CONFIG(accessibility)
7
8#include "qwindowsuiainvokeprovider.h"
9#include "qwindowsuiautils.h"
10#include "qwindowscontext.h"
11
12#include <QtGui/qaccessible.h>
13#include <QtCore/qloggingcategory.h>
14#include <QtCore/qstring.h>
15
16QT_BEGIN_NAMESPACE
17
18using namespace QWindowsUiAutomation;
19
20
21QWindowsUiaInvokeProvider::QWindowsUiaInvokeProvider(QAccessible::Id id) :
22 QWindowsUiaBaseProvider(id)
23{
24}
25
26QWindowsUiaInvokeProvider::~QWindowsUiaInvokeProvider()
27{
28}
29
30HRESULT STDMETHODCALLTYPE QWindowsUiaInvokeProvider::Invoke()
31{
32 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
33
34 QAccessibleInterface *accessible = accessibleInterface();
35 if (!accessible)
36 return UIA_E_ELEMENTNOTAVAILABLE;
37
38 QAccessibleActionInterface *actionInterface = accessible->actionInterface();
39 if (!actionInterface)
40 return UIA_E_ELEMENTNOTAVAILABLE;
41
42 actionInterface->doAction(QAccessibleActionInterface::pressAction());
43 return S_OK;
44}
45
46QT_END_NAMESPACE
47
48#endif // QT_CONFIG(accessibility)