btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / notification / AppUsage.h
blob53b419ce8338a65a80c21444440d37dbbf6012ed
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
11 #include <map>
13 #include <Entry.h>
14 #include <Flattenable.h>
15 #include <Notification.h>
16 #include <Roster.h>
17 #include <String.h>
19 class BMessage;
21 class AppUsage : public BFlattenable {
22 public:
23 AppUsage();
24 AppUsage(const char* name,
25 const char* signature,
26 bool allow = true);
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);
36 const char* AppName();
37 const char* Signature();
38 bool Allowed();
39 void SetAllowed(bool allow);
41 private:
42 BString fAppName;
43 BString fSignature;
44 bool fAllow;
47 #endif // _APP_USAGE_H