{
Actor self = Self();
- // Enable highlightability
- self.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
+ // Accessibility
+ self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::LINK);
+ self.SetProperty(DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
+}
- DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
- return std::unique_ptr<Dali::Accessibility::Accessible>(
- new AccessibleImpl(actor, Dali::Accessibility::Role::LINK));
- });
+DevelControl::ControlAccessible* TextAnchor::CreateAccessibleObject()
+{
+ return new TextAnchorAccessible(Self());
}
TextAnchor::TextAnchor()
-: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT))
+: Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
+ mStartCharacterIndex(0),
+ mEndCharacterIndex(0),
+ mUri()
{
}
{
}
-int32_t TextAnchor::AccessibleImpl::GetEndIndex() const
+int32_t TextAnchor::TextAnchorAccessible::GetEndIndex() const
{
auto self = Toolkit::TextAnchor::DownCast(Self());
return self.GetProperty(Toolkit::TextAnchor::Property::END_CHARACTER_INDEX).Get<int>();
}
-int32_t TextAnchor::AccessibleImpl::GetStartIndex() const
+int32_t TextAnchor::TextAnchorAccessible::GetStartIndex() const
{
auto self = Toolkit::TextAnchor::DownCast(Self());
return self.GetProperty(Toolkit::TextAnchor::Property::START_CHARACTER_INDEX).Get<int>();
}
-int32_t TextAnchor::AccessibleImpl::GetAnchorCount() const
+int32_t TextAnchor::TextAnchorAccessible::GetAnchorCount() const
{
return 1;
}
-Dali::Accessibility::Accessible* TextAnchor::AccessibleImpl::GetAnchorAccessible(int32_t anchorIndex) const
+Dali::Accessibility::Accessible* TextAnchor::TextAnchorAccessible::GetAnchorAccessible(int32_t anchorIndex) const
{
- return Control::Impl::GetAccessibilityObject(Self());
+ return const_cast<TextAnchorAccessible*>(this);
}
-std::string TextAnchor::AccessibleImpl::GetAnchorUri(int32_t anchorIndex) const
+std::string TextAnchor::TextAnchorAccessible::GetAnchorUri(int32_t anchorIndex) const
{
auto self = Toolkit::TextAnchor::DownCast(Self());
return self.GetProperty(Toolkit::TextAnchor::Property::URI).Get<std::string>();
}
-bool TextAnchor::AccessibleImpl::IsValid() const
+bool TextAnchor::TextAnchorAccessible::IsValid() const
{
return !GetAnchorUri(0).empty();
}