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
47 lines
1.3 KiB
C++
47 lines
1.3 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 _NOTIFICATION_RECEIVED_H
|
|
#define _NOTIFICATION_RECEIVED_H
|
|
|
|
#include <Flattenable.h>
|
|
#include <Roster.h>
|
|
#include <String.h>
|
|
|
|
class NotificationReceived : public BFlattenable {
|
|
public:
|
|
NotificationReceived();
|
|
NotificationReceived(const char* title, notification_type type,
|
|
bool enabled = true);
|
|
~NotificationReceived();
|
|
|
|
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* Title();
|
|
notification_type Type();
|
|
void SetType(notification_type type);
|
|
time_t LastReceived();
|
|
bool Allowed();
|
|
|
|
void SetTimeStamp(time_t time);
|
|
void UpdateTimeStamp();
|
|
|
|
private:
|
|
BString fTitle;
|
|
notification_type fType;
|
|
bool fEnabled;
|
|
time_t fLastReceived;
|
|
};
|
|
|
|
#endif // _NOTIFICATION_RECEIVED_H
|