| 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_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | 5 #ifndef UI_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ |
| 6 #define UI_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | 6 #define UI_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
| 14 #include "ui/base/models/table_model.h" | 14 #include "ui/base/models/table_model.h" |
| 15 #include "ui/views/controls/button/button.h" | 15 #include "ui/views/controls/button/button.h" |
| 16 #include "ui/views/controls/table/table_view.h" | 16 #include "ui/views/controls/table/table_view.h" |
| 17 #include "ui/views/controls/table/table_view_observer.h" | 17 #include "ui/views/controls/table/table_view_observer.h" |
| 18 #include "ui/views/examples/example_base.h" | 18 #include "ui/views/examples/example_base.h" |
| 19 | 19 |
| 20 namespace gfx { |
| 21 class ImageSkia; |
| 22 } |
| 23 |
| 20 namespace views { | 24 namespace views { |
| 21 class Checkbox; | 25 class Checkbox; |
| 22 class Event; | 26 class Event; |
| 23 class TableView; | 27 class TableView; |
| 24 | 28 |
| 25 namespace examples { | 29 namespace examples { |
| 26 | 30 |
| 27 class TableExample : public ExampleBase, | 31 class TableExample : public ExampleBase, |
| 28 public ui::TableModel, | 32 public ui::TableModel, |
| 29 public TableViewObserver, | 33 public TableViewObserver, |
| 30 public ButtonListener { | 34 public ButtonListener { |
| 31 public: | 35 public: |
| 32 TableExample(); | 36 TableExample(); |
| 33 virtual ~TableExample(); | 37 virtual ~TableExample(); |
| 34 | 38 |
| 35 // ExampleBase: | 39 // ExampleBase: |
| 36 virtual void CreateExampleView(View* container) OVERRIDE; | 40 virtual void CreateExampleView(View* container) OVERRIDE; |
| 37 | 41 |
| 38 // ui::TableModel: | 42 // ui::TableModel: |
| 39 virtual int RowCount() OVERRIDE; | 43 virtual int RowCount() OVERRIDE; |
| 40 virtual string16 GetText(int row, int column_id) OVERRIDE; | 44 virtual string16 GetText(int row, int column_id) OVERRIDE; |
| 41 virtual SkBitmap GetIcon(int row) OVERRIDE; | 45 virtual gfx::ImageSkia GetIcon(int row) OVERRIDE; |
| 42 virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; | 46 virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; |
| 43 | 47 |
| 44 // TableViewObserver: | 48 // TableViewObserver: |
| 45 virtual void OnSelectionChanged() OVERRIDE; | 49 virtual void OnSelectionChanged() OVERRIDE; |
| 46 virtual void OnDoubleClick() OVERRIDE; | 50 virtual void OnDoubleClick() OVERRIDE; |
| 47 virtual void OnMiddleClick() OVERRIDE; | 51 virtual void OnMiddleClick() OVERRIDE; |
| 48 virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) OVERRIDE; | 52 virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) OVERRIDE; |
| 49 virtual void OnTableViewDelete(TableView* table_view) OVERRIDE; | 53 virtual void OnTableViewDelete(TableView* table_view) OVERRIDE; |
| 50 virtual void OnTableView2Delete(TableView2* table_view) OVERRIDE; | 54 virtual void OnTableView2Delete(TableView2* table_view) OVERRIDE; |
| 51 | 55 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 64 SkBitmap icon1_; | 68 SkBitmap icon1_; |
| 65 SkBitmap icon2_; | 69 SkBitmap icon2_; |
| 66 | 70 |
| 67 DISALLOW_COPY_AND_ASSIGN(TableExample); | 71 DISALLOW_COPY_AND_ASSIGN(TableExample); |
| 68 }; | 72 }; |
| 69 | 73 |
| 70 } // namespace examples | 74 } // namespace examples |
| 71 } // namespace views | 75 } // namespace views |
| 72 | 76 |
| 73 #endif // UI_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | 77 #endif // UI_VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ |
| OLD | NEW |