BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / networkstatus / RadioView.h
blob3415ee70be961a17d9260d8f64a4432cf0269699
1 /*
2 * Copyright 2010, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef RADIO_VIEW_H
6 #define RADIO_VIEW_H
9 #include <View.h>
12 class BMessageRunner;
15 class RadioView : public BView {
16 public:
17 RadioView(BRect frame, const char* name,
18 int32 resizingMode);
19 virtual ~RadioView();
21 void SetPercent(int32 percent);
22 void SetMax(int32 max);
24 void StartPulsing();
25 void StopPulsing();
26 bool IsPulsing() const
27 { return fPulse != NULL; }
29 static void Draw(BView* view, BRect rect, int32 percent,
30 int32 count);
31 static int32 DefaultMax();
33 protected:
34 virtual void AttachedToWindow();
35 virtual void DetachedFromWindow();
37 virtual void MessageReceived(BMessage* message);
38 virtual void Draw(BRect updateRect);
39 virtual void FrameResized(float width, float height);
41 private:
42 void _RestartPulsing();
44 static void _Compute(const BRect& bounds, BPoint& center,
45 int32& count, int32 max, float& step);
46 static void _DrawBow(BView* view, int32 index,
47 const BPoint& center, int32 count,
48 float step);
49 static void _SetColor(BView* view, int32 percent,
50 int32 phase, int32 index, int32 count);
51 static bool _IsDisabled(int32 percent, int32 index,
52 int32 count);
54 private:
55 int32 fPercent;
56 BMessageRunner* fPulse;
57 int32 fPhase;
58 int32 fMax;
62 #endif // RADIO_VIEW_H