BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / terminal / SmartTabView.h
blobcc6e49c7e093599e2389100049d46ad947b28233
1 /*
2 * Copyright 2007-2010, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stefano Ceccherini (burton666@libero.it)
7 * Ingo Weinhold (ingo_weinhold@gmx.de)
8 */
9 #ifndef SMART_TAB_VIEW_H
10 #define SMART_TAB_VIEW_H
13 #include <TabView.h>
16 class BPopUpMenu;
17 class BScrollView;
20 class SmartTabView : public BTabView {
21 public:
22 class Listener;
24 public:
25 SmartTabView(BRect frame, const char* name,
26 button_width width = B_WIDTH_AS_USUAL,
27 uint32 resizingMode = B_FOLLOW_ALL,
28 uint32 flags = B_FULL_UPDATE_ON_RESIZE
29 | B_WILL_DRAW | B_NAVIGABLE_JUMP
30 | B_FRAME_EVENTS | B_NAVIGABLE);
31 SmartTabView(const char* name,
32 button_width width = B_WIDTH_AS_USUAL,
33 uint32 flags = B_FULL_UPDATE_ON_RESIZE
34 | B_WILL_DRAW | B_NAVIGABLE_JUMP
35 | B_FRAME_EVENTS | B_NAVIGABLE
36 | B_SUPPORTS_LAYOUT);
37 virtual ~SmartTabView();
39 void SetInsets(float left, float top, float right,
40 float bottom);
42 virtual void MouseDown(BPoint where);
44 virtual void AttachedToWindow();
45 virtual void AllAttached();
47 virtual void Select(int32 tab);
49 virtual void AddTab(BView* target, BTab* tab = NULL);
50 virtual BTab* RemoveTab(int32 index);
51 void MoveTab(int32 index, int32 newIndex);
53 virtual BRect DrawTabs();
55 void SetScrollView(BScrollView* scrollView);
57 void SetListener(Listener* listener)
58 { fListener = listener; }
60 private:
61 int32 _ClickedTabIndex(const BPoint& point);
63 private:
64 BRect fInsets;
65 BScrollView* fScrollView;
66 Listener* fListener;
70 class SmartTabView::Listener {
71 public:
72 virtual ~Listener();
74 virtual void TabSelected(SmartTabView* tabView, int32 index);
75 virtual void TabDoubleClicked(SmartTabView* tabView,
76 BPoint point, int32 index);
77 virtual void TabMiddleClicked(SmartTabView* tabView,
78 BPoint point, int32 index);
79 virtual void TabRightClicked(SmartTabView* tabView,
80 BPoint point, int32 index);
84 #endif // SMART_TAB_VIEW_H