52 virtual void info(
const std::string& message,
float duration = 3.0f) = 0;
55 virtual void success(
const std::string& message,
float duration = 3.0f) = 0;
58 virtual void warning(
const std::string& message,
float duration = 5.0f) = 0;
61 virtual void error(
const std::string& message,
float duration = 5.0f) = 0;
88 static std::shared_ptr<INotificationService>
instance();
92 static void setInstance(std::shared_ptr<INotificationService> service);
95 static void info(
const std::string& message,
float duration = 3.0f);
96 static void success(
const std::string& message,
float duration = 3.0f);
97 static void warning(
const std::string& message,
float duration = 5.0f);
98 static void error(
const std::string& message,
float duration = 5.0f);
101 static std::shared_ptr<INotificationService> instance_;
107 static std::shared_ptr<INotificationService> snapshotInstance();
119 void info(
const std::string& ,
float )
override {}
120 void success(
const std::string& ,
float )
override {}
121 void warning(
const std::string& ,
float )
override {}
122 void error(
const std::string& ,
float )
override {}
virtual ~INotificationService()=default
virtual void error(const std::string &message, float duration=5.0f)=0
Show an error notification.
virtual void success(const std::string &message, float duration=3.0f)=0
Show a success notification.
virtual void show(const Notification ¬ification)=0
Show a notification with full control.
virtual void warning(const std::string &message, float duration=5.0f)=0
Show a warning notification.
virtual void clearAll()=0
Clear all notifications.
virtual void info(const std::string &message, float duration=3.0f)=0
Show an info notification.
static void setInstance(std::shared_ptr< INotificationService > service)
Set the notification service implementation UI layer calls this at startup with its implementation.
static void success(const std::string &message, float duration=3.0f)
static void error(const std::string &message, float duration=5.0f)
static std::shared_ptr< INotificationService > instance()
Get the current notification service instance.
static void warning(const std::string &message, float duration=5.0f)
static void info(const std::string &message, float duration=3.0f)
Convenience methods that safely handle null instance.
void show(const Notification &) override
Show a notification with full control.
void error(const std::string &, float) override
Show an error notification.
void success(const std::string &, float) override
Show a success notification.
void clearAll() override
Clear all notifications.
void info(const std::string &, float) override
Show an info notification.
void warning(const std::string &, float) override
Show a warning notification.
std::function< void()> onAction