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) |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 class TableViewObserver { | 277 class TableViewObserver { |
278 public: | 278 public: |
279 virtual ~TableViewObserver() {} | 279 virtual ~TableViewObserver() {} |
280 | 280 |
281 // Invoked when the selection changes. | 281 // Invoked when the selection changes. |
282 virtual void OnSelectionChanged() = 0; | 282 virtual void OnSelectionChanged() = 0; |
283 | 283 |
284 // Optional method invoked when the user double clicks on the table. | 284 // Optional method invoked when the user double clicks on the table. |
285 virtual void OnDoubleClick() {} | 285 virtual void OnDoubleClick() {} |
286 | 286 |
| 287 // Optional method invoked when the user middle clicks on the table. |
| 288 virtual void OnMiddleClick() {} |
| 289 |
287 // Optional method invoked when the user hits a key with the table in focus. | 290 // Optional method invoked when the user hits a key with the table in focus. |
288 virtual void OnKeyDown(unsigned short virtual_keycode) {} | 291 virtual void OnKeyDown(unsigned short virtual_keycode) {} |
289 | 292 |
290 // Invoked when the user presses the delete key. | 293 // Invoked when the user presses the delete key. |
291 virtual void OnTableViewDelete(TableView* table_view) {} | 294 virtual void OnTableViewDelete(TableView* table_view) {} |
292 }; | 295 }; |
293 | 296 |
294 #if defined(OS_WIN) | 297 #if defined(OS_WIN) |
295 // TODO(port): Port TableView. | 298 // TODO(port): Port TableView. |
296 class TableView : public NativeControl, | 299 class TableView : public NativeControl, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // GetCellColors is never invoked. | 448 // GetCellColors is never invoked. |
446 void SetCustomColorsEnabled(bool custom_colors_enabled); | 449 void SetCustomColorsEnabled(bool custom_colors_enabled); |
447 | 450 |
448 // Notification from the ListView that the selected state of an item has | 451 // Notification from the ListView that the selected state of an item has |
449 // changed. | 452 // changed. |
450 virtual void OnSelectedStateChanged(); | 453 virtual void OnSelectedStateChanged(); |
451 | 454 |
452 // Notification from the ListView that the used double clicked the table. | 455 // Notification from the ListView that the used double clicked the table. |
453 virtual void OnDoubleClick(); | 456 virtual void OnDoubleClick(); |
454 | 457 |
| 458 // Notification from the ListView that the user middle clicked the table. |
| 459 virtual void OnMiddleClick(); |
| 460 |
455 // Subclasses can implement this method if they need to be notified of a key | 461 // Subclasses can implement this method if they need to be notified of a key |
456 // press event. Other wise, it appeals to table_view_observer_ | 462 // press event. Other wise, it appeals to table_view_observer_ |
457 virtual void OnKeyDown(unsigned short virtual_keycode); | 463 virtual void OnKeyDown(unsigned short virtual_keycode); |
458 | 464 |
459 // Invoked to customize the colors or font at a particular cell. If you | 465 // Invoked to customize the colors or font at a particular cell. If you |
460 // change the colors or font, return true. This is only invoked if | 466 // change the colors or font, return true. This is only invoked if |
461 // SetCustomColorsEnabled(true) has been invoked. | 467 // SetCustomColorsEnabled(true) has been invoked. |
462 virtual bool GetCellColors(int model_row, | 468 virtual bool GetCellColors(int model_row, |
463 int column, | 469 int column, |
464 ItemColor* foreground, | 470 ItemColor* foreground, |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 scoped_array<int> view_to_model_; | 674 scoped_array<int> view_to_model_; |
669 scoped_array<int> model_to_view_; | 675 scoped_array<int> model_to_view_; |
670 | 676 |
671 DISALLOW_COPY_AND_ASSIGN(TableView); | 677 DISALLOW_COPY_AND_ASSIGN(TableView); |
672 }; | 678 }; |
673 #endif // defined(OS_WIN) | 679 #endif // defined(OS_WIN) |
674 | 680 |
675 } // namespace views | 681 } // namespace views |
676 | 682 |
677 #endif // VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ | 683 #endif // VIEWS_CONTROLS_TABLE_TABLE_VIEW_H_ |
OLD | NEW |