[dali_1.2.55] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / devel-api / actors / actor-devel.h
index 11229e4..22085a9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ACTOR_DEVEL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -88,29 +88,81 @@ enum Type
   CLIPPING_MODE        = Dali::Actor::Property::CLIPPING_MODE,
 
   /**
-   * @brief name "siblingOrder", type INTEGER
-   *
-   * @details Sets the sibling order of the actor so depth position can be defined within the same parent.
-   *
+   * @brief Sets the sibling order of the actor so depth position can be defined within the same parent.
+   * @details Name "siblingOrder", type Property::INTEGER.
+   * @note The initial value is 0.
    * @note Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the
-   * sibling order. The values set by this Property will likey change.
+   * sibling order. The values set by this Property will likely change.
    */
-  SIBLING_ORDER        = CLIPPING_MODE + 1,
+  SIBLING_ORDER = CLIPPING_MODE + 1,
 
   /**
    * @brief The opacity of the actor.
    * @details Name "opacity", type Property::FLOAT.
-   * @SINCE_1_2.28
    */
-  OPACITY              = CLIPPING_MODE + 2,
+  OPACITY = CLIPPING_MODE + 2,
+
+  /**
+   * @brief Returns the screen position of the Actor
+   * @details Name "screenPosition", type Property::VECTOR2. Read-only
+   * @note This assumes default camera and default render-task and the Z position is ZERO.
+   */
+  SCREEN_POSITION = CLIPPING_MODE + 3,
+
+  /**
+   * @brief Determines whether the anchor point should be used to determine the position of the actor.
+   * @details Name "positionUsesAnchorPoint", type Property::BOOLEAN.
+   * @note This is true by default.
+   * @note If false, then the top-left of the actor is used for the position.
+   * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
+   */
+  POSITION_USES_ANCHOR_POINT = CLIPPING_MODE + 4,
+
+  /**
+   * @brief The direction of layout.
+   * @details Name "layoutDirection", type Property::STRING.
+   */
+  LAYOUT_DIRECTION = CLIPPING_MODE + 5,
+
+  /**
+   * @brief Determines whether child actors inherit the layout direction from a parent.
+   * @details Name "layoutDirectionInheritance", type Property::BOOLEAN.
+   */
+  LAYOUT_DIRECTION_INHERITANCE = CLIPPING_MODE + 6
 };
 
 } // namespace Property
 
