| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_BASE_MODELS_TREE_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_TREE_MODEL_H_ |
| 6 #define UI_BASE_MODELS_TREE_MODEL_H_ | 6 #define UI_BASE_MODELS_TREE_MODEL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "ui/ui_api.h" |
| 12 | 13 |
| 13 class SkBitmap; | 14 class SkBitmap; |
| 14 | 15 |
| 15 namespace ui { | 16 namespace ui { |
| 16 | 17 |
| 17 class TreeModel; | 18 class TreeModel; |
| 18 | 19 |
| 19 // TreeModelNode -------------------------------------------------------------- | 20 // TreeModelNode -------------------------------------------------------------- |
| 20 | 21 |
| 21 // Type of class returned from the model. | 22 // Type of class returned from the model. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 46 // Notification that the contents of a node has changed. | 47 // Notification that the contents of a node has changed. |
| 47 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; | 48 virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) = 0; |
| 48 | 49 |
| 49 protected: | 50 protected: |
| 50 virtual ~TreeModelObserver() {} | 51 virtual ~TreeModelObserver() {} |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 // TreeModel ------------------------------------------------------------------ | 54 // TreeModel ------------------------------------------------------------------ |
| 54 | 55 |
| 55 // The model for TreeView. | 56 // The model for TreeView. |
| 56 class TreeModel { | 57 class UI_API TreeModel { |
| 57 public: | 58 public: |
| 58 // Returns the root of the tree. This may or may not be shown in the tree, | 59 // Returns the root of the tree. This may or may not be shown in the tree, |
| 59 // see SetRootShown for details. | 60 // see SetRootShown for details. |
| 60 virtual TreeModelNode* GetRoot() = 0; | 61 virtual TreeModelNode* GetRoot() = 0; |
| 61 | 62 |
| 62 // Returns the number of children in |parent|. | 63 // Returns the number of children in |parent|. |
| 63 virtual int GetChildCount(TreeModelNode* parent) = 0; | 64 virtual int GetChildCount(TreeModelNode* parent) = 0; |
| 64 | 65 |
| 65 // Returns the child node of |parent| at |index|. | 66 // Returns the child node of |parent| at |index|. |
| 66 virtual TreeModelNode* GetChild(TreeModelNode* parent, int index) = 0; | 67 virtual TreeModelNode* GetChild(TreeModelNode* parent, int index) = 0; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 90 // GetIcons. | 91 // GetIcons. |
| 91 virtual int GetIconIndex(TreeModelNode* node); | 92 virtual int GetIconIndex(TreeModelNode* node); |
| 92 | 93 |
| 93 protected: | 94 protected: |
| 94 virtual ~TreeModel() {} | 95 virtual ~TreeModel() {} |
| 95 }; | 96 }; |
| 96 | 97 |
| 97 } // namespace ui | 98 } // namespace ui |
| 98 | 99 |
| 99 #endif // UI_BASE_MODELS_TREE_MODEL_H_ | 100 #endif // UI_BASE_MODELS_TREE_MODEL_H_ |
| OLD | NEW |