vfs: check userland buffers before reading them.
[haiku.git] / src / apps / webpositive / tabview / TabView.h
blob376bfa0d953634604de87cad141744d86a08b5c6
1 /*
2 * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de>
4 * All rights reserved. Distributed under the terms of the MIT License.
5 */
6 #ifndef TAB_VIEW_H
7 #define TAB_VIEW_H
9 #include <AbstractLayoutItem.h>
10 #include <Rect.h>
11 #include <String.h>
14 class BMessage;
15 class BView;
16 class TabContainerView;
17 class TabLayoutItem;
20 class TabView {
21 public:
22 TabView();
23 virtual ~TabView();
25 virtual BSize MinSize();
26 virtual BSize PreferredSize();
27 virtual BSize MaxSize();
29 void Draw(BRect updateRect);
30 virtual void DrawBackground(BView* owner, BRect frame,
31 const BRect& updateRect, bool isFirst,
32 bool isLast, bool isFront);
33 virtual void DrawContents(BView* owner, BRect frame,
34 const BRect& updateRect, bool isFirst,
35 bool isLast, bool isFront);
37 virtual void MouseDown(BPoint where, uint32 buttons);
38 virtual void MouseUp(BPoint where);
39 virtual void MouseMoved(BPoint where, uint32 transit,
40 const BMessage* dragMessage);
42 void SetIsFront(bool isFront);
43 bool IsFront() const;
44 void SetIsLast(bool isLast);
45 virtual void Update(bool isFirst, bool isLast,
46 bool isFront);
48 BLayoutItem* LayoutItem() const;
49 void SetContainerView(
50 TabContainerView* containerView);
51 TabContainerView* ContainerView() const;
53 void SetLabel(const char* label);
54 const BString& Label() const;
56 BRect Frame() const;
58 private:
59 float _LabelHeight() const;
61 private:
62 TabContainerView* fContainerView;
63 TabLayoutItem* fLayoutItem;
65 BString fLabel;
67 bool fIsFirst;
68 bool fIsLast;
69 bool fIsFront;
73 class TabLayoutItem : public BAbstractLayoutItem {
74 public:
75 TabLayoutItem(TabView* parent);
77 virtual bool IsVisible();
78 virtual void SetVisible(bool visible);
80 virtual BRect Frame();
81 virtual void SetFrame(BRect frame);
83 virtual BView* View();
85 virtual BSize BaseMinSize();
86 virtual BSize BaseMaxSize();
87 virtual BSize BasePreferredSize();
88 virtual BAlignment BaseAlignment();
90 TabView* Parent() const;
91 void InvalidateContainer();
92 void InvalidateContainer(BRect frame);
93 private:
94 TabView* fParent;
95 BRect fFrame;
96 bool fVisible;
101 #endif // TAB_VIEW_H