Changelog: Add accessible-selectable and accessible-selected properties

This commit is contained in:
Arnold Loubriat 2024-10-13 22:33:05 +02:00 committed by Simon Hausmann
parent 66ebcbd1b7
commit 19f09950c2
8 changed files with 60 additions and 0 deletions

View file

@ -316,6 +316,32 @@ public:
return std::nullopt;
}
/// Returns the accessible-selected of that element, if any.
std::optional<bool> accessible_selected() const
{
if (auto result = get_accessible_string_property(
cbindgen_private::AccessibleStringProperty::Selected)) {
if (*result == "true")
return true;
else if (*result == "false")
return false;
}
return std::nullopt;
}
/// Returns the accessible-selectable of that element, if any.
std::optional<bool> accessible_selectable() const
{
if (auto result = get_accessible_string_property(
cbindgen_private::AccessibleStringProperty::Selectable)) {
if (*result == "true")
return true;
else if (*result == "false")
return false;
}
return std::nullopt;
}
/// Sets the accessible-value of that element.
///
/// Setting the value will invoke the `accessible-action-set-value` callback.