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
73 lines
1.5 KiB
C++
73 lines
1.5 KiB
C++
/*
|
|
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _NOTIFICATION_H
|
|
#define _NOTIFICATION_H
|
|
|
|
#include <Entry.h>
|
|
|
|
// notification types
|
|
enum notification_type {
|
|
B_INFORMATION_NOTIFICATION,
|
|
B_IMPORTANT_NOTIFICATION,
|
|
B_ERROR_NOTIFICATION,
|
|
B_PROGRESS_NOTIFICATION
|
|
};
|
|
|
|
class BBitmap;
|
|
class BList;
|
|
|
|
class BNotification {
|
|
public:
|
|
BNotification(notification_type type);
|
|
~BNotification();
|
|
|
|
notification_type Type() const;
|
|
|
|
const char* Application() const;
|
|
void SetApplication(const char* app);
|
|
|
|
const char* Title() const;
|
|
void SetTitle(const char* title);
|
|
|
|
const char* Content() const;
|
|
void SetContent(const char* content);
|
|
|
|
const char* MessageID() const;
|
|
void SetMessageID(const char* id);
|
|
|
|
float Progress() const;
|
|
void SetProgress(float progress);
|
|
|
|
const char* OnClickApp() const;
|
|
void SetOnClickApp(const char* app);
|
|
|
|
entry_ref* OnClickFile() const;
|
|
void SetOnClickFile(const entry_ref* file);
|
|
|
|
BList* OnClickRefs() const;
|
|
void AddOnClickRef(const entry_ref* ref);
|
|
|
|
BList* OnClickArgv() const;
|
|
void AddOnClickArg(const char* arg);
|
|
|
|
BBitmap* Icon() const;
|
|
void SetIcon(BBitmap* icon);
|
|
|
|
private:
|
|
notification_type fType;
|
|
char* fAppName;
|
|
char* fTitle;
|
|
char* fContent;
|
|
char* fID;
|
|
float fProgress;
|
|
char* fApp;
|
|
entry_ref* fFile;
|
|
BList* fRefs;
|
|
BList* fArgv;
|
|
BBitmap* fBitmap;
|
|
};
|
|
|
|
#endif // _NOTIFICATION_H
|