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/macros.h"
9 #include "base/memory/scoped_vector.h"
10 #include "ui/views/controls/button/button.h"
11 #include "ui/views/controls/combobox/combobox_listener.h"
12 #include "ui/views/examples/example_base.h"
20 class ExampleComboboxModel
;
22 class VIEWS_EXAMPLES_EXPORT TextExample
: public ExampleBase
,
23 public ButtonListener
,
24 public ComboboxListener
{
27 virtual ~TextExample();
30 virtual void CreateExampleView(View
* container
) OVERRIDE
;
33 // Creates and adds a check box to the layout.
34 Checkbox
* AddCheckbox(GridLayout
* layout
, const char* name
);
36 // Creates and adds a combobox to the layout.
37 Combobox
* AddCombobox(GridLayout
* layout
,
43 virtual void ButtonPressed(Button
* button
, const ui::Event
& event
) OVERRIDE
;
46 virtual void OnPerformAction(Combobox
* combobox
) OVERRIDE
;
48 class TextExampleView
;
49 // The content of the scroll view.
50 TextExampleView
* text_view_
;
52 // Combo box for horizontal text alignment.
53 Combobox
* h_align_cb_
;
55 // Combo box for text eliding style.
56 Combobox
* eliding_cb_
;
58 // Combo box for ampersand prefix show / hide behavior.
61 // Combo box to choose one of the sample texts.
64 // Check box to enable/disable multiline text drawing.
65 Checkbox
* multiline_checkbox_
;
67 // Check box to enable/disable character break behavior.
68 Checkbox
* break_checkbox_
;
70 // Check box to enable/disable text halo.
71 Checkbox
* halo_checkbox_
;
73 // Check box to enable/disable bold style.
74 Checkbox
* bold_checkbox_
;
76 // Check box to enable/disable italic style.
77 Checkbox
* italic_checkbox_
;
79 // Check box to enable/disable underline style.
80 Checkbox
* underline_checkbox_
;
82 // We create a model for each of the combobox, so we need to keep them
83 // around until destruction time.
84 ScopedVector
<ExampleComboboxModel
> example_combobox_model_
;
86 DISALLOW_COPY_AND_ASSIGN(TextExample
);
89 } // namespace examples
92 #endif // UI_VIEWS_EXAMPLES_TEXT_EXAMPLE_H_