| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | |
| 6 #define VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "third_party/skia/include/core/SkBitmap.h" | |
| 14 #include "ui/base/models/table_model.h" | |
| 15 #include "views/controls/button/button.h" | |
| 16 #include "views/controls/table/table_view.h" | |
| 17 #include "views/controls/table/table_view_observer.h" | |
| 18 #include "views/examples/example_base.h" | |
| 19 | |
| 20 namespace views { | |
| 21 class Checkbox; | |
| 22 class Event; | |
| 23 class TableView; | |
| 24 } | |
| 25 | |
| 26 namespace examples { | |
| 27 | |
| 28 class TableExample : public ExampleBase, | |
| 29 public ui::TableModel, | |
| 30 public views::TableViewObserver, | |
| 31 public views::ButtonListener { | |
| 32 public: | |
| 33 explicit TableExample(ExamplesMain* main); | |
| 34 virtual ~TableExample(); | |
| 35 | |
| 36 // ExampleBase: | |
| 37 virtual void CreateExampleView(views::View* container) OVERRIDE; | |
| 38 | |
| 39 // ui::TableModel: | |
| 40 virtual int RowCount() OVERRIDE; | |
| 41 virtual string16 GetText(int row, int column_id) OVERRIDE; | |
| 42 virtual SkBitmap GetIcon(int row) OVERRIDE; | |
| 43 virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; | |
| 44 | |
| 45 // views::TableViewObserver: | |
| 46 virtual void OnSelectionChanged() OVERRIDE; | |
| 47 virtual void OnDoubleClick() OVERRIDE; | |
| 48 virtual void OnMiddleClick() OVERRIDE; | |
| 49 virtual void OnKeyDown(ui::KeyboardCode virtual_keycode) OVERRIDE; | |
| 50 virtual void OnTableViewDelete(views::TableView* table_view) OVERRIDE; | |
| 51 virtual void OnTableView2Delete(views::TableView2* table_view) OVERRIDE; | |
| 52 | |
| 53 // views::ButtonListener: | |
| 54 virtual void ButtonPressed(views::Button* sender, | |
| 55 const views::Event& event) OVERRIDE; | |
| 56 | |
| 57 private: | |
| 58 // The table to be tested. | |
| 59 views::TableView* table_; | |
| 60 | |
| 61 views::Checkbox* column1_visible_checkbox_; | |
| 62 views::Checkbox* column2_visible_checkbox_; | |
| 63 views::Checkbox* column3_visible_checkbox_; | |
| 64 views::Checkbox* column4_visible_checkbox_; | |
| 65 | |
| 66 SkBitmap icon1_; | |
| 67 SkBitmap icon2_; | |
| 68 | |
| 69 DISALLOW_COPY_AND_ASSIGN(TableExample); | |
| 70 }; | |
| 71 | |
| 72 } // namespace examples | |
| 73 | |
| 74 #endif // VIEWS_EXAMPLES_TABLE_EXAMPLE_H_ | |
| OLD | NEW |