Dan Sinclair | 451e4c8 | 2017-10-30 15:35:42 +0000 | [diff] [blame] | 1 | // Copyright 2017 PDFium Authors. All rights reserved. |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 4 | |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 7 | #ifndef FXJS_CJS_DOCUMENT_H_ |
| 8 | #define FXJS_CJS_DOCUMENT_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Tom Sepez | 6ba32d9 | 2016-01-05 16:26:32 -0800 | [diff] [blame] | 10 | #include <list> |
| 11 | #include <memory> |
Dan Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 12 | #include <vector> |
Tom Sepez | 6ba32d9 | 2016-01-05 16:26:32 -0800 | [diff] [blame] | 13 | |
Tom Sepez | 2cbae73 | 2018-06-26 15:11:28 +0000 | [diff] [blame] | 14 | #include "core/fxcrt/observable.h" |
Lei Zhang | 31beedc | 2018-10-18 21:09:55 +0000 | [diff] [blame] | 15 | #include "fxjs/cjs_object.h" |
Tom Sepez | 221f0b3 | 2018-06-04 22:11:27 +0000 | [diff] [blame] | 16 | #include "fxjs/js_define.h" |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 17 | |
Lei Zhang | 073ecf4 | 2018-10-11 16:56:00 +0000 | [diff] [blame] | 18 | class CPDFSDK_InteractiveForm; |
| 19 | class CPDF_InteractiveForm; |
Dan Sinclair | 451e4c8 | 2017-10-30 15:35:42 +0000 | [diff] [blame] | 20 | class CPDF_TextObject; |
Lei Zhang | 313c425 | 2017-02-27 16:37:36 -0800 | [diff] [blame] | 21 | struct CJS_DelayData; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 22 | |
Tom Sepez | 5586545 | 2018-08-27 20:18:04 +0000 | [diff] [blame] | 23 | class CJS_Document final : public CJS_Object, public Observable<CJS_Document> { |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 24 | public: |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 25 | static int GetObjDefnID(); |
| 26 | static void DefineJSObjects(CFXJS_Engine* pEngine); |
| 27 | |
Tom Sepez | 36aae4f | 2018-06-04 19:44:37 +0000 | [diff] [blame] | 28 | CJS_Document(v8::Local<v8::Object> pObject, CJS_Runtime* pRuntime); |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 29 | ~CJS_Document() override; |
| 30 | |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 31 | void SetFormFillEnv(CPDFSDK_FormFillEnvironment* pFormFillEnv); |
| 32 | CPDFSDK_FormFillEnvironment* GetFormFillEnv() const { |
| 33 | return m_pFormFillEnv.Get(); |
| 34 | } |
| 35 | void AddDelayData(std::unique_ptr<CJS_DelayData> pData); |
| 36 | void DoFieldDelay(const WideString& sFieldName, int nControlIndex); |
| 37 | |
Nico Weber | 563f62a | 2019-02-12 18:47:12 +0000 | [diff] [blame] | 38 | JS_STATIC_PROP(ADBE, ADBE, CJS_Document) |
| 39 | JS_STATIC_PROP(author, author, CJS_Document) |
| 40 | JS_STATIC_PROP(baseURL, base_URL, CJS_Document) |
| 41 | JS_STATIC_PROP(bookmarkRoot, bookmark_root, CJS_Document) |
| 42 | JS_STATIC_PROP(calculate, calculate, CJS_Document) |
| 43 | JS_STATIC_PROP(Collab, collab, CJS_Document) |
| 44 | JS_STATIC_PROP(creationDate, creation_date, CJS_Document) |
| 45 | JS_STATIC_PROP(creator, creator, CJS_Document) |
| 46 | JS_STATIC_PROP(delay, delay, CJS_Document) |
| 47 | JS_STATIC_PROP(dirty, dirty, CJS_Document) |
| 48 | JS_STATIC_PROP(documentFileName, document_file_name, CJS_Document) |
| 49 | JS_STATIC_PROP(external, external, CJS_Document) |
| 50 | JS_STATIC_PROP(filesize, filesize, CJS_Document) |
| 51 | JS_STATIC_PROP(icons, icons, CJS_Document) |
| 52 | JS_STATIC_PROP(info, info, CJS_Document) |
| 53 | JS_STATIC_PROP(keywords, keywords, CJS_Document) |
| 54 | JS_STATIC_PROP(layout, layout, CJS_Document) |
| 55 | JS_STATIC_PROP(media, media, CJS_Document) |
| 56 | JS_STATIC_PROP(modDate, mod_date, CJS_Document) |
| 57 | JS_STATIC_PROP(mouseX, mouse_x, CJS_Document) |
| 58 | JS_STATIC_PROP(mouseY, mouse_y, CJS_Document) |
| 59 | JS_STATIC_PROP(numFields, num_fields, CJS_Document) |
| 60 | JS_STATIC_PROP(numPages, num_pages, CJS_Document) |
| 61 | JS_STATIC_PROP(pageNum, page_num, CJS_Document) |
| 62 | JS_STATIC_PROP(pageWindowRect, page_window_rect, CJS_Document) |
| 63 | JS_STATIC_PROP(path, path, CJS_Document) |
| 64 | JS_STATIC_PROP(producer, producer, CJS_Document) |
| 65 | JS_STATIC_PROP(subject, subject, CJS_Document) |
| 66 | JS_STATIC_PROP(title, title, CJS_Document) |
| 67 | JS_STATIC_PROP(URL, URL, CJS_Document) |
| 68 | JS_STATIC_PROP(zoom, zoom, CJS_Document) |
| 69 | JS_STATIC_PROP(zoomType, zoom_type, CJS_Document) |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 70 | |
Nico Weber | 563f62a | 2019-02-12 18:47:12 +0000 | [diff] [blame] | 71 | JS_STATIC_METHOD(addAnnot, CJS_Document) |
| 72 | JS_STATIC_METHOD(addField, CJS_Document) |
| 73 | JS_STATIC_METHOD(addLink, CJS_Document) |
| 74 | JS_STATIC_METHOD(addIcon, CJS_Document) |
| 75 | JS_STATIC_METHOD(calculateNow, CJS_Document) |
| 76 | JS_STATIC_METHOD(closeDoc, CJS_Document) |
| 77 | JS_STATIC_METHOD(createDataObject, CJS_Document) |
| 78 | JS_STATIC_METHOD(deletePages, CJS_Document) |
| 79 | JS_STATIC_METHOD(exportAsText, CJS_Document) |
| 80 | JS_STATIC_METHOD(exportAsFDF, CJS_Document) |
| 81 | JS_STATIC_METHOD(exportAsXFDF, CJS_Document) |
| 82 | JS_STATIC_METHOD(extractPages, CJS_Document) |
| 83 | JS_STATIC_METHOD(getAnnot, CJS_Document) |
| 84 | JS_STATIC_METHOD(getAnnots, CJS_Document) |
| 85 | JS_STATIC_METHOD(getAnnot3D, CJS_Document) |
| 86 | JS_STATIC_METHOD(getAnnots3D, CJS_Document) |
| 87 | JS_STATIC_METHOD(getField, CJS_Document) |
| 88 | JS_STATIC_METHOD(getIcon, CJS_Document) |
| 89 | JS_STATIC_METHOD(getLinks, CJS_Document) |
| 90 | JS_STATIC_METHOD(getNthFieldName, CJS_Document) |
| 91 | JS_STATIC_METHOD(getOCGs, CJS_Document) |
| 92 | JS_STATIC_METHOD(getPageBox, CJS_Document) |
| 93 | JS_STATIC_METHOD(getPageNthWord, CJS_Document) |
| 94 | JS_STATIC_METHOD(getPageNthWordQuads, CJS_Document) |
| 95 | JS_STATIC_METHOD(getPageNumWords, CJS_Document) |
| 96 | JS_STATIC_METHOD(getPrintParams, CJS_Document) |
| 97 | JS_STATIC_METHOD(getURL, CJS_Document) |
| 98 | JS_STATIC_METHOD(gotoNamedDest, CJS_Document) |
| 99 | JS_STATIC_METHOD(importAnFDF, CJS_Document) |
| 100 | JS_STATIC_METHOD(importAnXFDF, CJS_Document) |
| 101 | JS_STATIC_METHOD(importTextData, CJS_Document) |
| 102 | JS_STATIC_METHOD(insertPages, CJS_Document) |
| 103 | JS_STATIC_METHOD(mailDoc, CJS_Document) |
| 104 | JS_STATIC_METHOD(mailForm, CJS_Document) |
| 105 | JS_STATIC_METHOD(print, CJS_Document) |
| 106 | JS_STATIC_METHOD(removeField, CJS_Document) |
| 107 | JS_STATIC_METHOD(replacePages, CJS_Document) |
| 108 | JS_STATIC_METHOD(removeIcon, CJS_Document) |
| 109 | JS_STATIC_METHOD(resetForm, CJS_Document) |
| 110 | JS_STATIC_METHOD(saveAs, CJS_Document) |
| 111 | JS_STATIC_METHOD(submitForm, CJS_Document) |
| 112 | JS_STATIC_METHOD(syncAnnotScan, CJS_Document) |
Dan Sinclair | f743552 | 2018-02-05 22:27:22 +0000 | [diff] [blame] | 113 | |
| 114 | private: |
| 115 | static int ObjDefnID; |
| 116 | static const char kName[]; |
| 117 | static const JSPropertySpec PropertySpecs[]; |
| 118 | static const JSMethodSpec MethodSpecs[]; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 119 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 120 | CJS_Result get_ADBE(CJS_Runtime* pRuntime); |
| 121 | CJS_Result set_ADBE(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 122 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 123 | CJS_Result get_author(CJS_Runtime* pRuntime); |
| 124 | CJS_Result set_author(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 125 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 126 | CJS_Result get_base_URL(CJS_Runtime* pRuntime); |
| 127 | CJS_Result set_base_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 128 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 129 | CJS_Result get_bookmark_root(CJS_Runtime* pRuntime); |
| 130 | CJS_Result set_bookmark_root(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 131 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 132 | CJS_Result get_calculate(CJS_Runtime* pRuntime); |
| 133 | CJS_Result set_calculate(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 134 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 135 | CJS_Result get_collab(CJS_Runtime* pRuntime); |
| 136 | CJS_Result set_collab(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 137 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 138 | CJS_Result get_creation_date(CJS_Runtime* pRuntime); |
| 139 | CJS_Result set_creation_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 140 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 141 | CJS_Result get_creator(CJS_Runtime* pRuntime); |
| 142 | CJS_Result set_creator(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 143 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 144 | CJS_Result get_delay(CJS_Runtime* pRuntime); |
| 145 | CJS_Result set_delay(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 146 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 147 | CJS_Result get_dirty(CJS_Runtime* pRuntime); |
| 148 | CJS_Result set_dirty(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 149 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 150 | CJS_Result get_document_file_name(CJS_Runtime* pRuntime); |
| 151 | CJS_Result set_document_file_name(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 152 | v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 153 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 154 | CJS_Result get_external(CJS_Runtime* pRuntime); |
| 155 | CJS_Result set_external(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 156 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 157 | CJS_Result get_filesize(CJS_Runtime* pRuntime); |
| 158 | CJS_Result set_filesize(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 159 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 160 | CJS_Result get_icons(CJS_Runtime* pRuntime); |
| 161 | CJS_Result set_icons(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 162 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 163 | CJS_Result get_info(CJS_Runtime* pRuntime); |
| 164 | CJS_Result set_info(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 165 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 166 | CJS_Result get_keywords(CJS_Runtime* pRuntime); |
| 167 | CJS_Result set_keywords(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 168 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 169 | CJS_Result get_layout(CJS_Runtime* pRuntime); |
| 170 | CJS_Result set_layout(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 171 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 172 | CJS_Result get_media(CJS_Runtime* pRuntime); |
| 173 | CJS_Result set_media(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 174 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 175 | CJS_Result get_mod_date(CJS_Runtime* pRuntime); |
| 176 | CJS_Result set_mod_date(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 177 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 178 | CJS_Result get_mouse_x(CJS_Runtime* pRuntime); |
| 179 | CJS_Result set_mouse_x(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 180 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 181 | CJS_Result get_mouse_y(CJS_Runtime* pRuntime); |
| 182 | CJS_Result set_mouse_y(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 183 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 184 | CJS_Result get_num_fields(CJS_Runtime* pRuntime); |
| 185 | CJS_Result set_num_fields(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 186 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 187 | CJS_Result get_num_pages(CJS_Runtime* pRuntime); |
| 188 | CJS_Result set_num_pages(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 189 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 190 | CJS_Result get_page_num(CJS_Runtime* pRuntime); |
| 191 | CJS_Result set_page_num(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 192 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 193 | CJS_Result get_page_window_rect(CJS_Runtime* pRuntime); |
| 194 | CJS_Result set_page_window_rect(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 195 | v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 196 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 197 | CJS_Result get_path(CJS_Runtime* pRuntime); |
| 198 | CJS_Result set_path(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 199 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 200 | CJS_Result get_producer(CJS_Runtime* pRuntime); |
| 201 | CJS_Result set_producer(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 202 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 203 | CJS_Result get_subject(CJS_Runtime* pRuntime); |
| 204 | CJS_Result set_subject(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 205 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 206 | CJS_Result get_title(CJS_Runtime* pRuntime); |
| 207 | CJS_Result set_title(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 208 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 209 | CJS_Result get_zoom(CJS_Runtime* pRuntime); |
| 210 | CJS_Result set_zoom(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 211 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 212 | CJS_Result get_zoom_type(CJS_Runtime* pRuntime); |
| 213 | CJS_Result set_zoom_type(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
dan sinclair | cbe23db | 2017-10-19 14:29:33 -0400 | [diff] [blame] | 214 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 215 | CJS_Result get_URL(CJS_Runtime* pRuntime); |
| 216 | CJS_Result set_URL(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 217 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 218 | CJS_Result addAnnot(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 219 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 220 | CJS_Result addField(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 221 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 222 | CJS_Result addLink(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 223 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 224 | CJS_Result addIcon(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 225 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 226 | CJS_Result calculateNow(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 227 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 228 | CJS_Result closeDoc(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 229 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 230 | CJS_Result createDataObject(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 231 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 232 | CJS_Result deletePages(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 233 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 234 | CJS_Result exportAsText(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 235 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 236 | CJS_Result exportAsFDF(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 237 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 238 | CJS_Result exportAsXFDF(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 239 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 240 | CJS_Result extractPages(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 241 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 242 | CJS_Result getAnnot(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 243 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 244 | CJS_Result getAnnots(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 245 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 246 | CJS_Result getAnnot3D(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 247 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 248 | CJS_Result getAnnots3D(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 249 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 250 | CJS_Result getField(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 251 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 252 | CJS_Result getIcon(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 253 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 254 | CJS_Result getLinks(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 255 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 256 | CJS_Result getNthFieldName(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 257 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 258 | CJS_Result getOCGs(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 259 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 260 | CJS_Result getPageBox(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 261 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 262 | CJS_Result getPageNthWord(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 263 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 264 | CJS_Result getPageNthWordQuads( |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 265 | CJS_Runtime* pRuntime, |
| 266 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 267 | CJS_Result getPageNumWords(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 268 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 269 | CJS_Result getPrintParams(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 270 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 271 | CJS_Result getURL(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 272 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 273 | CJS_Result gotoNamedDest(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 274 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 275 | CJS_Result importAnFDF(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 276 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 277 | CJS_Result importAnXFDF(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 278 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 279 | CJS_Result importTextData(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 280 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 281 | CJS_Result insertPages(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 282 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 283 | CJS_Result mailForm(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 284 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 285 | CJS_Result print(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 286 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 287 | CJS_Result removeField(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 288 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 289 | CJS_Result replacePages(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 290 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 291 | CJS_Result resetForm(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 292 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 293 | CJS_Result saveAs(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 294 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 295 | CJS_Result submitForm(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 296 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 297 | CJS_Result syncAnnotScan(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 298 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 299 | CJS_Result mailDoc(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 300 | const std::vector<v8::Local<v8::Value>>& params); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 301 | CJS_Result removeIcon(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 302 | const std::vector<v8::Local<v8::Value>>& params); |
Lei Zhang | a6d9f0e | 2015-06-13 00:48:38 -0700 | [diff] [blame] | 303 | |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 304 | CJS_Result getPropertyInternal(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 305 | const ByteString& propName); |
Tom Sepez | 3a6d058 | 2018-08-17 19:28:52 +0000 | [diff] [blame] | 306 | CJS_Result setPropertyInternal(CJS_Runtime* pRuntime, |
Dan Sinclair | 8f524d6 | 2017-10-25 13:30:31 -0400 | [diff] [blame] | 307 | v8::Local<v8::Value> vp, |
| 308 | const ByteString& propName); |
tonikitoo | ea3ff9e | 2016-08-02 11:52:28 -0700 | [diff] [blame] | 309 | |
Lei Zhang | 073ecf4 | 2018-10-11 16:56:00 +0000 | [diff] [blame] | 310 | CPDF_InteractiveForm* GetCoreInteractiveForm(); |
| 311 | CPDFSDK_InteractiveForm* GetSDKInteractiveForm(); |
Lei Zhang | ab22647 | 2018-10-09 20:44:55 +0000 | [diff] [blame] | 312 | |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 313 | WideString m_cwBaseURL; |
Tom Sepez | 36aae4f | 2018-06-04 19:44:37 +0000 | [diff] [blame] | 314 | CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; |
Tom Sepez | 56c1019 | 2016-03-15 12:34:17 -0700 | [diff] [blame] | 315 | std::list<std::unique_ptr<CJS_DelayData>> m_DelayData; |
Lei Zhang | 313c425 | 2017-02-27 16:37:36 -0800 | [diff] [blame] | 316 | // Needs to be a std::list for iterator stability. |
Ryan Harrison | 275e260 | 2017-09-18 14:23:18 -0400 | [diff] [blame] | 317 | std::list<WideString> m_IconNames; |
Tom Sepez | 36aae4f | 2018-06-04 19:44:37 +0000 | [diff] [blame] | 318 | bool m_bDelay = false; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 319 | }; |
| 320 | |
Dan Sinclair | e0345a4 | 2017-10-30 20:20:42 +0000 | [diff] [blame] | 321 | #endif // FXJS_CJS_DOCUMENT_H_ |