OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_VIEWS_TABLE_VIEW_H_ | 5 #ifndef CHROME_VIEWS_TABLE_VIEW_H_ |
6 #define CHROME_VIEWS_TABLE_VIEW_H_ | 6 #define CHROME_VIEWS_TABLE_VIEW_H_ |
7 | 7 |
| 8 #include "build/build_config.h" |
| 9 |
| 10 #if defined(OS_WIN) |
8 #include <windows.h> | 11 #include <windows.h> |
| 12 #endif // defined(OS_WIN) |
9 | 13 |
10 #include <map> | 14 #include <map> |
11 #include <unicode/coll.h> | 15 #include <unicode/coll.h> |
12 #include <unicode/uchar.h> | 16 #include <unicode/uchar.h> |
13 #include <vector> | 17 #include <vector> |
14 | 18 |
15 #include "base/logging.h" | 19 #include "base/logging.h" |
16 #include "chrome/common/l10n_util.h" | 20 #include "chrome/common/l10n_util.h" |
| 21 #if defined(OS_WIN) |
| 22 // TODO(port): remove the ifdef when native_control.h is ported. |
17 #include "chrome/views/native_control.h" | 23 #include "chrome/views/native_control.h" |
| 24 #endif // defined(OS_WIN) |
18 #include "SkColor.h" | 25 #include "SkColor.h" |
19 | 26 |
20 class SkBitmap; | 27 class SkBitmap; |
21 | 28 |
22 // A TableView is a view that displays multiple rows with any number of columns. | 29 // A TableView is a view that displays multiple rows with any number of columns. |
23 // TableView is driven by a TableModel. The model returns the contents | 30 // TableView is driven by a TableModel. The model returns the contents |
24 // to display. TableModel also has an Observer which is used to notify | 31 // to display. TableModel also has an Observer which is used to notify |
25 // TableView of changes to the model so that the display may be updated | 32 // TableView of changes to the model so that the display may be updated |
26 // appropriately. | 33 // appropriately. |
27 // | 34 // |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 // Optional method invoked when the user double clicks on the table. | 284 // Optional method invoked when the user double clicks on the table. |
278 virtual void OnDoubleClick() {} | 285 virtual void OnDoubleClick() {} |
279 | 286 |
280 // Optional method invoked when the user hits a key with the table in focus. | 287 // Optional method invoked when the user hits a key with the table in focus. |
281 virtual void OnKeyDown(unsigned short virtual_keycode) {} | 288 virtual void OnKeyDown(unsigned short virtual_keycode) {} |
282 | 289 |
283 // Invoked when the user presses the delete key. | 290 // Invoked when the user presses the delete key. |
284 virtual void OnTableViewDelete(TableView* table_view) {} | 291 virtual void OnTableViewDelete(TableView* table_view) {} |
285 }; | 292 }; |
286 | 293 |
| 294 #if defined(OS_WIN) |
| 295 // TODO(port): Port TableView. |
287 class TableView : public NativeControl, | 296 class TableView : public NativeControl, |
288 public TableModelObserver { | 297 public TableModelObserver { |
289 public: | 298 public: |
290 typedef TableSelectionIterator iterator; | 299 typedef TableSelectionIterator iterator; |
291 | 300 |
292 // A helper struct for GetCellColors. Set |color_is_set| to true if color is | 301 // A helper struct for GetCellColors. Set |color_is_set| to true if color is |
293 // set. See OnCustomDraw for more details on why we need this. | 302 // set. See OnCustomDraw for more details on why we need this. |
294 struct ItemColor { | 303 struct ItemColor { |
295 bool color_is_set; | 304 bool color_is_set; |
296 SkColor color; | 305 SkColor color; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 | 663 |
655 // Current sort. | 664 // Current sort. |
656 SortDescriptors sort_descriptors_; | 665 SortDescriptors sort_descriptors_; |
657 | 666 |
658 // Mappings used when sorted. | 667 // Mappings used when sorted. |
659 scoped_array<int> view_to_model_; | 668 scoped_array<int> view_to_model_; |
660 scoped_array<int> model_to_view_; | 669 scoped_array<int> model_to_view_; |
661 | 670 |
662 DISALLOW_COPY_AND_ASSIGN(TableView); | 671 DISALLOW_COPY_AND_ASSIGN(TableView); |
663 }; | 672 }; |
| 673 #endif // defined(OS_WIN) |
664 | 674 |
665 } // namespace views | 675 } // namespace views |
666 | 676 |
667 #endif // CHROME_VIEWS_TABLE_VIEW_H_ | 677 #endif // CHROME_VIEWS_TABLE_VIEW_H_ |
OLD | NEW |