+namespace VisibilityChange
+{
+
+enum Type
+{
+  SELF,   ///< The visibility of the actor itself has changed.
+  PARENT  ///< The visibility of a parent has changed.
+};
+
+} // namespace VisibilityChange
+
+namespace LayoutDirection
+{
+
+enum Type
+{
+  LTR,   ///< Left to Right direction (Default).
+  RTL    ///< Right to Left direction.
+};
+
+} // namespace
+
+typedef Signal< void ( Actor, bool, VisibilityChange::Type ) > VisibilityChangedSignalType; ///< Signal type of VisibilityChangedSignalType
+
+typedef Signal< void ( Actor, LayoutDirection::Type ) > LayoutDirectionChangedSignalType; ///< Signal type of LayoutDirectionChangedSignal
+
 /**
- * @brief Raise actor above the next highest level of actor(s)
+ * @brief Raise actor above the next highest level of actor(s).
  *
- * @param[in] actor the Actor to lower
+ * @param[in] actor The Actor to raise
  * @note Sibling order of actors within the parent will be updated automatically.
  * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
  * Initially actors added to a parent will have the same sibling order and shown in relation to insertion order.
@@ -121,9 +173,9 @@ enum Type
 DALI_IMPORT_API void Raise( Actor actor );
 
 /**
- * @brief Lower the actor to underneath the level below actor(s)
+ * @brief Lower the actor to underneath the level below actor(s).
  *
- * @param[in] actor the Actor to lower
+ * @param[in] actor The Actor to lower
  * @note Sibling order of actors within the parent will be updated automatically.
  * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
  * Lowering this actor below actors with the same sibling order as each other will lower this actor above them.
@@ -132,9 +184,9 @@ DALI_IMPORT_API void Raise( Actor actor );
 DALI_IMPORT_API void Lower( Actor actor );
 
 /**
- * @brief Raise actor above all other actors
+ * @brief Raise actor above all other actors.
  *
- * @param[in] actor the Actor to lower
+ * @param[in] actor The Actor to raise to the top
  * @note Sibling order of actors within the parent will be updated automatically.
  * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
  * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
@@ -142,9 +194,9 @@ DALI_IMPORT_API void Lower( Actor actor );
 DALI_IMPORT_API void RaiseToTop( Actor actor );
 
 /**
- * @brief Lower actor to the bottom of all actors
+ * @brief Lower actor to the bottom of all actors.
  *
- * @param[in] actor the Actor to lower
+ * @param[in] actor The Actor to lower to the bottom
  * @note Sibling order of actors within the parent will be updated automatically.
  * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
  * Once a raise or lower API is used that actor will then have an exclusive sibling order independent of insertion.
@@ -152,10 +204,10 @@ DALI_IMPORT_API void RaiseToTop( Actor actor );
 DALI_IMPORT_API void LowerToBottom( Actor actor );
 
 /**
- * @brief Raise the actor to above the target actor
+ * @brief Raise the actor to above the target actor.
  *
- * @param[in] actor the Actor to lower
- * @param[in] target the target Actor to raise above
+ * @param[in] actor The actor to raise
+ * @param[in] target Will be raised above this actor
  * @note Sibling order of actors within the parent will be updated automatically.
  * Actors on the level above the target actor will still be shown above this actor.
  * Raising this actor above actors with the same sibling order as each other will raise this actor above them.
@@ -165,10 +217,10 @@ DALI_IMPORT_API void LowerToBottom( Actor actor );
 DALI_IMPORT_API void RaiseAbove( Actor actor, Dali::Actor target );
 
 /**
- * @brief Lower the actor to below the target actor
+ * @brief Lower the actor to below the target actor.
  *
- * @param[in] actor the Actor to lower
- * @param[in] target the target Actor to lower below
+ * @param[in] actor The Actor to lower
+ * @param[in] target Will be lowered below this actor
  * @note Sibling order of actors within the parent will be updated automatically.
  * Using this API means a limit of DevelLayer::SIBLING_ORDER_MULTIPLIER Actors.
  * Lowering this actor below actors with the same sibling order as each other will lower this actor above them.
@@ -176,6 +228,36 @@ DALI_IMPORT_API void RaiseAbove( Actor actor, Dali::Actor target );
  */
 DALI_IMPORT_API void LowerBelow( Actor actor, Dali::Actor target );
 
+/**
+ * @brief This signal is emitted when the visible property of this or a parent actor is changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( Actor actor, bool visible, VisibilityChange::Type& type );
+ * @endcode
+ * actor: The actor, or child of actor, whose visibility has changed
+ * visible: Whether the actor is now visible or not
+ * type: Whether the actor's visible property has changed or a parent's.
+ * @return The signal to connect to
+ * @pre The Actor has been initialized.
+ * @note This signal is NOT emitted if the actor becomes transparent (or the reverse), it's only linked with Actor::Property::VISIBLE.
+ */
+DALI_IMPORT_API VisibilityChangedSignalType& VisibilityChangedSignal( Actor actor );
+
+/**
+ * @brief This signal is emitted when the layout direction property of this or a parent actor is changed.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( Actor actor, LayoutDirection::Type type );
+ * @endcode
+ * actor: The actor, or child of actor, whose laytou direction has changed
+ * type: Whether the actor's layout direction property has changed or a parent's.
+ * @return The signal to connect to
+ * @pre The Actor has been initialized.
+ */
+DALI_IMPORT_API LayoutDirectionChangedSignalType& LayoutDirectionChangedSignal( Actor actor );
+
 } // namespace DevelActor
 
 } // namespace Dali