| 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 VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ | 5 #ifndef VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ |
| 6 #define VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ | 6 #define VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include <windows.h> | 11 #include <windows.h> |
| 12 typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW; | 12 typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW; |
| 13 #endif // defined(OS_WIN) | 13 #endif // defined(OS_WIN) |
| 14 | 14 |
| 15 #include <map> | 15 #include <map> |
| 16 #include <vector> | 16 #include <vector> |
| 17 | 17 |
| 18 #include "app/table_model_observer.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| 20 // TODO(port): remove the ifdef when native_control.h is ported. | 21 // TODO(port): remove the ifdef when native_control.h is ported. |
| 21 #include "views/controls/native_control.h" | 22 #include "views/controls/native_control.h" |
| 22 #endif // defined(OS_WIN) | 23 #endif // defined(OS_WIN) |
| 23 #include "views/controls/table/table_model_observer.h" | |
| 24 | 24 |
| 25 struct TableColumn; |
| 26 class TableModel; |
| 25 class SkBitmap; | 27 class SkBitmap; |
| 26 | 28 |
| 27 // 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. |
| 28 // TableView is driven by a TableModel. The model returns the contents | 30 // TableView is driven by a TableModel. The model returns the contents |
| 29 // 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 |
| 30 // 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 |
| 31 // appropriately. | 33 // appropriately. |
| 32 // | 34 // |
| 33 // TableView itself has an observer that is notified when the selection | 35 // TableView itself has an observer that is notified when the selection |
| 34 // changes. | 36 // changes. |
| 35 // | 37 // |
| 36 // Tables may be sorted either by directly invoking SetSortDescriptors or by | 38 // Tables may be sorted either by directly invoking SetSortDescriptors or by |
| 37 // marking the column as sortable and the user doing a gesture to sort the | 39 // marking the column as sortable and the user doing a gesture to sort the |
| 38 // contents. TableView itself maintains the sort so that the underlying model | 40 // contents. TableView itself maintains the sort so that the underlying model |
| 39 // isn't effected. | 41 // isn't effected. |
| 40 // | 42 // |
| 41 // When a table is sorted the model coordinates do not necessarily match the | 43 // When a table is sorted the model coordinates do not necessarily match the |
| 42 // view coordinates. All table methods are in terms of the model. If you need to | 44 // view coordinates. All table methods are in terms of the model. If you need to |
| 43 // convert to view coordinates use model_to_view. | 45 // convert to view coordinates use model_to_view. |
| 44 // | 46 // |
| 45 // Sorting is done by a locale sensitive string sort. You can customize the | 47 // Sorting is done by a locale sensitive string sort. You can customize the |
| 46 // sort by way of overriding CompareValues. | 48 // sort by way of overriding CompareValues. |
| 47 // | 49 // |
| 48 // TableView is a wrapper around the window type ListView in report mode. | 50 // TableView is a wrapper around the window type ListView in report mode. |
| 49 namespace views { | 51 namespace views { |
| 50 | 52 |
| 51 class ListView; | 53 class ListView; |
| 52 class ListViewParent; | 54 class ListViewParent; |
| 53 class TableView; | 55 class TableView; |
| 54 struct TableColumn; | |
| 55 class TableModel; | |
| 56 class TableViewObserver; | 56 class TableViewObserver; |
| 57 | 57 |
| 58 // The cells in the first column of a table can contain: | 58 // The cells in the first column of a table can contain: |
| 59 // - only text | 59 // - only text |
| 60 // - a small icon (16x16) and some text | 60 // - a small icon (16x16) and some text |
| 61 // - a check box and some text | 61 // - a check box and some text |
| 62 enum TableTypes { | 62 enum TableTypes { |
| 63 TEXT_ONLY = 0, | 63 TEXT_ONLY = 0, |
| 64 ICON_AND_TEXT, | 64 ICON_AND_TEXT, |
| 65 CHECK_BOX_AND_TEXT | 65 CHECK_BOX_AND_TEXT |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 scoped_array<int> view_to_model_; | 466 scoped_array<int> view_to_model_; |
| 467 scoped_array<int> model_to_view_; | 467 scoped_array<int> model_to_view_; |
| 468 | 468 |
| 469 DISALLOW_COPY_AND_ASSIGN(TableView); | 469 DISALLOW_COPY_AND_ASSIGN(TableView); |
| 470 }; | 470 }; |
| 471 #endif // defined(OS_WIN) | 471 #endif // defined(OS_WIN) |
| 472 | 472 |
| 473 } // namespace views | 473 } // namespace views |
| 474 | 474 |
| 475 #endif // VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ | 475 #endif // VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ |
| OLD | NEW |