[AT-SPI] Rename AccessibleImpl to <Control>Accessible
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / radio-button-impl.h
index dc31882..8c3289d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
-#define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
+#ifndef DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H
+#define DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/text-view/text-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
 #include "button-impl.h"
 
@@ -33,82 +32,66 @@ namespace Toolkit
 {
 namespace Internal
 {
-
 /**
  * RadioButton implementation class.
  *
  * \sa Dali::Toolkit::RadioButton
  */
-class RadioButton: public Button
+class RadioButton : public Button
 {
- public:
-
+public:
   /**
    * Create a new RadioButton.
    *
-   * @return A smart-pointer to the newly allocated PushButton.
+   * @return A smart-pointer to the newly allocated RadioButton.
    */
   static Dali::Toolkit::RadioButton New();
 
+private:
   /**
-   * Construct a new PushButton.
+   * Construct a new RadioButton.
    */
   RadioButton();
 
   /**
-   * Construct a new PushButton with label.
-   */
-  RadioButton( const std::string& label );
-
-  /**
-   * Construct a new PushButton with label.
-   */
-  RadioButton( Actor label );
-
-  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~RadioButton();
 
+private: // From Button
   /**
-   * @copydoc Dali::Toolkit::Button::SetLabel( Actor label )
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void SetLabel( Actor label );   // TODO: After refactoring painter, this will be removed
+  void OnInitialize() override;
 
   /**
-   * @copydoc Dali::Toolkit::Button::SetSelected( bool selected )
+   * @copydoc Toolkit::Internal::Button::OnStateChange
    */
-  virtual void SetSelected( bool selected );
+  void OnStateChange(State newState) override;
 
   /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
+   * @copydoc Toolkit::Internal::Button::OnToggleReleased
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
- protected: // From Control
-
-  /**
-   * Sets the relative position of image and label.
-   */
-  virtual void OnInitialize();
-
- protected: // From Button
-  /**
-   * Change button state when the button is pressed.
-   */
-  virtual void OnButtonUp();
-
- private:
+  bool OnToggleReleased() override;
 
+private:
   // Undefined
-  RadioButton( const RadioButton& origin );
+  RadioButton(const RadioButton& origin);
 
   // Undefined
-  RadioButton& operator=( const RadioButton& origin );
-
-  Image mUnselectedImage;  ///< Stores the unselected image
-  Image mSelectedImage;    ///< Stores the selected image
-  ImageActor mRadioIcon;   ///< Stores the current image
+  RadioButton& operator=(const RadioButton& origin);
+
+protected:
+  class RadioButtonAccessible : public Button::ButtonAccessible
+  {
+  public:
+    using Button::ButtonAccessible::ButtonAccessible;
+
+    /**
+     * @copydoc Dali::Toolkit::DevelControl::ControlAccessible::CalculateStates()
+     */
+    Dali::Accessibility::States CalculateStates() override;
+  };
 };
 
 } // namespace Internal
@@ -121,7 +104,7 @@ inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& b
 
   Dali::RefObject& handle = button.GetImplementation();
 
-  return static_cast<Toolkit::Internal::RadioButton&> (handle);
+  return static_cast<Toolkit::Internal::RadioButton&>(handle);
 }
 
 inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
@@ -130,10 +113,10 @@ inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::Ra
 
   const Dali::RefObject& handle = button.GetImplementation();
 
-  return static_cast<const Toolkit::Internal::RadioButton&> (handle);
+  return static_cast<const Toolkit::Internal::RadioButton&>(handle);
 }
 
 } // namespace Toolkit
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
+#endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H