Merge "Change WheelEvent" into tizen
[platform/core/uifw/dali-core.git] / dali / public-api / actors / actor.h
index 5c35143..1d6035b 100644 (file)
@@ -22,7 +22,6 @@
 #include <string>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor-enumerations.h>
 #include <dali/public-api/actors/draw-mode.h>
 #include <dali/public-api/math/radian.h>
@@ -45,18 +44,11 @@ class Layer;
 struct KeyEvent;
 struct TouchEvent;
 struct HoverEvent;
-struct MouseWheelEvent;
+struct WheelEvent;
 struct Vector2;
 struct Vector3;
 struct Vector4;
 
-/**
- * @brief Actor container.
- */
-typedef std::vector<Actor> ActorContainer;
-typedef ActorContainer::iterator ActorIter; ///< Iterator for Dali::ActorContainer
-typedef ActorContainer::const_iterator ActorConstIter; ///< Const iterator for Dali::ActorContainer
-
 typedef Rect<float> Padding;      ///< Padding definition
 
 /**
@@ -79,6 +71,10 @@ typedef Rect<float> Padding;      ///< Padding definition
  *
  * <i>Hit Test Algorithm:</i>
  *
+ * - Stage
+ *   - Gets the first down and the last up touch events to the screen, regardless of actor touch event consumption.
+ *   - Stage's root layer can be used to catch unconsumed touch events.
+ *
  * - RenderTasks
  *   - Hit testing is dependent on the camera used, which is specific to each RenderTask.
  *
@@ -227,7 +223,7 @@ typedef Rect<float> Padding;      ///< Padding definition
  * |-------------------|------------------------------|
  * | touched           | @ref TouchedSignal()         |
  * | hovered           | @ref HoveredSignal()         |
- * | mouse-wheel-event | @ref MouseWheelEventSignal() |
+ * | wheel-event       | @ref WheelEventSignal()      |
  * | on-stage          | @ref OnStageSignal()         |
  * | off-stage         | @ref OffStageSignal()        |
  *
@@ -292,7 +288,6 @@ public:
       POSITION_INHERITANCE,                               ///< name "position-inheritance",  type std::string
       DRAW_MODE,                                          ///< name "draw-mode",             type std::string
       SIZE_MODE_FACTOR,                                   ///< name "size-mode-factor",      type Vector3
-      RELAYOUT_ENABLED,                                   ///< name "relayout-enabled",      type Boolean
       WIDTH_RESIZE_POLICY,                                ///< name "width-resize-policy",   type String
       HEIGHT_RESIZE_POLICY,                               ///< name "height-resize-policy",  type String
       SIZE_SCALE_POLICY,                                  ///< name "size-scale-policy",     type String
@@ -308,7 +303,7 @@ public:
 
   typedef Signal< bool (Actor, const TouchEvent&)> TouchSignalType;                 ///< Touch signal type
   typedef Signal< bool (Actor, const HoverEvent&)> HoverSignalType;                 ///< Hover signal type
-  typedef Signal< bool (Actor, const MouseWheelEvent&) > MouseWheelEventSignalType; ///< Mousewheel signal type
+  typedef Signal< bool (Actor, const WheelEvent&) > WheelEventSignalType;           ///< Wheel signal type
   typedef Signal< void (Actor) > OnStageSignalType;  ///< Stage connection signal type
   typedef Signal< void (Actor) > OffStageSignalType; ///< Stage disconnection signal type
   typedef Signal< void (Actor) > OnRelayoutSignalType; ///< Called when the actor is relaid out
@@ -434,7 +429,6 @@ public:
    * @param [in] child The child.
    * @post The child will be referenced by its parent. This means that the child will be kept alive,
    * even if the handle passed into this method is reset or destroyed.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Add(Actor child);
 
@@ -453,7 +447,6 @@ public:
    * @post The child will be referenced by its parent. This means that the child will be kept alive,
    * even if the handle passed into this method is reset or destroyed.
    * @post If the index is greater than the current child count, it will be ignored and added at the end.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Insert(unsigned int index, Actor child);
 
@@ -464,7 +457,6 @@ public:
    * @pre This Actor (the parent) has been initialized.
    * @pre The child actor is not the same as the parent actor.
    * @param [in] child The child.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Remove(Actor child);
 
@@ -473,7 +465,6 @@ public:
    *
    * If the actor has no parent, this method does nothing.
    * @pre The (child) actor has been initialized.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Unparent();
 
@@ -1147,20 +1138,6 @@ public:
   // SIZE NEGOTIATION
 
   /**
-   * @brief Set if the actor should do relayout in size negotiation or not.
-   *
-   * @param[in] enabled Flag to specify if actor should do relayout or not.
-   */
-  void SetRelayoutEnabled( bool enabled );
-
-  /**
-   * @brief Is the actor included in relayout or not.
-   *
-   * @return Return if the actor is involved in size negotiation or not.
-   */
-  bool IsRelayoutEnabled() const;
-
-  /**
    * Set the resize policy to be used for the given dimension(s)
    *
    * @param[in] policy The resize policy to use
@@ -1214,6 +1191,9 @@ public:
   /**
    * @brief Calculate the height of the actor given a width
    *
+   * The natural size is used for default calculation.
+   * size 0 is treated as aspect ratio 1:1.
+   *
    * @param width Width to use
    * @return Return the height based on the width
    */
@@ -1222,6 +1202,9 @@ public:
   /**
    * @brief Calculate the width of the actor given a height
    *
+   * The natural size is used for default calculation.
+   * size 0 is treated as aspect ratio 1:1.
+   *
    * @param height Height to use
    * @return Return the width based on the height
    */
@@ -1236,23 +1219,6 @@ public:
   float GetRelayoutSize( Dimension::Type dimension ) const;
 
   /**
-   * @brief Request to relayout of all actors in the sub-tree below the given actor.
-   *
-   * This flags the actor and all actors below it for relayout. The actual
-   * relayout is performed at the end of the frame. This means that multiple calls to relayout
-   * will not cause multiple relayouts to occur.
-   */
-  void RelayoutRequestTree();
-
-  /**
-   * @brief Force propagate relayout flags through the tree. This actor and all actors
-   * dependent on it will have their relayout flags reset.
-   *
-   * This is useful for resetting layout flags during the layout process.
-   */
-  void PropagateRelayoutFlags();
-
-  /**
    * @brief Set the padding for use in layout
    *
    * @param[in] padding Padding for the actor
@@ -1325,18 +1291,18 @@ public: // Signals
   HoverSignalType& HoveredSignal();
 
   /**
-   * @brief This signal is emitted when mouse wheel event is received.
+   * @brief This signal is emitted when wheel event is received.
    *
    * A callback of the following type may be connected:
    * @code
-   *   bool YourCallbackName(Actor actor, const MouseWheelEvent& event);
+   *   bool YourCallbackName(Actor actor, const WheelEvent& event);
    * @endcode
-   * The return value of True, indicates that the mouse wheel event should be consumed.
+   * The return value of True, indicates that the wheel event should be consumed.
    * Otherwise the signal will be emitted on the next sensitive parent of the actor.
    * @pre The Actor has been initialized.
    * @return The signal to connect to.
    */
-  MouseWheelEventSignalType& MouseWheelEventSignal();
+  WheelEventSignalType& WheelEventSignal();
 
   /**
    * @brief This signal is emitted after the actor has been connected to the stage.