1 // Copyright (c) 2012 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.
5 #ifndef UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_
6 #define UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_vector.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/controls/combobox/combobox_listener.h"
13 #include "ui/views/examples/example_base.h"
21 class ExampleComboboxModel;
23 class TextExample : public ExampleBase,
24 public ButtonListener,
25 public ComboboxListener {
28 virtual ~TextExample();
30 // Overridden from ExampleBase:
31 virtual void CreateExampleView(View* container) OVERRIDE;
34 // Creates and adds a check box to the layout.
35 Checkbox* AddCheckbox(GridLayout* layout, const char* name);
37 // Creates and adds a combobox to the layout.
38 Combobox* AddCombobox(GridLayout* layout,
43 // Overridden from ButtonListener:
44 virtual void ButtonPressed(Button* button, const ui::Event& event) OVERRIDE;
46 // Overridden from ComboboxListener:
47 virtual void OnSelectedIndexChanged(Combobox* combobox) OVERRIDE;
49 class TextExampleView;
50 // The content of the scroll view.
51 TextExampleView* text_view_;
53 // Combo box for horizontal text alignment.
54 Combobox* h_align_cb_;
56 // Combo box for text eliding style.
57 Combobox* eliding_cb_;
59 // Combo box for ampersand prefix show / hide behavior.
62 // Combo box to choose one of the sample texts.
65 // Check box to enable/disable multiline text drawing.
66 Checkbox* multiline_checkbox_;
68 // Check box to enable/disable character break behavior.
69 Checkbox* break_checkbox_;
71 // Check box to enable/disable text halo.
72 Checkbox* halo_checkbox_;
74 // Check box to enable/disable bold style.
75 Checkbox* bold_checkbox_;
77 // Check box to enable/disable italic style.
78 Checkbox* italic_checkbox_;
80 // Check box to enable/disable underline style.
81 Checkbox* underline_checkbox_;
83 // We create a model for each of the combobox, so we need to keep them
84 // around until destruction time.
85 ScopedVector<ExampleComboboxModel> example_combobox_model_;
87 DISALLOW_COPY_AND_ASSIGN(TextExample);
90 } // namespace examples
93 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_