2 * Copyright 2006-2015, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
13 class BStatusBar
: public BView
{
15 BStatusBar(BRect frame
, const char* name
,
16 const char* label
= NULL
,
17 const char* trailingLabel
= NULL
);
18 BStatusBar(const char* name
,
19 const char* label
= NULL
,
20 const char* trailingLabel
= NULL
);
21 BStatusBar(BMessage
* archive
);
22 virtual ~BStatusBar();
24 static BArchivable
* Instantiate(BMessage
* archive
);
25 virtual status_t
Archive(BMessage
* archive
,
26 bool deep
= true) const;
28 virtual void AttachedToWindow();
29 virtual void DetachedFromWindow();
30 virtual void AllAttached();
31 virtual void AllDetached();
33 virtual void WindowActivated(bool state
);
34 virtual void MakeFocus(bool focus
= true);
36 virtual void GetPreferredSize(float* _width
,
38 virtual BSize
MinSize();
39 virtual BSize
MaxSize();
40 virtual BSize
PreferredSize();
41 virtual void ResizeToPreferred();
42 virtual void FrameMoved(BPoint newPosition
);
43 virtual void FrameResized(float newWidth
, float newHeight
);
45 virtual void Draw(BRect updateRect
);
47 virtual void MessageReceived(BMessage
* message
);
49 virtual void MouseDown(BPoint where
);
50 virtual void MouseUp(BPoint where
);
51 virtual void MouseMoved(BPoint where
, uint32 transit
,
52 const BMessage
* dragMessage
);
55 virtual void SetBarColor(rgb_color color
);
56 virtual void SetBarHeight(float height
);
58 virtual void SetText(const char* string
);
59 virtual void SetTrailingText(const char* string
);
60 virtual void SetMaxValue(float max
);
62 virtual void Update(float delta
, const char* text
= NULL
,
63 const char* trailingText
= NULL
);
64 virtual void Reset(const char* label
= NULL
,
65 const char* trailingLabel
= NULL
);
66 virtual void SetTo(float value
, const char* text
= NULL
,
67 const char* trailingText
= NULL
);
69 float CurrentValue() const;
70 float MaxValue() const;
71 rgb_color
BarColor() const;
72 float BarHeight() const;
74 const char* Text() const;
75 const char* TrailingText() const;
76 const char* Label() const;
77 const char* TrailingLabel() const;
79 virtual BHandler
* ResolveSpecifier(BMessage
* message
,
80 int32 index
, BMessage
* specifier
,
81 int32 what
, const char* property
);
82 virtual status_t
GetSupportedSuites(BMessage
* data
);
84 virtual status_t
Perform(perform_code d
, void* arg
);
88 virtual void _ReservedStatusBar2();
89 virtual void _ReservedStatusBar3();
90 virtual void _ReservedStatusBar4();
92 BStatusBar
& operator=(const BStatusBar
& other
);
95 void _SetTextData(BString
& text
, const char* string
,
96 const BString
& combineWith
,
98 BRect
_BarFrame(const font_height
* fontHeight
100 float _BarPosition(const BRect
& barFrame
) const;
101 bool _HasText() const;
104 BString fTrailingLabel
;
106 BString fTrailingText
;
112 bool fCustomBarHeight
;
113 uint32 fInternalFlags
;
118 #endif // _STATUS_BAR_H