vfs: check userland buffers before reading them.
[haiku.git] / headers / private / notification / NotificationReceived.h
blob9d8a88ff5142a81a52a053fe529d9bb879a95090
1 /*
2 * Copyright 2010, 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 _NOTIFICATION_RECEIVED_H
9 #define _NOTIFICATION_RECEIVED_H
11 #include <Flattenable.h>
12 #include <Roster.h>
13 #include <String.h>
15 class NotificationReceived : public BFlattenable {
16 public:
17 NotificationReceived();
18 NotificationReceived(const char* title, notification_type type,
19 bool enabled = true);
20 ~NotificationReceived();
22 virtual bool AllowsTypeCode(type_code code) const;
23 virtual status_t Flatten(void *buffer, ssize_t numBytes) const;
24 virtual ssize_t FlattenedSize() const;
25 virtual bool IsFixedSize() const;
26 virtual type_code TypeCode() const;
27 virtual status_t Unflatten(type_code code, const void *buffer,
28 ssize_t numBytes);
30 const char* Title();
31 notification_type Type();
32 void SetType(notification_type type);
33 time_t LastReceived();
34 bool Allowed();
36 void SetTimeStamp(time_t time);
37 void UpdateTimeStamp();
39 private:
40 BString fTitle;
41 notification_type fType;
42 bool fEnabled;
43 time_t fLastReceived;
46 #endif // _NOTIFICATION_RECEIVED_H