mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
9f54ea9bcd
This patch adds NotificationServer, which runs as the "notify" user and provides an IPC API for desktop notifications. LibGUI gains the GUI::Notification class for showing notifications. NotificationServer is spawned on demand and will unspawn after dimissing all visible notifications. :^) Finally, this also comes with a small /bin/notify utility.
28 lines
494 B
C++
28 lines
494 B
C++
#pragma once
|
|
|
|
#include <LibCore/Object.h>
|
|
|
|
namespace GUI {
|
|
|
|
class Notification : public Core::Object {
|
|
C_OBJECT(Notification);
|
|
|
|
public:
|
|
virtual ~Notification() override;
|
|
|
|
const String& text() const { return m_text; }
|
|
void set_text(const String& text) { m_text = text; }
|
|
|
|
const String& title() const { return m_title; }
|
|
void set_title(const String& title) { m_title = title; }
|
|
|
|
void show();
|
|
|
|
private:
|
|
Notification();
|
|
|
|
String m_title;
|
|
String m_text;
|
|
};
|
|
|
|
}
|