4#include <QtGui/qtguiglobal.h>
5#if QT_CONFIG(accessibility)
11#include <QtGui/qaccessible.h>
12#include <QtCore/qloggingcategory.h>
13#include <QtCore/qstring.h>
17using namespace QWindowsUiAutomation;
19static bool isExpanded(QAccessibleInterface *accessible)
22 if (accessible->role() == QAccessible::MenuItem)
23 return accessible->childCount() > 0 && !accessible->child(0)->state().invisible;
25 return accessible->state().expandable && accessible->state().expanded;
28QWindowsUiaExpandCollapseProvider::QWindowsUiaExpandCollapseProvider(QAccessible::Id
id) :
29 QWindowsUiaBaseProvider(
id)
33QWindowsUiaExpandCollapseProvider::~QWindowsUiaExpandCollapseProvider() =
default;
35HRESULT STDMETHODCALLTYPE QWindowsUiaExpandCollapseProvider::Expand()
37 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
39 QAccessibleInterface *accessible = accessibleInterface();
43 QAccessibleActionInterface *actionInterface = accessible->actionInterface();
47 if (!isExpanded(accessible))
48 actionInterface->doAction(QAccessibleActionInterface::showMenuAction());
53HRESULT STDMETHODCALLTYPE QWindowsUiaExpandCollapseProvider::Collapse()
55 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
57 QAccessibleInterface *accessible = accessibleInterface();
61 QAccessibleActionInterface *actionInterface = accessible->actionInterface();
65 if (isExpanded(accessible))
66 actionInterface->doAction(QAccessibleActionInterface::showMenuAction());
73 qCDebug(lcQpaUiAutomation) << __FUNCTION__;
79 QAccessibleInterface *accessible = accessibleInterface();
Combined button and popup list for selecting options.
#define qCDebug(category,...)
#define UIA_E_ELEMENTNOTAVAILABLE
IRawElementProviderFragment __RPC__deref_out_opt IRawElementProviderFragment ** pRetVal
@ ExpandCollapseState_Collapsed
@ ExpandCollapseState_Expanded
@ ExpandCollapseState_LeafNode