ListItemMarkerBox.h 933 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
  3. * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/Layout/Box.h>
  9. namespace Web::Layout {
  10. class ListItemMarkerBox final : public Box {
  11. public:
  12. explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr<CSS::StyleProperties>);
  13. virtual ~ListItemMarkerBox() override;
  14. Gfx::Bitmap const* list_style_image_bitmap() const;
  15. String const& text() const { return m_text; }
  16. virtual RefPtr<Painting::Paintable> create_paintable() const override;
  17. CSS::ListStyleType list_style_type() const { return m_list_style_type; }
  18. private:
  19. virtual bool can_have_children() const override { return false; }
  20. CSS::ListStyleType m_list_style_type { CSS::ListStyleType::None };
  21. size_t m_index;
  22. String m_text {};
  23. };
  24. }