OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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_TABBED_PANE_NATIVE_TABBED_PANE_WIN_H_ |
| 6 #define VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_WIN_H_ |
| 7 |
| 8 #include "views/controls/native_control_win.h" |
| 9 #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" |
| 10 |
| 11 namespace views { |
| 12 |
| 13 class WidgetWin; |
| 14 |
| 15 class NativeTabbedPaneWin : public NativeControlWin, |
| 16 public NativeTabbedPaneWrapper { |
| 17 public: |
| 18 explicit NativeTabbedPaneWin(TabbedPane* tabbed_pane); |
| 19 virtual ~NativeTabbedPaneWin(); |
| 20 |
| 21 // NativeTabbedPaneWrapper implementation: |
| 22 virtual void AddTab(const std::wstring& title, View* contents); |
| 23 virtual void AddTabAtIndex(int index, |
| 24 const std::wstring& title, |
| 25 View* contents, |
| 26 bool select_if_first_tab); |
| 27 virtual View* RemoveTabAtIndex(int index); |
| 28 virtual void SelectTabAt(int index); |
| 29 virtual int GetTabCount(); |
| 30 virtual int GetSelectedTabIndex(); |
| 31 virtual View* GetSelectedTab(); |
| 32 virtual View* GetView(); |
| 33 virtual void SetFocus(); |
| 34 virtual gfx::NativeView GetTestingHandle() const; |
| 35 |
| 36 // NativeControlWin overrides. |
| 37 virtual void CreateNativeControl(); |
| 38 virtual bool ProcessMessage(UINT message, |
| 39 WPARAM w_param, |
| 40 LPARAM l_param, |
| 41 LRESULT* result); |
| 42 |
| 43 // View overrides: |
| 44 virtual void Layout(); |
| 45 virtual FocusTraversable* GetFocusTraversable(); |
| 46 virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); |
| 47 |
| 48 private: |
| 49 // Changes the contents view to the view associated with the tab at |index|. |
| 50 void DoSelectTabAt(int index); |
| 51 |
| 52 // Resizes the HWND control to macth the size of the containing view. |
| 53 void ResizeContents(); |
| 54 |
| 55 // The tabbed-pane we are bound to. |
| 56 TabbedPane* tabbed_pane_; |
| 57 |
| 58 // The views associated with the different tabs. |
| 59 std::vector<View*> tab_views_; |
| 60 |
| 61 // The window displayed in the tab. |
| 62 WidgetWin* content_window_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(NativeTabbedPaneWin); |
| 65 }; |
| 66 |
| 67 } // namespace views |
| 68 |
| 69 #endif // VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_WIN_H_ |
OLD | NEW |