summaryrefslogtreecommitdiff
path: root/src/gui_message.hh
blob: c44cce1f92eb5fd617ddf5111bdf5555f671f3db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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