2022-03-02 23:59:19 +01:00
|
|
|
#pragma once
|
2019-03-02 16:06:33 +01:00
|
|
|
|
|
|
|
#include <string>
|
2021-12-31 14:59:39 +01:00
|
|
|
|
2021-12-31 00:57:06 +01:00
|
|
|
#include "history_actions.hpp"
|
2019-03-02 16:06:33 +01:00
|
|
|
|
2019-03-27 20:37:30 +01:00
|
|
|
/*
|
2021-12-31 14:59:39 +01:00
|
|
|
* The display function should call ImGui primitives to display arbitrary stuff
|
|
|
|
* in the notifications queue
|
2019-03-27 20:37:30 +01:00
|
|
|
*/
|
2019-03-02 16:06:33 +01:00
|
|
|
class Notification {
|
|
|
|
public:
|
|
|
|
virtual void display() const = 0;
|
|
|
|
|
|
|
|
virtual ~Notification() = default;
|
|
|
|
};
|
|
|
|
|
2019-03-27 20:37:30 +01:00
|
|
|
/*
|
|
|
|
* Displays the string given to the constructor
|
|
|
|
*/
|
2019-03-02 16:06:33 +01:00
|
|
|
class TextNotification : public Notification {
|
|
|
|
public:
|
2021-12-31 14:59:39 +01:00
|
|
|
explicit TextNotification(const std::string& message);
|
2019-03-02 16:06:33 +01:00
|
|
|
|
|
|
|
void display() const override;
|
|
|
|
|
|
|
|
const std::string message;
|
|
|
|
};
|
|
|
|
|
2019-03-27 20:37:30 +01:00
|
|
|
/*
|
2021-12-31 14:59:39 +01:00
|
|
|
* Displays "Undo" in orange followed by the message associated with the action
|
|
|
|
* passed to the constructor
|
2019-03-27 20:37:30 +01:00
|
|
|
*/
|
2019-03-02 16:06:33 +01:00
|
|
|
class UndoNotification : public Notification {
|
|
|
|
public:
|
2021-12-31 14:59:39 +01:00
|
|
|
explicit UndoNotification(const ActionWithMessage& awm) :
|
|
|
|
message(awm.getMessage()) {};
|
2019-03-02 16:06:33 +01:00
|
|
|
|
|
|
|
void display() const override;
|
|
|
|
|
|
|
|
const std::string message;
|
|
|
|
};
|
|
|
|
|
2019-03-27 20:37:30 +01:00
|
|
|
/*
|
2021-12-31 14:59:39 +01:00
|
|
|
* Displays "Redo" in blue followed by the message associated with the action
|
|
|
|
* passed to the constructor
|
2019-03-27 20:37:30 +01:00
|
|
|
*/
|
2021-12-31 14:59:39 +01:00
|
|
|
class RedoNotification : public Notification {
|
2019-03-02 16:06:33 +01:00
|
|
|
public:
|
2021-12-31 14:59:39 +01:00
|
|
|
explicit RedoNotification(const ActionWithMessage& awm) :
|
|
|
|
message(awm.getMessage()) {};
|
2019-03-02 16:06:33 +01:00
|
|
|
|
|
|
|
void display() const override;
|
|
|
|
|
|
|
|
const std::string message;
|
|
|
|
};
|