Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
cfx_csscomputedstyle.h
Go to the documentation of this file.
1
// Copyright 2017 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_CSSCOMPUTEDSTYLE_H_
8
#
define
CORE_FXCRT_CSS_CFX_CSSCOMPUTEDSTYLE_H_
9
10
#
include
<
optional
>
11
#
include
<
vector
>
12
13
#
include
"core/fxcrt/css/cfx_css.h"
14
#
include
"core/fxcrt/css/cfx_csscustomproperty.h"
15
#
include
"core/fxcrt/mask.h"
16
#
include
"core/fxcrt/retain_ptr.h"
17
#
include
"core/fxcrt/widestring.h"
18
#
include
"core/fxge/dib/fx_dib.h"
19
20
class
CFX_CSSValueList;
21
22
class
CFX_CSSComputedStyle
final
:
public
Retainable
{
23
public
:
24
class
InheritedData
{
25
public
:
26
InheritedData
();
27
~
InheritedData
();
28
29
CFX_CSSLength
m_LetterSpacing
{
CFX_CSSLengthUnit
::
Normal
,
0
}
;
30
CFX_CSSLength
m_WordSpacing
{
CFX_CSSLengthUnit
::
Normal
,
0
}
;
31
CFX_CSSLength
m_TextIndent
{
CFX_CSSLengthUnit
::
Point
,
0
}
;
32
RetainPtr
<CFX_CSSValueList>
m_pFontFamily
;
33
float
m_fFontSize
= 12.0f;
34
float
m_fLineHeight
= 14.0f;
35
FX_ARGB
m_dwFontColor
= 0xFF000000;
36
uint16_t
m_wFontWeight
= 400;
37
CFX_CSSFontVariant
m_eFontVariant
=
CFX_CSSFontVariant
::
Normal
;
38
CFX_CSSFontStyle
m_eFontStyle
=
CFX_CSSFontStyle
::
Normal
;
39
CFX_CSSTextAlign
m_eTextAlign
=
CFX_CSSTextAlign
::
Left
;
40
};
41
42
class
NonInheritedData
{
43
public
:
44
NonInheritedData
();
45
46
CFX_CSSRect
m_MarginWidth
{
CFX_CSSLengthUnit
::
Point
,
0
}
;
47
CFX_CSSRect
m_BorderWidth
{
CFX_CSSLengthUnit
::
Point
,
0
}
;
48
CFX_CSSRect
m_PaddingWidth
{
CFX_CSSLengthUnit
::
Point
,
0
}
;
49
CFX_CSSLength
m_Top
;
50
CFX_CSSLength
m_Bottom
;
51
CFX_CSSLength
m_Left
;
52
CFX_CSSLength
m_Right
;
53
float
m_fVerticalAlign
= 0.0f;
54
CFX_CSSDisplay
m_eDisplay
=
CFX_CSSDisplay
::
Inline
;
55
CFX_CSSVerticalAlign
m_eVerticalAlignType
=
CFX_CSSVerticalAlign
::
Baseline
;
56
Mask
<
CFX_CSSTEXTDECORATION
>
m_dwTextDecoration
;
57
bool
m_bHasMargin
=
false
;
58
bool
m_bHasBorder
=
false
;
59
bool
m_bHasPadding
=
false
;
60
};
61
62
CONSTRUCT_VIA_MAKE_RETAIN
;
63
64
std
::optional<
WideString
>
GetLastFontFamily
()
const
;
65
uint16_t
GetFontWeight
()
const
;
66
CFX_CSSFontVariant
GetFontVariant
()
const
;
67
CFX_CSSFontStyle
GetFontStyle
()
const
;
68
float
GetFontSize
()
const
;
69
FX_ARGB
GetColor
()
const
;
70
void
SetFontWeight
(uint16_t wFontWeight);
71
void
SetFontVariant
(
CFX_CSSFontVariant
eFontVariant);
72
void
SetFontStyle
(
CFX_CSSFontStyle
eFontStyle);
73
void
SetFontSize
(
float
fFontSize);
74
void
SetColor
(
FX_ARGB
dwFontColor);
75
76
const
CFX_CSSRect
*
GetBorderWidth
()
const
;
77
const
CFX_CSSRect
*
GetMarginWidth
()
const
;
78
const
CFX_CSSRect
*
GetPaddingWidth
()
const
;
79
void
SetMarginWidth
(
const
CFX_CSSRect
& rect);
80
void
SetPaddingWidth
(
const
CFX_CSSRect
& rect);
81
82
CFX_CSSDisplay
GetDisplay
()
const
;
83
84
float
GetLineHeight
()
const
;
85
const
CFX_CSSLength
&
GetTextIndent
()
const
;
86
CFX_CSSTextAlign
GetTextAlign
()
const
;
87
CFX_CSSVerticalAlign
GetVerticalAlign
()
const
;
88
float
GetNumberVerticalAlign
()
const
;
89
Mask
<
CFX_CSSTEXTDECORATION
>
GetTextDecoration
()
const
;
90
const
CFX_CSSLength
&
GetLetterSpacing
()
const
;
91
void
SetLineHeight
(
float
fLineHeight);
92
void
SetTextIndent
(
const
CFX_CSSLength
& textIndent);
93
void
SetTextAlign
(
CFX_CSSTextAlign
eTextAlign);
94
void
SetNumberVerticalAlign
(
float
fAlign);
95
void
SetTextDecoration
(
Mask
<
CFX_CSSTEXTDECORATION
> dwTextDecoration);
96
void
SetLetterSpacing
(
const
CFX_CSSLength
& letterSpacing);
97
void
AddCustomStyle
(
const
CFX_CSSCustomProperty
& prop);
98
99
bool
GetCustomStyle
(
const
WideString
& wsName,
WideString
* pValue)
const
;
100
101
InheritedData
m_InheritedData
;
102
NonInheritedData
m_NonInheritedData
;
103
104
private
:
105
CFX_CSSComputedStyle();
106
~
CFX_CSSComputedStyle
()
override
;
107
108
std::vector<CFX_CSSCustomProperty> m_CustomProperties;
109
};
110
111
#
endif
// CORE_FXCRT_CSS_CFX_CSSCOMPUTEDSTYLE_H_
CFX_CSSFontVariant
CFX_CSSFontVariant
Definition
cfx_css.h:82
CFX_CSSFontVariant::Normal
@ Normal
Definition
cfx_css.h:83
CFX_CSSFontStyle
CFX_CSSFontStyle
Definition
cfx_css.h:57
CFX_CSSFontStyle::Normal
@ Normal
Definition
cfx_css.h:58
CFX_CSSDisplay
CFX_CSSDisplay
Definition
cfx_css.h:48
CFX_CSSDisplay::Inline
@ Inline
Definition
cfx_css.h:52
CFX_CSSVerticalAlign
CFX_CSSVerticalAlign
Definition
cfx_css.h:70
CFX_CSSVerticalAlign::Baseline
@ Baseline
Definition
cfx_css.h:71
CFX_CSSTextAlign
CFX_CSSTextAlign
Definition
cfx_css.h:62
CFX_CSSTextAlign::Left
@ Left
Definition
cfx_css.h:63
CFX_CSSLengthUnit
CFX_CSSLengthUnit
Definition
cfx_css.h:40
CFX_CSSLengthUnit::Point
@ Point
Definition
cfx_css.h:44
CFX_CSSLengthUnit::Normal
@ Normal
Definition
cfx_css.h:43
CFX_CSSTEXTDECORATION
CFX_CSSTEXTDECORATION
Definition
cfx_css.h:87
CFX_CSSComputedStyle::InheritedData
Definition
cfx_csscomputedstyle.h:24
CFX_CSSComputedStyle::InheritedData::~InheritedData
~InheritedData()
CFX_CSSComputedStyle::InheritedData::m_wFontWeight
uint16_t m_wFontWeight
Definition
cfx_csscomputedstyle.h:36
CFX_CSSComputedStyle::InheritedData::m_fFontSize
float m_fFontSize
Definition
cfx_csscomputedstyle.h:33
CFX_CSSComputedStyle::InheritedData::InheritedData
InheritedData()
CFX_CSSComputedStyle::InheritedData::m_dwFontColor
FX_ARGB m_dwFontColor
Definition
cfx_csscomputedstyle.h:35
CFX_CSSComputedStyle::InheritedData::m_fLineHeight
float m_fLineHeight
Definition
cfx_csscomputedstyle.h:34
CFX_CSSComputedStyle::InheritedData::m_WordSpacing
CFX_CSSLength m_WordSpacing
Definition
cfx_csscomputedstyle.h:30
CFX_CSSComputedStyle::InheritedData::m_TextIndent
CFX_CSSLength m_TextIndent
Definition
cfx_csscomputedstyle.h:31
CFX_CSSComputedStyle::InheritedData::m_eFontStyle
CFX_CSSFontStyle m_eFontStyle
Definition
cfx_csscomputedstyle.h:38
CFX_CSSComputedStyle::InheritedData::m_LetterSpacing
CFX_CSSLength m_LetterSpacing
Definition
cfx_csscomputedstyle.h:29
CFX_CSSComputedStyle::InheritedData::m_pFontFamily
RetainPtr< CFX_CSSValueList > m_pFontFamily
Definition
cfx_csscomputedstyle.h:32
CFX_CSSComputedStyle::InheritedData::m_eFontVariant
CFX_CSSFontVariant m_eFontVariant
Definition
cfx_csscomputedstyle.h:37
CFX_CSSComputedStyle::InheritedData::m_eTextAlign
CFX_CSSTextAlign m_eTextAlign
Definition
cfx_csscomputedstyle.h:39
CFX_CSSComputedStyle::NonInheritedData
Definition
cfx_csscomputedstyle.h:42
CFX_CSSComputedStyle::NonInheritedData::m_Right
CFX_CSSLength m_Right
Definition
cfx_csscomputedstyle.h:52
CFX_CSSComputedStyle::NonInheritedData::m_PaddingWidth
CFX_CSSRect m_PaddingWidth
Definition
cfx_csscomputedstyle.h:48
CFX_CSSComputedStyle::NonInheritedData::m_bHasPadding
bool m_bHasPadding
Definition
cfx_csscomputedstyle.h:59
CFX_CSSComputedStyle::NonInheritedData::m_bHasMargin
bool m_bHasMargin
Definition
cfx_csscomputedstyle.h:57
CFX_CSSComputedStyle::NonInheritedData::m_MarginWidth
CFX_CSSRect m_MarginWidth
Definition
cfx_csscomputedstyle.h:46
CFX_CSSComputedStyle::NonInheritedData::m_eVerticalAlignType
CFX_CSSVerticalAlign m_eVerticalAlignType
Definition
cfx_csscomputedstyle.h:55
CFX_CSSComputedStyle::NonInheritedData::m_fVerticalAlign
float m_fVerticalAlign
Definition
cfx_csscomputedstyle.h:53
CFX_CSSComputedStyle::NonInheritedData::m_BorderWidth
CFX_CSSRect m_BorderWidth
Definition
cfx_csscomputedstyle.h:47
CFX_CSSComputedStyle::NonInheritedData::m_Left
CFX_CSSLength m_Left
Definition
cfx_csscomputedstyle.h:51
CFX_CSSComputedStyle::NonInheritedData::m_dwTextDecoration
Mask< CFX_CSSTEXTDECORATION > m_dwTextDecoration
Definition
cfx_csscomputedstyle.h:56
CFX_CSSComputedStyle::NonInheritedData::m_Bottom
CFX_CSSLength m_Bottom
Definition
cfx_csscomputedstyle.h:50
CFX_CSSComputedStyle::NonInheritedData::m_Top
CFX_CSSLength m_Top
Definition
cfx_csscomputedstyle.h:49
CFX_CSSComputedStyle::NonInheritedData::NonInheritedData
NonInheritedData()
CFX_CSSComputedStyle::NonInheritedData::m_bHasBorder
bool m_bHasBorder
Definition
cfx_csscomputedstyle.h:58
CFX_CSSComputedStyle::NonInheritedData::m_eDisplay
CFX_CSSDisplay m_eDisplay
Definition
cfx_csscomputedstyle.h:54
CFX_CSSComputedStyle::m_InheritedData
InheritedData m_InheritedData
Definition
cfx_csscomputedstyle.h:101
CFX_CSSComputedStyle::SetTextAlign
void SetTextAlign(CFX_CSSTextAlign eTextAlign)
Definition
cfx_csscomputedstyle.cpp:145
CFX_CSSComputedStyle::SetNumberVerticalAlign
void SetNumberVerticalAlign(float fAlign)
Definition
cfx_csscomputedstyle.cpp:149
CFX_CSSComputedStyle::SetMarginWidth
void SetMarginWidth(const CFX_CSSRect &rect)
Definition
cfx_csscomputedstyle.cpp:95
CFX_CSSComputedStyle::SetTextDecoration
void SetTextDecoration(Mask< CFX_CSSTEXTDECORATION > dwTextDecoration)
Definition
cfx_csscomputedstyle.cpp:154
CFX_CSSComputedStyle::SetTextIndent
void SetTextIndent(const CFX_CSSLength &textIndent)
Definition
cfx_csscomputedstyle.cpp:141
CFX_CSSComputedStyle::GetBorderWidth
const CFX_CSSRect * GetBorderWidth() const
Definition
cfx_csscomputedstyle.cpp:80
CFX_CSSComputedStyle::SetPaddingWidth
void SetPaddingWidth(const CFX_CSSRect &rect)
Definition
cfx_csscomputedstyle.cpp:100
CFX_CSSComputedStyle::SetFontWeight
void SetFontWeight(uint16_t wFontWeight)
Definition
cfx_csscomputedstyle.cpp:60
CFX_CSSComputedStyle::SetFontVariant
void SetFontVariant(CFX_CSSFontVariant eFontVariant)
Definition
cfx_csscomputedstyle.cpp:64
CFX_CSSComputedStyle::SetFontStyle
void SetFontStyle(CFX_CSSFontStyle eFontStyle)
Definition
cfx_csscomputedstyle.cpp:68
CFX_CSSComputedStyle::SetColor
void SetColor(FX_ARGB dwFontColor)
Definition
cfx_csscomputedstyle.cpp:76
CFX_CSSComputedStyle::SetFontSize
void SetFontSize(float fFontSize)
Definition
cfx_csscomputedstyle.cpp:72
CFX_CSSComputedStyle::GetTextIndent
const CFX_CSSLength & GetTextIndent() const
Definition
cfx_csscomputedstyle.cpp:113
CFX_CSSComputedStyle::AddCustomStyle
void AddCustomStyle(const CFX_CSSCustomProperty &prop)
Definition
cfx_csscomputedstyle.cpp:164
CFX_CSSComputedStyle::m_NonInheritedData
NonInheritedData m_NonInheritedData
Definition
cfx_csscomputedstyle.h:102
CFX_CSSComputedStyle::GetColor
FX_ARGB GetColor() const
Definition
cfx_csscomputedstyle.cpp:56
CFX_CSSComputedStyle::GetVerticalAlign
CFX_CSSVerticalAlign GetVerticalAlign() const
Definition
cfx_csscomputedstyle.cpp:121
CFX_CSSComputedStyle::GetLastFontFamily
std::optional< WideString > GetLastFontFamily() const
Definition
cfx_csscomputedstyle.cpp:28
CFX_CSSComputedStyle::GetTextDecoration
Mask< CFX_CSSTEXTDECORATION > GetTextDecoration() const
Definition
cfx_csscomputedstyle.cpp:129
CFX_CSSComputedStyle::GetFontStyle
CFX_CSSFontStyle GetFontStyle() const
Definition
cfx_csscomputedstyle.cpp:48
CFX_CSSComputedStyle::GetFontWeight
uint16_t GetFontWeight() const
Definition
cfx_csscomputedstyle.cpp:40
CFX_CSSComputedStyle::GetFontVariant
CFX_CSSFontVariant GetFontVariant() const
Definition
cfx_csscomputedstyle.cpp:44
CFX_CSSComputedStyle::GetLineHeight
float GetLineHeight() const
Definition
cfx_csscomputedstyle.cpp:109
CFX_CSSComputedStyle::GetMarginWidth
const CFX_CSSRect * GetMarginWidth() const
Definition
cfx_csscomputedstyle.cpp:85
CFX_CSSComputedStyle::~CFX_CSSComputedStyle
~CFX_CSSComputedStyle() override
CFX_CSSComputedStyle::GetLetterSpacing
const CFX_CSSLength & GetLetterSpacing() const
Definition
cfx_csscomputedstyle.cpp:133
CFX_CSSComputedStyle::GetTextAlign
CFX_CSSTextAlign GetTextAlign() const
Definition
cfx_csscomputedstyle.cpp:117
CFX_CSSComputedStyle::GetFontSize
float GetFontSize() const
Definition
cfx_csscomputedstyle.cpp:52
CFX_CSSComputedStyle::GetCustomStyle
bool GetCustomStyle(const WideString &wsName, WideString *pValue) const
Definition
cfx_csscomputedstyle.cpp:17
CFX_CSSComputedStyle::GetDisplay
CFX_CSSDisplay GetDisplay() const
Definition
cfx_csscomputedstyle.cpp:105
CFX_CSSComputedStyle::SetLetterSpacing
void SetLetterSpacing(const CFX_CSSLength &letterSpacing)
Definition
cfx_csscomputedstyle.cpp:159
CFX_CSSComputedStyle::GetPaddingWidth
const CFX_CSSRect * GetPaddingWidth() const
Definition
cfx_csscomputedstyle.cpp:90
CFX_CSSComputedStyle::GetNumberVerticalAlign
float GetNumberVerticalAlign() const
Definition
cfx_csscomputedstyle.cpp:125
CFX_CSSComputedStyle::SetLineHeight
void SetLineHeight(float fLineHeight)
Definition
cfx_csscomputedstyle.cpp:137
CFX_CSSCustomProperty
Definition
cfx_csscustomproperty.h:12
CFX_CSSLength
Definition
cfx_css.h:96
CFX_CSSLength::CFX_CSSLength
CFX_CSSLength(CFX_CSSLengthUnit eUnit, float fValue)
Definition
cfx_css.h:100
CFX_CSSRect
Definition
cfx_css.h:124
CFX_CSSRect::CFX_CSSRect
CFX_CSSRect(CFX_CSSLengthUnit eUnit, float val)
Definition
cfx_css.h:128
fxcrt::Mask
Definition
mask.h:15
fxcrt::RetainPtr
Definition
retain_ptr.h:28
fxcrt::Retainable
Definition
retain_ptr.h:156
FX_ARGB
uint32_t FX_ARGB
Definition
fx_dib.h:36
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
CONSTRUCT_VIA_MAKE_RETAIN
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition
retain_ptr.h:222
WideString
fxcrt::WideString WideString
Definition
widestring.h:207
qtwebengine
src
3rdparty
chromium
third_party
pdfium
core
fxcrt
css
cfx_csscomputedstyle.h
Generated on
for Qt by
1.18.0