1/*
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.
7 */
8#ifndef _APP_USAGE_H
9#define _APP_USAGE_H
10
11#include <map>
12
13#include <Entry.h>
14#include <Flattenable.h>
15#include <Notification.h>
16#include <Roster.h>
17#include <String.h>
18
19class BMessage;
20
21class AppUsage : public BFlattenable {
22public:
23										AppUsage();
24										AppUsage(const char* name,
25											const char* signature,
26											bool allow = true);
27
28	virtual	bool						AllowsTypeCode(type_code code) const;
29	virtual	status_t					Flatten(void* buffer, ssize_t numBytes) const;
30	virtual	ssize_t						FlattenedSize() const;
31	virtual	bool						IsFixedSize() const;
32	virtual	type_code					TypeCode() const;
33	virtual	status_t					Unflatten(type_code code, const void* buffer,
34											ssize_t numBytes);
35
36			const char*					AppName();
37			const char*					Signature();
38			bool						Allowed();
39			void						SetAllowed(bool allow);
40
41private:
42			BString						fAppName;
43			BString						fSignature;
44			bool						fAllow;
45};
46
47#endif	// _APP_USAGE_H
48