interface.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef INTERFACE_HPP
  2. #define INTERFACE_HPP
  3. #include "simple.hpp"
  4. template <typename Offset>
  5. class i_movable
  6. {
  7. protected:
  8. ~i_movable() = default;
  9. public:
  10. virtual i_movable& operator+=(const Offset&) = 0;
  11. };
  12. template <typename Bound>
  13. class i_bounds
  14. {
  15. protected:
  16. ~i_bounds() = default;
  17. public:
  18. virtual Bound lower() const = 0;
  19. virtual Bound upper() const = 0;
  20. };
  21. template <typename T>
  22. class i_movable_bounds : public i_bounds<T>, public i_movable<T>
  23. {
  24. protected:
  25. ~i_movable_bounds() = default;
  26. };
  27. class i_graphic
  28. {
  29. protected:
  30. ~i_graphic() = default;
  31. public:
  32. virtual void draw(const graphical::surface&) = 0;
  33. };
  34. class i_interactive
  35. {
  36. protected:
  37. ~i_interactive() = default;
  38. public:
  39. virtual void update(const interactive::event&) = 0;
  40. };
  41. class i_focusable
  42. {
  43. protected:
  44. ~i_focusable() = default;
  45. public:
  46. virtual void focus(bool) = 0;
  47. virtual bool focus() const = 0;
  48. };
  49. class i_interactive_focusable : public i_interactive, public i_focusable
  50. {
  51. protected:
  52. ~i_interactive_focusable() = default;
  53. };
  54. class i_ui_object
  55. {
  56. public:
  57. virtual ~i_ui_object() = default;
  58. };
  59. #endif /* end of include guard */