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