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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #import "base/mac/cocoa_protocols.h" | |
8 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
9 | 8 |
10 // TabViewPickerTable is an NSOutlineView that can be used to switch between the | 9 // TabViewPickerTable is an NSOutlineView that can be used to switch between the |
11 // NSTabViewItems of an NSTabView. To use this, just create a | 10 // NSTabViewItems of an NSTabView. To use this, just create a |
12 // TabViewPickerTable in Interface Builder and connect the |tabView_| outlet | 11 // TabViewPickerTable in Interface Builder and connect the |tabView_| outlet |
13 // to an NSTabView. Now the table is automatically populated with the tab labels | 12 // to an NSTabView. Now the table is automatically populated with the tab labels |
14 // of the tab view, clicking the table updates the tab view, and switching | 13 // of the tab view, clicking the table updates the tab view, and switching |
15 // tab view items updates the selection of the table. | 14 // tab view items updates the selection of the table. |
16 @interface TabViewPickerTable : NSOutlineView <NSTabViewDelegate, | 15 @interface TabViewPickerTable : NSOutlineView <NSTabViewDelegate, |
17 NSOutlineViewDelegate, | 16 NSOutlineViewDelegate, |
18 NSOutlineViewDataSource> { | 17 NSOutlineViewDataSource> { |
19 @public | 18 @public |
20 IBOutlet NSTabView* tabView_; // Visible for testing. | 19 IBOutlet NSTabView* tabView_; // Visible for testing. |
21 | 20 |
22 @private | 21 @private |
23 id oldTabViewDelegate_; | 22 id oldTabViewDelegate_; |
24 | 23 |
25 // Shown above all the tab names. May be |nil|. | 24 // Shown above all the tab names. May be |nil|. |
26 scoped_nsobject<NSString> heading_; | 25 scoped_nsobject<NSString> heading_; |
27 } | 26 } |
28 @property(nonatomic, copy) NSString* heading; | 27 @property(nonatomic, copy) NSString* heading; |
29 @end | 28 @end |
OLD | NEW |