2 * Copyright 2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _SEPARATOR_VIEW_H
6 #define _SEPARATOR_VIEW_H
14 class BSeparatorView
: public BView
{
16 BSeparatorView(orientation orientation
,
17 border_style border
= B_PLAIN_BORDER
);
18 BSeparatorView(const char* name
,
20 orientation orientation
= B_HORIZONTAL
,
21 border_style border
= B_FANCY_BORDER
,
22 const BAlignment
& alignment
23 = BAlignment(B_ALIGN_HORIZONTAL_CENTER
,
24 B_ALIGN_VERTICAL_CENTER
));
25 BSeparatorView(const char* name
,
27 orientation orientation
= B_HORIZONTAL
,
28 border_style border
= B_FANCY_BORDER
,
29 const BAlignment
& alignment
30 = BAlignment(B_ALIGN_HORIZONTAL_CENTER
,
31 B_ALIGN_VERTICAL_CENTER
));
32 BSeparatorView(const char* label
= NULL
,
33 orientation orientation
= B_HORIZONTAL
,
34 border_style border
= B_FANCY_BORDER
,
35 const BAlignment
& alignment
36 = BAlignment(B_ALIGN_HORIZONTAL_CENTER
,
37 B_ALIGN_VERTICAL_CENTER
));
38 BSeparatorView(BView
* labelView
,
39 orientation orientation
= B_HORIZONTAL
,
40 border_style border
= B_FANCY_BORDER
,
41 const BAlignment
& alignment
42 = BAlignment(B_ALIGN_HORIZONTAL_CENTER
,
43 B_ALIGN_VERTICAL_CENTER
));
45 BSeparatorView(BMessage
* archive
);
47 virtual ~BSeparatorView();
49 static BArchivable
* Instantiate(BMessage
* archive
);
50 virtual status_t
Archive(BMessage
* into
,
51 bool deep
= true) const;
53 virtual void Draw(BRect updateRect
);
55 virtual void GetPreferredSize(float* width
, float* height
);
56 virtual BSize
MinSize();
57 virtual BSize
MaxSize();
58 virtual BSize
PreferredSize();
60 void SetOrientation(orientation orientation
);
61 void SetAlignment(const BAlignment
& aligment
);
62 void SetBorderStyle(border_style border
);
64 void SetLabel(const char* label
);
65 void SetLabel(BView
* view
, bool deletePrevious
);
67 virtual status_t
Perform(perform_code code
, void* data
);
70 virtual void DoLayout();
74 virtual void _ReservedSeparatorView1();
75 virtual void _ReservedSeparatorView2();
76 virtual void _ReservedSeparatorView3();
77 virtual void _ReservedSeparatorView4();
78 virtual void _ReservedSeparatorView5();
79 virtual void _ReservedSeparatorView6();
80 virtual void _ReservedSeparatorView7();
81 virtual void _ReservedSeparatorView8();
82 virtual void _ReservedSeparatorView9();
83 virtual void _ReservedSeparatorView10();
86 void _Init(const char* label
, BView
* labelView
,
87 orientation orientation
,
88 BAlignment alignment
, border_style border
);
90 float _BorderSize() const;
91 BRect
_MaxLabelBounds() const;
97 orientation fOrientation
;
98 BAlignment fAlignment
;
101 uint32 _reserved
[10];
104 #endif // _SEPARATOR_VIEW_H