[AT-SPI] Remove SetAccessibilityConstructor()
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / slider / slider-impl.cpp
index 8cac5ed..a48ddbe 100644 (file)
@@ -202,16 +202,17 @@ void Slider::OnInitialize()
   // Size the Slider actor to a default
   self.SetProperty(Actor::Property::SIZE, Vector2(DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y));
 
-  // Set the Slider to be highlightable in Screen Reader mode
-  self.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
-
   // Connect to the touch signal
   self.TouchedSignal().Connect(this, &Slider::OnTouch);
 
-  DevelControl::SetAccessibilityConstructor(self, [](Dali::Actor actor) {
-    return std::unique_ptr<Dali::Accessibility::Accessible>(
-      new AccessibleImpl(actor, Dali::Accessibility::Role::SLIDER));
-  });
+  // Accessibility
+  self.SetProperty(DevelControl::Property::ACCESSIBILITY_ROLE, Dali::Accessibility::Role::SLIDER);
+  self.SetProperty(DevelControl::Property::ACCESSIBILITY_HIGHLIGHTABLE, true);
+}
+
+DevelControl::ControlAccessible* Slider::CreateAccessibleObject()
+{
+  return new SliderAccessible(Self());
 }
 
 void Slider::OnRelayout(const Vector2& size, RelayoutContainer& container)
@@ -950,7 +951,7 @@ void Slider::SetValue(float value)
   DisplayValue(mValue, true);
   if(Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor())
   {
-    Control::Impl::GetAccessibilityObject(Self())->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::VALUE);
+    GetAccessibleObject()->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::VALUE);
   }
 }
 
@@ -1411,25 +1412,25 @@ Property::Value Slider::GetProperty(BaseObject* object, Property::Index property
   return value;
 }
 
-double Slider::AccessibleImpl::GetMinimum()
+double Slider::SliderAccessible::GetMinimum() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::LOWER_BOUND).Get<float>();
 }
 
-double Slider::AccessibleImpl::GetCurrent()
+double Slider::SliderAccessible::GetCurrent() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::VALUE).Get<float>();
 }
 
-double Slider::AccessibleImpl::GetMaximum()
+double Slider::SliderAccessible::GetMaximum() const
 {
   auto self = Toolkit::Slider::DownCast(Self());
   return self.GetProperty(Toolkit::Slider::Property::UPPER_BOUND).Get<float>();
 }
 
-bool Slider::AccessibleImpl::SetCurrent(double current)
+bool Slider::SliderAccessible::SetCurrent(double current)
 {
   if(current < GetMinimum() || current > GetMaximum())
     return false;
@@ -1477,7 +1478,7 @@ bool Slider::AccessibleImpl::SetCurrent(double current)
   return true;
 }
 
-double Slider::AccessibleImpl::GetMinimumIncrement()
+double Slider::SliderAccessible::GetMinimumIncrement() const
 {
   auto self = Toolkit::Slider::DownCast(Self());