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