Merge patch by plfiorini :
Some changes to the API for notifications. * Don't go through be_roster to send a notification, but use Notification->Send() instead. * Rename App to Group to make the purpose clearer And some changes to the notification code itself: * Use the Notification class as the way to convey informations about a notification. Allows easier extension of this class * Code cleanup * Use of the layout kit for the notify window Unfortunately, the latter part clashes quite a bit with the changes I already did to the notification window, so it's now quite broken. Working on that next, but I wanted to separate that work from the patch ... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43114 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#define _NOTIFICATION_H
|
||||
|
||||
|
||||
#include <Archivable.h>
|
||||
#include <Entry.h>
|
||||
#include <List.h>
|
||||
#include <String.h>
|
||||
@@ -22,15 +23,21 @@ enum notification_type {
|
||||
class BBitmap;
|
||||
|
||||
|
||||
class BNotification {
|
||||
class BNotification : public BArchivable {
|
||||
public:
|
||||
BNotification(notification_type type);
|
||||
~BNotification();
|
||||
BNotification(BMessage* archive);
|
||||
virtual ~BNotification();
|
||||
|
||||
status_t InitCheck() const;
|
||||
|
||||
static BArchivable* Instantiate(BMessage* archive);
|
||||
virtual status_t Archive(BMessage* archive, bool deep = true) const;
|
||||
|
||||
notification_type Type() const;
|
||||
|
||||
const char* Application() const;
|
||||
void SetApplication(const BString& app);
|
||||
const char* Group() const;
|
||||
void SetGroup(const BString& group);
|
||||
|
||||
const char* Title() const;
|
||||
void SetTitle(const BString& title);
|
||||
@@ -61,9 +68,13 @@ public:
|
||||
const BBitmap* Icon() const;
|
||||
status_t SetIcon(const BBitmap* icon);
|
||||
|
||||
status_t Send(bigtime_t timeout = -1);
|
||||
|
||||
private:
|
||||
status_t fInitStatus;
|
||||
|
||||
notification_type fType;
|
||||
BString fAppName;
|
||||
BString fGroup;
|
||||
BString fTitle;
|
||||
BString fContent;
|
||||
BString fID;
|
||||
|
||||
Reference in New Issue
Block a user