[Tizen] Fixed actor relayout dimension dependencies
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / custom-actor-internal.h
index c3b57b3..a70d884 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CUSTOM_ACTOR_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.
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/actors/actor-declarations.h>
+#include <dali/internal/event/actors/actor-impl.h>
 #include <dali/public-api/actors/custom-actor.h>
 #include <dali/public-api/animation/animation.h>
 
 namespace Dali
 {
-
 namespace Internal
 {
-
 class CustomActor : public Actor
 {
 public:
-
   /**
    * Create a new custom actor.
    * @return A smart-pointer to the newly allocated Actor.
@@ -66,34 +63,32 @@ public:
   Dali::TypeInfo GetTypeInfo();
 
 protected:
-
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~CustomActor();
+  ~CustomActor() override;
 
 private:
-
   /**
-   * @copydoc Internal::Actor::OnStageConnectionExternal
+   * @copydoc Internal::Actor::OnSceneConnectionExternal
    */
-  virtual void OnStageConnectionExternal( int32_t depth )
+  void OnSceneConnectionExternal(int32_t depth) override
   {
-    mImpl->OnStageConnection( depth );
+    mImpl->OnSceneConnection(depth);
   }
 
   /**
-   * @copydoc Internal::Actor::OnStageDisconnectionExternal
+   * @copydoc Internal::Actor::OnSceneDisconnectionExternal
    */
-  virtual void OnStageDisconnectionExternal()
+  void OnSceneDisconnectionExternal() override
   {
-    mImpl->OnStageDisconnection();
+    mImpl->OnSceneDisconnection();
   }
 
   /**
    * @copydoc Internal::Actor::OnChildAdd
    */
-  virtual void OnChildAdd(Actor& child)
+  void OnChildAdd(Actor& child) override
   {
     Dali::Actor handle(&child);
     mImpl->OnChildAdd(handle);
@@ -102,7 +97,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnChildRemove
    */
-  virtual void OnChildRemove(Actor& child)
+  void OnChildRemove(Actor& child) override
   {
     Dali::Actor handle(&child);
     mImpl->OnChildRemove(handle);
@@ -111,7 +106,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnPropertySet
    */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
+  void OnPropertySet(Property::Index index, const Property::Value& propertyValue) override
   {
     mImpl->OnPropertySet(index, propertyValue);
   }
@@ -119,7 +114,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnSizeSet
    */
-  virtual void OnSizeSet(const Vector3& targetSize)
+  void OnSizeSet(const Vector3& targetSize) override
   {
     mImpl->OnSizeSet(targetSize);
   }
@@ -127,64 +122,32 @@ private:
   /**
    * @copydoc Internal::Actor::OnSizeAnimation
    */
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
+  void OnSizeAnimation(Animation& animation, const Vector3& targetSize) override
   {
     Dali::Animation animationHandle(&animation);
     mImpl->OnSizeAnimation(animationHandle, targetSize);
   }
 
   /**
-   * @copydoc Internal::Actor::OnTouchEvent
-   */
-  virtual bool OnTouchEvent(const TouchEvent& event)
-  {
-    return mImpl->OnTouchEvent(event);
-  }
-
-  /**
-   * @copydoc Internal::Actor::OnHoverEvent
-   */
-  virtual bool OnHoverEvent(const HoverEvent& event)
-  {
-    return mImpl->OnHoverEvent(event);
-  }
-
-  /**
-   * @copydoc Internal::Actor::OnKeyEvent
-   */
-  virtual bool OnKeyEvent(const KeyEvent& event)
-  {
-    return mImpl->OnKeyEvent(event);
-  }
-
-  /**
-   * @copydoc Internal::Actor::OnWheelEvent
-   */
-  virtual bool OnWheelEvent(const WheelEvent& event)
-  {
-    return mImpl->OnWheelEvent(event);
-  }
-
-  /**
    * @copydoc Internal::Actor::OnRelayout
    */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+  void OnRelayout(const Vector2& size, RelayoutContainer& container) override
   {
-    mImpl->OnRelayout( size, container );
+    mImpl->OnRelayout(size, container);
   }
 
   /**
    * @copydoc Internal::Actor::OnSetResizePolicy
    */
-  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+  void OnSetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension) override
   {
-    mImpl->OnSetResizePolicy( policy, dimension );
+    mImpl->OnSetResizePolicy(policy, dimension);
   }
 
   /**
    * @copydoc Internal::Actor::GetNaturalSize
    */
-  virtual Vector3 GetNaturalSize() const
+  Vector3 GetNaturalSize() const override
   {
     return mImpl->GetNaturalSize();
   }
@@ -192,65 +155,63 @@ private:
   /**
    * @copydoc Internal::Actor::CalculateChildSize
    */
-  virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+  float CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension) override
   {
-    return mImpl->CalculateChildSize( child, dimension );
+    return mImpl->CalculateChildSize(child, dimension);
   }
 
   /**
    * @copydoc Internal::Actor::GetHeightForWidth
    */
-  virtual float GetHeightForWidth( float width )
+  float GetHeightForWidth(float width) override
   {
-    return mImpl->GetHeightForWidth( width );
+    return mImpl->GetHeightForWidth(width);
   }
 
   /**
    * @copydoc Internal::Actor::GetWidthForHeight
    */
-  virtual float GetWidthForHeight( float height )
+  float GetWidthForHeight(float height) override
   {
-    return mImpl->GetWidthForHeight( height );
+    return mImpl->GetWidthForHeight(height);
   }
 
   /**
    * @copydoc Internal::Actor::RelayoutDependentOnChildren
    */
-  virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS )
+  bool RelayoutDependentOnChildren(Dimension::Type dimension = Dimension::ALL_DIMENSIONS) override
   {
-    return mImpl->RelayoutDependentOnChildren( dimension );
+    return mImpl->RelayoutDependentOnChildren(dimension);
   }
 
   /**
    * @copydoc Internal::Actor::OnCalculateRelayoutSize
    */
-  virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+  void OnCalculateRelayoutSize(Dimension::Type dimension) override
   {
-    return mImpl->OnCalculateRelayoutSize( dimension );
+    return mImpl->OnCalculateRelayoutSize(dimension);
   }
 
   /**
    * @copydoc Internal::Actor::OnLayoutNegotiated
    */
-  virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+  void OnLayoutNegotiated(float size, Dimension::Type dimension) override
   {
-    return mImpl->OnLayoutNegotiated( size, dimension );
+    return mImpl->OnLayoutNegotiated(size, dimension);
   }
 
   /**
    * Private constructor; see also CustomActor::New()
    */
-  CustomActor( const SceneGraph::Node& node, CustomActorImpl& extension );
+  CustomActor(const SceneGraph::Node& node, CustomActorImpl& extension);
 
   // no default or copy constructor or assignment
-  CustomActor() = delete;
-  CustomActor( const CustomActor& ) = delete;
-  CustomActor& operator=( const CustomActor& rhs ) = delete;
+  CustomActor()                   = delete;
+  CustomActor(const CustomActor&) = delete;
+  CustomActor& operator=(const CustomActor& rhs) = delete;
 
 protected:
-
   CustomActorImplPtr mImpl;
-
 };
 
 } // namespace Internal
@@ -259,7 +220,7 @@ protected:
 
 inline Internal::CustomActor& GetImpl(Dali::CustomActor& actor)
 {
-  DALI_ASSERT_ALWAYS( actor && "CustomActor handle is empty" );
+  DALI_ASSERT_ALWAYS(actor && "CustomActor handle is empty");
 
   BaseObject& handle = actor.GetBaseObject();
 
@@ -268,7 +229,7 @@ inline Internal::CustomActor& GetImpl(Dali::CustomActor& actor)
 
 inline const Internal::CustomActor& GetImpl(const Dali::CustomActor& actor)
 {
-  DALI_ASSERT_ALWAYS( actor && "CustomActor handle is empty" );
+  DALI_ASSERT_ALWAYS(actor && "CustomActor handle is empty");
 
   const BaseObject& handle = actor.GetBaseObject();