Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_css.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FXCRT_CSS_CFX_CSS_H_
8#define CORE_FXCRT_CSS_CFX_CSS_H_
9
10#include <stdint.h>
11
12#include <type_traits>
13
18 // Note the values below this comment must be > 0x0F so we can mask the above.
23};
24using CFX_CSSValueTypeMask = std::underlying_type<CFX_CSSVALUETYPE>::type;
25
26#undef CSS_PROP____
27#define CSS_PROP____(a, b, c, d) a,
29#include "core/fxcrt/css/properties.inc"
30};
31#undef CSS_PROP____
32
33#undef CSS_PROP_VALUE____
34#define CSS_PROP_VALUE____(a, b, c) a,
36#include "core/fxcrt/css/property_values.inc"
37};
38#undef CSS_PROP_VALUE____
39
41 Auto,
42 None,
43 Normal,
44 Point,
45 Percent,
46};
47
48enum class CFX_CSSDisplay : uint8_t {
49 None,
51 Block,
52 Inline,
55};
56
58 Normal,
59 Italic,
60};
61
63 Left,
64 Right,
65 Center,
66 Justify,
68};
69
72 Sub,
73 Super,
74 Top,
75 TextTop,
76 Middle,
77 Bottom,
79 Number,
80};
81
83 Normal,
85};
86
88 kNone = 0,
89 kUnderline = 1 << 0,
90 kOverline = 1 << 1,
91 kLineThrough = 1 << 2,
92 kBlink = 1 << 3,
93 kDouble = 1 << 4,
94};
95
97 public:
98 CFX_CSSLength() = default;
99
100 CFX_CSSLength(CFX_CSSLengthUnit eUnit, float fValue)
101 : m_unit(eUnit), m_fValue(fValue) {}
102
104 m_unit = eUnit;
105 return *this;
106 }
107
108 CFX_CSSLength& Set(CFX_CSSLengthUnit eUnit, float fValue) {
109 m_unit = eUnit;
110 m_fValue = fValue;
111 return *this;
112 }
113
114 CFX_CSSLengthUnit GetUnit() const { return m_unit; }
115
116 float GetValue() const { return m_fValue; }
117 bool NonZero() const { return static_cast<int>(m_fValue) != 0; }
118
119 private:
120 CFX_CSSLengthUnit m_unit;
121 float m_fValue;
122};
123
125 public:
126 CFX_CSSRect() = default;
127
129 : left(eUnit, val),
130 top(eUnit, val),
131 right(eUnit, val),
132 bottom(eUnit, val) {}
133
135 left.Set(eUnit);
136 top.Set(eUnit);
137 right.Set(eUnit);
138 bottom.Set(eUnit);
139 return *this;
140 }
141 CFX_CSSRect& Set(CFX_CSSLengthUnit eUnit, float fValue) {
142 left.Set(eUnit, fValue);
143 top.Set(eUnit, fValue);
144 right.Set(eUnit, fValue);
145 bottom.Set(eUnit, fValue);
146 return *this;
147 }
148
153};
154
155#endif // CORE_FXCRT_CSS_CFX_CSS_H_
CFX_CSSVALUETYPE
Definition cfx_css.h:14
@ CFX_CSSVALUETYPE_Shorthand
Definition cfx_css.h:17
@ CFX_CSSVALUETYPE_List
Definition cfx_css.h:16
@ CFX_CSSVALUETYPE_Primitive
Definition cfx_css.h:15
@ CFX_CSSVALUETYPE_MaybeEnum
Definition cfx_css.h:20
@ CFX_CSSVALUETYPE_MaybeString
Definition cfx_css.h:21
@ CFX_CSSVALUETYPE_MaybeColor
Definition cfx_css.h:22
@ CFX_CSSVALUETYPE_MaybeNumber
Definition cfx_css.h:19
CFX_CSSFontVariant
Definition cfx_css.h:82
CFX_CSSFontStyle
Definition cfx_css.h:57
CFX_CSSDisplay
Definition cfx_css.h:48
CFX_CSSVerticalAlign
Definition cfx_css.h:70
CFX_CSSTextAlign
Definition cfx_css.h:62
CFX_CSSLengthUnit
Definition cfx_css.h:40
CFX_CSSPropertyValue
Definition cfx_css.h:35
CFX_CSSProperty
Definition cfx_css.h:28
CFX_CSSTEXTDECORATION
Definition cfx_css.h:87
~CFX_CSSColorValue() override
FX_ARGB Value() const
CFX_CSSColorValue(FX_ARGB color)
float GetValue() const
Definition cfx_css.h:116
CFX_CSSLengthUnit GetUnit() const
Definition cfx_css.h:114
CFX_CSSLength & Set(CFX_CSSLengthUnit eUnit)
Definition cfx_css.h:103
bool NonZero() const
Definition cfx_css.h:117
CFX_CSSLength & Set(CFX_CSSLengthUnit eUnit, float fValue)
Definition cfx_css.h:108
CFX_CSSLength()=default
CFX_CSSLength(CFX_CSSLengthUnit eUnit, float fValue)
Definition cfx_css.h:100
CFX_CSSRect()=default
CFX_CSSLength right
Definition cfx_css.h:151
CFX_CSSLength top
Definition cfx_css.h:150
CFX_CSSRect(CFX_CSSLengthUnit eUnit, float val)
Definition cfx_css.h:128
CFX_CSSLength bottom
Definition cfx_css.h:152
CFX_CSSLength left
Definition cfx_css.h:149
CFX_CSSRect & Set(CFX_CSSLengthUnit eUnit)
Definition cfx_css.h:134
CFX_CSSRect & Set(CFX_CSSLengthUnit eUnit, float fValue)
Definition cfx_css.h:141
CFX_CSSValue(PrimitiveType type)
PrimitiveType GetType() const
~CFX_CSSValue() override