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