LayoutStyle.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <SharedGraphics/Color.h>
  3. #include <SharedGraphics/Size.h>
  4. struct Box {
  5. int top { 0 };
  6. int right { 0 };
  7. int bottom { 0 };
  8. int left { 0 };
  9. };
  10. enum FontStyle {
  11. Normal,
  12. Bold,
  13. };
  14. class LayoutStyle {
  15. public:
  16. LayoutStyle();
  17. ~LayoutStyle();
  18. Color text_color() const { return m_text_color; }
  19. Color background_color() const { return m_background_color; }
  20. Box& offset() { return m_offset; }
  21. Box& margin() { return m_margin; }
  22. Box& padding() { return m_padding; }
  23. const Box& offset() const { return m_offset; }
  24. const Box& margin() const { return m_margin; }
  25. const Box& padding() const { return m_padding; }
  26. FontStyle font_style() const { return m_font_style; }
  27. const Size& size() const { return m_size; }
  28. Size& size() { return m_size; }
  29. private:
  30. Color m_text_color;
  31. Color m_background_color;
  32. Box m_offset;
  33. Box m_margin;
  34. Box m_padding;
  35. Size m_size;
  36. FontStyle m_font_style { FontStyle::Normal };
  37. };