Revert "[Tizen] Add codes for Dali Windows Backend"
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.h
index d931353..b9734c7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ACTOR_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -1419,6 +1419,24 @@ public:
   void EmitVisibilityChangedSignal( bool visible, DevelActor::VisibilityChange::Type type );
 
   /**
+   * @brief Emits the layout direction change signal for this actor and all its children.
+   * @param[in] type Whether the actor's layout direction property has changed or a parent's.
+   */
+  void EmitLayoutDirectionChangedSignal( LayoutDirection::Type type );
+
+  /**
+   * @brief Emits the ChildAdded signal for this actor
+   * @param[in] child The child actor that has been added
+   */
+  void EmitChildAddedSignal( Actor& child );
+
+  /**
+   * @brief Emits the ChildRemoved signal for this actor
+   * @param[in] child The child actor that has been removed
+   */
+  void EmitChildRemovedSignal( Actor& child );
+
+  /**
    * @copydoc Dali::Actor::TouchedSignal()
    */
   Dali::Actor::TouchSignalType& TouchedSignal();
@@ -1459,6 +1477,21 @@ public:
   DevelActor::VisibilityChangedSignalType& VisibilityChangedSignal();
 
   /**
+   * @copydoc LayoutDirectionChangedSignal
+   */
+  Dali::Actor::LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal();
+
+  /**
+   * @copydoc DevelActor::ChildAddedSignal
+   */
+  DevelActor::ChildChangedSignalType& ChildAddedSignal();
+
+  /**
+   * @copydoc DevelActor::ChildRemovedSignal
+   */
+  DevelActor::ChildChangedSignalType& ChildRemovedSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -1722,11 +1755,9 @@ private:
     };
   };
 
-  // Undefined
-  Actor();
-
-  // Undefined
-  Actor( const Actor& );
+  // Remove default constructor and copy constructor
+  Actor()=delete;
+  Actor( const Actor& )=delete;
 
   // Undefined
   Actor& operator=( const Actor& rhs );
@@ -1869,7 +1900,7 @@ private:
    * @param[in] size The size to apply the policy to
    * @return Return the adjusted size
    */
-  Vector2 ApplySizeSetPolicy( const Vector2 size );
+  Vector2 ApplySizeSetPolicy( const Vector2& size );
 
   /**
    * Retrieve the parent object of an Actor.
@@ -1909,6 +1940,25 @@ private:
    */
   void SetVisibleInternal( bool visible, SendMessage::Type sendMessage );
 
+  /**
+   * Set whether a child actor inherits it's parent's layout direction. Default is to inherit.
+   * @param[in] inherit - true if the actor should inherit layout direction, false otherwise.
+   */
+  void SetInheritLayoutDirection( bool inherit );
+
+  /**
+   * Returns whether the actor inherits it's parent's layout direction.
+   * @return true if the actor inherits it's parent's layout direction, false otherwise.
+   */
+  bool IsLayoutDirectionInherited() const;
+
+  /**
+   * @brief Propagates layout direction recursively.
+   * @param[in] actor The actor for seting layout direction.
+   * @param[in] direction New layout direction.
+   */
+  void InheritLayoutDirectionRecursively( ActorPtr actor, Dali::LayoutDirection::Type direction, bool set = false );
+
 protected:
 
   Actor* mParent;                 ///< Each actor (except the root) can have one parent
@@ -1933,6 +1983,9 @@ protected:
   Dali::Actor::OffStageSignalType          mOffStageSignal;
   Dali::Actor::OnRelayoutSignalType        mOnRelayoutSignal;
   DevelActor::VisibilityChangedSignalType  mVisibilityChangedSignal;
+  Dali::Actor::LayoutDirectionChangedSignalType  mLayoutDirectionChangedSignal;
+  DevelActor::ChildChangedSignalType       mChildAddedSignal;
+  DevelActor::ChildChangedSignalType       mChildRemovedSignal;
 
   Quaternion      mTargetOrientation; ///< Event-side storage for orientation
   Vector4         mTargetColor;       ///< Event-side storage for color
@@ -1963,6 +2016,8 @@ protected:
   bool mInheritScale                               : 1; ///< Cached: Whether the parent's scale should be inherited.
   bool mPositionUsesAnchorPoint                    : 1; ///< Cached: Whether the position uses the anchor point or not.
   bool mVisible                                    : 1; ///< Cached: Whether the actor is visible or not.
+  bool mInheritLayoutDirection                     : 1; ///< Whether the actor inherits the layout direction from parent.
+  LayoutDirection::Type mLayoutDirection  : 1; ///< Layout direction, Left to Right or Right to Left.
   DrawMode::Type mDrawMode                         : 2; ///< Cached: How the actor and its children should be drawn
   PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
   ColorMode mColorMode                             : 2; ///< Cached: Determines whether mWorldColor is inherited