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