2020-01-18 09:38:21 +01:00
/*
2024-10-04 13:19:50 +02:00
* Copyright ( c ) 2018 - 2020 , Andreas Kling < andreas @ ladybird . org >
2020-01-18 09:38:21 +01:00
*
2021-04-22 01:24:48 -07:00
* SPDX - License - Identifier : BSD - 2 - Clause
2020-01-18 09:38:21 +01:00
*/
2019-07-01 17:17:32 +02:00
# pragma once
2023-03-30 17:13:37 +01:00
# include <LibWeb/CSS/PercentageOr.h>
2019-07-01 17:17:32 +02:00
2020-07-26 20:01:35 +02:00
namespace Web : : CSS {
2020-03-07 10:27:02 +01:00
2022-09-13 17:42:39 +02:00
class LengthBox {
public :
LengthBox ( ) ;
LengthBox ( LengthPercentage top , LengthPercentage right , LengthPercentage bottom , LengthPercentage left ) ;
~ LengthBox ( ) ;
2025-04-15 15:18:27 -06:00
// Length (and thus LengthPercentage) includes a RefPtr<CalculatedStyleValue const> member, but we can't include the header CSSStyleValue.h as it includes
2022-09-13 17:42:39 +02:00
// this file already. To break the cyclic dependency, we must initialize these members in the constructor.
LengthPercentage & top ( ) { return m_top ; }
LengthPercentage & right ( ) { return m_right ; }
LengthPercentage & bottom ( ) { return m_bottom ; }
2023-07-07 22:48:11 -04:00
LengthPercentage & left ( ) { return m_left ; }
2022-09-13 17:42:39 +02:00
LengthPercentage const & top ( ) const { return m_top ; }
LengthPercentage const & right ( ) const { return m_right ; }
LengthPercentage const & bottom ( ) const { return m_bottom ; }
2023-07-07 22:48:11 -04:00
LengthPercentage const & left ( ) const { return m_left ; }
2022-09-13 17:42:39 +02:00
2024-10-27 11:58:52 +11:00
bool operator = = ( LengthBox const & ) const = default ;
2022-09-13 17:42:39 +02:00
private :
LengthPercentage m_top ;
LengthPercentage m_right ;
LengthPercentage m_bottom ;
LengthPercentage m_left ;
2019-07-01 17:17:32 +02:00
} ;
2020-03-07 10:27:02 +01:00
}