Make UEFI boot-platform build again
[haiku.git] / headers / os / interface / Box.h
bloba3020d3602f157eddfcc2c4f0873e3cf3da4fa29
1 /*
2 * Copyright 2005-2015 Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _BOX_H
6 #define _BOX_H
9 #include <View.h>
12 class BBox : public BView {
13 public:
14 BBox(BRect frame, const char* name = NULL,
15 uint32 resizingMode = B_FOLLOW_LEFT_TOP,
16 uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS
17 | B_NAVIGABLE_JUMP,
18 border_style border = B_FANCY_BORDER);
19 BBox(const char* name,
20 uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS
21 | B_NAVIGABLE_JUMP,
22 border_style border = B_FANCY_BORDER,
23 BView* child = NULL);
24 BBox(border_style border, BView* child);
25 virtual ~BBox();
27 /* Archiving */
28 BBox(BMessage* archive);
29 static BArchivable* Instantiate(BMessage* archive);
30 virtual status_t Archive(BMessage* archive, bool deep = true) const;
32 virtual void SetBorder(border_style border);
33 border_style Border() const;
35 float TopBorderOffset();
36 BRect InnerFrame();
38 void SetLabel(const char* string);
39 status_t SetLabel(BView* viewLabel);
41 const char* Label() const;
42 BView* LabelView() const;
44 virtual void Draw(BRect updateRect);
45 virtual void AttachedToWindow();
46 virtual void DetachedFromWindow();
47 virtual void AllAttached();
48 virtual void AllDetached();
49 virtual void FrameResized(float width, float height);
50 virtual void MessageReceived(BMessage* message);
51 virtual void MouseDown(BPoint point);
52 virtual void MouseUp(BPoint point);
53 virtual void WindowActivated(bool active);
54 virtual void MouseMoved(BPoint point, uint32 transit,
55 const BMessage* dragMessage);
56 virtual void FrameMoved(BPoint newLocation);
58 virtual BHandler* ResolveSpecifier(BMessage* message,
59 int32 index, BMessage* specifier,
60 int32 what, const char* property);
62 virtual void ResizeToPreferred();
63 virtual void GetPreferredSize(float* _width, float* _height);
64 virtual void MakeFocus(bool focused = true);
65 virtual status_t GetSupportedSuites(BMessage* message);
67 virtual status_t Perform(perform_code d, void* arg);
69 virtual BSize MinSize();
70 virtual BSize MaxSize();
71 virtual BSize PreferredSize();
72 virtual BAlignment LayoutAlignment();
74 protected:
75 virtual void LayoutInvalidated(bool descendants = false);
76 virtual void DoLayout();
78 private:
79 struct LayoutData;
81 virtual void _ReservedBox1();
82 virtual void _ReservedBox2();
84 BBox &operator=(const BBox &);
86 void _InitObject(BMessage* data = NULL);
87 void _DrawPlain(BRect labelBox);
88 void _DrawFancy(BRect labelBox);
89 void _ClearLabel();
91 BView* _Child() const;
92 void _ValidateLayoutData();
94 char* fLabel;
95 BRect fBounds;
96 border_style fStyle;
97 BView* fLabelView;
98 LayoutData* fLayoutData;
101 #endif // _BOX_H