7#ifndef FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_
8#define FPDFSDK_FPDFXFA_CPDFXFA_CONTEXT_H_
15#include "core/fpdfapi/parser/cpdf_document.h"
16#include "core/fxcrt/cfx_timer.h"
17#include "core/fxcrt/observed_ptr.h"
18#include "core/fxcrt/retain_ptr.h"
19#include "core/fxcrt/unowned_ptr.h"
20#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
21#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
22#include "fxjs/gc/heap.h"
23#include "v8/include/cppgc/persistent.h"
24#include "xfa/fxfa/cxfa_ffapp.h"
25#include "xfa/fxfa/cxfa_ffdoc.h"
29class CPDFXFA_DocEnvironment;
54 m_XFAPageList.resize(count);
62 return m_pFormFillEnv.Get();
82 void Beep(uint32_t dwType)
override;
83 int32_t
MsgBox(
const WideString& wsMessage,
84 const WideString& wsTitle,
86 uint32_t dwButtonType)
override;
87 WideString
Response(
const WideString& wsQuestion,
88 const WideString& wsTitle,
89 const WideString& wsDefaultAnswer,
92 const WideString& wsURL)
override;
94 const WideString& wsData,
95 const WideString& wsContentType,
96 const WideString& wsEncode,
97 const WideString& wsHeader,
98 WideString& wsResponse)
override;
100 const WideString& wsData,
101 const WideString& wsEncode)
override;
109 std::vector<RetainPtr<IFX_SeekableStream>>* fileList);
112 CJS_Runtime* GetCJSRuntime()
const;
118 int m_nPageCount = 0;
122 std::unique_ptr<CFX_XMLDocument> m_pXML;
123 ObservedPtr<CPDFSDK_FormFillEnvironment> m_pFormFillEnv;
124 std::vector<RetainPtr<CPDFXFA_Page>> m_XFAPageList;
127 std::unique_ptr<CPDFXFA_DocEnvironment> m_pDocEnv;
129 FXGCScopedHeap m_pGCHeap;
130 cppgc::Persistent<CXFA_FFApp> m_pXFAApp;
131 cppgc::Persistent<CXFA_FFDoc> m_pXFADoc;
132 cppgc::Persistent<CXFA_FFDocView> m_pXFADocView;
void BC_Library_Destroy()
WideString GetPlatform() override
RetainPtr< IFX_SeekableReadStream > DownloadURL(const WideString &wsURL) override
bool PostRequestURL(const WideString &wsURL, const WideString &wsData, const WideString &wsContentType, const WideString &wsEncode, const WideString &wsHeader, WideString &wsResponse) override
RetainPtr< CPDFXFA_Page > GetXFAPage(CXFA_FFPageView *pPage) const
void SetOriginalPageCount(int count)
FormType GetFormType() const
WideString GetAppTitle() const override
WideString Response(const WideString &wsQuestion, const WideString &wsTitle, const WideString &wsDefaultAnswer, bool bMark) override
bool SaveDatasetsPackage(const RetainPtr< IFX_SeekableStream > &pStream)
~CPDFXFA_Context() override
void SetFormFillEnv(CPDFSDK_FormFillEnvironment *pFormFillEnv)
bool PutRequestURL(const WideString &wsURL, const WideString &wsData, const WideString &wsEncode) override
void SendPreSaveToXFADoc(std::vector< RetainPtr< IFX_SeekableStream > > *fileList)
CPDFSDK_FormFillEnvironment * GetFormFillEnv() const
CXFA_FFDocView * GetXFADocView() const
void SendPostSaveToXFADoc()
WideString GetAppName() override
bool SaveFormPackage(const RetainPtr< IFX_SeekableStream > &pStream)
CFX_Timer::HandlerIface * GetTimerHandler() const override
void Beep(uint32_t dwType) override
bool ContainsExtensionForegroundForm() const override
CPDFXFA_Context(CPDF_Document *pPDFDoc)
RetainPtr< CPDFXFA_Page > GetOrCreateXFAPage(int page_index)
bool ContainsExtensionForm() const override
int GetOriginalPageCount() const
WideString GetLanguage() override
RetainPtr< CPDFXFA_Page > GetXFAPage(int page_index)
void DeletePage(int page_index) override
LoadStatus GetLoadStatus() const
bool ContainsExtensionFullForm() const override
int GetPageCount() const override
cppgc::Heap * GetGCHeap() const override
CFX_XMLDocument * GetXMLDoc()
int32_t MsgBox(const WideString &wsMessage, const WideString &wsTitle, uint32_t dwIconType, uint32_t dwButtonType) override
CPDF_Document * GetPDFDoc() const
const CPDF_Dictionary * GetRoot() const
CXFA_Object * GetXFAObject(XFA_HashCode wsNodeNameHash)
CXFA_EventParam(XFA_EVENTTYPE type)
CXFA_FFWidgetHandler * GetWidgetHandler()
CXFA_FFDoc * GetDoc() const
CXFA_Node * GetRootSubform()
bool SavePackage(CXFA_Node *pNode, const RetainPtr< IFX_SeekableStream > &pFile)
CXFA_Document * GetXFADoc() const
CXFA_ReadyNodeIterator(CXFA_Node *pTravelRoot)
static void InitializeGlobals()
static void DestroyGlobals()
static WideString FromUTF16LE(pdfium::span< const uint8_t > data)
void CPDFXFA_ModuleInit()
void CPDFXFA_ModuleDestroy()
CXFA_Node * ToNode(CXFA_Object *pObj)