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_WIN_H_ |
| 6 #define VIEWS_CONTROLS_LISTBOX_NATIVE_LISTBOX_WIN_H_ |
| 7 |
| 8 #include <windows.h> |
| 9 |
| 10 #include "base/string16.h" |
| 11 #include "views/controls/listbox/native_listbox_wrapper.h" |
| 12 #include "views/controls/native_control_win.h" |
| 13 |
| 14 namespace views { |
| 15 |
| 16 // A View that hosts a native Windows listbox. |
| 17 class NativeListboxWin : public NativeControlWin, public NativeListboxWrapper { |
| 18 public: |
| 19 NativeListboxWin(Listbox* listbox, |
| 20 const std::vector<string16>& strings, |
| 21 Listbox::Listener* listener); |
| 22 virtual ~NativeListboxWin(); |
| 23 |
| 24 // NativeListboxWrapper implementation: |
| 25 virtual int GetRowCount() const; |
| 26 virtual int SelectedRow() const; |
| 27 virtual void SelectRow(int row); |
| 28 virtual View* GetView(); |
| 29 |
| 30 // Overridden from View: |
| 31 virtual gfx::Size GetPreferredSize(); |
| 32 |
| 33 // Overridden from NativeControlWin: |
| 34 virtual bool ProcessMessage(UINT message, |
| 35 WPARAM w_param, |
| 36 LPARAM l_param, |
| 37 LRESULT* result); |
| 38 |
| 39 protected: |
| 40 virtual void CreateNativeControl(); |
| 41 |
| 42 private: |
| 43 // The listbox we are bound to. |
| 44 Listbox* listbox_; |
| 45 |
| 46 // The strings shown in the listbox. |
| 47 std::vector<string16> strings_; |
| 48 |
| 49 // Listens to selection changes. |
| 50 Listbox::Listener* listener_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(NativeListboxWin); |
| 53 }; |
| 54 |
| 55 } // namespace views |
| 56 |
| 57 #endif // VIEWS_CONTROLS_LISTBOX_NATIVE_LISTBOX_WIN_H_ |
OLD | NEW |