2 * Copyright 2022 Connor McAdams for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "uiautomation.h"
22 #include "uia_classes.h"
23 #include "wine/list.h"
25 extern HMODULE huia_module DECLSPEC_HIDDEN
;
31 PROP_TYPE_PATTERN_PROP
,
35 * HUIANODEs that have an associated HWND are able to pull data from up to 4
36 * different providers:
38 * - Override providers are used to override values from all other providers.
39 * - Main providers are the base provider for an HUIANODE.
40 * - Nonclient providers are used to represent the nonclient area of the HWND.
41 * - HWND providers are used to represent data from the HWND as a whole, such
42 * as the bounding box.
44 * When a property is requested from the node, each provider is queried in
45 * descending order starting with the override provider until either one
46 * returns a property or there are no more providers to query.
48 enum uia_node_prov_type
{
57 IWineUiaNode IWineUiaNode_iface
;
60 IWineUiaProvider
*prov
[PROV_TYPE_COUNT
];
61 DWORD git_cookie
[PROV_TYPE_COUNT
];
69 int creator_prov_type
;
70 struct list prov_thread_list_entry
;
71 struct list node_map_list_entry
;
72 struct uia_provider_thread_map_entry
*map
;
75 static inline struct uia_node
*impl_from_IWineUiaNode(IWineUiaNode
*iface
)
77 return CONTAINING_RECORD(iface
, struct uia_node
, IWineUiaNode_iface
);
81 IWineUiaProvider IWineUiaProvider_iface
;
84 IRawElementProviderSimple
*elprov
;
85 BOOL return_nested_node
;
86 BOOL parent_check_ran
;
90 static inline struct uia_provider
*impl_from_IWineUiaProvider(IWineUiaProvider
*iface
)
92 return CONTAINING_RECORD(iface
, struct uia_provider
, IWineUiaProvider_iface
);
95 static inline void variant_init_bool(VARIANT
*v
, BOOL val
)
98 V_BOOL(v
) = val
? VARIANT_TRUE
: VARIANT_FALSE
;
102 HRESULT
get_safearray_bounds(SAFEARRAY
*sa
, LONG
*lbound
, LONG
*elems
) DECLSPEC_HIDDEN
;
103 int uia_compare_safearrays(SAFEARRAY
*sa1
, SAFEARRAY
*sa2
, int prop_type
) DECLSPEC_HIDDEN
;
104 int get_node_provider_type_at_idx(struct uia_node
*node
, int idx
) DECLSPEC_HIDDEN
;
105 HRESULT
create_uia_node_from_elprov(IRawElementProviderSimple
*elprov
, HUIANODE
*out_node
,
106 BOOL get_hwnd_providers
) DECLSPEC_HIDDEN
;
108 /* uia_com_client.c */
109 HRESULT
create_uia_iface(IUnknown
**iface
, BOOL is_cui8
) DECLSPEC_HIDDEN
;
112 const struct uia_prop_info
*uia_prop_info_from_id(PROPERTYID prop_id
) DECLSPEC_HIDDEN
;
113 const struct uia_pattern_info
*uia_pattern_info_from_id(PATTERNID pattern_id
) DECLSPEC_HIDDEN
;
114 const struct uia_control_type_info
*uia_control_type_info_from_id(CONTROLTYPEID control_type_id
) DECLSPEC_HIDDEN
;
117 void uia_stop_provider_thread(void) DECLSPEC_HIDDEN
;
118 void uia_provider_thread_remove_node(HUIANODE node
) DECLSPEC_HIDDEN
;
119 LRESULT
uia_lresult_from_node(HUIANODE huianode
) DECLSPEC_HIDDEN
;