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.
8 #ifndef _NOTIFICATION_VIEW_H
9 #define _NOTIFICATION_VIEW_H
21 const uint32 kRemoveView
= 'ReVi';
22 const float kExpandSize
= 8;
23 const float kPenSize
= 1;
26 class NotificationView
: public BView
{
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;
55 void _CalculateSize();
56 void _DrawCloseButton(const BRect
& updateRect
);
64 typedef std::list
<LineInfo
*> LineInfoList
;
66 BNotification
* fNotification
;
71 BMessageRunner
* fRunner
;
76 rgb_color fStripeColor
;
81 #endif // _NOTIFICATION_VIEW_H