Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: ui/base/models/tree_model.h

Issue 10437006: Converts ui/views/controls, ui/views/examples, ui/base/models to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/base/ui_export.h" 12 #include "ui/base/ui_export.h"
13 13
14 class SkBitmap; 14 namespace gfx {
15 class ImageSkia;
16 }
15 17
16 namespace ui { 18 namespace ui {
17 19
18 class TreeModel; 20 class TreeModel;
19 21
20 // TreeModelNode -------------------------------------------------------------- 22 // TreeModelNode --------------------------------------------------------------
21 23
22 // Type of class returned from the model. 24 // Type of class returned from the model.
23 class TreeModelNode { 25 class TreeModelNode {
24 public: 26 public:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 79
78 // Removes an observer of the model. 80 // Removes an observer of the model.
79 virtual void RemoveObserver(TreeModelObserver* observer) = 0; 81 virtual void RemoveObserver(TreeModelObserver* observer) = 0;
80 82
81 // Sets the title of |node|. 83 // Sets the title of |node|.
82 // This is only invoked if the node is editable and the user edits a node. 84 // This is only invoked if the node is editable and the user edits a node.
83 virtual void SetTitle(TreeModelNode* node, const string16& title); 85 virtual void SetTitle(TreeModelNode* node, const string16& title);
84 86
85 // Returns the set of icons for the nodes in the tree. You only need override 87 // Returns the set of icons for the nodes in the tree. You only need override
86 // this if you don't want to use the default folder icons. 88 // this if you don't want to use the default folder icons.
87 virtual void GetIcons(std::vector<SkBitmap>* icons) {} 89 virtual void GetIcons(std::vector<gfx::ImageSkia>* icons) {}
88 90
89 // Returns the index of the icon to use for |node|. Return -1 to use the 91 // Returns the index of the icon to use for |node|. Return -1 to use the
90 // default icon. The index is relative to the list of icons returned from 92 // default icon. The index is relative to the list of icons returned from
91 // GetIcons. 93 // GetIcons.
92 virtual int GetIconIndex(TreeModelNode* node); 94 virtual int GetIconIndex(TreeModelNode* node);
93 95
94 protected: 96 protected:
95 virtual ~TreeModel() {} 97 virtual ~TreeModel() {}
96 }; 98 };
97 99
98 } // namespace ui 100 } // namespace ui
99 101
100 #endif // UI_BASE_MODELS_TREE_MODEL_H_ 102 #endif // UI_BASE_MODELS_TREE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698