Refactored Item Layouts
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / item-view / depth-layout.h
@@ -27,6 +27,9 @@ namespace Dali
 namespace Toolkit
 {
 
+namespace Internal
+{
+
 class DepthLayout;
 
 typedef IntrusivePtr<DepthLayout> DepthLayoutPtr;
@@ -34,19 +37,10 @@ typedef IntrusivePtr<DepthLayout> DepthLayoutPtr;
 /**
  * This layout arranges items in a grid, which scrolls along the Z-Axis.
  */
-class DALI_IMPORT_API DepthLayout : public ItemLayout
+class DepthLayout : public ItemLayout
 {
 public:
 
-  typedef boost::function<Vector3 (unsigned int numberOfColumns, float layoutWidth)> ItemSizeFunction;
-
-  typedef boost::function<float (float layoutHeight)> BottomMarginFunction;
-
-  typedef boost::function<float (unsigned int numberOfColumns,
-                                 unsigned int columnNumber,
-                                 const Vector3& itemSize,
-                                 float layoutWidth)> ColumnPositionFunction;
-
   /**
    * Create a new spiral layout
    */
@@ -107,30 +101,6 @@ public:
   Degree GetTiltAngle() const;
 
   /**
-   * Set the function used to calculate the item-size, for a given layout-size.
-   * @param[in] function The item-size function.
-   */
-  void SetItemSizeFunction(ItemSizeFunction function);
-
-  /**
-   * Get the function used to calculate the item-size.
-   * @return The item-size function.
-   */
-  ItemSizeFunction GetItemSizeFunction() const;
-
-  /**
-   * Set the function used to calculate the margin in the bottom of the layout, for a given layout-size.
-   * @param[in] function The bottom margin function.
-   */
-  void SetBottomMarginFunction(BottomMarginFunction function);
-
-  /**
-   * Get the function used to calculate the margin in the bottom of the layout.
-   * @return The bottom margin function.
-   */
-  BottomMarginFunction GetBottomMarginFunction() const;
-
-  /**
    * Set the tilt angle of the individual items in the layout.
    * @param[in] angle The item tilt angle in degrees.
    */
@@ -143,18 +113,6 @@ public:
   Degree GetItemTiltAngle() const;
 
   /**
-   * Set the function used to calculate the horizontal position of each column, for a given column, item-size & layout-size.
-   * @param[in] function The column-position function.
-   */
-  void SetColumnPositionFunction(ColumnPositionFunction function);
-
-  /**
-   * Get the function used to calculate the horizontal position of each column
-   * @return The column-position function.
-   */
-  ColumnPositionFunction GetColumnPositionFunction() const;
-
-  /**
    * Set the factor used to customise the scroll speed while dragging and swiping the layout.
    * @param[in] scrollSpeed The scroll speed factor.
    */
@@ -228,9 +186,9 @@ private:
   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
 
   /**
-   * @copydoc ItemLayout::GetItemSize()
+   * @copydoc ItemLayout::GetDefaultItemSize()
    */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
 
   /**
    * @copydoc ItemLayout::GetResizeAnimation()
@@ -238,34 +196,19 @@ private:
   virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
 
   /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
+   * @copydoc ItemLayout::GetScrollDirection()
    */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
+  virtual Degree GetScrollDirection() const;
 
   /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
+   * @copydoc ItemLayout::ApplyConstraints()
    */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
+  virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
 
   /**
-   * @copydoc ItemLayout::GetScrollDirection()
+   * @copydoc ItemLayout::GetItemPosition()
    */
-  virtual Degree GetScrollDirection() const;
+  virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
 
 protected:
 
@@ -280,6 +223,8 @@ private:
   Impl* mImpl;
 };
 
+} // namespace Internal
+
 } // namespace Toolkit
 
 } // namespace Dali