Fix FreeBSD build.
[haiku.git] / headers / os / app / Notification.h
blob4a602d714191ccbf23b0faab750aff0e1e99ab5a
1 /*
2 * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _NOTIFICATION_H
6 #define _NOTIFICATION_H
9 #include <Archivable.h>
10 #include <Entry.h>
11 #include <List.h>
12 #include <String.h>
15 // notification types
16 enum notification_type {
17 B_INFORMATION_NOTIFICATION,
18 B_IMPORTANT_NOTIFICATION,
19 B_ERROR_NOTIFICATION,
20 B_PROGRESS_NOTIFICATION
23 class BBitmap;
26 class BNotification : public BArchivable {
27 public:
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);
76 private:
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();
86 status_t fInitStatus;
88 BString fSourceSignature;
89 BString fSourceName;
90 notification_type fType;
91 BString fGroup;
92 BString fTitle;
93 BString fContent;
94 BString fID;
95 float fProgress;
97 BString fApp;
98 entry_ref* fFile;
99 BList fRefs;
100 BList fArgv;
101 BBitmap* fBitmap;
103 uint32 _reserved[8];
107 #endif // _NOTIFICATION_H