[3.0] Add descriptions and example codes
[platform/core/uifw/dali-core.git] / dali / public-api / actors / actor.h
index ff2e5a2..1040218 100644 (file)
@@ -46,6 +46,7 @@ struct Degree;
 class Quaternion;
 class Layer;
 struct KeyEvent;
+class TouchData;
 struct TouchEvent;
 struct HoverEvent;
 struct WheelEvent;
@@ -146,13 +147,7 @@ typedef Rect<float> Padding;      ///< Padding definition @SINCE_1_0.0
  *
  *     Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest.
  *     @endcode
- *   - Stencil Actors can be used to influence the result of hits on renderable actors within a layer.
- *     If a Stencil Actor exists on a layer and that Actor is marked visible then a successful
- *     hit on a renderable actor can only take place in the area that the stencil Actor marks as visible.
- *     The hit can be in any Stencil Actor in that layer, but must be in the region of one of them.
- *     Stencil Actor inheritance behaves as with rendering in that any child of a Stencil Actor will
- *     also be considered a Stencil Actor.
- *     Non-renderable actors can be hit regardless of whether a stencil actor is hit or not.
+ *     For more information, see SetDrawMode().
  *
  * <i>Touch or hover Event Delivery:</i>
  *
@@ -295,7 +290,7 @@ public:
       INHERIT_ORIENTATION,                                ///< name "inheritOrientation",    type bool @SINCE_1_0.0
       INHERIT_SCALE,                                      ///< name "inheritScale",          type bool @SINCE_1_0.0
       COLOR_MODE,                                         ///< name "colorMode",             type std::string @SINCE_1_0.0
-      POSITION_INHERITANCE,                               ///< name "positionInheritance",   type std::string @SINCE_1_0.0
+      POSITION_INHERITANCE,                               ///< name "positionInheritance",   type std::string @DEPRECATED_1_1.24 Use INHERIT_POSITION instead
       DRAW_MODE,                                          ///< name "drawMode",              type std::string @SINCE_1_0.0
       SIZE_MODE_FACTOR,                                   ///< name "sizeModeFactor",        type Vector3 @SINCE_1_0.0
       WIDTH_RESIZE_POLICY,                                ///< name "widthResizePolicy",     type String @SINCE_1_0.0
@@ -306,17 +301,19 @@ public:
       PADDING,                                            ///< name "padding",               type Vector4 @SINCE_1_0.0
       MINIMUM_SIZE,                                       ///< name "minimumSize",           type Vector2 @SINCE_1_0.0
       MAXIMUM_SIZE,                                       ///< name "maximumSize",           type Vector2 @SINCE_1_0.0
+      INHERIT_POSITION,                                   ///< name "inheritPosition", type bool @SINCE_1_1.24
     };
   };
 
   // Typedefs
 
-  typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType;                 ///< Touch signal type @SINCE_1_0.0
-  typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType;                 ///< Hover signal type @SINCE_1_0.0
-  typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType;           ///< Wheel signal type @SINCE_1_0.0
-  typedef Signal< void (Actor) > OnStageSignalType;  ///< Stage connection signal type @SINCE_1_0.0
-  typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type @SINCE_1_0.0
-  typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out @SINCE_1_0.0
+  typedef Signal< bool (Actor, const TouchEvent&) > TouchSignalType;        ///< @DEPRECATED_1_1.37 @brief Touch signal type @SINCE_1_0.0
+  typedef Signal< bool (Actor, const TouchData&) >  TouchDataSignalType;    ///< Touch signal type @SINCE_1_1.37
+  typedef Signal< bool (Actor, const HoverEvent&) > HoverSignalType;        ///< Hover signal type @SINCE_1_0.0
+  typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType;   ///< Wheel signal type @SINCE_1_0.0
+  typedef Signal< void (Actor) > OnStageSignalType;                         ///< Stage connection signal type @SINCE_1_0.0
+  typedef Signal< void (Actor) > OffStageSignalType;                        ///< Stage disconnection signal type @SINCE_1_0.0
+  typedef Signal< void (Actor) > OnRelayoutSignalType;                      ///< Called when the actor is relaid out @SINCE_1_0.0
 
   // Creation
 
@@ -758,6 +755,7 @@ public:
   Vector3 GetCurrentWorldPosition() const;
 
   /**
+   * @DEPRECATED_1_1.24 Use SetInheritPosition instead
    * @brief Set the actors position inheritance mode.
    *
    * The default is to inherit.
@@ -770,6 +768,21 @@ public:
   void SetPositionInheritanceMode( PositionInheritanceMode mode );
 
   /**
+   * @brief Set whether a child actor inherits it's parent's position.
+   *
+   * Default is to inherit.
+   * Switching this off means that using SetPosition() sets the actor's world position3
+   * @SINCE_1_1.24
+   * @param[in] inherit - true if the actor should inherit position, false otherwise.
+   * @pre The Actor has been initialized.
+   */
+  inline void SetInheritPosition( bool inherit )
+  {
+    SetProperty(Property::INHERIT_POSITION, inherit );
+  }
+
+  /**
+   * @DEPRECATED_1_1.24 Use IsPositionInherited
    * @brief Returns the actors position inheritance mode.
    *
    * @SINCE_1_0.0
@@ -779,6 +792,18 @@ public:
   PositionInheritanceMode GetPositionInheritanceMode() const;
 
   /**
+   * @brief Returns whether the actor inherits its parent's position.
+   *
+   * @SINCE_1_1.24
+   * @return True if the actor inherits its parent position, false if it uses world position.
+   * @pre The Actor has been initialized.
+   */
+  inline bool IsPositionInherited() const
+  {
+    return GetProperty(Property::INHERIT_POSITION ).Get<bool>();
+  }
+
+  /**
    * @brief Sets the orientation of the Actor.
    *
    * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
@@ -1113,7 +1138,7 @@ public:
   // Input Handling
 
   /**
-   * @brief Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
+   * @brief Sets whether an actor should emit touch or hover signals.
    *
    * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
    * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
@@ -1409,6 +1434,7 @@ public: // Renderer
 public: // Signals
 
   /**
+   * @DEPRECATED_1_1.37 Use TouchSignal() instead.
    * @brief This signal is emitted when touch input is received.
    *
    * A callback of the following type may be connected:
@@ -1424,6 +1450,21 @@ public: // Signals
   TouchSignalType& TouchedSignal();
 
   /**
+   * @brief This signal is emitted when touch input is received.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   bool YourCallbackName( Actor actor, TouchData& touch );
+   * @endcode
+   * The return value of True, indicates that the touch event has been consumed.
+   * Otherwise the signal will be emitted on the next sensitive parent of the actor.
+   * @SINCE_1_1.37
+   * @return The signal to connect to.
+   * @pre The Actor has been initialized.
+   */
+  TouchDataSignalType& TouchSignal();
+
+  /**
    * @brief This signal is emitted when hover input is received.
    *
    * A callback of the following type may be connected:
@@ -1512,6 +1553,7 @@ public: // Signals
 public: // Not intended for application developers
 
   /**
+   * @internal
    * @brief This constructor is used by Actor::New() methods.
    *
    * @SINCE_1_0.0
@@ -1521,6 +1563,7 @@ public: // Not intended for application developers
 };
 
 /**
+ * @internal
  * @brief Helper for discarding an actor handle.
  *
  * If the handle is empty, this method does nothing.  Otherwise