1 /*
2    NSTabView.h
3 
4    Copyright (C) 1996 Free Software Foundation, Inc.
5 
6    Author:  Michael Hanni <mhanni@sprintmail.com>
7    Date: 1999
8 
9    This file is part of the GNUstep GUI Library.
10 
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Lesser General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15 
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
19    Lesser General Public License for more details.
20 
21    You should have received a copy of the GNU Lesser General Public
22    License along with this library; see the file COPYING.LIB.
23    If not, see <http://www.gnu.org/licenses/> or write to the
24    Free Software Foundation, 51 Franklin Street, Fifth Floor,
25    Boston, MA 02110-1301, USA.
26 */
27 
28 #ifndef _GNUstep_H_NSTabView
29 #define _GNUstep_H_NSTabView
30 
31 #import <AppKit/NSView.h>
32 #import <AppKit/NSColor.h>
33 #import <AppKit/NSCell.h>
34 
35 typedef enum {
36   NSTopTabsBezelBorder,
37   NSLeftTabsBezelBorder,
38   NSBottomTabsBezelBorder,
39   NSRightTabsBezelBorder,
40   NSNoTabsBezelBorder,
41   NSNoTabsLineBorder,
42   NSNoTabsNoBorder
43 } NSTabViewType;
44 
45 @class NSFont;
46 @class NSTabViewItem;
47 
48 @interface NSTabView : NSView <NSCoding>
49 {
50   NSMutableArray *_items;
51   NSFont *_font;
52   NSTabViewType _type;
53   NSTabViewItem *_selected;
54   BOOL _draws_background;
55   BOOL _truncated_label;
56   id _delegate;
57   NSView *_original_nextKeyView;
58   NSUInteger _selected_item;
59 }
60 - (void)addTabViewItem:(NSTabViewItem *)tabViewItem;
61 - (void)insertTabViewItem:(NSTabViewItem *)tabViewItem
62 		  atIndex:(NSInteger)index;
63 - (void)removeTabViewItem:(NSTabViewItem *)tabViewItem;
64 - (NSInteger)indexOfTabViewItem:(NSTabViewItem *)tabViewItem;
65 - (NSInteger)indexOfTabViewItemWithIdentifier:(id)identifier;
66 - (NSInteger)numberOfTabViewItems;
67 
68 - (NSTabViewItem *)tabViewItemAtIndex:(NSInteger)index;
69 - (NSArray *)tabViewItems;
70 
71 - (void)selectFirstTabViewItem:(id)sender;
72 - (void)selectLastTabViewItem:(id)sender;
73 - (void)selectNextTabViewItem:(id)sender;
74 - (void)selectPreviousTabViewItem:(id)sender;
75 - (void)selectTabViewItem:(NSTabViewItem *)tabViewItem;
76 - (void)selectTabViewItemAtIndex:(NSInteger)index;
77 - (void)selectTabViewItemWithIdentifier:(id)identifier;
78 - (void)takeSelectedTabViewItemFromSender:(id)sender;
79 - (NSTabViewItem*) selectedTabViewItem;
80 
81 - (void)setFont:(NSFont *)font;
82 - (NSFont *)font;
83 
84 - (void)setTabViewType:(NSTabViewType)tabViewType;
85 - (NSTabViewType)tabViewType;
86 
87 - (void)setDrawsBackground:(BOOL)flag;
88 - (BOOL)drawsBackground;
89 
90 - (void)setAllowsTruncatedLabels:(BOOL)allowTruncatedLabels;
91 - (BOOL)allowsTruncatedLabels;
92 
93 - (void)setDelegate:(id)anObject;
94 - (id)delegate;
95 
96 - (NSSize)minimumSize;
97 - (NSRect)contentRect;
98 
99 - (NSTabViewItem *)tabViewItemAtPoint:(NSPoint)point;
100 
101 #if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
102 - (NSControlSize)controlSize;
103 - (NSControlTint)controlTint;
104 - (void)setControlSize:(NSControlSize)controlSize;
105 - (void)setControlTint:(NSControlTint)controlTint;
106 #endif
107 
108 @end
109 
110 @interface NSObject(NSTabViewDelegate)
111 - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem;
112 - (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem;
113 - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem;
114 - (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)TabView;
115 @end
116 
117 #endif // _GNUstep_H_NSTabView
118 
119 /* Notifications */
120 
121