58 void Trace(cppgc::Visitor* visitor)
const;
61 Result DoLayout(
bool bUseBreakControl,
float fHeightLimit,
float fRealHeight);
69 CPPGC_STACK_ALLOCATED();
75 absl::optional<
float> m_fCurColumnWidth;
76 UnownedPtr<std::vector<
float>> m_prgSpecifiedColumnWidths;
81 CXFA_ContentLayoutProcessor(
cppgc::Heap* pHeap,
85 Result DoLayoutInternal(
bool bUseBreakControl,
90 CFX_SizeF GetCurrentComponentSize();
91 bool HasLayoutItem()
const {
return !!m_pLayoutItem; }
92 void SplitLayoutItem(
float fSplitPos);
93 float FindSplitPos(
float fProposedSplitPos);
94 bool ProcessKeepForSplit(
97 std::vector<cppgc::Persistent<CXFA_ContentLayoutItem>>*
99 float* fContentCurRowAvailWidth,
100 float* fContentCurRowHeight,
101 float* fContentCurRowY,
102 bool* bAddedItemInRow,
105 void ProcessUnUseOverFlow(
CXFA_Node* pLeaderNode,
107 CXFA_ContentLayoutItem* pTrailerItem,
109 bool IsAddNewRowForTrailer(CXFA_ContentLayoutItem* pTrailerItem);
110 bool JudgeLeaderOrTrailerForOccur(
CXFA_Node* pFormNode);
113 CXFA_ContentLayoutItem* CreateContentLayoutItem(
CXFA_Node* pFormNode);
115 void SetCurrentComponentPos(
const CFX_PointF& pos);
116 void SetCurrentComponentSize(
const CFX_SizeF& size);
118 void SplitLayoutItem(CXFA_ContentLayoutItem* pLayoutItem,
119 CXFA_ContentLayoutItem* pSecondParent,
121 float InsertKeepLayoutItems();
122 bool CalculateRowChildPosition(
123 std::vector<cppgc::Persistent<CXFA_ContentLayoutItem>> (
124 &rgCurLineLayoutItems)[3],
125 XFA_AttributeValue eFlowStrategy,
126 bool bContainerHeightAutoSize,
127 bool bContainerWidthAutoSize,
128 float* fContentCalculatedWidth,
129 float* fContentCalculatedHeight,
130 float* fContentCurRowY,
131 float fContentCurRowHeight,
132 float fContentWidthLimit,
134 void ProcessUnUseBinds(
CXFA_Node* pFormNode);
135 bool JudgePutNextPage(CXFA_ContentLayoutItem* pParentLayoutItem,
137 std::vector<CXFA_ContentLayoutItem*>* pKeepItems);
139 void DoLayoutPositionedContainer(Context* pContext);
140 void DoLayoutTableContainer(
CXFA_Node* pLayoutNode);
141 Result DoLayoutFlowedContainer(
bool bUseBreakControl,
147 void DoLayoutField();
149 void GotoNextContainerNodeSimple();
157 absl::optional<Stage> ProcessKeepNodesForCheckNext(
CXFA_Node** pCurActionNode,
159 bool* pLastKeepNode);
161 absl::optional<Stage> ProcessKeepNodesForBreakBefore(
167 void UpdatePendingItemLayout(CXFA_ContentLayoutItem* pLayoutItem);
168 void AddTrailerBeforeSplit(
float fSplitPos,
169 CXFA_ContentLayoutItem* pTrailerLayoutItem,
171 void AddLeaderAfterSplit(CXFA_ContentLayoutItem* pLeaderLayoutItem);
172 void AddPendingNode(
CXFA_Node* pPendingNode,
bool bBreakPending);
173 float InsertPendingItems(
CXFA_Node* pCurChildNode);
176 bool bContainerWidthAutoSize,
177 bool bContainerHeightAutoSize,
178 float fContainerHeight,
180 uint8_t* uCurHAlignState,
181 std::vector<cppgc::Persistent<CXFA_ContentLayoutItem>> (
182 &rgCurLineLayoutItems)[3],
183 bool bUseBreakControl,
186 float fContentWidthLimit,
187 float* fContentCurRowY,
188 float* fContentCurRowAvailWidth,
189 float* fContentCurRowHeight,
190 bool* bAddedItemInRow,
192 Context* pLayoutContext,
195 absl::optional<Stage> HandleKeep(
CXFA_Node* pBreakAfterNode,
197 absl::optional<Stage> HandleBookendLeader(
CXFA_Node* pParentContainer,
199 absl::optional<Stage> HandleBreakBefore(
CXFA_Node* pChildContainer,
201 absl::optional<Stage> HandleBreakAfter(
CXFA_Node* pChildContainer,
203 absl::optional<Stage> HandleCheckNextChildContainer(
207 absl::optional<Stage> HandleBookendTrailer(
CXFA_Node* pParentContainer,
209 void ProcessKeepNodesEnd();
210 void AdjustContainerSpecifiedSize(Context* pContext,
212 bool* pContainerWidthAutoSize,
213 bool* pContainerHeightAutoSize);
214 CXFA_ContentLayoutItem* FindLastContentLayoutItem(
216 CFX_SizeF CalculateLayoutItemSize(
const CXFA_ContentLayoutItem* pLayoutChild);
220 bool m_bBreakPending =
true;
221 bool m_bUseInherited =
false;
222 bool m_bKeepBreakFinish =
false;
223 bool m_bIsProcessKeep =
false;
224 bool m_bHasAvailHeight =
true;
225 float m_fUsedSize = 0;
226 float m_fLastRowWidth = 0;
227 float m_fLastRowY = 0;
228 float m_fWidthLimit = 0;
230 cppgc::Member<CXFA_Node>
const m_pFormNode;
231 cppgc::Member<CXFA_Node> m_pCurChildNode;
232 cppgc::Member<CXFA_Node> m_pKeepHeadNode;
233 cppgc::Member<CXFA_Node> m_pKeepTailNode;
234 cppgc::Member<CXFA_ContentLayoutItem> m_pLayoutItem;
235 cppgc::Member<CXFA_ContentLayoutItem> m_pOldLayoutItem;
236 cppgc::Member<CXFA_ViewLayoutProcessor> m_pViewLayoutProcessor;
237 cppgc::Member<CXFA_ContentLayoutProcessor> m_pCurChildPreprocessor;
238 std::vector<
float> m_rgSpecifiedColumnWidths;
void InsertAfter(CXFA_ContentLayoutItem *pNext)
CXFA_ContentLayoutItem * GetNext() const
CXFA_ContentLayoutItem * GetLast()
Result DoLayout(bool bUseBreakControl, float fHeightLimit, float fRealHeight)
void DoLayoutPageArea(CXFA_ViewLayoutItem *pPageAreaLayoutItem)
void Trace(cppgc::Visitor *visitor) const
constexpr float kXFALayoutPrecision