Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffdoc.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 _FXFA_FORMFILLER_DOC_IMP_H\r
8 #define _FXFA_FORMFILLER_DOC_IMP_H\r
9 class CXFA_FFApp;\r
10 class CXFA_FFNotify;\r
11 class CXFA_FFDocView;\r
12 class IXFA_Locale;\r
13 typedef struct _FX_IMAGEDIB_AND_DPI {\r
14     CFX_DIBSource* pDibSource;\r
15     FX_INT32       iImageXDpi;\r
16     FX_INT32       iImageYDpi;\r
17 } FX_IMAGEDIB_AND_DPI;\r
18 class CXFA_FFDoc : public CFX_Object\r
19 {\r
20 public:\r
21     CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider);\r
22     ~CXFA_FFDoc();\r
23     IXFA_DocProvider*           GetDocProvider()\r
24     {\r
25         return m_pDocProvider;\r
26     }\r
27     FX_DWORD                            GetDocType();\r
28     FX_INT32                            StartLoad();\r
29     FX_INT32                            DoLoad(IFX_Pause *pPause = NULL);\r
30     void                                        StopLoad();\r
31     IXFA_DocView*                       CreateDocView(FX_DWORD dwView = 0);\r
32     FX_BOOL                                     OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile);\r
33     FX_BOOL                                     OpenDoc(CPDF_Document* pPDFDoc);\r
34     FX_BOOL                                     CloseDoc();\r
35     void                                        SetDocType(FX_DWORD dwType);\r
36     CXFA_Document*                      GetXFADoc()\r
37     {\r
38         return m_pDocument;\r
39     }\r
40     CXFA_FFApp*                         GetApp()\r
41     {\r
42         return m_pApp;\r
43     }\r
44     CXFA_FFDocView*                     GetDocView(IXFA_DocLayout* pLayout);\r
45     CXFA_FFDocView*                     GetDocView();\r
46     CPDF_Document*                      GetPDFDoc();\r
47     CFX_DIBitmap*                       GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);\r
48     IFDE_XMLElement*            GetPackageData(FX_WSTR wsPackage);\r
49     FX_BOOL                                     SavePackage(FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);\r
50     FX_BOOL                                     ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE);\r
51 protected:\r
52     IXFA_DocProvider*           m_pDocProvider;\r
53     CXFA_Document*                      m_pDocument;\r
54     IFX_FileRead*                       m_pStream;\r
55     CXFA_FFApp*                         m_pApp;\r
56     CXFA_FFNotify*                      m_pNotify;\r
57     CPDF_Document*                      m_pPDFDoc;\r
58     CFX_MapPtrToPtr                     m_mapNamedImages;\r
59     CFX_MapPtrToPtr                     m_mapTypeToDocView;\r
60     FX_DWORD                            m_dwDocType;\r
61     FX_BOOL                                     m_bOwnStream;\r
62 };\r
63 #endif\r