GMargins.h 1010 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. class GMargins {
  3. public:
  4. GMargins() { }
  5. GMargins(int left, int top, int right, int bottom)
  6. : m_left(left)
  7. , m_top(top)
  8. , m_right(right)
  9. , m_bottom(bottom)
  10. {
  11. }
  12. ~GMargins() { }
  13. bool is_null() const { return !m_left && !m_top && !m_right && !m_bottom; }
  14. int left() const { return m_left; }
  15. int top() const { return m_top; }
  16. int right() const { return m_right; }
  17. int bottom() const { return m_bottom; }
  18. void set_left(int value) { m_left = value; }
  19. void set_top(int value) { m_top = value; }
  20. void set_right(int value) { m_right = value; }
  21. void set_bottom(int value) { m_bottom = value; }
  22. bool operator==(const GMargins& other) const
  23. {
  24. return m_left == other.m_left
  25. && m_top == other.m_top
  26. && m_right == other.m_right
  27. && m_bottom == other.m_bottom;
  28. }
  29. private:
  30. int m_left { 0 };
  31. int m_top { 0 };
  32. int m_right { 0 };
  33. int m_bottom { 0 };
  34. };