[AT-SPI] Support reading states and tooltips of ToggleButton
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / toggle-button-impl.h
index 8c76eb4..7609773 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H__
-#define __DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H__
+#ifndef DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H
+#define DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H
 
 /*
- * Copyright (c) 2017 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.
@@ -134,17 +134,17 @@ private: // From Button
   /**
    * @copydoc Toolkit::Internal::Button::OnInitialize
    */
-  virtual void OnInitialize();
+  void OnInitialize() override;
 
   /**
    * @copydoc Toolkit::Internal::Button::OnRelayout
    */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+  void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
 
   /**
    * This method is called when the button is pressed.
    */
-  virtual void OnPressed();
+  void OnPressed() override;
 
 private:
 
@@ -163,6 +163,15 @@ private:
   std::vector<Toolkit::Visual::Base> mToggleDisabledSelectedVisuals;  ///< Save all disabled selected visuals.
   std::vector<std::string> mToggleTooltips;               ///< Toggle tooltips.
   unsigned int             mCurrentToggleIndex;       ///< The index of state.
+protected:
+  struct AccessibleImpl : public Button::AccessibleImpl
+  {
+    using Button::AccessibleImpl::AccessibleImpl;
+
+    Dali::Accessibility::States CalculateStates() override;
+    std::string GetDescriptionRaw() override;
+  };
+  void OnStateChange( State newState ) override;
 };
 
 } // namespace Internal
@@ -191,4 +200,4 @@ inline const Toolkit::Internal::ToggleButton& GetImplementation( const Toolkit::
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H__
+#endif // DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H