2 * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef _NOTIFICATION_H
6 #define _NOTIFICATION_H
9 #include <Archivable.h>
16 enum notification_type
{
17 B_INFORMATION_NOTIFICATION
,
18 B_IMPORTANT_NOTIFICATION
,
20 B_PROGRESS_NOTIFICATION
26 class BNotification
: public BArchivable
{
28 BNotification(notification_type type
);
29 BNotification(BMessage
* archive
);
30 virtual ~BNotification();
32 status_t
InitCheck() const;
34 static BArchivable
* Instantiate(BMessage
* archive
);
35 virtual status_t
Archive(BMessage
* archive
, bool deep
= true) const;
37 const char* SourceSignature() const;
38 const char* SourceName() const;
40 notification_type
Type() const;
42 const char* Group() const;
43 void SetGroup(const BString
& group
);
45 const char* Title() const;
46 void SetTitle(const BString
& title
);
48 const char* Content() const;
49 void SetContent(const BString
& content
);
51 const char* MessageID() const;
52 void SetMessageID(const BString
& id
);
54 float Progress() const;
55 void SetProgress(float progress
);
57 const char* OnClickApp() const;
58 void SetOnClickApp(const BString
& app
);
60 const entry_ref
* OnClickFile() const;
61 status_t
SetOnClickFile(const entry_ref
* file
);
63 status_t
AddOnClickRef(const entry_ref
* ref
);
64 int32
CountOnClickRefs() const;
65 const entry_ref
* OnClickRefAt(int32 index
) const;
67 status_t
AddOnClickArg(const BString
& arg
);
68 int32
CountOnClickArgs() const;
69 const char* OnClickArgAt(int32 index
) const;
71 const BBitmap
* Icon() const;
72 status_t
SetIcon(const BBitmap
* icon
);
74 status_t
Send(bigtime_t timeout
= -1);
77 virtual void _ReservedNotification1();
78 virtual void _ReservedNotification2();
79 virtual void _ReservedNotification3();
80 virtual void _ReservedNotification4();
81 virtual void _ReservedNotification5();
82 virtual void _ReservedNotification6();
83 virtual void _ReservedNotification7();
84 virtual void _ReservedNotification8();
88 BString fSourceSignature
;
90 notification_type fType
;
107 #endif // _NOTIFICATION_H