de9dcd41f8
#1245. There are some TODOs outlined in the ticket, but they will be much easier to review as individual patches against trunk, versus as a new version of the huge patch. I've messed a lot with src/servers/notification/NotificationsView.cpp in order to resolve a crash I was getting when testing this thing (rewrote line wrapping). I've also replaced the icons with the one that zuMi did long ago. Thanks, plfiorini, for working on this code as much as you did! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36949 a95241bf-73f2-0310-859d-f6bbb57e9c96
55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
/*
|
|
* Copyright 2010, 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 NotificationReceived;
|
|
|
|
typedef std::map<BString, NotificationReceived*> notify_t;
|
|
|
|
class AppUsage : public BFlattenable {
|
|
public:
|
|
AppUsage();
|
|
AppUsage(entry_ref ref, const char* name,
|
|
bool allow = true);
|
|
~AppUsage();
|
|
|
|
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);
|
|
|
|
entry_ref Ref();
|
|
const char* Name();
|
|
bool Allowed(const char* title, notification_type type);
|
|
bool Allowed();
|
|
NotificationReceived* NotificationAt(int32 index);
|
|
int32 Notifications();
|
|
void AddNotification(NotificationReceived* notification);
|
|
|
|
private:
|
|
entry_ref fRef;
|
|
BString fName;
|
|
bool fAllow;
|
|
notify_t fNotifications;
|
|
};
|
|
|
|
#endif // _APP_USAGE_H
|