1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef UI_APP_LIST_APP_LIST_ITEM_LIST_OBSERVER_H_ 6 #define UI_APP_LIST_APP_LIST_ITEM_LIST_OBSERVER_H_ 7 8 #include "base/basictypes.h" 9 #include "ui/app_list/app_list_export.h" 10 11 namespace app_list { 12 13 class AppListItem; 14 15 class APP_LIST_EXPORT AppListItemListObserver { 16 public: 17 // Triggered after |item| has been added to the list at |index|. OnListItemAdded(size_t index,AppListItem * item)18 virtual void OnListItemAdded(size_t index, AppListItem* item) {} 19 20 // Triggered after an item has been removed from the list at |index|, just 21 // before the item is deleted. OnListItemRemoved(size_t index,AppListItem * item)22 virtual void OnListItemRemoved(size_t index, AppListItem* item) {} 23 24 // Triggered after |item| has been moved from |from_index| to |to_index|. 25 // Note: |from_index| may equal |to_index| if only the ordinal has changed. OnListItemMoved(size_t from_index,size_t to_index,AppListItem * item)26 virtual void OnListItemMoved(size_t from_index, 27 size_t to_index, 28 AppListItem* item) {} 29 30 protected: ~AppListItemListObserver()31 virtual ~AppListItemListObserver() {} 32 }; 33 34 } // namespace app_list 35 36 #endif // UI_APP_LIST_APP_LIST_ITEM_LIST_OBSERVER_H_ 37