| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_CXFA_LAYOUTPROCESSOR_H_ | 7 #ifndef XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ |
| 8 #define XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ | 8 #define XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "core/fxcrt/fx_system.h" | 12 #include "core/fxcrt/fx_system.h" |
| 11 #include "xfa/fxfa/parser/xfa_object.h" | 13 #include "xfa/fxfa/parser/xfa_object.h" |
| 12 | 14 |
| 13 class CXFA_ContainerLayoutItem; | 15 class CXFA_ContainerLayoutItem; |
| 14 class CXFA_Document; | 16 class CXFA_Document; |
| 15 class CXFA_ItemLayoutProcessor; | 17 class CXFA_ItemLayoutProcessor; |
| 16 class CXFA_LayoutItem; | 18 class CXFA_LayoutItem; |
| 17 class CXFA_LayoutPageMgr; | 19 class CXFA_LayoutPageMgr; |
| 18 class CXFA_Node; | 20 class CXFA_Node; |
| 19 class IFX_Pause; | 21 class IFX_Pause; |
| 20 | 22 |
| 21 class CXFA_LayoutProcessor { | 23 class CXFA_LayoutProcessor { |
| 22 public: | 24 public: |
| 23 explicit CXFA_LayoutProcessor(CXFA_Document* pDocument); | 25 explicit CXFA_LayoutProcessor(CXFA_Document* pDocument); |
| 24 ~CXFA_LayoutProcessor(); | 26 ~CXFA_LayoutProcessor(); |
| 25 | 27 |
| 26 CXFA_Document* GetDocument() const; | 28 CXFA_Document* GetDocument() const; |
| 27 int32_t StartLayout(bool bForceRestart = false); | 29 int32_t StartLayout(bool bForceRestart = false); |
| 28 int32_t DoLayout(IFX_Pause* pPause = nullptr); | 30 int32_t DoLayout(IFX_Pause* pPause = nullptr); |
| 29 bool IncrementLayout(); | 31 bool IncrementLayout(); |
| 30 int32_t CountPages() const; | 32 int32_t CountPages() const; |
| 31 CXFA_ContainerLayoutItem* GetPage(int32_t index) const; | 33 CXFA_ContainerLayoutItem* GetPage(int32_t index) const; |
| 32 CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); | 34 CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); |
| 33 | |
| 34 void AddChangedContainer(CXFA_Node* pContainer); | 35 void AddChangedContainer(CXFA_Node* pContainer); |
| 35 void SetForceReLayout(bool bForceRestart) { m_bNeeLayout = bForceRestart; } | 36 void SetForceReLayout(bool bForceRestart) { m_bNeeLayout = bForceRestart; } |
| 36 CXFA_ContainerLayoutItem* GetRootLayoutItem() const; | 37 CXFA_ContainerLayoutItem* GetRootLayoutItem() const; |
| 37 CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() { | 38 CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() const { |
| 38 return m_pRootItemLayoutProcessor; | 39 return m_pRootItemLayoutProcessor.get(); |
| 39 } | 40 } |
| 40 CXFA_LayoutPageMgr* GetLayoutPageMgr() { return m_pLayoutPageMgr; } | 41 CXFA_LayoutPageMgr* GetLayoutPageMgr() const { |
| 42 return m_pLayoutPageMgr.get(); |
| 43 } |
| 41 | 44 |
| 42 private: | 45 private: |
| 43 void ClearLayoutData(); | |
| 44 | |
| 45 bool IsNeedLayout(); | 46 bool IsNeedLayout(); |
| 46 | 47 |
| 47 CXFA_Document* m_pDocument; | 48 CXFA_Document* const m_pDocument; |
| 48 CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; | 49 std::unique_ptr<CXFA_ItemLayoutProcessor> m_pRootItemLayoutProcessor; |
| 49 CXFA_LayoutPageMgr* m_pLayoutPageMgr; | 50 std::unique_ptr<CXFA_LayoutPageMgr> m_pLayoutPageMgr; |
| 50 CXFA_NodeArray m_rgChangedContainers; | 51 CXFA_NodeArray m_rgChangedContainers; |
| 51 uint32_t m_nProgressCounter; | 52 uint32_t m_nProgressCounter; |
| 52 bool m_bNeeLayout; | 53 bool m_bNeeLayout; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 #endif // XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ | 56 #endif // XFA_FXFA_PARSER_CXFA_LAYOUTPROCESSOR_H_ |
| OLD | NEW |