Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: views/controls/tabbed_pane/native_tabbed_pane_wrapper.h

Issue 155668: Refactoring of tabbed-pane component so it can be ported to Linux toolkit_view (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(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_WRAPPER_H_
6 #define VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_WRAPPER_H_
7
8 namespace views {
9
10 class TabbedPane;
11 class View;
12
13 // An interface implemented by an object that provides a platform-native
14 // tabbed-pane.
15 class NativeTabbedPaneWrapper {
16 public:
17 // The TabbedPane calls this when it is destroyed to clean up the wrapper
18 // object.
19 virtual ~NativeTabbedPaneWrapper() { }
20
21 // Adds a new tab at the end of this TabbedPane with the specified |title|.
22 // |contents| is the view displayed when the tab is selected and is owned by
23 // the TabbedPane.
24 virtual void AddTab(const std::wstring& title, View* contents) = 0;
25
26 // Adds a new tab at the specified |index| with the specified |title|.
27 // |contents| is the view displayed when the tab is selected and is owned by
28 // the TabbedPane. If |select_if_first_tab| is true and the tabbed pane is
29 // currently empty, the new tab is selected. If you pass in false for
30 // |select_if_first_tab| you need to explicitly invoke SelectTabAt, otherwise
31 // the tabbed pane will not have a valid selection.
32 virtual void AddTabAtIndex(int index,
33 const std::wstring& title,
34 View* contents,
35 bool select_if_first_tab) = 0;
36
37 // Removes the tab at the specified |index| and returns the associated content
38 // view. The caller becomes the owner of the returned view.
39 virtual View* RemoveTabAtIndex(int index) = 0;
40
41 // Selects the tab at the specified |index|, which must be valid.
42 virtual void SelectTabAt(int index) = 0;
43
44 // Returns the number of tabs.
45 virtual int GetTabCount() = 0;
46
47 // Returns the index of the selected tab.
48 virtual int GetSelectedTabIndex() = 0;
49
50 // Returns the contents of the selected tab.
51 virtual View* GetSelectedTab() = 0;
52
53 // Retrieves the views::View that hosts the native control.
54 virtual View* GetView() = 0;
55
56 // Sets the focus to the tabbed pane native view.
57 virtual void SetFocus() = 0;
58
59 // Returns a handle to the underlying native view for testing.
60 virtual gfx::NativeView GetTestingHandle() const = 0;
61
62 // Creates an appropriate NativeTabbedPaneWrapper for the platform.
63 static NativeTabbedPaneWrapper* CreateNativeWrapper(TabbedPane* tabbed_pane);
64 };
65
66 } // namespace views
67
68 #endif // VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_WRAPPER_H_
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/controls/tabbed_pane/tabbed_pane.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698