Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / custom-actor-internal.h
index c195a27..a70d884 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_CUSTOM_ACTOR_H__
-#define __DALI_INTERNAL_CUSTOM_ACTOR_H__
+#ifndef DALI_INTERNAL_CUSTOM_ACTOR_H
+#define DALI_INTERNAL_CUSTOM_ACTOR_H
 
 /*
- * Copyright (c) 2014 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.
@@ -58,35 +55,40 @@ public:
     return *mImpl;
   }
 
-protected:
+  /**
+   * Get the type info associated with this object.
+   *
+   * @return The type info
+   */
+  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()
+  void OnSceneConnectionExternal(int32_t depth) override
   {
-    mImpl->OnStageConnection();
+    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);
@@ -95,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);
@@ -104,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);
   }
@@ -112,7 +114,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnSizeSet
    */
-  virtual void OnSizeSet(const Vector3& targetSize)
+  void OnSizeSet(const Vector3& targetSize) override
   {
     mImpl->OnSizeSet(targetSize);
   }
@@ -120,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::OnMouseWheelEvent
-   */
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event)
-  {
-    return mImpl->OnMouseWheelEvent(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();
   }
@@ -185,64 +155,62 @@ 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(CustomActorImpl& extension);
+  CustomActor(const SceneGraph::Node& node, CustomActorImpl& extension);
 
-  // Undefined
-  CustomActor(const CustomActor&);
-
-  // Undefined
-  CustomActor& operator=(const CustomActor& rhs);
+  // no default or copy constructor or assignment
+  CustomActor()                   = delete;
+  CustomActor(const CustomActor&) = delete;
+  CustomActor& operator=(const CustomActor& rhs) = delete;
 
 protected:
-
   CustomActorImplPtr mImpl;
 };
 
@@ -252,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();
 
@@ -261,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();
 
@@ -270,4 +238,4 @@ inline const Internal::CustomActor& GetImpl(const Dali::CustomActor& actor)
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_CUSTOM_ACTOR_H__
+#endif // DALI_INTERNAL_CUSTOM_ACTOR_H