X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fbutton-impl.cpp;h=1f5510d4d64e070130234fbb22744c768c36301c;hp=d840e96b98b0ea2e8238c5ef9f22d3b26550cc11;hb=e3d6a0a27fd980a4ced6e7257abdc32bc192e871;hpb=f11be450471738b68f98fa4c552b3a22482ae4de diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index d840e96..1f5510d 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -619,6 +619,7 @@ void Button::OnInitialize() mTapDetector.DetectedSignal().Connect(this, &Button::OnTap); self.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true ); + self.SetProperty( Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true ); self.TouchedSignal().Connect( this, &Button::OnTouch ); } @@ -1313,6 +1314,39 @@ Padding Button::GetForegroundPadding() return mForegroundPadding; } +std::string Button::AccessibleImpl::GetNameRaw() +{ + auto slf = Toolkit::Button::DownCast( self ); + + Property::Map label = slf.GetProperty( Toolkit::Button::Property::LABEL ); + + std::string labelText; + label.Find( Toolkit::TextVisual::Property::TEXT )->Get( labelText ); + + return labelText; +} + +Property::Index Button::AccessibleImpl::GetNamePropertyIndex() +{ + Property::Index label = Toolkit::Button::Property::LABEL; + Property::Map labelMap = self.GetProperty(label); + + if (MapContainsTextString(labelMap)) + return label; + else + return Property::INVALID_INDEX; +} + +Dali::Accessibility::States Button::AccessibleImpl::CalculateStates() +{ + auto tmp = Control::Impl::AccessibleImpl::CalculateStates(); + tmp[Dali::Accessibility::State::SELECTABLE] = true; + auto slf = Toolkit::Button::DownCast( self ); + tmp[Dali::Accessibility::State::ENABLED] = !slf.GetProperty( Toolkit::Button::Property::DISABLED ); + tmp[Dali::Accessibility::State::CHECKED] = slf.GetProperty( Toolkit::Button::Property::SELECTED ); + return tmp; +} + } // namespace Internal } // namespace Toolkit