New API to get the range of items in the current ItemView cache 77/24177/1
authorRichard Huang <r.huang@samsung.com>
Wed, 18 Jun 2014 12:23:25 +0000 (13:23 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 8 Jul 2014 17:47:17 +0000 (18:47 +0100)
Change-Id: I559963ec022f6bd2d4c607da6c2a0ce19190aacf
Signed-off-by: Adeel Kazmi <adeel.kazmi@samsung.com>
base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
base/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
base/dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp
capi/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h

index be23888..73a25ff 100644 (file)
@@ -1796,6 +1796,12 @@ Vector3 ItemView::GetItemsAnchorPoint() const
   return mItemsAnchorPoint;
 }
 
+void ItemView::GetItemsRange(ItemRange& range)
+{
+  range.begin = mItemPool.begin()->first;
+  range.end = mItemPool.rbegin()->first + 1;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 40a5955..bd143eb 100644 (file)
@@ -284,6 +284,11 @@ public:
    */
   Vector3 GetItemsAnchorPoint() const;
 
+  /**
+   * @copydoc Toolkit::ItemView::GetItemsRange
+   */
+  void GetItemsRange(ItemRange& range);
+
 private:
 
   /**
index b638186..0271e1a 100644 (file)
@@ -249,6 +249,11 @@ Vector3 ItemView::GetItemsAnchorPoint() const
   return GetImpl(*this).GetItemsAnchorPoint();
 }
 
+void ItemView::GetItemsRange(ItemRange& range)
+{
+  GetImpl(*this).GetItemsRange(range);
+}
+
 } // namespace Toolkit
 
 } // namespace Dali
index 82c9c83..61c7265 100644 (file)
@@ -44,6 +44,7 @@ class ItemView;
 class ScrollConnector;
 class ItemFactory;
 class ItemLayout;
+struct ItemRange;
 
 typedef IntrusivePtr<ItemLayout> ItemLayoutPtr;
 
@@ -412,6 +413,13 @@ public:
    */
   Vector3 GetItemsAnchorPoint() const;
 
+  /**
+   * @brief Get the range of items that are currently in ItemView.
+   *
+   * @param[out] range The range of items.
+   */
+  void GetItemsRange(ItemRange& range);
+
 public: // Not intended for application developers
 
   /**