MCPcopy Create free account
hub / github.com/AccessKit/accesskit / GetPropertyValue

Method GetPropertyValue

platforms/windows/src/node.rs:1009–1043  ·  view source on GitHub ↗
(&self, property_id: UIA_PROPERTY_ID)

Source from the content-addressed store, hash-verified

1007 }
1008
1009 fn GetPropertyValue(&self, property_id: UIA_PROPERTY_ID) -> Result<VARIANT> {
1010 self.resolve_with_tree_state_and_context(|node, state, context| {
1011 let wrapper = NodeWrapper(&node);
1012 let mut result = wrapper.get_property_value(property_id);
1013 if result.is_empty() {
1014 if node.is_root() {
1015 match property_id {
1016 UIA_NamePropertyId => {
1017 result = window_title(context.hwnd).into();
1018 }
1019 UIA_NativeWindowHandlePropertyId => {
1020 result = (context.hwnd.0.0 as i32).into();
1021 }
1022 _ => (),
1023 }
1024 }
1025 match property_id {
1026 UIA_FrameworkIdPropertyId => result = state.toolkit_name().into(),
1027 UIA_ProviderDescriptionPropertyId => result = toolkit_description(state).into(),
1028 UIA_ControllerForPropertyId => {
1029 let controlled: Vec<IUnknown> = node
1030 .controls()
1031 .filter(|controlled| filter(controlled) == FilterResult::Include)
1032 .map(|controlled| self.relative(controlled.id()))
1033 .map(IRawElementProviderSimple::from)
1034 .filter_map(|controlled| controlled.cast::<IUnknown>().ok())
1035 .collect();
1036 result = controlled.into();
1037 }
1038 _ => (),
1039 }
1040 }
1041 Ok(result.into())
1042 })
1043 }
1044
1045 fn HostRawElementProvider(&self) -> Result<IRawElementProviderSimple> {
1046 self.with_tree_state_and_context(|state, context| {

Callers

nothing calls this directly

Calls 11

window_titleFunction · 0.85
toolkit_descriptionFunction · 0.85
mapMethod · 0.80
controlsMethod · 0.80
NodeWrapperClass · 0.70
is_emptyMethod · 0.45
is_rootMethod · 0.45
toolkit_nameMethod · 0.45
relativeMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected