Updated all header files to new format
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / progress-bar / progress-bar-impl.h
index 8d33e02..f806926 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_PROGRESS_BAR_H
 
 /*
- * Copyright (c) 2017 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.
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali/public-api/animation/animation.h>
-#include <dali-toolkit/public-api/controls/progress-bar/progress-bar.h>
 #include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/internal/controls/control/control-data-impl.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/progress-bar/progress-bar.h>
+#include <dali/public-api/animation/animation.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 class ProgressBar;
 
-typedef Dali::IntrusivePtr< ProgressBar > ProgressBarPtr;
+typedef Dali::IntrusivePtr<ProgressBar> ProgressBarPtr;
 
 /**
  * @copydoc Toolkit::ProgressBar
@@ -45,16 +42,14 @@ typedef Dali::IntrusivePtr< ProgressBar > ProgressBarPtr;
 class ProgressBar : public Control
 {
 public:
-
   /**
    * Create a new ProgressBar with predefined style.
    * @param[in] progressBarStyle A style value that determines the shape of the progress bar.
    * @return A public handle to the newly allocated ProgressBar.
    */
-  static Dali::Toolkit::ProgressBar New( DevelProgressBar::Style progressBarStyle = DevelProgressBar::Style::LINEAR );
+  static Dali::Toolkit::ProgressBar New(DevelProgressBar::Style progressBarStyle = DevelProgressBar::Style::LINEAR);
 
 public:
-
   // Properties
 
   /**
@@ -62,7 +57,7 @@ public:
    *
    * @param[in] value The value to set. Will be clamped to [lowerBound .. upperBound]
    */
-  void SetProgressValue( float value );
+  void SetProgressValue(float value);
 
   /**
    * Get the value of the ProgressBar
@@ -76,7 +71,7 @@ public:
    *
    * @param[in] value The secondary progress value to set. Will be clamped to [lowerBound .. upperBound]
    */
-  void SetSecondaryProgressValue( float value );
+  void SetSecondaryProgressValue(float value);
 
   /**
    * Get the secondary progress value of the ProgressBar
@@ -90,7 +85,7 @@ public:
    *
    * @param[in] value The value to set.
    */
-  void SetIndeterminate( bool value );
+  void SetIndeterminate(bool value);
 
   /**
    * Get the indeterminate state value of the ProgressBar
@@ -104,7 +99,7 @@ public:
    *
    * @param[in] Transition data map to set.
    */
-  void SetIndeterminateVisualTransition( Property::Map transtion );
+  void SetIndeterminateVisualTransition(Property::Map transtion);
 
   /**
    * Get the indeterminate visual transition data map of the ProgressBar
@@ -126,7 +121,6 @@ public:
    */
   Toolkit::ProgressBar::ValueChangedSignalType& ValueChangedSignal();
 
-
   /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
@@ -136,8 +130,7 @@ public:
    * @return True if the signal was connected.
    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
    */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName,
-                               FunctorDelegate* functor );
+  static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
 
   // Properties
 
@@ -147,7 +140,7 @@ public:
    * @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.
@@ -155,10 +148,9 @@ 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);
 
 protected:
-
   /**
    * Construct a new ProgressBar.
    */
@@ -172,7 +164,7 @@ protected:
   /**
    * @copydoc CustomActorImpl::OnRelayout()
    */
-  void OnRelayout( const Vector2& size, RelayoutContainer& container ) override;
+  void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
 
   /**
    * @copydoc CustomActorImpl::GetNaturalSize()
@@ -180,7 +172,6 @@ protected:
   Vector3 GetNaturalSize() override;
 
 private:
-
   /**
    * Domain is a from/to pair
    */
@@ -192,14 +183,14 @@ private:
     Domain()
     {
     }
-    Domain( Vector2 fromVal, Vector2 toVal )
-        : from( fromVal ), to( toVal )
+    Domain(Vector2 fromVal, Vector2 toVal)
+    : from(fromVal),
+      to(toVal)
     {
     }
   };
 
 private:
-
   /**
    * @copydoc Toolkit::Control::OnInitialize()
    */
@@ -211,65 +202,63 @@ private:
    * @param[in] currentSize The current size of the ProgressBar
    * @return The range as a domain pair
    */
-  Domain CalcDomain( const Vector2& currentSize );
+  Domain CalcDomain(const Vector2& currentSize);
 
   /**
    * Set indeterminate visual transition animation
    */
-  void SetIndeterminateVisualTransition( Toolkit::TransitionData transtion );
+  void SetIndeterminateVisualTransition(Toolkit::TransitionData transtion);
 
   /**
    * Convert value to transition data
    */
-  Toolkit::TransitionData ConvertPropertyToTransition( const Property::Value& value );
+  Toolkit::TransitionData ConvertPropertyToTransition(const Property::Value& value);
 
   /**
    * Update progress bar label when progress value is changed
    */
