#include <dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
END_TEST;
}
+
+int utcDaliAccessibilityHidden(void)
+{
+ ToolkitTestApplication application;
+
+ auto control = Toolkit::Control::New();
+ auto* accessible = Dali::Accessibility::Accessible::Get(control);
+
+ // Check not hidden
+ DALI_TEST_CHECK(accessible);
+ DALI_TEST_CHECK(!accessible->IsHidden());
+ DALI_TEST_CHECK(!control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+ control.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, true);
+
+ // Check hidden
+ DALI_TEST_CHECK(accessible->IsHidden());
+ DALI_TEST_CHECK(control.GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN));
+
+ END_TEST;
+}
return attributeMap;
}
+bool ControlAccessible::IsHidden() const
+{
+ auto control = Dali::Toolkit::Control::DownCast(Self());
+
+ Internal::Control& internalControl = Toolkit::Internal::GetImplementation(control);
+ Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get(internalControl);
+
+ return controlImpl.mAccessibilityHidden;
+}
+
bool ControlAccessible::GrabFocus()
{
return Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self());
*/
Dali::Accessibility::Attributes GetAttributes() const override;
+ /**
+ * @copydoc Dali::Accessibility::Accessible::IsHidden()
+ */
+ bool IsHidden() const override;
+
/**
* @copydoc Dali::Accessibility::Component::GrabFocus()
*/
* @see Dali::Accessibility::Role
*/
ACCESSIBILITY_ROLE,
+
/**
* @brief Mark of able to highlight object.
* @details Name "accessibilityHighlightable", type Property::BOOLEAN.
*/
ACCESSIBILITY_HIGHLIGHTABLE,
+
/**
* @brief Set of accessibility attributes describing object in accessibility hierarchy
* @details Name "accessibilityAttributes", type Property::MAP
* @note If a control's dispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
*/
DISPATCH_KEY_EVENTS,
+
+ /**
+ * @brief Marks the object as invisible to AT-SPI clients.
+ * @details Name "accessibilityHidden", type Property::BOOLEAN.
+ * @note The representative Accessible object will not appear in the AT-SPI tree.
+ */
+ ACCESSIBILITY_HIDDEN,
};
} // namespace Property
const PropertyRegistration Control::Impl::PROPERTY_19(typeRegistration, "accessibilityRole", Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Property::INTEGER, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_20(typeRegistration, "accessibilityHighlightable", Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
const PropertyRegistration Control::Impl::PROPERTY_21(typeRegistration, "accessibilityAttributes", Toolkit::DevelControl::Property::ACCESSIBILITY_ATTRIBUTES, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
-const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents", Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_22(typeRegistration, "dispatchKeyEvents", Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
+const PropertyRegistration Control::Impl::PROPERTY_23(typeRegistration, "accessibilityHidden", Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty);
// clang-format on
}
break;
}
+
+ case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+ {
+ bool hidden;
+ if(value.Get(hidden))
+ {
+ controlImpl.mImpl->mAccessibilityHidden = hidden;
+ }
+ break;
+ }
}
}
}
value = controlImpl.mImpl->mAccessibilityAttributes;
break;
}
+
case Toolkit::DevelControl::Property::DISPATCH_KEY_EVENTS:
{
value = controlImpl.mImpl->mDispatchKeyEvents;
break;
}
+
+ case Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN:
+ {
+ value = controlImpl.mImpl->mAccessibilityHidden;
+ break;
+ }
}
}
bool mAccessibilityHighlightable = false;
bool mAccessibilityHighlightableSet = false;
+ bool mAccessibilityHidden = false;
+
Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN;
std::map<Dali::Accessibility::RelationType, std::set<Accessibility::Accessible*>> mAccessibilityRelations;
static const PropertyRegistration PROPERTY_20;
static const PropertyRegistration PROPERTY_21;
static const PropertyRegistration PROPERTY_22;
+ static const PropertyRegistration PROPERTY_23;
private:
// Accessibility - notification for highlighted object to check if it is showing.
}
case Actor::Property::VISIBLE:
{
- if(Dali::Accessibility::IsUp())
+ if(Dali::Accessibility::IsUp() && !Self().GetProperty<bool>(Toolkit::DevelControl::Property::ACCESSIBILITY_HIDDEN))
{
Dali::Accessibility::Accessible::Get(Self())->EmitVisible(Self().GetProperty(Actor::Property::VISIBLE).Get<bool>());
}