1/*
2 * Copyright 2010, 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_RECEIVED_H
9#define _NOTIFICATION_RECEIVED_H
10
11#include <Flattenable.h>
12#include <Roster.h>
13#include <String.h>
14
15class NotificationReceived : public BFlattenable {
16public:
17								NotificationReceived();
18								NotificationReceived(const char* title, notification_type type,
19									bool enabled = true);
20								~NotificationReceived();
21
22	virtual	bool				AllowsTypeCode(type_code code) const;
23	virtual	status_t			Flatten(void *buffer, ssize_t numBytes) const;
24	virtual	ssize_t				FlattenedSize() const;
25	virtual	bool				IsFixedSize() const;
26	virtual	type_code			TypeCode() const;
27	virtual	status_t			Unflatten(type_code code, const void *buffer,
28								ssize_t numBytes);
29
30			const char*			Title();
31			notification_type	Type();
32			void				SetType(notification_type type);
33			time_t				LastReceived();
34			bool				Allowed();
35
36			void				SetTimeStamp(time_t time);
37			void				UpdateTimeStamp();
38
39private:
40			BString				fTitle;
41			notification_type	fType;
42			bool				fEnabled;
43			time_t				fLastReceived;
44};
45
46#endif	// _NOTIFICATION_RECEIVED_H
47