-  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
+  void CreateVisualsForComponent(Property::Index index, const Property::Value& value, const int visualDepth);
 
   /**
    * Update progress bar label when progress value is changed
    */
-  bool GetPropertyMapForVisual( Property::Index visualIndex, Property::Map& retreivedMap ) const;
+  bool GetPropertyMapForVisual(Property::Index visualIndex, Property::Map& retreivedMap) const;
 
   /**
    * Apply progress value to visual
    */
-  void ApplyProgressToVisual( float progress, Property::Index index, int depth );
+  void ApplyProgressToVisual(float progress, Property::Index index, int depth);
 
   /**
    * Apply progress value to visual transform
    */
-  void ApplyProgressToVisualTransform( float progress, Vector2 trackSize, Property::Index index );
+  void ApplyProgressToVisualTransform(float progress, Vector2 trackSize, Property::Index index);
 
   /**
    * Check if we should start animating
    */
-  void OnSceneConnection( int depth ) override;
+  void OnSceneConnection(int depth) override;
 
 private:
-
   // Undefined
-  ProgressBar( const ProgressBar& );
+  ProgressBar(const ProgressBar&);
 
   // Undefined
-  ProgressBar& operator=( const ProgressBar& rhs );
+  ProgressBar& operator=(const ProgressBar& rhs);
 
 private:
+  Domain mDomain; ///< Current domain of the handle
 
-  Domain mDomain;                                                     ///< Current domain of the handle
-
-  Animation mIndeterminateVisualAni;                                  ///< Animation for indetrminate visual. Transition animation.
-  Toolkit::ProgressBar::ValueChangedSignalType mValueChangedSignal;   ///< Signal emitted when the value is changed
+  Animation                                    mIndeterminateVisualAni; ///< Animation for indetrminate visual. Transition animation.
+  Toolkit::ProgressBar::ValueChangedSignalType mValueChangedSignal;     ///< Signal emitted when the value is changed
 
-  Toolkit::TransitionData mIndeterminateVisualTransition;             ///< Transition data map for mIndeterminateVisualAni
-  float mProgressValue;                                               ///< Current value of ProgressBar
-  float mSecondaryProgressValue;                                      ///< Current loading value of ProgressBar
-  bool mIndeterminate;                                                ///< Whether the progress state is determined or not
-  Property::Map mTrackVisualMap;                                      ///< To backup visual properties when switching determinate/indeterminate.
-  Property::Map mProgressVisualMap;                                   ///< To backup visual properties when switching determinate/indeterminate.
-  Property::Map mSecondaryProgressVisualMap;                          ///< To backup visual properties when switching determinate/indeterminate.
+  Toolkit::TransitionData mIndeterminateVisualTransition; ///< Transition data map for mIndeterminateVisualAni
+  float                   mProgressValue;                 ///< Current value of ProgressBar
+  float                   mSecondaryProgressValue;        ///< Current loading value of ProgressBar
+  bool                    mIndeterminate;                 ///< Whether the progress state is determined or not
+  Property::Map           mTrackVisualMap;                ///< To backup visual properties when switching determinate/indeterminate.
+  Property::Map           mProgressVisualMap;             ///< To backup visual properties when switching determinate/indeterminate.
+  Property::Map           mSecondaryProgressVisualMap;    ///< To backup visual properties when switching determinate/indeterminate.
 
 protected:
   struct AccessibleImpl : public Control::Impl::AccessibleImpl,
@@ -279,7 +268,7 @@ protected:
     double GetMinimum() override;
     double GetCurrent() override;
     double GetMaximum() override;
-    bool SetCurrent( double ) override;
+    bool   SetCurrent(double) override;
     double GetMinimumIncrement() override;
   };
 };
@@ -288,22 +277,22 @@ protected:
 
 // Helpers for public-api forwarding methods
 
-inline Toolkit::Internal::ProgressBar& GetImpl( Toolkit::ProgressBar& pub )
+inline Toolkit::Internal::ProgressBar& GetImpl(Toolkit::ProgressBar& pub)
 {
-  DALI_ASSERT_ALWAYS( pub );
+  DALI_ASSERT_ALWAYS(pub);
 
   Dali::RefObject& handle = pub.GetImplementation();
 
-  return static_cast< Toolkit::Internal::ProgressBar& >( handle );
+  return static_cast<Toolkit::Internal::ProgressBar&>(handle);
 }
 
-inline const Toolkit::Internal::ProgressBar& GetImpl( const Toolkit::ProgressBar& pub )
+inline const Toolkit::Internal::ProgressBar& GetImpl(const Toolkit::ProgressBar& pub)
 {
-  DALI_ASSERT_ALWAYS( pub );
+  DALI_ASSERT_ALWAYS(pub);
 
   const Dali::RefObject& handle = pub.GetImplementation();
 
-  return static_cast< const Toolkit::Internal::ProgressBar& >( handle );
+  return static_cast<const Toolkit::Internal::ProgressBar&>(handle);
 }
 
 } // namespace Toolkit