John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 1 | // Copyright 2014 PDFium Authors. All rights reserved. |
| 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 | f766ad2 | 2016-03-14 13:51:24 -0400 | [diff] [blame] | 7 | #ifndef FPDFSDK_JAVASCRIPT_FIELD_H_ |
| 8 | #define FPDFSDK_JAVASCRIPT_FIELD_H_ |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 9 | |
Dan Sinclair | 3ebd121 | 2016-03-09 09:59:23 -0500 | [diff] [blame] | 10 | #include <string> |
| 11 | #include <vector> |
Tom Sepez | 9a3f812 | 2015-04-07 15:35:48 -0700 | [diff] [blame] | 12 | |
dsinclair | a52ab74 | 2016-09-29 13:59:29 -0700 | [diff] [blame] | 13 | #include "core/fxcrt/cfx_observable.h" |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 14 | #include "fpdfsdk/cpdfsdk_formfillenvironment.h" |
Dan Sinclair | f766ad2 | 2016-03-14 13:51:24 -0400 | [diff] [blame] | 15 | #include "fpdfsdk/javascript/JS_Define.h" |
dan sinclair | 89e904b | 2016-03-23 19:29:15 -0400 | [diff] [blame] | 16 | #include "fpdfsdk/pdfwindow/PWL_Wnd.h" // For CPWL_Color. |
Tom Sepez | 9a3f812 | 2015-04-07 15:35:48 -0700 | [diff] [blame] | 17 | |
Tom Sepez | 3745841 | 2015-10-06 11:33:46 -0700 | [diff] [blame] | 18 | class CPDFSDK_Widget; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 19 | class Document; |
| 20 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 21 | enum FIELD_PROP { |
| 22 | FP_ALIGNMENT, |
| 23 | FP_BORDERSTYLE, |
| 24 | FP_BUTTONALIGNX, |
| 25 | FP_BUTTONALIGNY, |
| 26 | FP_BUTTONFITBOUNDS, |
| 27 | FP_BUTTONPOSITION, |
| 28 | FP_BUTTONSCALEHOW, |
| 29 | FP_BUTTONSCALEWHEN, |
| 30 | FP_CALCORDERINDEX, |
| 31 | FP_CHARLIMIT, |
| 32 | FP_COMB, |
| 33 | FP_COMMITONSELCHANGE, |
| 34 | FP_CURRENTVALUEINDICES, |
| 35 | FP_DEFAULTVALUE, |
| 36 | FP_DONOTSCROLL, |
| 37 | FP_DISPLAY, |
| 38 | FP_FILLCOLOR, |
| 39 | FP_HIDDEN, |
| 40 | FP_HIGHLIGHT, |
| 41 | FP_LINEWIDTH, |
| 42 | FP_MULTILINE, |
| 43 | FP_MULTIPLESELECTION, |
| 44 | FP_PASSWORD, |
| 45 | FP_RECT, |
| 46 | FP_RICHTEXT, |
| 47 | FP_RICHVALUE, |
| 48 | FP_ROTATION, |
| 49 | FP_STROKECOLOR, |
| 50 | FP_STYLE, |
| 51 | FP_TEXTCOLOR, |
| 52 | FP_TEXTFONT, |
| 53 | FP_TEXTSIZE, |
| 54 | FP_USERNAME, |
| 55 | FP_VALUE |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 56 | }; |
| 57 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 58 | struct CJS_DelayData { |
weili | 625ad66 | 2016-06-15 11:21:33 -0700 | [diff] [blame] | 59 | CJS_DelayData(FIELD_PROP prop, int idx, const CFX_WideString& name); |
| 60 | ~CJS_DelayData(); |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 61 | |
| 62 | FIELD_PROP eProp; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 63 | int nControlIndex; |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 64 | CFX_WideString sFieldName; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 65 | int32_t num; |
| 66 | bool b; |
| 67 | CFX_ByteString string; |
| 68 | CFX_WideString widestring; |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 69 | CFX_FloatRect rect; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 70 | CPWL_Color color; |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 71 | std::vector<uint32_t> wordarray; |
| 72 | std::vector<CFX_WideString> widestringarray; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 73 | }; |
| 74 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 75 | class Field : public CJS_EmbedObj { |
| 76 | public: |
Lei Zhang | d88a364 | 2015-11-10 09:38:57 -0800 | [diff] [blame] | 77 | explicit Field(CJS_Object* pJSObject); |
Lei Zhang | 2b1a2d5 | 2015-08-14 22:16:22 -0700 | [diff] [blame] | 78 | ~Field() override; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 79 | |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 80 | bool alignment(IJS_EventContext* cc, |
| 81 | CJS_PropValue& vp, |
| 82 | CFX_WideString& sError); |
| 83 | bool borderStyle(IJS_EventContext* cc, |
| 84 | CJS_PropValue& vp, |
| 85 | CFX_WideString& sError); |
| 86 | bool buttonAlignX(IJS_EventContext* cc, |
| 87 | CJS_PropValue& vp, |
| 88 | CFX_WideString& sError); |
| 89 | bool buttonAlignY(IJS_EventContext* cc, |
| 90 | CJS_PropValue& vp, |
| 91 | CFX_WideString& sError); |
| 92 | bool buttonFitBounds(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 93 | CJS_PropValue& vp, |
| 94 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 95 | bool buttonPosition(IJS_EventContext* cc, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 96 | CJS_PropValue& vp, |
| 97 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 98 | bool buttonScaleHow(IJS_EventContext* cc, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 99 | CJS_PropValue& vp, |
| 100 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 101 | bool buttonScaleWhen(IJS_EventContext* cc, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 102 | CJS_PropValue& vp, |
| 103 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 104 | bool calcOrderIndex(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 105 | CJS_PropValue& vp, |
| 106 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 107 | bool charLimit(IJS_EventContext* cc, |
| 108 | CJS_PropValue& vp, |
| 109 | CFX_WideString& sError); |
| 110 | bool comb(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 111 | bool commitOnSelChange(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 112 | CJS_PropValue& vp, |
| 113 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 114 | bool currentValueIndices(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 115 | CJS_PropValue& vp, |
| 116 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 117 | bool defaultStyle(IJS_EventContext* cc, |
| 118 | CJS_PropValue& vp, |
| 119 | CFX_WideString& sError); |
| 120 | bool defaultValue(IJS_EventContext* cc, |
| 121 | CJS_PropValue& vp, |
| 122 | CFX_WideString& sError); |
| 123 | bool doNotScroll(IJS_EventContext* cc, |
| 124 | CJS_PropValue& vp, |
| 125 | CFX_WideString& sError); |
| 126 | bool doNotSpellCheck(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 127 | CJS_PropValue& vp, |
| 128 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 129 | bool delay(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 130 | bool display(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 131 | bool doc(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 132 | bool editable(IJS_EventContext* cc, |
| 133 | CJS_PropValue& vp, |
| 134 | CFX_WideString& sError); |
| 135 | bool exportValues(IJS_EventContext* cc, |
| 136 | CJS_PropValue& vp, |
| 137 | CFX_WideString& sError); |
| 138 | bool fileSelect(IJS_EventContext* cc, |
| 139 | CJS_PropValue& vp, |
| 140 | CFX_WideString& sError); |
| 141 | bool fillColor(IJS_EventContext* cc, |
| 142 | CJS_PropValue& vp, |
| 143 | CFX_WideString& sError); |
| 144 | bool hidden(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 145 | bool highlight(IJS_EventContext* cc, |
| 146 | CJS_PropValue& vp, |
| 147 | CFX_WideString& sError); |
| 148 | bool lineWidth(IJS_EventContext* cc, |
| 149 | CJS_PropValue& vp, |
| 150 | CFX_WideString& sError); |
| 151 | bool multiline(IJS_EventContext* cc, |
| 152 | CJS_PropValue& vp, |
| 153 | CFX_WideString& sError); |
| 154 | bool multipleSelection(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 155 | CJS_PropValue& vp, |
| 156 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 157 | bool name(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 158 | bool numItems(IJS_EventContext* cc, |
| 159 | CJS_PropValue& vp, |
| 160 | CFX_WideString& sError); |
| 161 | bool page(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 162 | bool password(IJS_EventContext* cc, |
| 163 | CJS_PropValue& vp, |
| 164 | CFX_WideString& sError); |
| 165 | bool print(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 166 | bool radiosInUnison(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 167 | CJS_PropValue& vp, |
| 168 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 169 | bool readonly(IJS_EventContext* cc, |
| 170 | CJS_PropValue& vp, |
| 171 | CFX_WideString& sError); |
| 172 | bool rect(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 173 | bool required(IJS_EventContext* cc, |
| 174 | CJS_PropValue& vp, |
| 175 | CFX_WideString& sError); |
| 176 | bool richText(IJS_EventContext* cc, |
| 177 | CJS_PropValue& vp, |
| 178 | CFX_WideString& sError); |
| 179 | bool richValue(IJS_EventContext* cc, |
| 180 | CJS_PropValue& vp, |
| 181 | CFX_WideString& sError); |
| 182 | bool rotation(IJS_EventContext* cc, |
| 183 | CJS_PropValue& vp, |
| 184 | CFX_WideString& sError); |
| 185 | bool strokeColor(IJS_EventContext* cc, |
| 186 | CJS_PropValue& vp, |
| 187 | CFX_WideString& sError); |
| 188 | bool style(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 189 | bool submitName(IJS_EventContext* cc, |
| 190 | CJS_PropValue& vp, |
| 191 | CFX_WideString& sError); |
| 192 | bool textColor(IJS_EventContext* cc, |
| 193 | CJS_PropValue& vp, |
| 194 | CFX_WideString& sError); |
| 195 | bool textFont(IJS_EventContext* cc, |
| 196 | CJS_PropValue& vp, |
| 197 | CFX_WideString& sError); |
| 198 | bool textSize(IJS_EventContext* cc, |
| 199 | CJS_PropValue& vp, |
| 200 | CFX_WideString& sError); |
| 201 | bool type(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 202 | bool userName(IJS_EventContext* cc, |
| 203 | CJS_PropValue& vp, |
| 204 | CFX_WideString& sError); |
| 205 | bool value(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
| 206 | bool valueAsString(IJS_EventContext* cc, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 207 | CJS_PropValue& vp, |
| 208 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 209 | bool source(IJS_EventContext* cc, CJS_PropValue& vp, CFX_WideString& sError); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 210 | |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 211 | bool browseForFileToSubmit(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 212 | const std::vector<CJS_Value>& params, |
| 213 | CJS_Value& vRet, |
| 214 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 215 | bool buttonGetCaption(IJS_EventContext* cc, |
Lei Zhang | 945fdb7 | 2015-11-11 10:18:16 -0800 | [diff] [blame] | 216 | const std::vector<CJS_Value>& params, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 217 | CJS_Value& vRet, |
| 218 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 219 | bool buttonGetIcon(IJS_EventContext* cc, |
Lei Zhang | 945fdb7 | 2015-11-11 10:18:16 -0800 | [diff] [blame] | 220 | const std::vector<CJS_Value>& params, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 221 | CJS_Value& vRet, |
| 222 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 223 | bool buttonImportIcon(IJS_EventContext* cc, |
Lei Zhang | 945fdb7 | 2015-11-11 10:18:16 -0800 | [diff] [blame] | 224 | const std::vector<CJS_Value>& params, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 225 | CJS_Value& vRet, |
| 226 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 227 | bool buttonSetCaption(IJS_EventContext* cc, |
Lei Zhang | 945fdb7 | 2015-11-11 10:18:16 -0800 | [diff] [blame] | 228 | const std::vector<CJS_Value>& params, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 229 | CJS_Value& vRet, |
| 230 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 231 | bool buttonSetIcon(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 232 | const std::vector<CJS_Value>& params, |
| 233 | CJS_Value& vRet, |
| 234 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 235 | bool checkThisBox(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 236 | const std::vector<CJS_Value>& params, |
| 237 | CJS_Value& vRet, |
| 238 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 239 | bool clearItems(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 240 | const std::vector<CJS_Value>& params, |
| 241 | CJS_Value& vRet, |
| 242 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 243 | bool defaultIsChecked(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 244 | const std::vector<CJS_Value>& params, |
| 245 | CJS_Value& vRet, |
| 246 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 247 | bool deleteItemAt(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 248 | const std::vector<CJS_Value>& params, |
| 249 | CJS_Value& vRet, |
| 250 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 251 | bool getArray(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 252 | const std::vector<CJS_Value>& params, |
| 253 | CJS_Value& vRet, |
| 254 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 255 | bool getItemAt(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 256 | const std::vector<CJS_Value>& params, |
| 257 | CJS_Value& vRet, |
| 258 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 259 | bool getLock(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 260 | const std::vector<CJS_Value>& params, |
| 261 | CJS_Value& vRet, |
| 262 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 263 | bool insertItemAt(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 264 | const std::vector<CJS_Value>& params, |
| 265 | CJS_Value& vRet, |
| 266 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 267 | bool isBoxChecked(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 268 | const std::vector<CJS_Value>& params, |
| 269 | CJS_Value& vRet, |
| 270 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 271 | bool isDefaultChecked(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 272 | const std::vector<CJS_Value>& params, |
| 273 | CJS_Value& vRet, |
| 274 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 275 | bool setAction(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 276 | const std::vector<CJS_Value>& params, |
| 277 | CJS_Value& vRet, |
| 278 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 279 | bool setFocus(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 280 | const std::vector<CJS_Value>& params, |
| 281 | CJS_Value& vRet, |
| 282 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 283 | bool setItems(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 284 | const std::vector<CJS_Value>& params, |
| 285 | CJS_Value& vRet, |
| 286 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 287 | bool setLock(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 288 | const std::vector<CJS_Value>& params, |
| 289 | CJS_Value& vRet, |
| 290 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 291 | bool signatureGetModifications(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 292 | const std::vector<CJS_Value>& params, |
| 293 | CJS_Value& vRet, |
| 294 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 295 | bool signatureGetSeedValue(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 296 | const std::vector<CJS_Value>& params, |
| 297 | CJS_Value& vRet, |
| 298 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 299 | bool signatureInfo(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 300 | const std::vector<CJS_Value>& params, |
| 301 | CJS_Value& vRet, |
| 302 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 303 | bool signatureSetSeedValue(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 304 | const std::vector<CJS_Value>& params, |
| 305 | CJS_Value& vRet, |
| 306 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 307 | bool signatureSign(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 308 | const std::vector<CJS_Value>& params, |
| 309 | CJS_Value& vRet, |
| 310 | CFX_WideString& sError); |
Tom Sepez | d6ae2af | 2017-02-16 11:49:55 -0800 | [diff] [blame^] | 311 | bool signatureValidate(IJS_EventContext* cc, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 312 | const std::vector<CJS_Value>& params, |
| 313 | CJS_Value& vRet, |
| 314 | CFX_WideString& sError); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 315 | |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 316 | static void SetAlignment(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 317 | const CFX_WideString& swFieldName, |
| 318 | int nControlIndex, |
| 319 | const CFX_ByteString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 320 | static void SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 321 | const CFX_WideString& swFieldName, |
| 322 | int nControlIndex, |
| 323 | const CFX_ByteString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 324 | static void SetButtonAlignX(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 325 | const CFX_WideString& swFieldName, |
| 326 | int nControlIndex, |
| 327 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 328 | static void SetButtonAlignY(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 329 | const CFX_WideString& swFieldName, |
| 330 | int nControlIndex, |
| 331 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 332 | static void SetButtonFitBounds(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 333 | const CFX_WideString& swFieldName, |
| 334 | int nControlIndex, |
| 335 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 336 | static void SetButtonPosition(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 337 | const CFX_WideString& swFieldName, |
| 338 | int nControlIndex, |
| 339 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 340 | static void SetButtonScaleHow(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 341 | const CFX_WideString& swFieldName, |
| 342 | int nControlIndex, |
| 343 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 344 | static void SetButtonScaleWhen(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 345 | const CFX_WideString& swFieldName, |
| 346 | int nControlIndex, |
| 347 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 348 | static void SetCalcOrderIndex(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 349 | const CFX_WideString& swFieldName, |
| 350 | int nControlIndex, |
| 351 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 352 | static void SetCharLimit(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 353 | const CFX_WideString& swFieldName, |
| 354 | int nControlIndex, |
| 355 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 356 | static void SetComb(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 357 | const CFX_WideString& swFieldName, |
| 358 | int nControlIndex, |
| 359 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 360 | static void SetCommitOnSelChange(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 361 | const CFX_WideString& swFieldName, |
| 362 | int nControlIndex, |
| 363 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 364 | static void SetCurrentValueIndices(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 365 | const CFX_WideString& swFieldName, |
| 366 | int nControlIndex, |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 367 | const std::vector<uint32_t>& array); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 368 | static void SetDefaultStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 369 | const CFX_WideString& swFieldName, |
| 370 | int nControlIndex); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 371 | static void SetDefaultValue(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 372 | const CFX_WideString& swFieldName, |
| 373 | int nControlIndex, |
| 374 | const CFX_WideString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 375 | static void SetDoNotScroll(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 376 | const CFX_WideString& swFieldName, |
| 377 | int nControlIndex, |
| 378 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 379 | static void SetDisplay(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 380 | const CFX_WideString& swFieldName, |
| 381 | int nControlIndex, |
| 382 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 383 | static void SetFillColor(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 384 | const CFX_WideString& swFieldName, |
| 385 | int nControlIndex, |
| 386 | const CPWL_Color& color); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 387 | static void SetHidden(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 388 | const CFX_WideString& swFieldName, |
| 389 | int nControlIndex, |
| 390 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 391 | static void SetHighlight(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 392 | const CFX_WideString& swFieldName, |
| 393 | int nControlIndex, |
| 394 | const CFX_ByteString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 395 | static void SetLineWidth(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 396 | const CFX_WideString& swFieldName, |
| 397 | int nControlIndex, |
| 398 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 399 | static void SetMultiline(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 400 | const CFX_WideString& swFieldName, |
| 401 | int nControlIndex, |
| 402 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 403 | static void SetMultipleSelection(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 404 | const CFX_WideString& swFieldName, |
| 405 | int nControlIndex, |
| 406 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 407 | static void SetPassword(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 408 | const CFX_WideString& swFieldName, |
| 409 | int nControlIndex, |
| 410 | bool b); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 411 | static void SetRect(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 412 | const CFX_WideString& swFieldName, |
| 413 | int nControlIndex, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 414 | const CFX_FloatRect& rect); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 415 | static void SetRotation(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 416 | const CFX_WideString& swFieldName, |
| 417 | int nControlIndex, |
| 418 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 419 | static void SetStrokeColor(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 420 | const CFX_WideString& swFieldName, |
| 421 | int nControlIndex, |
| 422 | const CPWL_Color& color); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 423 | static void SetStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 424 | const CFX_WideString& swFieldName, |
| 425 | int nControlIndex, |
| 426 | const CFX_ByteString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 427 | static void SetTextColor(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 428 | const CFX_WideString& swFieldName, |
| 429 | int nControlIndex, |
| 430 | const CPWL_Color& color); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 431 | static void SetTextFont(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 432 | const CFX_WideString& swFieldName, |
| 433 | int nControlIndex, |
| 434 | const CFX_ByteString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 435 | static void SetTextSize(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 436 | const CFX_WideString& swFieldName, |
| 437 | int nControlIndex, |
| 438 | int number); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 439 | static void SetUserName(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 440 | const CFX_WideString& swFieldName, |
| 441 | int nControlIndex, |
| 442 | const CFX_WideString& string); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 443 | static void SetValue(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 444 | const CFX_WideString& swFieldName, |
| 445 | int nControlIndex, |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 446 | const std::vector<CFX_WideString>& strArray); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 447 | |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 448 | static void AddField(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 449 | int nPageIndex, |
| 450 | int nFieldType, |
| 451 | const CFX_WideString& sName, |
Tom Sepez | 281a9ea | 2016-02-26 14:24:28 -0800 | [diff] [blame] | 452 | const CFX_FloatRect& rcCoords); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 453 | |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 454 | static void UpdateFormField(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 455 | CPDF_FormField* pFormField, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 456 | bool bChangeMark, |
| 457 | bool bResetAP, |
| 458 | bool bRefresh); |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 459 | static void UpdateFormControl(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 460 | CPDF_FormControl* pFormControl, |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 461 | bool bChangeMark, |
| 462 | bool bResetAP, |
| 463 | bool bRefresh); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 464 | |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 465 | static CPDFSDK_Widget* GetWidget(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
dsinclair | c5267c5 | 2016-11-04 15:35:12 -0700 | [diff] [blame] | 466 | CPDF_FormControl* pFormControl); |
Lei Zhang | d88a364 | 2015-11-10 09:38:57 -0800 | [diff] [blame] | 467 | static std::vector<CPDF_FormField*> GetFormFields( |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 468 | CPDFSDK_FormFillEnvironment* pFormFillEnv, |
Lei Zhang | d88a364 | 2015-11-10 09:38:57 -0800 | [diff] [blame] | 469 | const CFX_WideString& csFieldName); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 470 | |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 471 | static void DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv, |
| 472 | CJS_DelayData* pData); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 473 | |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 474 | bool AttachField(Document* pDocument, const CFX_WideString& csFieldName); |
| 475 | void SetDelay(bool bDelay); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 476 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 477 | protected: |
| 478 | void ParseFieldName(const std::wstring& strFieldNameParsed, |
| 479 | std::wstring& strFieldName, |
| 480 | int& iControlNo); |
Lei Zhang | d88a364 | 2015-11-10 09:38:57 -0800 | [diff] [blame] | 481 | std::vector<CPDF_FormField*> GetFormFields( |
| 482 | const CFX_WideString& csFieldName) const; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 483 | CPDF_FormControl* GetSmartFieldControl(CPDF_FormField* pFormField); |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 484 | bool ValueIsOccur(CPDF_FormField* pFormField, CFX_WideString csOptLabel); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 485 | |
tsepez | 41a53ad | 2016-03-28 16:59:30 -0700 | [diff] [blame] | 486 | void AddDelay_Int(FIELD_PROP prop, int32_t n); |
| 487 | void AddDelay_Bool(FIELD_PROP prop, bool b); |
| 488 | void AddDelay_String(FIELD_PROP prop, const CFX_ByteString& string); |
| 489 | void AddDelay_WideString(FIELD_PROP prop, const CFX_WideString& string); |
| 490 | void AddDelay_Rect(FIELD_PROP prop, const CFX_FloatRect& rect); |
| 491 | void AddDelay_Color(FIELD_PROP prop, const CPWL_Color& color); |
| 492 | void AddDelay_WordArray(FIELD_PROP prop, const std::vector<uint32_t>& array); |
| 493 | void AddDelay_WideStringArray(FIELD_PROP prop, |
| 494 | const std::vector<CFX_WideString>& array); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 495 | |
| 496 | void DoDelay(); |
| 497 | |
| 498 | public: |
| 499 | Document* m_pJSDoc; |
dsinclair | 3a7741a | 2016-10-11 10:39:49 -0700 | [diff] [blame] | 500 | CPDFSDK_FormFillEnvironment::ObservedPtr m_pFormFillEnv; |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 501 | CFX_WideString m_FieldName; |
| 502 | int m_nFormControlIndex; |
tsepez | 4cf5515 | 2016-11-02 14:37:54 -0700 | [diff] [blame] | 503 | bool m_bCanSet; |
| 504 | bool m_bDelay; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 505 | }; |
| 506 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 507 | class CJS_Field : public CJS_Object { |
| 508 | public: |
Lei Zhang | d88a364 | 2015-11-10 09:38:57 -0800 | [diff] [blame] | 509 | explicit CJS_Field(v8::Local<v8::Object> pObject) : CJS_Object(pObject) {} |
weili | bff506d | 2016-06-20 11:37:05 -0700 | [diff] [blame] | 510 | ~CJS_Field() override {} |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 511 | |
Tom Sepez | 3342090 | 2015-10-13 15:00:10 -0700 | [diff] [blame] | 512 | void InitInstance(IJS_Runtime* pIRuntime) override; |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 513 | |
Tom Sepez | cd56a7d | 2015-10-06 11:45:28 -0700 | [diff] [blame] | 514 | DECLARE_JS_CLASS(); |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 515 | JS_STATIC_PROP(alignment, Field); |
| 516 | JS_STATIC_PROP(borderStyle, Field); |
| 517 | JS_STATIC_PROP(buttonAlignX, Field); |
| 518 | JS_STATIC_PROP(buttonAlignY, Field); |
| 519 | JS_STATIC_PROP(buttonFitBounds, Field); |
| 520 | JS_STATIC_PROP(buttonPosition, Field); |
| 521 | JS_STATIC_PROP(buttonScaleHow, Field); |
| 522 | JS_STATIC_PROP(buttonScaleWhen, Field); |
| 523 | JS_STATIC_PROP(calcOrderIndex, Field); |
| 524 | JS_STATIC_PROP(charLimit, Field); |
| 525 | JS_STATIC_PROP(comb, Field); |
| 526 | JS_STATIC_PROP(commitOnSelChange, Field); |
| 527 | JS_STATIC_PROP(currentValueIndices, Field); |
| 528 | JS_STATIC_PROP(defaultStyle, Field); |
| 529 | JS_STATIC_PROP(defaultValue, Field); |
| 530 | JS_STATIC_PROP(doNotScroll, Field); |
| 531 | JS_STATIC_PROP(doNotSpellCheck, Field); |
| 532 | JS_STATIC_PROP(delay, Field); |
| 533 | JS_STATIC_PROP(display, Field); |
| 534 | JS_STATIC_PROP(doc, Field); |
| 535 | JS_STATIC_PROP(editable, Field); |
| 536 | JS_STATIC_PROP(exportValues, Field); |
| 537 | JS_STATIC_PROP(fileSelect, Field); |
| 538 | JS_STATIC_PROP(fillColor, Field); |
| 539 | JS_STATIC_PROP(hidden, Field); |
| 540 | JS_STATIC_PROP(highlight, Field); |
| 541 | JS_STATIC_PROP(lineWidth, Field); |
| 542 | JS_STATIC_PROP(multiline, Field); |
| 543 | JS_STATIC_PROP(multipleSelection, Field); |
| 544 | JS_STATIC_PROP(name, Field); |
| 545 | JS_STATIC_PROP(numItems, Field); |
| 546 | JS_STATIC_PROP(page, Field); |
| 547 | JS_STATIC_PROP(password, Field); |
| 548 | JS_STATIC_PROP(print, Field); |
| 549 | JS_STATIC_PROP(radiosInUnison, Field); |
| 550 | JS_STATIC_PROP(readonly, Field); |
| 551 | JS_STATIC_PROP(rect, Field); |
| 552 | JS_STATIC_PROP(required, Field); |
| 553 | JS_STATIC_PROP(richText, Field); |
| 554 | JS_STATIC_PROP(richValue, Field); |
| 555 | JS_STATIC_PROP(rotation, Field); |
| 556 | JS_STATIC_PROP(strokeColor, Field); |
| 557 | JS_STATIC_PROP(style, Field); |
| 558 | JS_STATIC_PROP(submitName, Field); |
| 559 | JS_STATIC_PROP(textColor, Field); |
| 560 | JS_STATIC_PROP(textFont, Field); |
| 561 | JS_STATIC_PROP(textSize, Field); |
| 562 | JS_STATIC_PROP(type, Field); |
| 563 | JS_STATIC_PROP(userName, Field); |
| 564 | JS_STATIC_PROP(value, Field); |
| 565 | JS_STATIC_PROP(valueAsString, Field); |
| 566 | JS_STATIC_PROP(source, Field); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 567 | |
Nico Weber | 9d8ec5a | 2015-08-04 13:00:21 -0700 | [diff] [blame] | 568 | JS_STATIC_METHOD(browseForFileToSubmit, Field); |
| 569 | JS_STATIC_METHOD(buttonGetCaption, Field); |
| 570 | JS_STATIC_METHOD(buttonGetIcon, Field); |
| 571 | JS_STATIC_METHOD(buttonImportIcon, Field); |
| 572 | JS_STATIC_METHOD(buttonSetCaption, Field); |
| 573 | JS_STATIC_METHOD(buttonSetIcon, Field); |
| 574 | JS_STATIC_METHOD(checkThisBox, Field); |
| 575 | JS_STATIC_METHOD(clearItems, Field); |
| 576 | JS_STATIC_METHOD(defaultIsChecked, Field); |
| 577 | JS_STATIC_METHOD(deleteItemAt, Field); |
| 578 | JS_STATIC_METHOD(getArray, Field); |
| 579 | JS_STATIC_METHOD(getItemAt, Field); |
| 580 | JS_STATIC_METHOD(getLock, Field); |
| 581 | JS_STATIC_METHOD(insertItemAt, Field); |
| 582 | JS_STATIC_METHOD(isBoxChecked, Field); |
| 583 | JS_STATIC_METHOD(isDefaultChecked, Field); |
| 584 | JS_STATIC_METHOD(setAction, Field); |
| 585 | JS_STATIC_METHOD(setFocus, Field); |
| 586 | JS_STATIC_METHOD(setItems, Field); |
| 587 | JS_STATIC_METHOD(setLock, Field); |
| 588 | JS_STATIC_METHOD(signatureGetModifications, Field); |
| 589 | JS_STATIC_METHOD(signatureGetSeedValue, Field); |
| 590 | JS_STATIC_METHOD(signatureInfo, Field); |
| 591 | JS_STATIC_METHOD(signatureSetSeedValue, Field); |
| 592 | JS_STATIC_METHOD(signatureSign, Field); |
| 593 | JS_STATIC_METHOD(signatureValidate, Field); |
John Abd-El-Malek | 3f3b45c | 2014-05-23 17:28:10 -0700 | [diff] [blame] | 594 | }; |
| 595 | |
Dan Sinclair | f766ad2 | 2016-03-14 13:51:24 -0400 | [diff] [blame] | 596 | #endif // FPDFSDK_JAVASCRIPT_FIELD_H_ |