Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxfa / src / parser / xfa_document_layout_imp.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _XFA_DOCUMENT_LAYOUT_IMP_H_\r
8 #define _XFA_DOCUMENT_LAYOUT_IMP_H_\r
9 class CXFA_ItemLayoutProcessor;\r
10 class CXFA_LayoutPageMgr;\r
11 class CXFA_LayoutAppAdapter;\r
12 class CXFA_ContainerLayoutItemImpl;\r
13 class CXFA_LayoutProcessor : public IXFA_DocLayout, public CFX_Object\r
14 {\r
15 public:\r
16     CXFA_LayoutProcessor(CXFA_Document* pDocument);\r
17     ~CXFA_LayoutProcessor();\r
18     virtual CXFA_Document*              GetDocument() const;\r
19     virtual     FX_INT32                        StartLayout(FX_BOOL bForceRestart = FALSE);\r
20     virtual FX_INT32                    DoLayout(IFX_Pause *pPause = NULL);\r
21     virtual FX_BOOL                             IncrementLayout();\r
22     virtual FX_INT32                    CountPages() const;\r
23     virtual IXFA_LayoutPage*    GetPage(FX_INT32 index) const;\r
24     virtual CXFA_LayoutItem*    GetLayoutItem(CXFA_Node *pFormItem);\r
25 \r
26     void                                AddChangedContainer(CXFA_Node* pContainer);\r
27     void                                SetForceReLayout(FX_BOOL bForceRestart)\r
28     {\r
29         m_bNeeLayout = bForceRestart;\r
30     }\r
31     CXFA_ContainerLayoutItemImpl*       GetRootLayoutItem() const;\r
32     CXFA_ItemLayoutProcessor*   GetRootRootItemLayoutProcessor()\r
33     {\r
34         return m_pRootItemLayoutProcessor;\r
35     }\r
36     CXFA_LayoutPageMgr*                 GetLayoutPageMgr()\r
37     {\r
38         return m_pLayoutPageMgr;\r
39     }\r
40 protected:\r
41     void                ClearLayoutData();\r
42 \r
43     FX_BOOL             IsNeedLayout();\r
44 \r
45     CXFA_Document*                              m_pDocument;\r
46     CXFA_ItemLayoutProcessor*   m_pRootItemLayoutProcessor;\r
47     CXFA_LayoutPageMgr*                 m_pLayoutPageMgr;\r
48     CXFA_NodeArray                              m_rgChangedContainers;\r
49     FX_UINT32                                   m_nProgressCounter;\r
50     FX_BOOL                                             m_bNeeLayout;\r
51 };\r
52 #endif\r