Refactoring VisualActions
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / arc / arc-visual.h
index 3de0473..011b946 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_ARC_VISUAL_H
 
 /*
- * Copyright (c) 2020 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.
 #include <dali/public-api/common/intrusive-ptr.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal
 {
-
 class ArcVisual;
-typedef IntrusivePtr< ArcVisual > ArcVisualPtr;
+typedef IntrusivePtr<ArcVisual> ArcVisualPtr;
 
 /**
  * The visual which renders an arc to the control's quad
@@ -49,10 +46,9 @@ typedef IntrusivePtr< ArcVisual > ArcVisualPtr;
  * | SWEEP_ANGLE     | FLOAT       |
  * | CAP             | INTEGER     |
  */
-class ArcVisual: public Visual::Base
+class ArcVisual : public Visual::Base
 {
 public:
-
   /**
    * @brief Create a new arc visual.
    *
@@ -60,28 +56,26 @@ public:
    * @param[in] properties A Property::Map containing settings for this visual
    * @return A smart-pointer to the newly allocated visual.
    */
-  static ArcVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties );
-
-public:  // from Visual
+  static ArcVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties);
 
+public: // from Visual
   /**
    * @copydoc Visual::Base::CreatePropertyMap
    */
-  void DoCreatePropertyMap( Property::Map& map ) const override;
+  void DoCreatePropertyMap(Property::Map& map) const override;
 
   /**
    * @copydoc Visual::Base::CreateInstancePropertyMap
    */
-  void DoCreateInstancePropertyMap( Property::Map& map ) const override;
+  void DoCreateInstancePropertyMap(Property::Map& map) const override;
 
 protected:
-
   /**
    * @brief Constructor.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    */
-  ArcVisual( VisualFactoryCache& factoryCache );
+  ArcVisual(VisualFactoryCache& factoryCache);
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
@@ -89,51 +83,47 @@ protected:
   virtual ~ArcVisual();
 
   /**
-   * @copydoc Visual::Base::DoSetProperties
+   * @copydoc Visual::Base::OnInitialize
    */
-  void DoSetProperties( const Property::Map& propertyMap ) override;
+  void OnInitialize() override;
 
   /**
-   * @copydoc Visual::Base::DoSetOnStage
+   * @copydoc Visual::Base::DoSetProperties
    */
-  void DoSetOnStage( Actor& actor ) override;
+  void DoSetProperties(const Property::Map& propertyMap) override;
 
   /**
-   * @copydoc Visual::Base::OnSetTransform
+   * @copydoc Visual::Base::DoSetOnScene
    */
-  void OnSetTransform() override;
+  void DoSetOnScene(Actor& actor) override;
 
   /**
-   * @copydoc Visual::Base::OnDoAction
+   * @copydoc Visual::Base::DoSetOffScene
    */
-  void OnDoAction( const Property::Index actionId, const Property::Value& attributes ) override;
-
-private:
+  void DoSetOffScene(Actor& actor) override;
 
   /**
-   * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
+   * @copydoc Visual::Base::OnSetTransform
    */
-  void InitializeRenderer();
+  void OnSetTransform() override;
 
 private:
-
   // Undefined
-  ArcVisual( const ArcVisual& arcVisual ) = delete;
+  ArcVisual(const ArcVisual& arcVisual) = delete;
 
   // Undefined
-  ArcVisual& operator=( const ArcVisual& arcVisual ) = delete;
+  ArcVisual& operator=(const ArcVisual& arcVisual) = delete;
 
 private:
-
-  float mThickness;                    ///< The thickness of the arc.
-  float mRadius;                       ///< The radius of the arc.
-  float mStartAngle;                   ///< The start angle of the arc.
-  float mSweepAngle;                   ///< The sweep angle of the arc.
-  Property::Index mRadiusIndex;        ///< The index of the radius property.
-  Property::Index mThicknessIndex;     ///< The index of the thickness property.
-  Property::Index mStartAngleIndex;    ///< The index of the start angle property.
-  Property::Index mSweepAngleIndex;    ///< The index of the sweep angle property.
-  DevelArcVisual::Cap::Type mCapType;  ///< The cap type.
+  float                     mThickness;       ///< The thickness of the arc.
+  float                     mRadius;          ///< The radius of the arc.
+  float                     mStartAngle;      ///< The start angle of the arc.
+  float                     mSweepAngle;      ///< The sweep angle of the arc.
+  Property::Index           mRadiusIndex;     ///< The index of the radius property.
+  Property::Index           mThicknessIndex;  ///< The index of the thickness property.
+  Property::Index           mStartAngleIndex; ///< The index of the start angle property.
+  Property::Index           mSweepAngleIndex; ///< The index of the sweep angle property.
+  DevelArcVisual::Cap::Type mCapType;         ///< The cap type.
 };
 
 } // namespace Internal