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

Method value

platforms/macos/src/node.rs:323–339  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

321 }
322
323 pub(crate) fn value(&self) -> Option<Value> {
324 if let Some(toggled) = self.0.toggled() {
325 return Some(Value::Bool(toggled != Toggled::False));
326 }
327 if self.0.role() == Role::Tab {
328 // On Mac, tabs are exposed as radio buttons, and are treated as checkable.
329 // Also, `Node::is_selected` is mapped to checked via `accessibilityValue`.
330 return Some(Value::Bool(self.0.is_selected().unwrap_or(false)));
331 }
332 if let Some(value) = self.0.value() {
333 return Some(Value::String(value));
334 }
335 if let Some(value) = self.0.numeric_value() {
336 return Some(Value::Number(value));
337 }
338 None
339 }
340
341 pub(crate) fn supports_text_ranges(&self) -> bool {
342 self.0.supports_text_ranges()

Callers 7

nameMethod · 0.45
node_updatedMethod · 0.45
textMethod · 0.45
populate_node_infoMethod · 0.45
node_addedMethod · 0.45
node_updatedMethod · 0.45

Calls 4

toggledMethod · 0.80
roleMethod · 0.45
is_selectedMethod · 0.45
numeric_valueMethod · 0.45

Tested by

no test coverage detected