haiku/headers/private/notification/AppUsage.h

48 lines
1.2 KiB
C
Raw Normal View History

/*
* Copyright 2010-2017, Haiku, Inc. All Rights Reserved.
* 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,
const char* signature,
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);
const char* AppName();
const char* Signature();
bool Allowed();
void SetAllowed(bool allow);
private:
BString fAppName;
BString fSignature;
bool fAllow;
};
#endif // _APP_USAGE_H