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