bin/pc: Mark non-returning function as void
[haiku.git] / src / servers / notification / NotificationView.h
blob41b7acb3e6169c4077a4f28593333b66146a2a3a
1 /*
2 * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3 * Copyright 2008-2009, Pier Luigi Fiorini. All Rights Reserved.
4 * Copyright 2004-2008, Michael Davidson. All Rights Reserved.
5 * Copyright 2004-2007, Mikael Eiman. All Rights Reserved.
6 * Distributed under the terms of the MIT License.
7 */
8 #ifndef _NOTIFICATION_VIEW_H
9 #define _NOTIFICATION_VIEW_H
11 #include <list>
13 #include <String.h>
14 #include <View.h>
17 class BBitmap;
18 class BMessageRunner;
19 class BNotification;
21 const uint32 kRemoveView = 'ReVi';
22 const float kExpandSize = 8;
23 const float kPenSize = 1;
26 class NotificationView : public BView {
27 public:
28 NotificationView(BNotification* notification,
29 bigtime_t timeout, float iconSize,
30 bool disableTimeout = false);
31 virtual ~NotificationView();
33 virtual void AttachedToWindow();
34 virtual void MessageReceived(BMessage* message);
35 virtual void Draw(BRect updateRect);
36 virtual void MouseDown(BPoint point);
39 virtual BSize MinSize();
40 virtual BSize MaxSize();
41 virtual BSize PreferredSize();
44 virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
45 BMessage* specifier, int32 form,
46 const char* property);
47 virtual status_t GetSupportedSuites(BMessage* msg);
49 void SetText(float newMaxWidth = -1);
50 void SetPreviewModeOn(bool enabled);
52 const char* MessageID() const;
54 private:
55 void _CalculateSize();
56 void _DrawCloseButton(const BRect& updateRect);
58 struct LineInfo {
59 BFont font;
60 BString text;
61 BPoint location;
64 typedef std::list<LineInfo*> LineInfoList;
66 BNotification* fNotification;
67 bigtime_t fTimeout;
68 float fIconSize;
69 bool fDisableTimeout;
71 BMessageRunner* fRunner;
73 BBitmap* fBitmap;
74 LineInfoList fLines;
75 float fHeight;
76 rgb_color fStripeColor;
77 bool fCloseClicked;
78 bool fPreviewModeOn;
81 #endif // _NOTIFICATION_VIEW_H