5#ifndef CORE_FXCRT_MASK_H_
6#define CORE_FXCRT_MASK_H_
17 using UnderlyingType =
typename std::underlying_type<E>::type;
22 constexpr Mask() =
default;
26 constexpr Mask(E val) : val_(
static_cast<UnderlyingType>(val)) {}
32 : val_(
static_cast<UnderlyingType>(v1) |
33 static_cast<UnderlyingType>(v2)) {}
35 constexpr Mask(E v1, E v2, E v3)
36 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
37 static_cast<UnderlyingType>(v3)) {}
39 constexpr Mask(E v1, E v2, E v3, E v4)
40 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
41 static_cast<UnderlyingType>(v3) |
42 static_cast<UnderlyingType>(v4)) {}
44 constexpr Mask(E v1, E v2, E v3, E v4, E v5)
45 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
46 static_cast<UnderlyingType>(v3) |
static_cast<UnderlyingType>(v4) |
47 static_cast<UnderlyingType>(v5)) {}
49 constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6)
50 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
51 static_cast<UnderlyingType>(v3) |
static_cast<UnderlyingType>(v4) |
52 static_cast<UnderlyingType>(v5) |
53 static_cast<UnderlyingType>(v6)) {}
55 constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6, E v7)
56 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
57 static_cast<UnderlyingType>(v3) |
static_cast<UnderlyingType>(v4) |
58 static_cast<UnderlyingType>(v5) |
static_cast<UnderlyingType>(v6) |
59 static_cast<UnderlyingType>(v7)) {}
61 constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6, E v7, E v8)
62 : val_(
static_cast<UnderlyingType>(v1) |
static_cast<UnderlyingType>(v2) |
63 static_cast<UnderlyingType>(v3) |
static_cast<UnderlyingType>(v4) |
64 static_cast<UnderlyingType>(v5) |
static_cast<UnderlyingType>(v6) |
65 static_cast<UnderlyingType>(v7) |
66 static_cast<UnderlyingType>(v8)) {}
68 explicit operator bool()
const {
return !!val_; }
71 return Mask(val_ | that.val_);
74 return Mask(val_ & that.val_);
77 return Mask(val_ ^ that.val_);
95 bool operator==(
const Mask& that)
const {
return val_ == that.val_; }
96 bool operator!=(
const Mask& that)
const {
return val_ != that.val_; }
99 return (val_ & that.val_) == that.val_;
109 explicit constexpr Mask(UnderlyingType val) : val_(val) {}
111 UnderlyingType val_ = 0;
CFX_CSSLength m_WordSpacing
CFX_CSSLength m_TextIndent
CFX_CSSFontStyle m_eFontStyle
CFX_CSSLength m_LetterSpacing
RetainPtr< CFX_CSSValueList > m_pFontFamily
CFX_CSSFontVariant m_eFontVariant
CFX_CSSTextAlign m_eTextAlign
CFX_CSSRect m_PaddingWidth
CFX_CSSRect m_MarginWidth
CFX_CSSVerticalAlign m_eVerticalAlignType
CFX_CSSRect m_BorderWidth
Mask< CFX_CSSTEXTDECORATION > m_dwTextDecoration
CFX_CSSDisplay m_eDisplay
InheritedData m_InheritedData
void SetTextAlign(CFX_CSSTextAlign eTextAlign)
void SetNumberVerticalAlign(float fAlign)
void SetMarginWidth(const CFX_CSSRect &rect)
void SetTextDecoration(Mask< CFX_CSSTEXTDECORATION > dwTextDecoration)
void SetTextIndent(const CFX_CSSLength &textIndent)
const CFX_CSSRect * GetBorderWidth() const
void SetPaddingWidth(const CFX_CSSRect &rect)
void SetFontWeight(uint16_t wFontWeight)
void SetFontVariant(CFX_CSSFontVariant eFontVariant)
void SetFontStyle(CFX_CSSFontStyle eFontStyle)
void SetColor(FX_ARGB dwFontColor)
void SetFontSize(float fFontSize)
const CFX_CSSLength & GetTextIndent() const
void AddCustomStyle(const CFX_CSSCustomProperty &prop)
NonInheritedData m_NonInheritedData
CFX_CSSVerticalAlign GetVerticalAlign() const
Mask< CFX_CSSTEXTDECORATION > GetTextDecoration() const
CFX_CSSFontStyle GetFontStyle() const
uint16_t GetFontWeight() const
CFX_CSSFontVariant GetFontVariant() const
float GetLineHeight() const
const CFX_CSSRect * GetMarginWidth() const
absl::optional< WideString > GetLastFontFamily() const
~CFX_CSSComputedStyle() override
const CFX_CSSLength & GetLetterSpacing() const
CFX_CSSTextAlign GetTextAlign() const
float GetFontSize() const
bool GetCustomStyle(const WideString &wsName, WideString *pValue) const
CFX_CSSDisplay GetDisplay() const
void SetLetterSpacing(const CFX_CSSLength &letterSpacing)
const CFX_CSSRect * GetPaddingWidth() const
float GetNumberVerticalAlign() const
void SetLineHeight(float fLineHeight)
CFX_CSSCustomProperty(const WideString &name, const WideString &value)
CFX_CSSCustomProperty(const CFX_CSSCustomProperty &prop)
CFX_CSSLength(CFX_CSSLengthUnit eUnit, float fValue)
CFX_CSSRect(CFX_CSSLengthUnit eUnit, float val)
constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6)
bool operator==(const Mask &that) const
constexpr Mask operator^(const Mask &that) const
constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6, E v7, E v8)
static Mask FromUnderlyingUnchecked(UnderlyingType val)
Mask & operator|=(const Mask &that)
constexpr Mask(E v1, E v2, E v3, E v4)
void Clear(const Mask &that)
constexpr Mask(E v1, E v2, E v3)
constexpr Mask operator|(const Mask &that) const
constexpr Mask(E v1, E v2)
Mask & operator&=(const Mask &that)
Mask & operator^=(const Mask &that)
bool operator!=(const Mask &that) const
constexpr Mask(const Mask &that)=default
Mask & operator=(const Mask &that)
UnderlyingType UncheckedValue() const
bool TestAll(const Mask &that) const
constexpr Mask(E v1, E v2, E v3, E v4, E v5, E v6, E v7)
constexpr Mask operator&(const Mask &that) const
constexpr Mask(E v1, E v2, E v3, E v4, E v5)
#define CONSTRUCT_VIA_MAKE_RETAIN