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_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 #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 #include "unicode/coll.h" | 13 #include "unicode/coll.h" |
13 | 14 |
14 class SkBitmap; | 15 class SkBitmap; |
15 | 16 |
16 namespace ui { | 17 namespace ui { |
17 | 18 |
18 class TableModelObserver; | 19 class TableModelObserver; |
19 | 20 |
20 // The model driving the TableView. | 21 // The model driving the TableView. |
21 class TableModel { | 22 class UI_API TableModel { |
22 public: | 23 public: |
23 // See HasGroups, get GetGroupID for details as to how this is used. | 24 // See HasGroups, get GetGroupID for details as to how this is used. |
24 struct Group { | 25 struct Group { |
25 // The title text for the group. | 26 // The title text for the group. |
26 string16 title; | 27 string16 title; |
27 | 28 |
28 // Unique id for the group. | 29 // Unique id for the group. |
29 int id; | 30 int id; |
30 }; | 31 }; |
31 typedef std::vector<Group> Groups; | 32 typedef std::vector<Group> Groups; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 void ClearCollator(); | 83 void ClearCollator(); |
83 | 84 |
84 protected: | 85 protected: |
85 virtual ~TableModel() {} | 86 virtual ~TableModel() {} |
86 | 87 |
87 // Returns the collator used by CompareValues. | 88 // Returns the collator used by CompareValues. |
88 icu::Collator* GetCollator(); | 89 icu::Collator* GetCollator(); |
89 }; | 90 }; |
90 | 91 |
91 // TableColumn specifies the title, alignment and size of a particular column. | 92 // TableColumn specifies the title, alignment and size of a particular column. |
92 struct TableColumn { | 93 struct UI_API TableColumn { |
93 enum Alignment { | 94 enum Alignment { |
94 LEFT, RIGHT, CENTER | 95 LEFT, RIGHT, CENTER |
95 }; | 96 }; |
96 | 97 |
97 TableColumn(); | 98 TableColumn(); |
98 TableColumn(int id, const string16& title, | 99 TableColumn(int id, const string16& title, |
99 Alignment alignment, int width); | 100 Alignment alignment, int width); |
100 TableColumn(int id, const string16& title, | 101 TableColumn(int id, const string16& title, |
101 Alignment alignment, int width, float percent); | 102 Alignment alignment, int width, float percent); |
102 | 103 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // to be visible. | 137 // to be visible. |
137 int min_visible_width; | 138 int min_visible_width; |
138 | 139 |
139 // Is this column sortable? Default is false | 140 // Is this column sortable? Default is false |
140 bool sortable; | 141 bool sortable; |
141 }; | 142 }; |
142 | 143 |
143 } // namespace ui | 144 } // namespace ui |
144 | 145 |
145 #endif // UI_BASE_MODELS_TABLE_MODEL_H_ | 146 #endif // UI_BASE_MODELS_TABLE_MODEL_H_ |
OLD | NEW |