[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / radio-button-impl.h
index 495e41f..075f8bd 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) 2019 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/buttons/radio-button.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
 #include "button-impl.h"
 
 namespace Dali
@@ -40,110 +40,60 @@ namespace Internal
  */
 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();
 
-  /**
-   * Construct a new PushButton.
-   */
-  RadioButton();
+private:
 
   /**
-   * Construct a new PushButton with label.
+   * Construct a new RadioButton.
    */
-  RadioButton(const std::string& label);
-
-  /**
-   * Construct a new PushButton with label.
-   */
-  RadioButton(Actor label);
+  RadioButton();
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~RadioButton();
 
-  /**
-   * @copydoc Dali::Toolkit::RadioButton::SetLabel(const std::string& label)
-   */
-  void SetLabel(const std::string& label);
+private: // From Button
 
   /**
-   * @copydoc Dali::Toolkit::RadioButton::SetLabel(Actor label)
+   * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  void SetLabel(Actor label);
+  void OnInitialize() override;
 
   /**
-   * @copydoc Dali::Toolkit::RadioButton::GetLabel()
+   * @copydoc Toolkit::Internal::Button::OnStateChange
    */
-  Actor GetLabel() const;
+  void OnStateChange( State newState ) override;
 
   /**
-   * @copydoc Dali::Toolkit::RadioButton::SetSelected(bool selected)
+   * @copydoc Toolkit::Internal::Button::OnToggleReleased
    */
-  void SetSelected(bool selected);
+  bool OnToggleReleased() override;
 
-  /**
-   * @copydoc Dali::Toolkit::RadioButton::IsSelected()
-   */
-  bool IsSelected()const;
-
-  /**
-   * @copydoc Dali::Toolkit::RadioButton::ToggleState()
-   */
-  void ToggleState();
-
-  /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
- public:
-  // Properties
-
-  /**
-   * @copydoc Button::SetProperty
-   */
-  static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value);
-
-  /**
-   * @copydoc Button::GetProperty
-   */
-  static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
-
- 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:
+private:
 
   // Undefined
-  RadioButton(const RadioButton& origin);
+  RadioButton( const RadioButton& origin );
 
   // Undefined
-  RadioButton& operator=(const RadioButton& origin);
+  RadioButton& operator=( const RadioButton& origin );
+
+protected:
+  struct AccessibleImpl : public Button::AccessibleImpl
+  {
+    using Button::AccessibleImpl::AccessibleImpl;
 
-  Image mUnselectedImage;  ///< Stores the unselected image
-  Image mSelectedImage;    ///< Stores the selected image
-  ImageActor mRadioIcon;   ///< Stores the current image
-  Actor mLabel;            ///< Stores the button label
-  bool mSelected;          ///< Stores the selected state
-} ;
+    Dali::Accessibility::States CalculateStates() override;
+  };
+};
 
 } // namespace Internal
 
@@ -170,4 +120,4 @@ inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::Ra
 } // namespace Toolkit
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
+#endif // DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H