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_CONTROLS_COMBOBOX_COMBOBOX_H_ | 5 #ifndef UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
6 #define UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 6 #define UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
12 #include "ui/views/controls/combobox/native_combobox_wrapper.h" | 12 #include "ui/views/controls/combobox/native_combobox_wrapper.h" |
13 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
14 | 14 |
| 15 namespace gfx { |
| 16 class Font; |
| 17 } |
| 18 |
15 namespace ui { | 19 namespace ui { |
16 class ComboboxModel; | 20 class ComboboxModel; |
17 } | 21 } |
18 | 22 |
19 namespace views { | 23 namespace views { |
20 | 24 |
21 class ComboboxListener; | 25 class ComboboxListener; |
22 | 26 |
23 // A non-editable combo-box (aka a drop-down list) | 27 // A non-editable combo-box (aka a drop-down list) |
24 class VIEWS_EXPORT Combobox : public View { | 28 class VIEWS_EXPORT Combobox : public View { |
25 public: | 29 public: |
26 // The combobox's class name. | 30 // The combobox's class name. |
27 static const char kViewClassName[]; | 31 static const char kViewClassName[]; |
28 | 32 |
29 // |model| is not owned by the combo box. | 33 // |model| is not owned by the combo box. |
30 explicit Combobox(ui::ComboboxModel* model); | 34 explicit Combobox(ui::ComboboxModel* model); |
31 virtual ~Combobox(); | 35 virtual ~Combobox(); |
32 | 36 |
| 37 static const gfx::Font& GetFont(); |
| 38 |
33 // Register |listener| for item change events. | 39 // Register |listener| for item change events. |
34 void set_listener(ComboboxListener* listener) { | 40 void set_listener(ComboboxListener* listener) { |
35 listener_ = listener; | 41 listener_ = listener; |
36 } | 42 } |
37 | 43 |
38 // Inform the combo box that its model changed. | 44 // Inform the combo box that its model changed. |
39 void ModelChanged(); | 45 void ModelChanged(); |
40 | 46 |
41 // Gets/Sets the selected item. | 47 // Gets/Sets the selected item. |
42 int selected_item() const { return selected_item_; } | 48 int selected_item() const { return selected_item_; } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 99 |
94 // The accessible name of the text field. | 100 // The accessible name of the text field. |
95 string16 accessible_name_; | 101 string16 accessible_name_; |
96 | 102 |
97 DISALLOW_COPY_AND_ASSIGN(Combobox); | 103 DISALLOW_COPY_AND_ASSIGN(Combobox); |
98 }; | 104 }; |
99 | 105 |
100 } // namespace views | 106 } // namespace views |
101 | 107 |
102 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ | 108 #endif // UI_VIEWS_CONTROLS_COMBOBOX_COMBOBOX_H_ |
OLD | NEW |