#include "fpdfsdk/fpdfxfa/cpdfxfa_context.h"
#include <stdint.h>
#include <algorithm>
#include <utility>
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_seekablemultistream.h"
#include "core/fxcodec/jpeg/jpeg_progressive_decoder.h"
#include "core/fxcrt/autonuller.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/fixed_size_data_vector.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxcrt/xml/cfx_xmldocument.h"
#include "core/fxcrt/xml/cfx_xmlparser.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h"
#include "fpdfsdk/fpdfxfa/cpdfxfa_page.h"
#include "fxbarcode/BC_Library.h"
#include "fxjs/cjs_runtime.h"
#include "fxjs/ijs_runtime.h"
#include "public/fpdf_formfill.h"
#include "v8/include/cppgc/allocation.h"
#include "xfa/fgas/font/cfgas_gemodule.h"
#include "xfa/fxfa/cxfa_eventparam.h"
#include "xfa/fxfa/cxfa_ffapp.h"
#include "xfa/fxfa/cxfa_ffdoc.h"
#include "xfa/fxfa/cxfa_ffdocview.h"
#include "xfa/fxfa/cxfa_ffpageview.h"
#include "xfa/fxfa/cxfa_ffwidgethandler.h"
#include "xfa/fxfa/cxfa_fontmgr.h"
#include "xfa/fxfa/cxfa_readynodeiterator.h"
#ifdef PDF_ENABLE_XFA_BMP
#include "core/fxcodec/bmp/bmp_progressive_decoder.h"
#endif
#ifdef PDF_ENABLE_XFA_GIF
#include "core/fxcodec/gif/gif_progressive_decoder.h"
#endif
namespace {
bool IsValidAlertButton(int type) { … }
bool IsValidAlertIcon(int type) { … }
RetainPtr<CPDF_SeekableMultiStream> CreateXFAMultiStream(
const CPDF_Document* pPDFDoc) { … }
}
void CPDFXFA_ModuleInit() { … }
void CPDFXFA_ModuleDestroy() { … }
CPDFXFA_Context::CPDFXFA_Context(CPDF_Document* pPDFDoc)
: … { … }
CPDFXFA_Context::~CPDFXFA_Context() { … }
void CPDFXFA_Context::SetFormFillEnv(
CPDFSDK_FormFillEnvironment* pFormFillEnv) { … }
bool CPDFXFA_Context::LoadXFADoc() { … }
int CPDFXFA_Context::GetPageCount() const { … }
RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetOrCreateXFAPage(int page_index) { … }
RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(int page_index) { … }
RetainPtr<CPDFXFA_Page> CPDFXFA_Context::GetXFAPage(
CXFA_FFPageView* pPage) const { … }
uint32_t CPDFXFA_Context::DeletePage(int page_index) { … }
bool CPDFXFA_Context::ContainsExtensionForm() const { … }
bool CPDFXFA_Context::ContainsExtensionFullForm() const { … }
bool CPDFXFA_Context::ContainsExtensionForegroundForm() const { … }
void CPDFXFA_Context::ClearChangeMark() { … }
CJS_Runtime* CPDFXFA_Context::GetCJSRuntime() const { … }
WideString CPDFXFA_Context::GetAppTitle() const { … }
WideString CPDFXFA_Context::GetAppName() { … }
WideString CPDFXFA_Context::GetLanguage() { … }
WideString CPDFXFA_Context::GetPlatform() { … }
void CPDFXFA_Context::Beep(uint32_t dwType) { … }
int32_t CPDFXFA_Context::MsgBox(const WideString& wsMessage,
const WideString& wsTitle,
uint32_t dwIconType,
uint32_t dwButtonType) { … }
WideString CPDFXFA_Context::Response(const WideString& wsQuestion,
const WideString& wsTitle,
const WideString& wsDefaultAnswer,
bool bMark) { … }
RetainPtr<IFX_SeekableReadStream> CPDFXFA_Context::DownloadURL(
const WideString& wsURL) { … }
bool CPDFXFA_Context::PostRequestURL(const WideString& wsURL,
const WideString& wsData,
const WideString& wsContentType,
const WideString& wsEncode,
const WideString& wsHeader,
WideString& wsResponse) { … }
bool CPDFXFA_Context::PutRequestURL(const WideString& wsURL,
const WideString& wsData,
const WideString& wsEncode) { … }
CFX_Timer::HandlerIface* CPDFXFA_Context::GetTimerHandler() const { … }
cppgc::Heap* CPDFXFA_Context::GetGCHeap() const { … }
bool CPDFXFA_Context::SaveDatasetsPackage(
const RetainPtr<IFX_SeekableStream>& pStream) { … }
bool CPDFXFA_Context::SaveFormPackage(
const RetainPtr<IFX_SeekableStream>& pStream) { … }
bool CPDFXFA_Context::SavePackage(const RetainPtr<IFX_SeekableStream>& pStream,
XFA_HashCode code) { … }
void CPDFXFA_Context::SendPostSaveToXFADoc() { … }
void CPDFXFA_Context::SendPreSaveToXFADoc(
std::vector<RetainPtr<IFX_SeekableStream>>* fileList) { … }