chromium/third_party/pdfium/fxjs/cjs_document.cpp

// Copyright 2017 The PDFium Authors
// 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

#include "fxjs/cjs_document.h"

#include <stdint.h>

#include <utility>

#include "constants/access_permissions.h"
#include "core/fpdfapi/page/cpdf_pageimagecache.h"
#include "core/fpdfapi/page/cpdf_pageobject.h"
#include "core/fpdfapi/page/cpdf_textobject.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_interactiveform.h"
#include "core/fpdfdoc/cpdf_nametree.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/span.h"
#include "fpdfsdk/cpdfsdk_annotiteration.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_interactiveform.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
#include "fxjs/cjs_annot.h"
#include "fxjs/cjs_app.h"
#include "fxjs/cjs_delaydata.h"
#include "fxjs/cjs_event_context.h"
#include "fxjs/cjs_field.h"
#include "fxjs/cjs_icon.h"
#include "fxjs/js_resources.h"
#include "v8/include/v8-container.h"

const JSPropertySpec CJS_Document::PropertySpecs[] =;

const JSMethodSpec CJS_Document::MethodSpecs[] =;

uint32_t CJS_Document::ObjDefnID =;
const char CJS_Document::kName[] =;

// static
uint32_t CJS_Document::GetObjDefnID() {}

// static
void CJS_Document::DefineJSObjects(CFXJS_Engine* pEngine) {}

CJS_Document::CJS_Document(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime)
    :{}

CJS_Document::~CJS_Document() = default;

// The total number of fields in document.
CJS_Result CJS_Document::get_num_fields(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_num_fields(CJS_Runtime* pRuntime,
                                        v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_dirty(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_dirty(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_ADBE(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_ADBE(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_page_num(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_page_num(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::addAnnot(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::addField(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::exportAsText(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::exportAsFDF(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::exportAsXFDF(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getField(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

// Gets the name of the nth field in the document
CJS_Result CJS_Document::getNthFieldName(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::importAnFDF(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::importAnXFDF(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::importTextData(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::mailDoc(CJS_Runtime* pRuntime,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

// exports the form data and mails the resulting fdf file as an attachment to
// all recipients.
// comment: need reader supports
CJS_Result CJS_Document::mailForm(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::print(CJS_Runtime* pRuntime,
                               pdfium::span<v8::Local<v8::Value>> params) {}

// removes the specified field from the document.
// comment:
// note: if the filed name is not rational, adobe is dumb for it.
CJS_Result CJS_Document::removeField(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

// reset filed values within a document.
// comment:
// note: if the fields names r not rational, aodbe is dumb for it.

CJS_Result CJS_Document::resetForm(CJS_Runtime* pRuntime,
                                   pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::saveAs(CJS_Runtime* pRuntime,
                                pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::syncAnnotScan(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::submitForm(CJS_Runtime* pRuntime,
                                    pdfium::span<v8::Local<v8::Value>> params) {}

void CJS_Document::SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv) {}

CJS_Result CJS_Document::get_bookmark_root(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_bookmark_root(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_author(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_author(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_info(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_info(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::getPropertyInternal(CJS_Runtime* pRuntime,
                                             const ByteString& propName) {}

CJS_Result CJS_Document::get_creation_date(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_creation_date(CJS_Runtime* pRuntime,
                                           v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_creator(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_creator(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_delay(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_delay(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_keywords(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_keywords(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_mod_date(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_mod_date(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_producer(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_producer(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_subject(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_subject(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_title(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_title(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_num_pages(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_num_pages(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_external(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_external(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_filesize(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_filesize(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_mouse_x(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_mouse_x(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_mouse_y(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_mouse_y(CJS_Runtime* pRuntime,
                                     v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_URL(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_URL(CJS_Runtime* pRuntime,
                                 v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_base_URL(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_base_URL(CJS_Runtime* pRuntime,
                                      v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_calculate(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_calculate(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_document_file_name(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_document_file_name(CJS_Runtime* pRuntime,
                                                v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_path(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_path(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_page_window_rect(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_page_window_rect(CJS_Runtime* pRuntime,
                                              v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_layout(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_layout(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::addLink(CJS_Runtime* pRuntime,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::closeDoc(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getPageBox(CJS_Runtime* pRuntime,
                                    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getAnnot(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getAnnots(CJS_Runtime* pRuntime,
                                   pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getAnnot3D(CJS_Runtime* pRuntime,
                                    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getAnnots3D(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getOCGs(CJS_Runtime* pRuntime,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getLinks(CJS_Runtime* pRuntime,
                                  pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::addIcon(CJS_Runtime* pRuntime,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::get_icons(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_icons(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::getIcon(CJS_Runtime* pRuntime,
                                 pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::removeIcon(CJS_Runtime* pRuntime,
                                    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::createDataObject(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::get_media(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_media(CJS_Runtime* pRuntime,
                                   v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::calculateNow(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::get_collab(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_collab(CJS_Runtime* pRuntime,
                                    v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::getPageNthWord(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getPageNthWordQuads(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getPageNumWords(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getPrintParams(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::get_zoom(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_zoom(CJS_Runtime* pRuntime,
                                  v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::get_zoom_type(CJS_Runtime* pRuntime) {}

CJS_Result CJS_Document::set_zoom_type(CJS_Runtime* pRuntime,
                                       v8::Local<v8::Value> vp) {}

CJS_Result CJS_Document::deletePages(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::extractPages(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::insertPages(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::replacePages(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::getURL(CJS_Runtime* pRuntime,
                                pdfium::span<v8::Local<v8::Value>> params) {}

CJS_Result CJS_Document::gotoNamedDest(
    CJS_Runtime* pRuntime,
    pdfium::span<v8::Local<v8::Value>> params) {}

void CJS_Document::AddDelayData(std::unique_ptr<CJS_DelayData> pData) {}

void CJS_Document::DoFieldDelay(const WideString& sFieldName,
                                int nControlIndex) {}

CPDF_InteractiveForm* CJS_Document::GetCoreInteractiveForm() {}

CPDFSDK_InteractiveForm* CJS_Document::GetSDKInteractiveForm() {}