summaryrefslogtreecommitdiff
path: root/src/gui_message.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@yahoo.com>2017-07-28 23:31:36 +0200
committerJoel Klinghed <the_jk@yahoo.com>2017-07-28 23:31:36 +0200
commit00bb1dc48e8b4f0e607adc1d60b456cac4fbd1e1 (patch)
tree7e52daf789195124ffaecd8972b51abc7c05221d /src/gui_message.hh
parent3eb752a7359f3714e603b36a77514d8f6fd4741c (diff)
Add GuiMessage, simple message dialog
Diffstat (limited to 'src/gui_message.hh')
-rw-r--r--src/gui_message.hh38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gui_message.hh b/src/gui_message.hh
new file mode 100644
index 0000000..c44cce1
--- /dev/null
+++ b/src/gui_message.hh
@@ -0,0 +1,38 @@
+// -*- mode: c++; c-basic-offset: 2; -*-
+
+#ifndef GUI_MESSAGE_HH
+#define GUI_MESSAGE_HH
+
+#include <string>
+#include <vector>
+
+#include "gui_window.hh"
+
+class GuiMessage : public GuiWindow {
+public:
+ class Listener : public GuiWindow::Listener {
+ public:
+ virtual ~Listener() {}
+
+ protected:
+ Listener() {}
+ };
+
+ enum Type {
+ ERROR,
+ OTHER,
+ };
+
+ static GuiMessage* create(Type type, std::string const& title,
+ std::string const& text);
+
+ virtual void add_listener(Listener* listener) = 0;
+ virtual void remove_listener(Listener* listener) = 0;
+
+ virtual void show(GuiWindow* parent) = 0;
+
+protected:
+ GuiMessage() {}
+};
+
+#endif // GUI_MESSAGE_HH