repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / webpositive / tabview / TabManager.h
blobf2f676a7d70198868e1492631b283737f721dedb
1 /*
2 * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
7 #ifndef TAB_MANAGER_H
8 #define TAB_MANAGER_H
10 #include <Messenger.h>
11 #include <TabView.h>
13 enum {
14 TAB_CHANGED = 'tcha',
15 CLOSE_TAB = 'cltb'
18 class BBitmap;
19 class BCardLayout;
20 class BGroupView;
21 class BMenu;
22 class TabContainerGroup;
23 class TabContainerView;
24 class TabManagerController;
26 class TabManager {
27 public:
28 TabManager(const BMessenger& target,
29 BMessage* newTabMessage);
30 virtual ~TabManager();
32 void SetTarget(const BMessenger& target);
33 const BMessenger& Target() const;
35 #if INTEGRATE_MENU_INTO_TAB_BAR
36 BMenu* Menu() const;
37 #endif
39 BView* TabGroup() const;
40 BView* GetTabContainerView() const;
41 BView* ContainerView() const;
43 BView* ViewForTab(int32 tabIndex) const;
44 int32 TabForView(const BView* containedView) const;
45 bool HasView(const BView* containedView) const;
47 void SelectTab(int32 tabIndex);
48 void SelectTab(const BView* containedView);
49 int32 SelectedTabIndex() const;
50 void CloseTab(int32 tabIndex);
52 void AddTab(BView* view, const char* label,
53 int32 index = -1);
54 BView* RemoveTab(int32 index);
55 int32 CountTabs() const;
57 void SetTabLabel(int32 tabIndex, const char* label);
58 const BString& TabLabel(int32);
59 void SetTabIcon(const BView* containedView,
60 const BBitmap* icon);
61 void SetCloseButtonsAvailable(bool available);
63 private:
64 #if INTEGRATE_MENU_INTO_TAB_BAR
65 BMenu* fMenu;
66 #endif
67 TabContainerGroup* fTabContainerGroup;
68 TabContainerView* fTabContainerView;
69 BView* fContainerView;
70 BCardLayout* fCardLayout;
71 TabManagerController* fController;
73 BMessenger fTarget;
76 #endif // TAB_MANAGER_H