Updated all header files to new format
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / buttons / toggle-button-impl.h
index a3bb83a..322285b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_TOGGLE_BUTTON_H
 
 /*
- * Copyright (c) 2019 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.
@@ -20,9 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/object/property-value.h>
 #include <dali/public-api/object/property-array.h>
-
+#include <dali/public-api/object/property-value.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/buttons/toggle-button.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 /**
  * ToggleButton implementation class.
  *
@@ -45,7 +41,6 @@ namespace Internal
 class ToggleButton : public Button
 {
 public:
-
   /**
    * Create a new ToggleButton.
    * @return A smart-pointer to the newly allocated ToggleButton.
@@ -53,7 +48,6 @@ public:
   static Dali::Toolkit::ToggleButton New();
 
 protected:
-
   /**
    * Construct a new ToggleButton.
    */
@@ -65,14 +59,13 @@ protected:
   virtual ~ToggleButton();
 
 public:
-
   /**
    * Called when a property of an object of this type is set.
    * @param[in] object The object whose property is set.
    * @param[in] index The property index.
    * @param[in] value The new property value.
    */
-  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
+  static void SetProperty(BaseObject* object, Property::Index index, const Property::Value& value);
 
   /**
    * Called to retrieve a property of an object of this type.
@@ -80,22 +73,21 @@ public:
    * @param[in] index The property index.
    * @return The current value of the property.
    */
-  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
+  static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
 
 private:
-
   /**
    * Called to create all toggle visuals and save them to mToggleVisuals.
    * @param[in] states The array store toggle states.
    * @param[out] visuals The created state visual vector.
    */
-  void CreateVisualsForAllStates( const Property::Array& states, std::vector<Toolkit::Visual::Base>& visuals );
+  void CreateVisualsForAllStates(const Property::Array& states, std::vector<Toolkit::Visual::Base>& visuals);
 
   /**
    * Called to set toggle states when TOGGLE_STATES is set in SetProperty function.
    * @param[in] states The array store toggle states.
    */
-  void SetToggleStates( const Property::Array& states );
+  void SetToggleStates(const Property::Array& states);
 
   /**
    * Called to retrieve toggle states.
@@ -107,7 +99,7 @@ private:
    * Called to set toggle tooltips when TOGGLE_TIPS is set in SetProperty function.
    * @param[in] tips The array store toggle tips.
    */
-  void SetToggleTooltips( std::vector<std::string>& tips );
+  void SetToggleTooltips(std::vector<std::string>& tips);
 
   /**
    * Called to retrieve toggle tips.
@@ -127,10 +119,9 @@ private:
    * @param[in] index The index of visual to relayout.
    * @param[in] size The size of control.
    */
-  void RelayoutVisual( Property::Index index, const Vector2& size );
+  void RelayoutVisual(Property::Index index, const Vector2& size);
 
 private: // From Button
-
   /**
    * @copydoc Toolkit::Internal::Button::OnInitialize
    */
@@ -139,7 +130,7 @@ private: // From Button
   /**
    * @copydoc Toolkit::Internal::Button::OnRelayout
    */
-  void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
+  void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
 
   /**
    * This method is called when the button is pressed.
@@ -147,54 +138,52 @@ private: // From Button
   void OnPressed() override;
 
 private:
-
   // Undefined
-  ToggleButton( const ToggleButton& );
+  ToggleButton(const ToggleButton&);
 
   // Undefined
-  ToggleButton& operator=( const ToggleButton& );
+  ToggleButton& operator=(const ToggleButton&);
 
 private:
-
-  Property::Array mToggleStates;                              ///< Toggle states, string or map.
-  std::vector<Toolkit::Visual::Base> mToggleVisuals;          ///< Save all unselected visuals.
-  std::vector<Toolkit::Visual::Base> mToggleSelectedVisuals;  ///< Save all selected visuals.
-  std::vector<Toolkit::Visual::Base> mToggleDisabledVisuals;  ///< Save all disabled unselected visuals.
-  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.
+  Property::Array                    mToggleStates;                  ///< Toggle states, string or map.
+  std::vector<Toolkit::Visual::Base> mToggleVisuals;                 ///< Save all unselected visuals.
+  std::vector<Toolkit::Visual::Base> mToggleSelectedVisuals;         ///< Save all selected visuals.
+  std::vector<Toolkit::Visual::Base> mToggleDisabledVisuals;         ///< Save all disabled unselected visuals.
+  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;
-    Property::Index GetDescriptionPropertyIndex() override;
+    std::string                 GetDescriptionRaw() override;
+    Property::Index             GetDescriptionPropertyIndex() override;
   };
-  void OnStateChange( State newState ) override;
+  void OnStateChange(State newState) override;
 };
 
 } // namespace Internal
 
 // Helpers for public-api forwarding methods
 
-inline Toolkit::Internal::ToggleButton& GetImplementation( Toolkit::ToggleButton& button )
+inline Toolkit::Internal::ToggleButton& GetImplementation(Toolkit::ToggleButton& button)
 {
-  DALI_ASSERT_ALWAYS( button );
+  DALI_ASSERT_ALWAYS(button);
 
   Dali::RefObject& handle = button.GetImplementation();
 
-  return static_cast<Toolkit::Internal::ToggleButton&>( handle );
+  return static_cast<Toolkit::Internal::ToggleButton&>(handle);
 }
 
-inline const Toolkit::Internal::ToggleButton& GetImplementation( const Toolkit::ToggleButton& button )
+inline const Toolkit::Internal::ToggleButton& GetImplementation(const Toolkit::ToggleButton& button)
 {
-  DALI_ASSERT_ALWAYS( button );
+  DALI_ASSERT_ALWAYS(button);
 
   const Dali::RefObject& handle = button.GetImplementation();
 
-  return static_cast<const Toolkit::Internal::ToggleButton&>( handle );
+  return static_cast<const Toolkit::Internal::ToggleButton&>(handle);
 }
 
 } // namespace Toolkit