X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-anchor-impl.cpp;h=8abb0aeaacc671ee28182723ec89dc2a0b7f3c63;hb=ff6ce970724ccc8bee65f7c93411b274907c09d7;hp=2fde91c4b101eaae38a0f7202e18ff5e91d37f1e;hpb=f382cfe22850eb6a81d15da5c59401670d9c4646;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/text-controls/text-anchor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-anchor-impl.cpp index 2fde91c..8abb0ae 100644 --- a/dali-toolkit/internal/controls/text-controls/text-anchor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-anchor-impl.cpp @@ -145,17 +145,21 @@ void TextAnchor::OnInitialize() { 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( - 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() { } @@ -163,35 +167,35 @@ TextAnchor::~TextAnchor() { } -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(); } -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(); } -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(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(); } -bool TextAnchor::AccessibleImpl::IsValid() const +bool TextAnchor::TextAnchorAccessible::IsValid() const { return !GetAnchorUri(0).empty(); }