xref: /haiku/src/apps/terminal/SmartTabView.h (revision 3be9edf8da228afd9fec0390f408c964766122aa)
1 /*
2  * Copyright 2007-2009, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  *	Authors:
6  *		Stefano Ceccherini (burton666@libero.it)
7  */
8 #ifndef SMART_TAB_VIEW_H
9 #define SMART_TAB_VIEW_H
10 
11 
12 #include <TabView.h>
13 
14 
15 class BPopUpMenu;
16 class BScrollView;
17 
18 
19 class SmartTabView : public BTabView {
20 public:
21 								SmartTabView(BRect frame, const char* name,
22 									button_width width = B_WIDTH_AS_USUAL,
23 									uint32 resizingMode = B_FOLLOW_ALL,
24 									uint32 flags = B_FULL_UPDATE_ON_RESIZE
25 										| B_WILL_DRAW | B_NAVIGABLE_JUMP
26 										| B_FRAME_EVENTS | B_NAVIGABLE);
27 	virtual						~SmartTabView();
28 
29 			void				SetInsets(float left, float top, float right,
30 									float bottom);
31 
32 	virtual void				MouseDown(BPoint where);
33 
34 	virtual void				AttachedToWindow();
35 	virtual void				AllAttached();
36 
37 	virtual void				MessageReceived(BMessage* message);
38 
39 	virtual	void				Select(int32 tab);
40 
41 	virtual	void				RemoveAndDeleteTab(int32 index);
42 
43 	virtual	void				AddTab(BView* target, BTab* tab = NULL);
44 	virtual BTab*				RemoveTab(int32 index);
45 
46 	virtual BRect				DrawTabs();
47 
48 			void				SetScrollView(BScrollView* scrollView);
49 
50 private:
51 			int32				_ClickedTabIndex(const BPoint& point);
52 
53 private:
54 			BRect				fInsets;
55 			BScrollView*		fScrollView;
56 };
57 
58 #endif // SMART_TAB_VIEW_H
59