Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h

Issue 2328573002: Split CPDFXFA_Document apart (Closed)
Patch Set: Fix merge Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h
diff --git a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h b/fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h
similarity index 69%
copy from fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
copy to fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h
index 31f3706b72e6521832f5fb8ecf1dd68486ccf81e..f6a538f816a677284ba9f1eee14a2e5ad27b3c37 100644
--- a/fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h
+++ b/fpdfsdk/fpdfxfa/include/cpdfxfa_docenvironment.h
@@ -1,51 +1,24 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
+// Copyright 2016 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 FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_
-#define FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_
-
-#include "xfa/fxfa/include/xfa_ffdoc.h"
-
-#include <memory>
-#include <vector>
+#ifndef FPDFSDK_FPDFXFA_INCLUDE_CPDFXFA_DOCENVIRONMENT_H_
+#define FPDFSDK_FPDFXFA_INCLUDE_CPDFXFA_DOCENVIRONMENT_H_
#include "public/fpdfview.h"
#include "xfa/fxfa/include/fxfa.h"
-#include "xfa/fxfa/include/xfa_ffdochandler.h"
-class CPDFXFA_App;
class CPDFXFA_Document;
-class CPDFXFA_Page;
-class CPDFSDK_Document;
-class CPDFDoc_Environment;
-class IJS_Runtime;
class IJS_Context;
-class CXFA_FFDocHandler;
-class CPDFXFA_Document : public IXFA_DocProvider {
+class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment {
public:
- CPDFXFA_Document(std::unique_ptr<CPDF_Document> pPDFDoc,
- CPDFXFA_App* pProvider);
- ~CPDFXFA_Document() override;
-
- FX_BOOL LoadXFADoc();
- CPDF_Document* GetPDFDoc() { return m_pPDFDoc.get(); }
- CXFA_FFDoc* GetXFADoc() { return m_pXFADoc.get(); }
- CXFA_FFDocView* GetXFADocView() { return m_pXFADocView; }
-
- int GetPageCount();
- CPDFXFA_Page* GetPage(int page_index);
-
- void DeletePage(int page_index);
- void RemovePage(CPDFXFA_Page* page);
- int GetDocType() { return m_iDocType; }
+ CPDFXFA_DocEnvironment(CPDFXFA_Document*);
+ ~CPDFXFA_DocEnvironment() override;
- CPDFSDK_Document* GetSDKDocument(CPDFDoc_Environment* pFormFillEnv);
-
- // IXFA_DocProvider
+ // IXFA_DocEnvironment
void SetChangeMark(CXFA_FFDoc* hDoc) override;
// used in dynamic xfa, dwFlags refer to XFA_INVALIDATE_XXX macros.
void InvalidateRect(CXFA_FFPageView* pPageView,
@@ -117,26 +90,7 @@ class CPDFXFA_Document : public IXFA_DocProvider {
IFX_FileRead* OpenLinkedFile(CXFA_FFDoc* hDoc,
const CFX_WideString& wsLink) override;
- void ClearChangeMark();
-
private:
- enum LoadStatus {
- FXFA_LOADSTATUS_PRELOAD = 0,
- FXFA_LOADSTATUS_LOADING,
- FXFA_LOADSTATUS_LOADED,
- FXFA_LOADSTATUS_CLOSING,
- FXFA_LOADSTATUS_CLOSED
- };
-
- void CloseXFADoc(CXFA_FFDocHandler* pDoc) {
- if (pDoc) {
- m_pXFADoc->CloseDoc();
- m_pXFADoc.reset();
- m_pXFADocView = nullptr;
- }
- }
-
- CPDFXFA_Page* GetPage(CXFA_FFPageView* pPage);
FX_BOOL OnBeforeNotifySubmit();
void OnAfterNotifySubmit();
FX_BOOL NotifySubmit(FX_BOOL bPrevOrPost);
@@ -153,19 +107,8 @@ class CPDFXFA_Document : public IXFA_DocProvider {
FPDF_DWORD flag);
void ToXFAContentFlags(CFX_WideString csSrcContent, FPDF_DWORD& flag);
- int m_iDocType;
-
- // |m_pSDKDoc| has to be released before |m_pPDFDoc| since it needs to access
- // it to kill focused annotations.
- std::unique_ptr<CPDF_Document> m_pPDFDoc;
- std::unique_ptr<CPDFSDK_Document> m_pSDKDoc;
- std::unique_ptr<CXFA_FFDoc> m_pXFADoc;
- CXFA_FFDocView* m_pXFADocView; // not owned.
- CPDFXFA_App* const m_pApp;
+ CPDFXFA_Document* const m_pDocument; // Not owned;
IJS_Context* m_pJSContext;
- CFX_ArrayTemplate<CPDFXFA_Page*> m_XFAPageList;
- LoadStatus m_nLoadStatus;
- int m_nPageCount;
};
-#endif // FPDFSDK_FPDFXFA_INCLUDE_FPDFXFA_DOC_H_
+#endif // FPDFSDK_FPDFXFA_INCLUDE_CPDFXFA_DOCENVIRONMENT_H_
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698