/**************************************************************************** ** ** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ****************************************************************************/ #include #if QT_CONFIG(accessibility) #include "qwinrtuiainvokeprovider.h" #include "qwinrtuiametadatacache.h" #include "qwinrtuiautils.h" #include #include #include #include #include QT_BEGIN_NAMESPACE using namespace QWinRTUiAutomation; using namespace ABI::Windows::UI::Xaml::Automation; using namespace ABI::Windows::UI::Xaml::Automation::Provider; QWinRTUiaInvokeProvider::QWinRTUiaInvokeProvider(QAccessible::Id id) : QWinRTUiaBaseProvider(id) { qCDebug(lcQpaUiAutomation) << __FUNCTION__; } QWinRTUiaInvokeProvider::~QWinRTUiaInvokeProvider() { qCDebug(lcQpaUiAutomation) << __FUNCTION__; } HRESULT STDMETHODCALLTYPE QWinRTUiaInvokeProvider::Invoke() { qCDebug(lcQpaUiAutomation) << __FUNCTION__; auto accid = id(); QEventDispatcherWinRT::runOnMainThread([accid]() { if (QAccessibleInterface *accessible = accessibleForId(accid)) if (QAccessibleActionInterface *actionInterface = accessible->actionInterface()) actionInterface->doAction(QAccessibleActionInterface::pressAction()); QWinRTUiaMetadataCache::instance()->load(accid); return S_OK; }, 0); return S_OK; } QT_END_NAMESPACE #endif // QT_CONFIG(accessibility)