1 // Copyright 2014 PDFium Authors. All rights reserved. 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 _XFA_DOCUMENT_LAYOUT_IMP_H_ 8 #define _XFA_DOCUMENT_LAYOUT_IMP_H_ 9 class CXFA_ItemLayoutProcessor; 10 class CXFA_LayoutPageMgr; 11 class CXFA_LayoutAppAdapter; 12 class CXFA_ContainerLayoutItem; 13 class CXFA_LayoutProcessor : public IXFA_DocLayout { 14 public: 15 CXFA_LayoutProcessor(CXFA_Document* pDocument); 16 ~CXFA_LayoutProcessor(); 17 virtual CXFA_Document* GetDocument() const; 18 virtual int32_t StartLayout(FX_BOOL bForceRestart = FALSE); 19 virtual int32_t DoLayout(IFX_Pause* pPause = NULL); 20 virtual FX_BOOL IncrementLayout(); 21 virtual int32_t CountPages() const; 22 virtual IXFA_LayoutPage* GetPage(int32_t index) const; 23 virtual CXFA_LayoutItem* GetLayoutItem(CXFA_Node* pFormItem); 24 25 void AddChangedContainer(CXFA_Node* pContainer); 26 void SetForceReLayout(FX_BOOL bForceRestart) { m_bNeeLayout = bForceRestart; } 27 CXFA_ContainerLayoutItem* GetRootLayoutItem() const; 28 CXFA_ItemLayoutProcessor* GetRootRootItemLayoutProcessor() { 29 return m_pRootItemLayoutProcessor; 30 } 31 CXFA_LayoutPageMgr* GetLayoutPageMgr() { return m_pLayoutPageMgr; } 32 33 protected: 34 void ClearLayoutData(); 35 36 FX_BOOL IsNeedLayout(); 37 38 CXFA_Document* m_pDocument; 39 CXFA_ItemLayoutProcessor* m_pRootItemLayoutProcessor; 40 CXFA_LayoutPageMgr* m_pLayoutPageMgr; 41 CXFA_NodeArray m_rgChangedContainers; 42 uint32_t m_nProgressCounter; 43 FX_BOOL m_bNeeLayout; 44 }; 45 #endif 46