OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_VIEWS_TREE_MODEL_H_ | 5 #ifndef CHROME_VIEWS_TREE_MODEL_H_ |
6 #define CHROME_VIEWS_TREE_MODEL_H_ | 6 #define CHROME_VIEWS_TREE_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 TreeModelNode* parent, | 32 TreeModelNode* parent, |
33 int start, | 33 int start, |
34 int count) = 0; | 34 int count) = 0; |
35 | 35 |
36 // Notification that nodes were removed from the specified parent. | 36 // Notification that nodes were removed from the specified parent. |
37 virtual void TreeNodesRemoved(TreeModel* model, | 37 virtual void TreeNodesRemoved(TreeModel* model, |
38 TreeModelNode* parent, | 38 TreeModelNode* parent, |
39 int start, | 39 int start, |
40 int count) = 0; | 40 int count) = 0; |
41 | 41 |
| 42 // Notification the children of |parent| have been reordered. Note, only |
| 43 // the direct children of |parent| have been reordered, not descendants. |
| 44 // TODO(sky): make this pure virtual after all sites have been updated. |
| 45 virtual void TreeNodeChildrenReordered(TreeModel* model, |
| 46 TreeModelNode* parent) {} |
| 47 |
42 // Notification that the contents of a node has changed. | 48 // Notification that the contents of a node has changed. |
43 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; | 49 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; |
44 }; | 50 }; |
45 | 51 |
46 // TreeModel ------------------------------------------------------------------ | 52 // TreeModel ------------------------------------------------------------------ |
47 | 53 |
48 // The model for TreeView. | 54 // The model for TreeView. |
49 class TreeModel { | 55 class TreeModel { |
50 public: | 56 public: |
51 // Returns the root of the tree. This may or may not be shown in the tree, | 57 // Returns the root of the tree. This may or may not be shown in the tree, |
(...skipping 25 matching lines...) Expand all Loading... |
77 | 83 |
78 // Returns the index of the icon to use for |node|. Return -1 to use the | 84 // Returns the index of the icon to use for |node|. Return -1 to use the |
79 // default icon. The index is relative to the list of icons returned from | 85 // default icon. The index is relative to the list of icons returned from |
80 // GetIcons. | 86 // GetIcons. |
81 virtual int GetIconIndex(TreeModelNode* node) { return -1; } | 87 virtual int GetIconIndex(TreeModelNode* node) { return -1; } |
82 }; | 88 }; |
83 | 89 |
84 } // namespace views | 90 } // namespace views |
85 | 91 |
86 #endif // CHROME_VIEWS_TREE_MODEL_H_ | 92 #endif // CHROME_VIEWS_TREE_MODEL_H_ |
OLD | NEW |