OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ | 7 #ifndef XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ |
8 #define XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ | 8 #define XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ |
9 | 9 |
10 #include "xfa/fxfa/parser/xfa_doclayout.h" | 10 #include "xfa/fxfa/parser/xfa_doclayout.h" |
11 #include "xfa/fxfa/parser/xfa_layout_itemlayout.h" | 11 #include "xfa/fxfa/parser/xfa_layout_itemlayout.h" |
12 | 12 |
13 class CXFA_ContainerRecord { | 13 class CXFA_ContainerRecord { |
14 public: | 14 public: |
15 CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = NULL, | 15 CXFA_ContainerRecord(CXFA_ContainerLayoutItem* pPageSet = nullptr, |
16 CXFA_ContainerLayoutItem* pPageArea = NULL, | 16 CXFA_ContainerLayoutItem* pPageArea = nullptr, |
17 CXFA_ContainerLayoutItem* pContentArea = NULL) | 17 CXFA_ContainerLayoutItem* pContentArea = nullptr) |
18 : pCurPageSet(pPageSet), | 18 : pCurPageSet(pPageSet), |
19 pCurPageArea(pPageArea), | 19 pCurPageArea(pPageArea), |
20 pCurContentArea(pContentArea) {} | 20 pCurContentArea(pContentArea) {} |
21 CXFA_ContainerLayoutItem* pCurPageSet; | 21 CXFA_ContainerLayoutItem* pCurPageSet; |
22 CXFA_ContainerLayoutItem* pCurPageArea; | 22 CXFA_ContainerLayoutItem* pCurPageArea; |
23 CXFA_ContainerLayoutItem* pCurContentArea; | 23 CXFA_ContainerLayoutItem* pCurContentArea; |
24 }; | 24 }; |
25 class CXFA_LayoutPageMgr { | 25 class CXFA_LayoutPageMgr { |
26 public: | 26 public: |
27 CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor); | 27 CXFA_LayoutPageMgr(CXFA_LayoutProcessor* pLayoutProcessor); |
(...skipping 16 matching lines...) Expand all Loading... |
44 FX_BOOL bBefore, | 44 FX_BOOL bBefore, |
45 CXFA_Node*& pBreakLeaderNode, | 45 CXFA_Node*& pBreakLeaderNode, |
46 CXFA_Node*& pBreakTrailerNode, | 46 CXFA_Node*& pBreakTrailerNode, |
47 FX_BOOL& bCreatePage); | 47 FX_BOOL& bCreatePage); |
48 FX_BOOL ProcessOverflow(CXFA_Node* pFormNode, | 48 FX_BOOL ProcessOverflow(CXFA_Node* pFormNode, |
49 CXFA_Node*& pLeaderNode, | 49 CXFA_Node*& pLeaderNode, |
50 CXFA_Node*& pTrailerNode, | 50 CXFA_Node*& pTrailerNode, |
51 FX_BOOL bDataMerge = FALSE, | 51 FX_BOOL bDataMerge = FALSE, |
52 FX_BOOL bCreatePage = TRUE); | 52 FX_BOOL bCreatePage = TRUE); |
53 CXFA_Node* QueryOverflow(CXFA_Node* pFormNode, | 53 CXFA_Node* QueryOverflow(CXFA_Node* pFormNode, |
54 CXFA_LayoutContext* pLayoutContext = NULL); | 54 CXFA_LayoutContext* pLayoutContext = nullptr); |
55 FX_BOOL ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, | 55 FX_BOOL ProcessBookendLeaderOrTrailer(CXFA_Node* pBookendNode, |
56 FX_BOOL bLeader, | 56 FX_BOOL bLeader, |
57 CXFA_Node*& pBookendAppendNode); | 57 CXFA_Node*& pBookendAppendNode); |
58 CXFA_LayoutItem* FindOrCreateLayoutItem(CXFA_Node* pFormNode); | 58 CXFA_LayoutItem* FindOrCreateLayoutItem(CXFA_Node* pFormNode); |
59 | 59 |
60 protected: | 60 protected: |
61 FX_BOOL AppendNewPage(FX_BOOL bFirstTemPage = FALSE); | 61 FX_BOOL AppendNewPage(FX_BOOL bFirstTemPage = FALSE); |
62 void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord, | 62 void ReorderPendingLayoutRecordToTail(CXFA_ContainerRecord* pNewRecord, |
63 CXFA_ContainerRecord* pPrevRecord); | 63 CXFA_ContainerRecord* pPrevRecord); |
64 void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord, | 64 void RemoveLayoutRecord(CXFA_ContainerRecord* pNewRecord, |
65 CXFA_ContainerRecord* pPrevRecord); | 65 CXFA_ContainerRecord* pPrevRecord); |
66 inline CXFA_ContainerRecord* GetCurrentContainerRecord() { | 66 inline CXFA_ContainerRecord* GetCurrentContainerRecord() { |
67 CXFA_ContainerRecord* result = | 67 CXFA_ContainerRecord* result = |
68 ((CXFA_ContainerRecord*)m_rgProposedContainerRecord.GetAt( | 68 ((CXFA_ContainerRecord*)m_rgProposedContainerRecord.GetAt( |
69 m_pCurrentContainerRecord)); | 69 m_pCurrentContainerRecord)); |
70 ASSERT(result); | 70 ASSERT(result); |
71 return result; | 71 return result; |
72 } | 72 } |
73 CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = NULL, | 73 CXFA_ContainerRecord* CreateContainerRecord(CXFA_Node* pPageNode = nullptr, |
74 FX_BOOL bCreateNew = FALSE); | 74 FX_BOOL bCreateNew = FALSE); |
75 void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, | 75 void AddPageAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, |
76 CXFA_Node* pNewPageArea); | 76 CXFA_Node* pNewPageArea); |
77 void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, | 77 void AddContentAreaLayoutItem(CXFA_ContainerRecord* pNewRecord, |
78 CXFA_Node* pContentArea); | 78 CXFA_Node* pContentArea); |
79 FX_BOOL RunBreak(XFA_ELEMENT eBreakType, | 79 FX_BOOL RunBreak(XFA_ELEMENT eBreakType, |
80 XFA_ATTRIBUTEENUM eTargetType, | 80 XFA_ATTRIBUTEENUM eTargetType, |
81 CXFA_Node* pTarget, | 81 CXFA_Node* pTarget, |
82 FX_BOOL bStartNew); | 82 FX_BOOL bStartNew); |
83 CXFA_Node* BreakOverflow(CXFA_Node* pOverflowNode, | 83 CXFA_Node* BreakOverflow(CXFA_Node* pOverflowNode, |
84 CXFA_Node*& pLeaderTemplate, | 84 CXFA_Node*& pLeaderTemplate, |
85 CXFA_Node*& pTrailerTemplate, | 85 CXFA_Node*& pTrailerTemplate, |
86 FX_BOOL bCreatePage = TRUE); | 86 FX_BOOL bCreatePage = TRUE); |
87 FX_BOOL ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode, | 87 FX_BOOL ResolveBookendLeaderOrTrailer(CXFA_Node* pBookendNode, |
88 FX_BOOL bLeader, | 88 FX_BOOL bLeader, |
89 CXFA_Node*& pBookendAppendTemplate); | 89 CXFA_Node*& pBookendAppendTemplate); |
90 FX_BOOL ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode, | 90 FX_BOOL ExecuteBreakBeforeOrAfter(CXFA_Node* pCurNode, |
91 FX_BOOL bBefore, | 91 FX_BOOL bBefore, |
92 CXFA_Node*& pBreakLeaderTemplate, | 92 CXFA_Node*& pBreakLeaderTemplate, |
93 CXFA_Node*& pBreakTrailerTemplate); | 93 CXFA_Node*& pBreakTrailerTemplate); |
94 | 94 |
95 int32_t CreateMinPageRecord(CXFA_Node* pPageArea, | 95 int32_t CreateMinPageRecord(CXFA_Node* pPageArea, |
96 FX_BOOL bTargetPageArea, | 96 FX_BOOL bTargetPageArea, |
97 FX_BOOL bCreateLast = FALSE); | 97 FX_BOOL bCreateLast = FALSE); |
98 void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE); | 98 void CreateMinPageSetRecord(CXFA_Node* pPageSet, FX_BOOL bCreateAll = FALSE); |
99 void CreateNextMinRecord(CXFA_Node* pRecordNode); | 99 void CreateNextMinRecord(CXFA_Node* pRecordNode); |
100 FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, | 100 FX_BOOL FindPageAreaFromPageSet(CXFA_Node* pPageSet, |
101 CXFA_Node* pStartChild, | 101 CXFA_Node* pStartChild, |
102 CXFA_Node* pTargetPageArea = NULL, | 102 CXFA_Node* pTargetPageArea = nullptr, |
103 CXFA_Node* pTargetContentArea = NULL, | 103 CXFA_Node* pTargetContentArea = nullptr, |
104 FX_BOOL bNewPage = FALSE, | 104 FX_BOOL bNewPage = FALSE, |
105 FX_BOOL bQuery = FALSE); | 105 FX_BOOL bQuery = FALSE); |
106 FX_BOOL FindPageAreaFromPageSet_Ordered(CXFA_Node* pPageSet, | 106 FX_BOOL FindPageAreaFromPageSet_Ordered( |
107 CXFA_Node* pStartChild, | 107 CXFA_Node* pPageSet, |
108 CXFA_Node* pTargetPageArea = NULL, | 108 CXFA_Node* pStartChild, |
109 CXFA_Node* pTargetContentArea = NULL, | 109 CXFA_Node* pTargetPageArea = nullptr, |
110 FX_BOOL bNewPage = FALSE, | 110 CXFA_Node* pTargetContentArea = nullptr, |
111 FX_BOOL bQuery = FALSE); | 111 FX_BOOL bNewPage = FALSE, |
| 112 FX_BOOL bQuery = FALSE); |
112 FX_BOOL FindPageAreaFromPageSet_SimplexDuplex( | 113 FX_BOOL FindPageAreaFromPageSet_SimplexDuplex( |
113 CXFA_Node* pPageSet, | 114 CXFA_Node* pPageSet, |
114 CXFA_Node* pStartChild, | 115 CXFA_Node* pStartChild, |
115 CXFA_Node* pTargetPageArea = NULL, | 116 CXFA_Node* pTargetPageArea = nullptr, |
116 CXFA_Node* pTargetContentArea = NULL, | 117 CXFA_Node* pTargetContentArea = nullptr, |
117 FX_BOOL bNewPage = FALSE, | 118 FX_BOOL bNewPage = FALSE, |
118 FX_BOOL bQuery = FALSE, | 119 FX_BOOL bQuery = FALSE, |
119 XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First); | 120 XFA_ATTRIBUTEENUM ePreferredPosition = XFA_ATTRIBUTEENUM_First); |
120 FX_BOOL MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL bLastMatch); | 121 FX_BOOL MatchPageAreaOddOrEven(CXFA_Node* pPageArea, FX_BOOL bLastMatch); |
121 CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea, | 122 CXFA_Node* GetNextAvailPageArea(CXFA_Node* pTargetPageArea, |
122 CXFA_Node* pTargetContentArea = NULL, | 123 CXFA_Node* pTargetContentArea = nullptr, |
123 FX_BOOL bNewPage = FALSE, | 124 FX_BOOL bNewPage = FALSE, |
124 FX_BOOL bQuery = FALSE); | 125 FX_BOOL bQuery = FALSE); |
125 FX_BOOL GetNextContentArea(CXFA_Node* pTargetContentArea); | 126 FX_BOOL GetNextContentArea(CXFA_Node* pTargetContentArea); |
126 void InitPageSetMap(); | 127 void InitPageSetMap(); |
127 void ProcessLastPageSet(); | 128 void ProcessLastPageSet(); |
128 inline FX_BOOL IsPageSetRootOrderedOccurrence() { | 129 inline FX_BOOL IsPageSetRootOrderedOccurrence() { |
129 return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence; | 130 return m_ePageSetMode == XFA_ATTRIBUTEENUM_OrderedOccurrence; |
130 } | 131 } |
131 void ClearData(); | 132 void ClearData(); |
132 void ClearRecordList(); | 133 void ClearRecordList(); |
(...skipping 10 matching lines...) Expand all Loading... |
143 CXFA_Node* m_pCurPageArea; | 144 CXFA_Node* m_pCurPageArea; |
144 int32_t m_nAvailPages; | 145 int32_t m_nAvailPages; |
145 int32_t m_nCurPageCount; | 146 int32_t m_nCurPageCount; |
146 XFA_ATTRIBUTEENUM m_ePageSetMode; | 147 XFA_ATTRIBUTEENUM m_ePageSetMode; |
147 FX_BOOL m_bCreateOverFlowPage; | 148 FX_BOOL m_bCreateOverFlowPage; |
148 CFX_MapPtrTemplate<CXFA_Node*, int32_t> m_pPageSetMap; | 149 CFX_MapPtrTemplate<CXFA_Node*, int32_t> m_pPageSetMap; |
149 CFX_ArrayTemplate<CXFA_ContainerLayoutItem*> m_PageArray; | 150 CFX_ArrayTemplate<CXFA_ContainerLayoutItem*> m_PageArray; |
150 }; | 151 }; |
151 | 152 |
152 #endif // XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ | 153 #endif // XFA_FXFA_PARSER_XFA_LAYOUT_PAGEMGR_NEW_H_ |
OLD | NEW |