summaryrefslogtreecommitdiff
path: root/xfa/src/fxfa/src/app/xfa_ffdoc.h
blob: 964573f201a9971184f5edef662994d85889bb67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef FXFA_SRC_APP_XFA_FFDOC_H_
#define FXFA_SRC_APP_XFA_FFDOC_H_

#include "../../../../include/fxfa/fxfa.h"

class CXFA_FFApp;
class CXFA_FFNotify;
class CXFA_FFDocView;
class IXFA_Locale;

typedef struct _FX_IMAGEDIB_AND_DPI {
    CFX_DIBSource* pDibSource;
    FX_INT32	   iImageXDpi;
    FX_INT32	   iImageYDpi;
} FX_IMAGEDIB_AND_DPI;

class CXFA_FFDoc : public IXFA_Doc
{
public:
    CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocProvider* pDocProvider);
    ~CXFA_FFDoc();
    IXFA_DocProvider*		GetDocProvider()
    {
        return m_pDocProvider;
    }
    FX_DWORD				GetDocType();
    FX_INT32				StartLoad();
    FX_INT32				DoLoad(IFX_Pause *pPause = NULL);
    void					StopLoad();
    IXFA_DocView*			CreateDocView(FX_DWORD dwView = 0);
    FX_BOOL					OpenDoc(IFX_FileRead* pStream, FX_BOOL bTakeOverFile);
    FX_BOOL					OpenDoc(CPDF_Document* pPDFDoc);
    FX_BOOL					CloseDoc();
    void					SetDocType(FX_DWORD dwType);
    CXFA_Document*			GetXFADoc()
    {
        return m_pDocument;
    }
    CXFA_FFApp*				GetApp()
    {
        return m_pApp;
    }
    CXFA_FFDocView*			GetDocView(IXFA_DocLayout* pLayout);
    CXFA_FFDocView*			GetDocView();
    CPDF_Document*			GetPDFDoc();
    CFX_DIBitmap*			GetPDFNamedImage(FX_WSTR wsName, FX_INT32 &iImageXDpi, FX_INT32 &iImageYDpi);
    IFDE_XMLElement*		GetPackageData(FX_WSTR wsPackage);
    FX_BOOL					SavePackage(FX_WSTR wsPackage, IFX_FileWrite* pFile, IXFA_ChecksumContext *pCSContext = NULL);
    FX_BOOL					ImportData(IFX_FileRead* pStream, FX_BOOL bXDP = TRUE);
protected:
    IXFA_DocProvider*		m_pDocProvider;
    CXFA_Document*			m_pDocument;
    IFX_FileRead*			m_pStream;
    CXFA_FFApp*				m_pApp;
    CXFA_FFNotify*			m_pNotify;
    CPDF_Document*			m_pPDFDoc;
    CFX_MapPtrToPtr			m_mapNamedImages;
    CFX_MapPtrToPtr			m_mapTypeToDocView;
    FX_DWORD				m_dwDocType;
    FX_BOOL					m_bOwnStream;
};

#endif  // FXFA_SRC_APP_XFA_FFDOC_H_