OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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_CONTROLS_LISTBOX_NATIVE_LISTBOX_WRAPPER_H_ |
| 6 #define VIEWS_CONTROLS_LISTBOX_NATIVE_LISTBOX_WRAPPER_H_ |
| 7 |
| 8 #include "gfx/native_widget_types.h" |
| 9 #include "gfx/rect.h" |
| 10 #include "views/controls/listbox/listbox.h" |
| 11 |
| 12 namespace views { |
| 13 |
| 14 // An interface implemented by an object that provides a platform-native |
| 15 // listbox. |
| 16 class NativeListboxWrapper { |
| 17 public: |
| 18 // Returns the number of rows in the table. |
| 19 virtual int GetRowCount() const = 0; |
| 20 |
| 21 // Returns the 0-based index of the currently selected row. |
| 22 virtual int SelectedRow() const = 0; |
| 23 |
| 24 // Selects the specified row, making sure it's visible. |
| 25 virtual void SelectRow(int row) = 0; |
| 26 |
| 27 // Retrieves the views::View that hosts the native control. |
| 28 virtual View* GetView() = 0; |
| 29 |
| 30 // Creates an appropriate NativeListboxWrapper for the platform. |
| 31 static NativeListboxWrapper* CreateNativeWrapper( |
| 32 Listbox* listbox, |
| 33 const std::vector<string16>& strings, |
| 34 Listbox::Listener* listener); |
| 35 }; |
| 36 |
| 37 } // namespace views |
| 38 |
| 39 #endif // VIEWS_CONTROLS_LISTBOX_NATIVE_LISTBOX_WRAPPER_H_ |
OLD | NEW |