1de9dcd41SStephan Aßmus/*
26aa05872SBrian Hill * Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
3de9dcd41SStephan Aßmus * Distributed under the terms of the MIT License.
4de9dcd41SStephan Aßmus */
5de9dcd41SStephan Aßmus#ifndef _NOTIFICATION_H
6de9dcd41SStephan Aßmus#define _NOTIFICATION_H
7de9dcd41SStephan Aßmus
80cf96104SAxel Dörfler
94ec6c3a0SAdrien Destugues#include <Archivable.h>
10de9dcd41SStephan Aßmus#include <Entry.h>
11f33637d9SStephan Aßmus#include <List.h>
12f33637d9SStephan Aßmus#include <String.h>
130cf96104SAxel Dörfler
140cf96104SAxel Dörfler
15de9dcd41SStephan Aßmus// notification types
16de9dcd41SStephan Aßmusenum notification_type {
17de9dcd41SStephan Aßmus	B_INFORMATION_NOTIFICATION,
18de9dcd41SStephan Aßmus	B_IMPORTANT_NOTIFICATION,
19de9dcd41SStephan Aßmus	B_ERROR_NOTIFICATION,
20de9dcd41SStephan Aßmus	B_PROGRESS_NOTIFICATION
21de9dcd41SStephan Aßmus};
22de9dcd41SStephan Aßmus
23f33637d9SStephan Aßmusclass BBitmap;
24f33637d9SStephan Aßmus
25de9dcd41SStephan Aßmus
264ec6c3a0SAdrien Destuguesclass BNotification : public BArchivable {
27de9dcd41SStephan Aßmuspublic:
280cf96104SAxel Dörfler								BNotification(notification_type type);
294ec6c3a0SAdrien Destugues								BNotification(BMessage* archive);
304ec6c3a0SAdrien Destugues	virtual						~BNotification();
314ec6c3a0SAdrien Destugues
324ec6c3a0SAdrien Destugues			status_t			InitCheck() const;
334ec6c3a0SAdrien Destugues
344ec6c3a0SAdrien Destugues	static	BArchivable*		Instantiate(BMessage* archive);
354ec6c3a0SAdrien Destugues	virtual	status_t			Archive(BMessage* archive, bool deep = true) const;
36de9dcd41SStephan Aßmus
376aa05872SBrian Hill			const char*			SourceSignature() const;
386aa05872SBrian Hill			const char*			SourceName() const;
396aa05872SBrian Hill
400cf96104SAxel Dörfler			notification_type	Type() const;
41de9dcd41SStephan Aßmus
424ec6c3a0SAdrien Destugues			const char*			Group() const;
434ec6c3a0SAdrien Destugues			void				SetGroup(const BString& group);
44de9dcd41SStephan Aßmus
450cf96104SAxel Dörfler			const char*			Title() const;
46908967a1SStephan Aßmus			void				SetTitle(const BString& title);
47de9dcd41SStephan Aßmus
480cf96104SAxel Dörfler			const char*			Content() const;
49908967a1SStephan Aßmus			void				SetContent(const BString& content);
50de9dcd41SStephan Aßmus
510cf96104SAxel Dörfler			const char*			MessageID() const;
52908967a1SStephan Aßmus			void				SetMessageID(const BString& id);
53de9dcd41SStephan Aßmus
540cf96104SAxel Dörfler			float				Progress() const;
550cf96104SAxel Dörfler			void				SetProgress(float progress);
56de9dcd41SStephan Aßmus
570cf96104SAxel Dörfler			const char*			OnClickApp() const;
58908967a1SStephan Aßmus			void				SetOnClickApp(const BString& app);
59de9dcd41SStephan Aßmus
60f33637d9SStephan Aßmus			const entry_ref*	OnClickFile() const;
61f33637d9SStephan Aßmus			status_t			SetOnClickFile(const entry_ref* file);
62de9dcd41SStephan Aßmus
63f33637d9SStephan Aßmus			status_t			AddOnClickRef(const entry_ref* ref);
64f33637d9SStephan Aßmus			int32				CountOnClickRefs() const;
65f33637d9SStephan Aßmus			const entry_ref*	OnClickRefAt(int32 index) const;
66de9dcd41SStephan Aßmus
67908967a1SStephan Aßmus			status_t			AddOnClickArg(const BString& arg);
68f33637d9SStephan Aßmus			int32				CountOnClickArgs() const;
69f33637d9SStephan Aßmus			const char*			OnClickArgAt(int32 index) const;
70de9dcd41SStephan Aßmus
71f33637d9SStephan Aßmus			const BBitmap*		Icon() const;
72f33637d9SStephan Aßmus			status_t			SetIcon(const BBitmap* icon);
73de9dcd41SStephan Aßmus
744ec6c3a0SAdrien Destugues			status_t			Send(bigtime_t timeout = -1);
754ec6c3a0SAdrien Destugues
76de9dcd41SStephan Aßmusprivate:
778856b518SBrian Hill	virtual	void _ReservedNotification1();
788856b518SBrian Hill	virtual	void _ReservedNotification2();
798856b518SBrian Hill	virtual	void _ReservedNotification3();
808856b518SBrian Hill	virtual	void _ReservedNotification4();
818856b518SBrian Hill	virtual	void _ReservedNotification5();
828856b518SBrian Hill	virtual	void _ReservedNotification6();
838856b518SBrian Hill	virtual	void _ReservedNotification7();
848856b518SBrian Hill	virtual	void _ReservedNotification8();
858856b518SBrian Hill
864ec6c3a0SAdrien Destugues			status_t			fInitStatus;
874ec6c3a0SAdrien Destugues
886aa05872SBrian Hill			BString				fSourceSignature;
896aa05872SBrian Hill			BString				fSourceName;
900cf96104SAxel Dörfler			notification_type	fType;
914ec6c3a0SAdrien Destugues			BString				fGroup;
92f33637d9SStephan Aßmus			BString				fTitle;
93f33637d9SStephan Aßmus			BString				fContent;
94f33637d9SStephan Aßmus			BString				fID;
950cf96104SAxel Dörfler			float				fProgress;
96f33637d9SStephan Aßmus
97f33637d9SStephan Aßmus			BString				fApp;
980cf96104SAxel Dörfler			entry_ref*			fFile;
99f33637d9SStephan Aßmus			BList				fRefs;
100f33637d9SStephan Aßmus			BList				fArgv;
1010cf96104SAxel Dörfler			BBitmap*			fBitmap;
1028856b518SBrian Hill
1038856b518SBrian Hill			uint32				_reserved[8];
104de9dcd41SStephan Aßmus};
105de9dcd41SStephan Aßmus
1060cf96104SAxel Dörfler
107de9dcd41SStephan Aßmus#endif	// _NOTIFICATION_H
108