LineBox.h 558 B

12345678910111213141516171819202122
  1. #pragma once
  2. #include <AK/Vector.h>
  3. #include <LibHTML/Layout/LineBoxFragment.h>
  4. class LineBox {
  5. public:
  6. LineBox() {}
  7. float width() const { return m_width; }
  8. void add_fragment(const LayoutNode& layout_node, int start, int length, int width, int height);
  9. const Vector<LineBoxFragment>& fragments() const { return m_fragments; }
  10. Vector<LineBoxFragment>& fragments() { return m_fragments; }
  11. void trim_trailing_whitespace();
  12. private:
  13. friend class LayoutBlock;
  14. Vector<LineBoxFragment> m_fragments;
  15. float m_width { 0 };
  16. };