From 80c487809858b74783a00e05cc8164edf4b1307c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 23 Mar 2017 12:11:20 -0400 Subject: Cleanup some xfa/fxfa code. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL moves the .h files to have names corresponding to the contained classes. The .cpp files are moved alongside the .h files. Any extra classes in the .h files have been split into their own files. Change-Id: I14b4efc02417f0df946500e87b6c502e77020db8 Reviewed-on: https://pdfium-review.googlesource.com/3160 Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffdoc.h | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 xfa/fxfa/cxfa_ffdoc.h (limited to 'xfa/fxfa/cxfa_ffdoc.h') diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h new file mode 100644 index 0000000000..1d46387a5e --- /dev/null +++ b/xfa/fxfa/cxfa_ffdoc.h @@ -0,0 +1,73 @@ +// 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 XFA_FXFA_CXFA_FFDOC_H_ +#define XFA_FXFA_CXFA_FFDOC_H_ + +#include +#include + +#include "xfa/fxfa/fxfa.h" +#include "xfa/fxfa/parser/cxfa_document.h" +#include "xfa/fxfa/parser/cxfa_document_parser.h" + +class CXFA_ChecksumContext; +class CXFA_FFApp; +class CXFA_FFNotify; +class CXFA_FFDocView; + +struct FX_IMAGEDIB_AND_DPI { + CFX_DIBSource* pDibSource; + int32_t iImageXDpi; + int32_t iImageYDpi; +}; + +class CXFA_FFDoc { + public: + CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment); + ~CXFA_FFDoc(); + + IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; } + XFA_DocType GetDocType() const { return m_dwDocType; } + + int32_t StartLoad(); + int32_t DoLoad(IFX_Pause* pPause = nullptr); + void StopLoad(); + + CXFA_FFDocView* CreateDocView(); + + bool OpenDoc(const CFX_RetainPtr& pStream); + bool OpenDoc(CPDF_Document* pPDFDoc); + bool CloseDoc(); + + CXFA_Document* GetXFADoc() { return m_pDocumentParser->GetDocument(); } + CXFA_FFApp* GetApp() { return m_pApp; } + CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout); + CXFA_FFDocView* GetDocView(); + CPDF_Document* GetPDFDoc(); + CFX_DIBitmap* GetPDFNamedImage(const CFX_WideStringC& wsName, + int32_t& iImageXDpi, + int32_t& iImageYDpi); + + bool SavePackage(XFA_HashCode code, + const CFX_RetainPtr& pFile, + CXFA_ChecksumContext* pCSContext); + bool ImportData(const CFX_RetainPtr& pStream, + bool bXDP = true); + + private: + IXFA_DocEnvironment* const m_pDocEnvironment; + std::unique_ptr m_pDocumentParser; + CFX_RetainPtr m_pStream; + CXFA_FFApp* m_pApp; + std::unique_ptr m_pNotify; + CPDF_Document* m_pPDFDoc; + std::map m_HashToDibDpiMap; + std::unique_ptr m_DocView; + XFA_DocType m_dwDocType; +}; + +#endif // XFA_FXFA_CXFA_FFDOC_H_ -- cgit v1.2.3