generic_element.h 493 B

123456789101112131415161718192021
  1. #pragma once
  2. #include <gui/gui.h>
  3. #include <gui/view.h>
  4. class GenericElement {
  5. public:
  6. GenericElement(){};
  7. virtual ~GenericElement(){};
  8. virtual void draw(Canvas* canvas) = 0;
  9. virtual bool input(InputEvent* event) = 0;
  10. // TODO that must be accessible only to ContainerVMData
  11. void set_parent_view(View* view);
  12. // TODO that must be accessible only to inheritors
  13. void lock_model();
  14. void unlock_model(bool need_redraw);
  15. private:
  16. View* view = nullptr;
  17. };