2011-11-03 16:49:18 +04:00
|
|
|
/*
|
2017-09-23 18:40:04 +03:00
|
|
|
* Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
|
2011-11-03 16:49:18 +04:00
|
|
|
* Copyright 2008-2009, Pier Luigi Fiorini. All Rights Reserved.
|
|
|
|
* Copyright 2004-2008, Michael Davidson. All Rights Reserved.
|
|
|
|
* Copyright 2004-2007, Mikael Eiman. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _APP_USAGE_H
|
|
|
|
#define _APP_USAGE_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <Entry.h>
|
|
|
|
#include <Flattenable.h>
|
|
|
|
#include <Notification.h>
|
|
|
|
#include <Roster.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
class BMessage;
|
|
|
|
|
|
|
|
class AppUsage : public BFlattenable {
|
|
|
|
public:
|
|
|
|
AppUsage();
|
|
|
|
AppUsage(const char* name,
|
2017-09-23 18:40:04 +03:00
|
|
|
const char* signature,
|
2011-11-03 16:49:18 +04:00
|
|
|
bool allow = true);
|
|
|
|
|
|
|
|
virtual bool AllowsTypeCode(type_code code) const;
|
|
|
|
virtual status_t Flatten(void* buffer, ssize_t numBytes) const;
|
|
|
|
virtual ssize_t FlattenedSize() const;
|
|
|
|
virtual bool IsFixedSize() const;
|
|
|
|
virtual type_code TypeCode() const;
|
|
|
|
virtual status_t Unflatten(type_code code, const void* buffer,
|
|
|
|
ssize_t numBytes);
|
|
|
|
|
2017-09-23 18:40:04 +03:00
|
|
|
const char* AppName();
|
|
|
|
const char* Signature();
|
2011-11-03 16:49:18 +04:00
|
|
|
bool Allowed();
|
2017-09-23 18:40:04 +03:00
|
|
|
void SetAllowed(bool allow);
|
2011-11-03 16:49:18 +04:00
|
|
|
|
|
|
|
private:
|
2017-09-23 18:40:04 +03:00
|
|
|
BString fAppName;
|
|
|
|
BString fSignature;
|
2011-11-03 16:49:18 +04:00
|
|
|
bool fAllow;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _APP_USAGE_H
|