Clip.h 581 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2022, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/CSS/EdgeRect.h>
  8. namespace Web::CSS {
  9. class Clip {
  10. public:
  11. enum class Type {
  12. Auto,
  13. Rect
  14. };
  15. Clip(Type type, EdgeRect edge_rect);
  16. Clip(EdgeRect edge_rect);
  17. static Clip make_auto();
  18. bool is_auto() const { return m_type == Type::Auto; }
  19. bool is_rect() const { return m_type == Type::Rect; }
  20. EdgeRect to_rect() const { return m_edge_rect; }
  21. private:
  22. Type m_type;
  23. EdgeRect m_edge_rect;
  24. };
  25. }