diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-06-15 23:20:00 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-22 22:08:54 +0200 |
| commit | cb17c3035bbd80bd8ea6718bae4c57cfb2555653 (patch) | |
| tree | f454181a2f58071f5f2ba4408e7e179838ed3fb4 /src/gui_form.hh | |
| parent | face8e0a7d5f530ee3e5e63ab1e3d6ecd497326b (diff) | |
Initial monitor GUI
Basic monitor functionality, GTK-3.0 and QT5 backends
Diffstat (limited to 'src/gui_form.hh')
| -rw-r--r-- | src/gui_form.hh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/gui_form.hh b/src/gui_form.hh new file mode 100644 index 0000000..95ec221 --- /dev/null +++ b/src/gui_form.hh @@ -0,0 +1,43 @@ +// -*- mode: c++; c-basic-offset: 2; -*- + +#ifndef GUI_FORM_HH +#define GUI_FORM_HH + +#include <string> + +#include "gui_window.hh" + +class GuiForm : public GuiWindow { +public: + class Listener : public GuiWindow::Listener { + public: + virtual ~Listener() {} + + virtual bool about_to_close(GuiForm* form); + + protected: + Listener() {} + }; + + static GuiForm* create(std::string const& title, std::string const& text); + + virtual void add_string(std::string const& id, std::string const& label, + std::string const& value) = 0; + virtual void add_number(std::string const& id, std::string const& label, + uint64_t value) = 0; + + virtual void add_listener(Listener* listener) = 0; + virtual void remove_listener(Listener* listener) = 0; + + virtual bool show(GuiWindow* parent) = 0; + + virtual void set_error(std::string const& error) = 0; + + virtual std::string get_string(std::string const& id) const = 0; + virtual uint64_t get_number(std::string const& id) const = 0; + +protected: + GuiForm() {} +}; + +#endif // GUI_FORM_HH |
