2010-05-27 18:48:27 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2010, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _NOTIFICATION_H
|
|
|
|
#define _NOTIFICATION_H
|
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
|
2010-05-27 18:48:27 +04:00
|
|
|
#include <Entry.h>
|
2010-05-27 21:50:12 +04:00
|
|
|
#include <List.h>
|
|
|
|
#include <String.h>
|
2010-05-27 19:53:35 +04:00
|
|
|
|
|
|
|
|
2010-05-27 18:48:27 +04:00
|
|
|
// notification types
|
|
|
|
enum notification_type {
|
|
|
|
B_INFORMATION_NOTIFICATION,
|
|
|
|
B_IMPORTANT_NOTIFICATION,
|
|
|
|
B_ERROR_NOTIFICATION,
|
|
|
|
B_PROGRESS_NOTIFICATION
|
|
|
|
};
|
|
|
|
|
2010-05-27 21:50:12 +04:00
|
|
|
class BBitmap;
|
|
|
|
|
2010-05-27 18:48:27 +04:00
|
|
|
|
|
|
|
class BNotification {
|
|
|
|
public:
|
2010-05-27 19:53:35 +04:00
|
|
|
BNotification(notification_type type);
|
|
|
|
~BNotification();
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
notification_type Type() const;
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
const char* Application() const;
|
2010-05-28 01:13:11 +04:00
|
|
|
void SetApplication(const BString& app);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
const char* Title() const;
|
2010-05-28 01:13:11 +04:00
|
|
|
void SetTitle(const BString& title);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
const char* Content() const;
|
2010-05-28 01:13:11 +04:00
|
|
|
void SetContent(const BString& content);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
const char* MessageID() const;
|
2010-05-28 01:13:11 +04:00
|
|
|
void SetMessageID(const BString& id);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
float Progress() const;
|
|
|
|
void SetProgress(float progress);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
const char* OnClickApp() const;
|
2010-05-28 01:13:11 +04:00
|
|
|
void SetOnClickApp(const BString& app);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 21:50:12 +04:00
|
|
|
const entry_ref* OnClickFile() const;
|
|
|
|
status_t SetOnClickFile(const entry_ref* file);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 21:50:12 +04:00
|
|
|
status_t AddOnClickRef(const entry_ref* ref);
|
|
|
|
int32 CountOnClickRefs() const;
|
|
|
|
const entry_ref* OnClickRefAt(int32 index) const;
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-28 01:13:11 +04:00
|
|
|
status_t AddOnClickArg(const BString& arg);
|
2010-05-27 21:50:12 +04:00
|
|
|
int32 CountOnClickArgs() const;
|
|
|
|
const char* OnClickArgAt(int32 index) const;
|
2010-05-27 18:48:27 +04:00
|
|
|
|
2010-05-27 21:50:12 +04:00
|
|
|
const BBitmap* Icon() const;
|
|
|
|
status_t SetIcon(const BBitmap* icon);
|
2010-05-27 18:48:27 +04:00
|
|
|
|
|
|
|
private:
|
2010-05-27 19:53:35 +04:00
|
|
|
notification_type fType;
|
2010-05-27 21:50:12 +04:00
|
|
|
BString fAppName;
|
|
|
|
BString fTitle;
|
|
|
|
BString fContent;
|
|
|
|
BString fID;
|
2010-05-27 19:53:35 +04:00
|
|
|
float fProgress;
|
2010-05-27 21:50:12 +04:00
|
|
|
|
|
|
|
BString fApp;
|
2010-05-27 19:53:35 +04:00
|
|
|
entry_ref* fFile;
|
2010-05-27 21:50:12 +04:00
|
|
|
BList fRefs;
|
|
|
|
BList fArgv;
|
2010-05-27 19:53:35 +04:00
|
|
|
BBitmap* fBitmap;
|
2010-05-27 18:48:27 +04:00
|
|
|
};
|
|
|
|
|
2010-05-27 19:53:35 +04:00
|
|
|
|
2010-05-27 18:48:27 +04:00
|
|
|
#endif // _NOTIFICATION_H
|