Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ui / app_list / app_list_folder_item.h
index 18c890b..8cc2e65 100644 (file)
@@ -25,6 +25,8 @@ class APP_LIST_EXPORT AppListFolderItem : public AppListItem,
                                           public AppListItemListObserver,
                                           public AppListItemObserver {
  public:
+  static const char kItemType[];
+
   explicit AppListFolderItem(const std::string& id);
   virtual ~AppListFolderItem();
 
@@ -34,21 +36,35 @@ class APP_LIST_EXPORT AppListFolderItem : public AppListItem,
   // Returns the icon of one of the top items with |item_index|.
   const gfx::ImageSkia& GetTopIcon(size_t item_index);
 
+  // Returns the target icon bounds for |item| to fly back to its parent folder
+  // icon in animation UI. If |item| is one of the top item icon, this will
+  // match its corresponding top item icon in the folder icon. Otherwise,
+  // the target icon bounds is centered at the |folder_icon_bounds| with
+  // the same size of the top item icon.
+  // The Rect returned is in the same coordinates of |folder_icon_bounds|.
+  gfx::Rect GetTargetIconRectInFolderForItem(
+      AppListItem* item, const gfx::Rect& folder_icon_bounds);
+
   AppListItemList* item_list() { return item_list_.get(); }
+  const AppListItemList* item_list() const { return item_list_.get(); }
 
-  static const char kItemType[];
+  // AppListItem
+  virtual void Activate(int event_flags) OVERRIDE;
+  virtual const char* GetItemType() const OVERRIDE;
+  virtual ui::MenuModel* GetContextMenuModel() OVERRIDE;
+  virtual AppListItem* FindChildItem(const std::string& id) OVERRIDE;
+  virtual size_t ChildItemCount() const OVERRIDE;
+  virtual bool CompareForTest(const AppListItem* other) const OVERRIDE;
 
   // Calculates the top item icons' bounds inside |folder_icon_bounds|.
   // Returns the bounds of top item icons in sequence of top left, top right,
   // bottom left, bottom right.
   static Rects GetTopIconsBounds(const gfx::Rect& folder_icon_bounds);
 
- private:
-  // AppListItem
-  virtual void Activate(int event_flags) OVERRIDE;
-  virtual const char* GetItemType() const OVERRIDE;
-  virtual ui::MenuModel* GetContextMenuModel() OVERRIDE;
+  // Returns an id for a new folder.
+  static std::string GenerateId();
 
+ private:
   // AppListItemObserver
   virtual void ItemIconChanged() OVERRIDE;
   virtual void ItemTitleChanged() OVERRIDE;