OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TABLE_MODEL_H_ | 5 #ifndef UI_BASE_MODELS_TABLE_MODEL_H_ |
6 #define UI_BASE_MODELS_TABLE_MODEL_H_ | 6 #define UI_BASE_MODELS_TABLE_MODEL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "third_party/icu/source/i18n/unicode/coll.h" | 11 #include "third_party/icu/source/i18n/unicode/coll.h" |
12 #include "ui/base/ui_export.h" | 12 #include "ui/base/ui_base_export.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class ImageSkia; | 15 class ImageSkia; |
16 } | 16 } |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 class TableModelObserver; | 20 class TableModelObserver; |
21 | 21 |
22 // The model driving the TableView. | 22 // The model driving the TableView. |
23 class UI_EXPORT TableModel { | 23 class UI_BASE_EXPORT TableModel { |
24 public: | 24 public: |
25 // See HasGroups, get GetGroupID for details as to how this is used. | 25 // See HasGroups, get GetGroupID for details as to how this is used. |
26 struct Group { | 26 struct Group { |
27 // The title text for the group. | 27 // The title text for the group. |
28 base::string16 title; | 28 base::string16 title; |
29 | 29 |
30 // Unique id for the group. | 30 // Unique id for the group. |
31 int id; | 31 int id; |
32 }; | 32 }; |
33 typedef std::vector<Group> Groups; | 33 typedef std::vector<Group> Groups; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void ClearCollator(); | 84 void ClearCollator(); |
85 | 85 |
86 protected: | 86 protected: |
87 virtual ~TableModel() {} | 87 virtual ~TableModel() {} |
88 | 88 |
89 // Returns the collator used by CompareValues. | 89 // Returns the collator used by CompareValues. |
90 icu::Collator* GetCollator(); | 90 icu::Collator* GetCollator(); |
91 }; | 91 }; |
92 | 92 |
93 // TableColumn specifies the title, alignment and size of a particular column. | 93 // TableColumn specifies the title, alignment and size of a particular column. |
94 struct UI_EXPORT TableColumn { | 94 struct UI_BASE_EXPORT TableColumn { |
95 enum Alignment { | 95 enum Alignment { |
96 LEFT, RIGHT, CENTER | 96 LEFT, RIGHT, CENTER |
97 }; | 97 }; |
98 | 98 |
99 TableColumn(); | 99 TableColumn(); |
100 TableColumn(int id, Alignment alignment, int width, float percent); | 100 TableColumn(int id, Alignment alignment, int width, float percent); |
101 | 101 |
102 // A unique identifier for the column. | 102 // A unique identifier for the column. |
103 int id; | 103 int id; |
104 | 104 |
(...skipping 24 matching lines...) Expand all Loading... |
129 // to be visible. | 129 // to be visible. |
130 int min_visible_width; | 130 int min_visible_width; |
131 | 131 |
132 // Is this column sortable? Default is false | 132 // Is this column sortable? Default is false |
133 bool sortable; | 133 bool sortable; |
134 }; | 134 }; |
135 | 135 |
136 } // namespace ui | 136 } // namespace ui |
137 | 137 |
138 #endif // UI_BASE_MODELS_TABLE_MODEL_H_ | 138 #endif // UI_BASE_MODELS_TABLE_MODEL_H_ |
OLD | NEW |