diff options
| author | crupest <crupest@outlook.com> | 2022-02-17 18:32:52 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-02-17 18:32:52 +0800 |
| commit | ada641977cd57a50fc862243ba256c58efc065b8 (patch) | |
| tree | 0f2124b88496f42e2cce2e3aaa64211131c18b37 /src/theme_builder/components/Editor.h | |
| parent | 9b3b13f78fffefb18f64aad88891d36009a8052e (diff) | |
| download | cru-ada641977cd57a50fc862243ba256c58efc065b8.tar.gz cru-ada641977cd57a50fc862243ba256c58efc065b8.tar.bz2 cru-ada641977cd57a50fc862243ba256c58efc065b8.zip | |
...
Diffstat (limited to 'src/theme_builder/components/Editor.h')
| -rw-r--r-- | src/theme_builder/components/Editor.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/theme_builder/components/Editor.h b/src/theme_builder/components/Editor.h new file mode 100644 index 00000000..29809c82 --- /dev/null +++ b/src/theme_builder/components/Editor.h @@ -0,0 +1,25 @@ +#pragma once +#include "cru/common/Event.h" +#include "cru/ui/components/Component.h" + +namespace cru::theme_builder::components { +class Editor : public ui::components::Component { + public: + Editor() = default; + ~Editor() override = default; + + public: + IEvent<std::nullptr_t>* ChangeEvent() { return &change_event_; } + + protected: + void RaiseChangeEvent(); + void SuppressNextChangeEvent(); + void ConnectChangeEvent(IEvent<std::nullptr_t>* event); + void ConnectChangeEvent(Editor* editor); + void ConnectChangeEvent(Editor& editor) { ConnectChangeEvent(&editor); } + + private: + bool suppress_next_change_event_ = false; + Event<std::nullptr_t> change_event_; +}; +} // namespace cru::theme_builder::components |
