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