Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: fpdfsdk/src/javascript/Field.cpp

Issue 1386173002: Rename IFXJS_Runtime and IFXJS_Context to IJS_. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Comment in fxjs_v8.h Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/javascript/Field.h ('k') | fpdfsdk/src/javascript/Icon.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "Field.h" 7 #include "Field.h"
8 8
9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. 9 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
10 #include "../../include/javascript/IJavaScript.h" 10 #include "../../include/javascript/IJavaScript.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 JS_STATIC_METHOD_ENTRY(signatureGetModifications) 103 JS_STATIC_METHOD_ENTRY(signatureGetModifications)
104 JS_STATIC_METHOD_ENTRY(signatureGetSeedValue) 104 JS_STATIC_METHOD_ENTRY(signatureGetSeedValue)
105 JS_STATIC_METHOD_ENTRY(signatureInfo) 105 JS_STATIC_METHOD_ENTRY(signatureInfo)
106 JS_STATIC_METHOD_ENTRY(signatureSetSeedValue) 106 JS_STATIC_METHOD_ENTRY(signatureSetSeedValue)
107 JS_STATIC_METHOD_ENTRY(signatureSign) 107 JS_STATIC_METHOD_ENTRY(signatureSign)
108 JS_STATIC_METHOD_ENTRY(signatureValidate) 108 JS_STATIC_METHOD_ENTRY(signatureValidate)
109 END_JS_STATIC_METHOD() 109 END_JS_STATIC_METHOD()
110 110
111 IMPLEMENT_JS_CLASS(CJS_Field, Field) 111 IMPLEMENT_JS_CLASS(CJS_Field, Field)
112 112
113 FX_BOOL CJS_Field::InitInstance(IFXJS_Context* cc) { 113 FX_BOOL CJS_Field::InitInstance(IJS_Context* cc) {
114 CJS_Context* pContext = (CJS_Context*)cc; 114 CJS_Context* pContext = (CJS_Context*)cc;
115 ASSERT(pContext != NULL); 115 ASSERT(pContext != NULL);
116 116
117 Field* pField = (Field*)GetEmbedObject(); 117 Field* pField = (Field*)GetEmbedObject();
118 ASSERT(pField != NULL); 118 ASSERT(pField != NULL);
119 119
120 pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate()); 120 pField->SetIsolate(pContext->GetJSRuntime()->GetIsolate());
121 121
122 return TRUE; 122 return TRUE;
123 }; 123 };
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 351
352 if (m_nFormControlIndex < 0) 352 if (m_nFormControlIndex < 0)
353 return pFormField->GetControl(0); 353 return pFormField->GetControl(0);
354 354
355 return pFormField->GetControl(m_nFormControlIndex); 355 return pFormField->GetControl(m_nFormControlIndex);
356 } 356 }
357 357
358 /* ---------------------------------------- property 358 /* ---------------------------------------- property
359 * ---------------------------------------- */ 359 * ---------------------------------------- */
360 360
361 FX_BOOL Field::alignment(IFXJS_Context* cc, 361 FX_BOOL Field::alignment(IJS_Context* cc,
362 CJS_PropValue& vp, 362 CJS_PropValue& vp,
363 CFX_WideString& sError) { 363 CFX_WideString& sError) {
364 ASSERT(m_pDocument != NULL); 364 ASSERT(m_pDocument != NULL);
365 365
366 if (vp.IsSetting()) { 366 if (vp.IsSetting()) {
367 if (!m_bCanSet) 367 if (!m_bCanSet)
368 return FALSE; 368 return FALSE;
369 369
370 CFX_ByteString alignStr; 370 CFX_ByteString alignStr;
371 vp >> alignStr; 371 vp >> alignStr;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 return TRUE; 410 return TRUE;
411 } 411 }
412 412
413 void Field::SetAlignment(CPDFSDK_Document* pDocument, 413 void Field::SetAlignment(CPDFSDK_Document* pDocument,
414 const CFX_WideString& swFieldName, 414 const CFX_WideString& swFieldName,
415 int nControlIndex, 415 int nControlIndex,
416 const CFX_ByteString& string) { 416 const CFX_ByteString& string) {
417 // Not supported. 417 // Not supported.
418 } 418 }
419 419
420 FX_BOOL Field::borderStyle(IFXJS_Context* cc, 420 FX_BOOL Field::borderStyle(IJS_Context* cc,
421 CJS_PropValue& vp, 421 CJS_PropValue& vp,
422 CFX_WideString& sError) { 422 CFX_WideString& sError) {
423 ASSERT(m_pDocument != NULL); 423 ASSERT(m_pDocument != NULL);
424 424
425 if (vp.IsSetting()) { 425 if (vp.IsSetting()) {
426 if (!m_bCanSet) 426 if (!m_bCanSet)
427 return FALSE; 427 return FALSE;
428 428
429 CFX_ByteString strType = ""; 429 CFX_ByteString strType = "";
430 vp >> strType; 430 vp >> strType;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 if (pWidget->GetBorderStyle() != nBorderStyle) { 527 if (pWidget->GetBorderStyle() != nBorderStyle) {
528 pWidget->SetBorderStyle(nBorderStyle); 528 pWidget->SetBorderStyle(nBorderStyle);
529 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); 529 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
530 } 530 }
531 } 531 }
532 } 532 }
533 } 533 }
534 } 534 }
535 } 535 }
536 536
537 FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, 537 FX_BOOL Field::buttonAlignX(IJS_Context* cc,
538 CJS_PropValue& vp, 538 CJS_PropValue& vp,
539 CFX_WideString& sError) { 539 CFX_WideString& sError) {
540 ASSERT(m_pDocument != NULL); 540 ASSERT(m_pDocument != NULL);
541 541
542 if (vp.IsSetting()) { 542 if (vp.IsSetting()) {
543 if (!m_bCanSet) 543 if (!m_bCanSet)
544 return FALSE; 544 return FALSE;
545 545
546 int nVP; 546 int nVP;
547 vp >> nVP; 547 vp >> nVP;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 return TRUE; 579 return TRUE;
580 } 580 }
581 581
582 void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, 582 void Field::SetButtonAlignX(CPDFSDK_Document* pDocument,
583 const CFX_WideString& swFieldName, 583 const CFX_WideString& swFieldName,
584 int nControlIndex, 584 int nControlIndex,
585 int number) { 585 int number) {
586 // Not supported. 586 // Not supported.
587 } 587 }
588 588
589 FX_BOOL Field::buttonAlignY(IFXJS_Context* cc, 589 FX_BOOL Field::buttonAlignY(IJS_Context* cc,
590 CJS_PropValue& vp, 590 CJS_PropValue& vp,
591 CFX_WideString& sError) { 591 CFX_WideString& sError) {
592 ASSERT(m_pDocument != NULL); 592 ASSERT(m_pDocument != NULL);
593 593
594 if (vp.IsSetting()) { 594 if (vp.IsSetting()) {
595 if (!m_bCanSet) 595 if (!m_bCanSet)
596 return FALSE; 596 return FALSE;
597 597
598 int nVP; 598 int nVP;
599 vp >> nVP; 599 vp >> nVP;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 return TRUE; 631 return TRUE;
632 } 632 }
633 633
634 void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, 634 void Field::SetButtonAlignY(CPDFSDK_Document* pDocument,
635 const CFX_WideString& swFieldName, 635 const CFX_WideString& swFieldName,
636 int nControlIndex, 636 int nControlIndex,
637 int number) { 637 int number) {
638 // Not supported. 638 // Not supported.
639 } 639 }
640 640
641 FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, 641 FX_BOOL Field::buttonFitBounds(IJS_Context* cc,
642 CJS_PropValue& vp, 642 CJS_PropValue& vp,
643 CFX_WideString& sError) { 643 CFX_WideString& sError) {
644 ASSERT(m_pDocument != NULL); 644 ASSERT(m_pDocument != NULL);
645 645
646 if (vp.IsSetting()) { 646 if (vp.IsSetting()) {
647 if (!m_bCanSet) 647 if (!m_bCanSet)
648 return FALSE; 648 return FALSE;
649 649
650 bool bVP; 650 bool bVP;
651 vp >> bVP; 651 vp >> bVP;
(...skipping 27 matching lines...) Expand all
679 return TRUE; 679 return TRUE;
680 } 680 }
681 681
682 void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument, 682 void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument,
683 const CFX_WideString& swFieldName, 683 const CFX_WideString& swFieldName,
684 int nControlIndex, 684 int nControlIndex,
685 bool b) { 685 bool b) {
686 // Not supported. 686 // Not supported.
687 } 687 }
688 688
689 FX_BOOL Field::buttonPosition(IFXJS_Context* cc, 689 FX_BOOL Field::buttonPosition(IJS_Context* cc,
690 CJS_PropValue& vp, 690 CJS_PropValue& vp,
691 CFX_WideString& sError) { 691 CFX_WideString& sError) {
692 ASSERT(m_pDocument != NULL); 692 ASSERT(m_pDocument != NULL);
693 693
694 if (vp.IsSetting()) { 694 if (vp.IsSetting()) {
695 if (!m_bCanSet) 695 if (!m_bCanSet)
696 return FALSE; 696 return FALSE;
697 697
698 int nVP; 698 int nVP;
699 vp >> nVP; 699 vp >> nVP;
(...skipping 25 matching lines...) Expand all
725 return TRUE; 725 return TRUE;
726 } 726 }
727 727
728 void Field::SetButtonPosition(CPDFSDK_Document* pDocument, 728 void Field::SetButtonPosition(CPDFSDK_Document* pDocument,
729 const CFX_WideString& swFieldName, 729 const CFX_WideString& swFieldName,
730 int nControlIndex, 730 int nControlIndex,
731 int number) { 731 int number) {
732 // Not supported. 732 // Not supported.
733 } 733 }
734 734
735 FX_BOOL Field::buttonScaleHow(IFXJS_Context* cc, 735 FX_BOOL Field::buttonScaleHow(IJS_Context* cc,
736 CJS_PropValue& vp, 736 CJS_PropValue& vp,
737 CFX_WideString& sError) { 737 CFX_WideString& sError) {
738 ASSERT(m_pDocument != NULL); 738 ASSERT(m_pDocument != NULL);
739 739
740 if (vp.IsSetting()) { 740 if (vp.IsSetting()) {
741 if (!m_bCanSet) 741 if (!m_bCanSet)
742 return FALSE; 742 return FALSE;
743 743
744 int nVP; 744 int nVP;
745 vp >> nVP; 745 vp >> nVP;
(...skipping 30 matching lines...) Expand all
776 return TRUE; 776 return TRUE;
777 } 777 }
778 778
779 void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, 779 void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument,
780 const CFX_WideString& swFieldName, 780 const CFX_WideString& swFieldName,
781 int nControlIndex, 781 int nControlIndex,
782 int number) { 782 int number) {
783 // Not supported. 783 // Not supported.
784 } 784 }
785 785
786 FX_BOOL Field::buttonScaleWhen(IFXJS_Context* cc, 786 FX_BOOL Field::buttonScaleWhen(IJS_Context* cc,
787 CJS_PropValue& vp, 787 CJS_PropValue& vp,
788 CFX_WideString& sError) { 788 CFX_WideString& sError) {
789 ASSERT(m_pDocument != NULL); 789 ASSERT(m_pDocument != NULL);
790 790
791 if (vp.IsSetting()) { 791 if (vp.IsSetting()) {
792 if (!m_bCanSet) 792 if (!m_bCanSet)
793 return FALSE; 793 return FALSE;
794 794
795 int nVP; 795 int nVP;
796 vp >> nVP; 796 vp >> nVP;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 return TRUE; 838 return TRUE;
839 } 839 }
840 840
841 void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, 841 void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument,
842 const CFX_WideString& swFieldName, 842 const CFX_WideString& swFieldName,
843 int nControlIndex, 843 int nControlIndex,
844 int number) { 844 int number) {
845 // Not supported. 845 // Not supported.
846 } 846 }
847 847
848 FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, 848 FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
849 CJS_PropValue& vp, 849 CJS_PropValue& vp,
850 CFX_WideString& sError) { 850 CFX_WideString& sError) {
851 ASSERT(m_pDocument != NULL); 851 ASSERT(m_pDocument != NULL);
852 852
853 if (vp.IsSetting()) { 853 if (vp.IsSetting()) {
854 if (!m_bCanSet) 854 if (!m_bCanSet)
855 return FALSE; 855 return FALSE;
856 856
857 int nVP; 857 int nVP;
858 vp >> nVP; 858 vp >> nVP;
(...skipping 29 matching lines...) Expand all
888 return TRUE; 888 return TRUE;
889 } 889 }
890 890
891 void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, 891 void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument,
892 const CFX_WideString& swFieldName, 892 const CFX_WideString& swFieldName,
893 int nControlIndex, 893 int nControlIndex,
894 int number) { 894 int number) {
895 // Not supported. 895 // Not supported.
896 } 896 }
897 897
898 FX_BOOL Field::charLimit(IFXJS_Context* cc, 898 FX_BOOL Field::charLimit(IJS_Context* cc,
899 CJS_PropValue& vp, 899 CJS_PropValue& vp,
900 CFX_WideString& sError) { 900 CFX_WideString& sError) {
901 ASSERT(m_pDocument != NULL); 901 ASSERT(m_pDocument != NULL);
902 902
903 if (vp.IsSetting()) { 903 if (vp.IsSetting()) {
904 if (!m_bCanSet) 904 if (!m_bCanSet)
905 return FALSE; 905 return FALSE;
906 906
907 int nVP; 907 int nVP;
908 vp >> nVP; 908 vp >> nVP;
(...skipping 20 matching lines...) Expand all
929 return TRUE; 929 return TRUE;
930 } 930 }
931 931
932 void Field::SetCharLimit(CPDFSDK_Document* pDocument, 932 void Field::SetCharLimit(CPDFSDK_Document* pDocument,
933 const CFX_WideString& swFieldName, 933 const CFX_WideString& swFieldName,
934 int nControlIndex, 934 int nControlIndex,
935 int number) { 935 int number) {
936 // Not supported. 936 // Not supported.
937 } 937 }
938 938
939 FX_BOOL Field::comb(IFXJS_Context* cc, 939 FX_BOOL Field::comb(IJS_Context* cc,
940 CJS_PropValue& vp, 940 CJS_PropValue& vp,
941 CFX_WideString& sError) { 941 CFX_WideString& sError) {
942 ASSERT(m_pDocument != NULL); 942 ASSERT(m_pDocument != NULL);
943 943
944 if (vp.IsSetting()) { 944 if (vp.IsSetting()) {
945 if (!m_bCanSet) 945 if (!m_bCanSet)
946 return FALSE; 946 return FALSE;
947 947
948 bool bVP; 948 bool bVP;
949 vp >> bVP; 949 vp >> bVP;
(...skipping 24 matching lines...) Expand all
974 return TRUE; 974 return TRUE;
975 } 975 }
976 976
977 void Field::SetComb(CPDFSDK_Document* pDocument, 977 void Field::SetComb(CPDFSDK_Document* pDocument,
978 const CFX_WideString& swFieldName, 978 const CFX_WideString& swFieldName,
979 int nControlIndex, 979 int nControlIndex,
980 bool b) { 980 bool b) {
981 // Not supported. 981 // Not supported.
982 } 982 }
983 983
984 FX_BOOL Field::commitOnSelChange(IFXJS_Context* cc, 984 FX_BOOL Field::commitOnSelChange(IJS_Context* cc,
985 CJS_PropValue& vp, 985 CJS_PropValue& vp,
986 CFX_WideString& sError) { 986 CFX_WideString& sError) {
987 ASSERT(m_pDocument != NULL); 987 ASSERT(m_pDocument != NULL);
988 988
989 if (vp.IsSetting()) { 989 if (vp.IsSetting()) {
990 if (!m_bCanSet) 990 if (!m_bCanSet)
991 return FALSE; 991 return FALSE;
992 992
993 bool bVP; 993 bool bVP;
994 vp >> bVP; 994 vp >> bVP;
(...skipping 26 matching lines...) Expand all
1021 return TRUE; 1021 return TRUE;
1022 } 1022 }
1023 1023
1024 void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument, 1024 void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument,
1025 const CFX_WideString& swFieldName, 1025 const CFX_WideString& swFieldName,
1026 int nControlIndex, 1026 int nControlIndex,
1027 bool b) { 1027 bool b) {
1028 // Not supported. 1028 // Not supported.
1029 } 1029 }
1030 1030
1031 FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, 1031 FX_BOOL Field::currentValueIndices(IJS_Context* cc,
1032 CJS_PropValue& vp, 1032 CJS_PropValue& vp,
1033 CFX_WideString& sError) { 1033 CFX_WideString& sError) {
1034 ASSERT(m_pDocument != NULL); 1034 ASSERT(m_pDocument != NULL);
1035 1035
1036 if (vp.IsSetting()) { 1036 if (vp.IsSetting()) {
1037 if (!m_bCanSet) 1037 if (!m_bCanSet)
1038 return FALSE; 1038 return FALSE;
1039 1039
1040 CFX_DWordArray array; 1040 CFX_DWordArray array;
1041 1041
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 int iSelecting = (int32_t)array.GetAt(i); 1116 int iSelecting = (int32_t)array.GetAt(i);
1117 if (iSelecting < pFormField->CountOptions() && 1117 if (iSelecting < pFormField->CountOptions() &&
1118 !pFormField->IsItemSelected(iSelecting)) 1118 !pFormField->IsItemSelected(iSelecting))
1119 pFormField->SetItemSelection(iSelecting, TRUE); 1119 pFormField->SetItemSelection(iSelecting, TRUE);
1120 } 1120 }
1121 UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE); 1121 UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
1122 } 1122 }
1123 } 1123 }
1124 } 1124 }
1125 1125
1126 FX_BOOL Field::defaultStyle(IFXJS_Context* cc, 1126 FX_BOOL Field::defaultStyle(IJS_Context* cc,
1127 CJS_PropValue& vp, 1127 CJS_PropValue& vp,
1128 CFX_WideString& sError) { 1128 CFX_WideString& sError) {
1129 // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT); 1129 // MQG sError = JSGetStringFromID(IDS_STRING_NOTSUPPORT);
1130 return FALSE; 1130 return FALSE;
1131 1131
1132 if (vp.IsSetting()) { 1132 if (vp.IsSetting()) {
1133 if (!m_bCanSet) 1133 if (!m_bCanSet)
1134 return FALSE; 1134 return FALSE;
1135 1135
1136 ; 1136 ;
1137 } else { 1137 } else {
1138 ; 1138 ;
1139 } 1139 }
1140 return TRUE; 1140 return TRUE;
1141 } 1141 }
1142 1142
1143 void Field::SetDefaultStyle(CPDFSDK_Document* pDocument, 1143 void Field::SetDefaultStyle(CPDFSDK_Document* pDocument,
1144 const CFX_WideString& swFieldName, 1144 const CFX_WideString& swFieldName,
1145 int nControlIndex) { 1145 int nControlIndex) {
1146 // Not supported. 1146 // Not supported.
1147 } 1147 }
1148 1148
1149 FX_BOOL Field::defaultValue(IFXJS_Context* cc, 1149 FX_BOOL Field::defaultValue(IJS_Context* cc,
1150 CJS_PropValue& vp, 1150 CJS_PropValue& vp,
1151 CFX_WideString& sError) { 1151 CFX_WideString& sError) {
1152 ASSERT(m_pDocument != NULL); 1152 ASSERT(m_pDocument != NULL);
1153 1153
1154 if (vp.IsSetting()) { 1154 if (vp.IsSetting()) {
1155 if (!m_bCanSet) 1155 if (!m_bCanSet)
1156 return FALSE; 1156 return FALSE;
1157 1157
1158 CFX_WideString WideStr; 1158 CFX_WideString WideStr;
1159 vp >> WideStr; 1159 vp >> WideStr;
(...skipping 22 matching lines...) Expand all
1182 return TRUE; 1182 return TRUE;
1183 } 1183 }
1184 1184
1185 void Field::SetDefaultValue(CPDFSDK_Document* pDocument, 1185 void Field::SetDefaultValue(CPDFSDK_Document* pDocument,
1186 const CFX_WideString& swFieldName, 1186 const CFX_WideString& swFieldName,
1187 int nControlIndex, 1187 int nControlIndex,
1188 const CFX_WideString& string) { 1188 const CFX_WideString& string) {
1189 // Not supported. 1189 // Not supported.
1190 } 1190 }
1191 1191
1192 FX_BOOL Field::doNotScroll(IFXJS_Context* cc, 1192 FX_BOOL Field::doNotScroll(IJS_Context* cc,
1193 CJS_PropValue& vp, 1193 CJS_PropValue& vp,
1194 CFX_WideString& sError) { 1194 CFX_WideString& sError) {
1195 ASSERT(m_pDocument != NULL); 1195 ASSERT(m_pDocument != NULL);
1196 1196
1197 if (vp.IsSetting()) { 1197 if (vp.IsSetting()) {
1198 if (!m_bCanSet) 1198 if (!m_bCanSet)
1199 return FALSE; 1199 return FALSE;
1200 1200
1201 bool bVP; 1201 bool bVP;
1202 vp >> bVP; 1202 vp >> bVP;
(...skipping 24 matching lines...) Expand all
1227 return TRUE; 1227 return TRUE;
1228 } 1228 }
1229 1229
1230 void Field::SetDoNotScroll(CPDFSDK_Document* pDocument, 1230 void Field::SetDoNotScroll(CPDFSDK_Document* pDocument,
1231 const CFX_WideString& swFieldName, 1231 const CFX_WideString& swFieldName,
1232 int nControlIndex, 1232 int nControlIndex,
1233 bool b) { 1233 bool b) {
1234 // Not supported. 1234 // Not supported.
1235 } 1235 }
1236 1236
1237 FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, 1237 FX_BOOL Field::doNotSpellCheck(IJS_Context* cc,
1238 CJS_PropValue& vp, 1238 CJS_PropValue& vp,
1239 CFX_WideString& sError) { 1239 CFX_WideString& sError) {
1240 ASSERT(m_pDocument != NULL); 1240 ASSERT(m_pDocument != NULL);
1241 1241
1242 if (vp.IsSetting()) { 1242 if (vp.IsSetting()) {
1243 if (!m_bCanSet) 1243 if (!m_bCanSet)
1244 return FALSE; 1244 return FALSE;
1245 1245
1246 bool bVP; 1246 bool bVP;
1247 vp >> bVP; 1247 vp >> bVP;
(...skipping 21 matching lines...) Expand all
1269 1269
1270 void Field::SetDelay(FX_BOOL bDelay) { 1270 void Field::SetDelay(FX_BOOL bDelay) {
1271 m_bDelay = bDelay; 1271 m_bDelay = bDelay;
1272 1272
1273 if (!m_bDelay) { 1273 if (!m_bDelay) {
1274 if (m_pJSDoc) 1274 if (m_pJSDoc)
1275 m_pJSDoc->DoFieldDelay(m_FieldName, m_nFormControlIndex); 1275 m_pJSDoc->DoFieldDelay(m_FieldName, m_nFormControlIndex);
1276 } 1276 }
1277 } 1277 }
1278 1278
1279 FX_BOOL Field::delay(IFXJS_Context* cc, 1279 FX_BOOL Field::delay(IJS_Context* cc,
1280 CJS_PropValue& vp, 1280 CJS_PropValue& vp,
1281 CFX_WideString& sError) { 1281 CFX_WideString& sError) {
1282 if (vp.IsSetting()) { 1282 if (vp.IsSetting()) {
1283 if (!m_bCanSet) 1283 if (!m_bCanSet)
1284 return FALSE; 1284 return FALSE;
1285 1285
1286 bool bVP; 1286 bool bVP;
1287 vp >> bVP; 1287 vp >> bVP;
1288 1288
1289 SetDelay(bVP); 1289 SetDelay(bVP);
1290 } else { 1290 } else {
1291 vp << m_bDelay; 1291 vp << m_bDelay;
1292 } 1292 }
1293 return TRUE; 1293 return TRUE;
1294 } 1294 }
1295 1295
1296 FX_BOOL Field::display(IFXJS_Context* cc, 1296 FX_BOOL Field::display(IJS_Context* cc,
1297 CJS_PropValue& vp, 1297 CJS_PropValue& vp,
1298 CFX_WideString& sError) { 1298 CFX_WideString& sError) {
1299 ASSERT(m_pDocument != NULL); 1299 ASSERT(m_pDocument != NULL);
1300 1300
1301 if (vp.IsSetting()) { 1301 if (vp.IsSetting()) {
1302 if (!m_bCanSet) 1302 if (!m_bCanSet)
1303 return FALSE; 1303 return FALSE;
1304 1304
1305 int nVP; 1305 int nVP;
1306 vp >> nVP; 1306 vp >> nVP;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1440 if (dwFlag != pWidget->GetFlags()) { 1440 if (dwFlag != pWidget->GetFlags()) {
1441 pWidget->SetFlags(dwFlag); 1441 pWidget->SetFlags(dwFlag);
1442 UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); 1442 UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
1443 } 1443 }
1444 } 1444 }
1445 } 1445 }
1446 } 1446 }
1447 } 1447 }
1448 } 1448 }
1449 1449
1450 FX_BOOL Field::doc(IFXJS_Context* cc, 1450 FX_BOOL Field::doc(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) {
1451 CJS_PropValue& vp,
1452 CFX_WideString& sError) {
1453 if (!vp.IsGetting()) { 1451 if (!vp.IsGetting()) {
1454 return FALSE; 1452 return FALSE;
1455 } 1453 }
1456 vp << m_pJSDoc->GetCJSDoc(); 1454 vp << m_pJSDoc->GetCJSDoc();
1457 return TRUE; 1455 return TRUE;
1458 } 1456 }
1459 1457
1460 FX_BOOL Field::editable(IFXJS_Context* cc, 1458 FX_BOOL Field::editable(IJS_Context* cc,
1461 CJS_PropValue& vp, 1459 CJS_PropValue& vp,
1462 CFX_WideString& sError) { 1460 CFX_WideString& sError) {
1463 ASSERT(m_pDocument != NULL); 1461 ASSERT(m_pDocument != NULL);
1464 if (vp.IsSetting()) { 1462 if (vp.IsSetting()) {
1465 if (!m_bCanSet) 1463 if (!m_bCanSet)
1466 return FALSE; 1464 return FALSE;
1467 1465
1468 bool bVP; 1466 bool bVP;
1469 vp >> bVP; 1467 vp >> bVP;
1470 } else { 1468 } else {
(...skipping 10 matching lines...) Expand all
1481 1479
1482 if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT) 1480 if (pFormField->GetFieldFlags() & FIELDFLAG_EDIT)
1483 vp << true; 1481 vp << true;
1484 else 1482 else
1485 vp << false; 1483 vp << false;
1486 } 1484 }
1487 1485
1488 return TRUE; 1486 return TRUE;
1489 } 1487 }
1490 1488
1491 FX_BOOL Field::exportValues(IFXJS_Context* cc, 1489 FX_BOOL Field::exportValues(IJS_Context* cc,
1492 CJS_PropValue& vp, 1490 CJS_PropValue& vp,
1493 CFX_WideString& sError) { 1491 CFX_WideString& sError) {
1494 ASSERT(m_pDocument != NULL); 1492 ASSERT(m_pDocument != NULL);
1495 1493
1496 CFX_PtrArray FieldArray; 1494 CFX_PtrArray FieldArray;
1497 GetFormFields(m_FieldName, FieldArray); 1495 GetFormFields(m_FieldName, FieldArray);
1498 if (FieldArray.GetSize() <= 0) 1496 if (FieldArray.GetSize() <= 0)
1499 return FALSE; 1497 return FALSE;
1500 1498
1501 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 1499 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
(...skipping 25 matching lines...) Expand all
1527 return FALSE; 1525 return FALSE;
1528 1526
1529 ExportValusArray.SetElement( 1527 ExportValusArray.SetElement(
1530 0, CJS_Value(m_isolate, pFormControl->GetExportValue().c_str())); 1528 0, CJS_Value(m_isolate, pFormControl->GetExportValue().c_str()));
1531 } 1529 }
1532 vp << ExportValusArray; 1530 vp << ExportValusArray;
1533 } 1531 }
1534 return TRUE; 1532 return TRUE;
1535 } 1533 }
1536 1534
1537 FX_BOOL Field::fileSelect(IFXJS_Context* cc, 1535 FX_BOOL Field::fileSelect(IJS_Context* cc,
1538 CJS_PropValue& vp, 1536 CJS_PropValue& vp,
1539 CFX_WideString& sError) { 1537 CFX_WideString& sError) {
1540 ASSERT(m_pDocument != NULL); 1538 ASSERT(m_pDocument != NULL);
1541 1539
1542 CFX_PtrArray FieldArray; 1540 CFX_PtrArray FieldArray;
1543 GetFormFields(m_FieldName, FieldArray); 1541 GetFormFields(m_FieldName, FieldArray);
1544 if (FieldArray.GetSize() <= 0) 1542 if (FieldArray.GetSize() <= 0)
1545 return FALSE; 1543 return FALSE;
1546 1544
1547 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 1545 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
1548 if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) 1546 if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
1549 return FALSE; 1547 return FALSE;
1550 1548
1551 if (vp.IsSetting()) { 1549 if (vp.IsSetting()) {
1552 if (!m_bCanSet) 1550 if (!m_bCanSet)
1553 return FALSE; 1551 return FALSE;
1554 1552
1555 bool bVP; 1553 bool bVP;
1556 vp >> bVP; 1554 vp >> bVP;
1557 } else { 1555 } else {
1558 if (pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) 1556 if (pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT)
1559 vp << true; 1557 vp << true;
1560 else 1558 else
1561 vp << false; 1559 vp << false;
1562 } 1560 }
1563 return TRUE; 1561 return TRUE;
1564 } 1562 }
1565 1563
1566 FX_BOOL Field::fillColor(IFXJS_Context* cc, 1564 FX_BOOL Field::fillColor(IJS_Context* cc,
1567 CJS_PropValue& vp, 1565 CJS_PropValue& vp,
1568 CFX_WideString& sError) { 1566 CFX_WideString& sError) {
1569 ASSERT(m_pDocument != NULL); 1567 ASSERT(m_pDocument != NULL);
1570 1568
1571 CJS_Array crArray(m_isolate); 1569 CJS_Array crArray(m_isolate);
1572 1570
1573 CFX_PtrArray FieldArray; 1571 CFX_PtrArray FieldArray;
1574 GetFormFields(m_FieldName, FieldArray); 1572 GetFormFields(m_FieldName, FieldArray);
1575 if (FieldArray.GetSize() <= 0) 1573 if (FieldArray.GetSize() <= 0)
1576 return FALSE; 1574 return FALSE;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 return TRUE; 1627 return TRUE;
1630 } 1628 }
1631 1629
1632 void Field::SetFillColor(CPDFSDK_Document* pDocument, 1630 void Field::SetFillColor(CPDFSDK_Document* pDocument,
1633 const CFX_WideString& swFieldName, 1631 const CFX_WideString& swFieldName,
1634 int nControlIndex, 1632 int nControlIndex,
1635 const CPWL_Color& color) { 1633 const CPWL_Color& color) {
1636 // Not supported. 1634 // Not supported.
1637 } 1635 }
1638 1636
1639 FX_BOOL Field::hidden(IFXJS_Context* cc, 1637 FX_BOOL Field::hidden(IJS_Context* cc,
1640 CJS_PropValue& vp, 1638 CJS_PropValue& vp,
1641 CFX_WideString& sError) { 1639 CFX_WideString& sError) {
1642 ASSERT(m_pDocument != NULL); 1640 ASSERT(m_pDocument != NULL);
1643 1641
1644 if (vp.IsSetting()) { 1642 if (vp.IsSetting()) {
1645 if (!m_bCanSet) 1643 if (!m_bCanSet)
1646 return FALSE; 1644 return FALSE;
1647 1645
1648 bool bVP; 1646 bool bVP;
1649 vp >> bVP; 1647 vp >> bVP;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
1747 if (dwFlags != pWidget->GetFlags()) { 1745 if (dwFlags != pWidget->GetFlags()) {
1748 pWidget->SetFlags(dwFlags); 1746 pWidget->SetFlags(dwFlags);
1749 UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); 1747 UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
1750 } 1748 }
1751 } 1749 }
1752 } 1750 }
1753 } 1751 }
1754 } 1752 }
1755 } 1753 }
1756 1754
1757 FX_BOOL Field::highlight(IFXJS_Context* cc, 1755 FX_BOOL Field::highlight(IJS_Context* cc,
1758 CJS_PropValue& vp, 1756 CJS_PropValue& vp,
1759 CFX_WideString& sError) { 1757 CFX_WideString& sError) {
1760 ASSERT(m_pDocument != NULL); 1758 ASSERT(m_pDocument != NULL);
1761 1759
1762 if (vp.IsSetting()) { 1760 if (vp.IsSetting()) {
1763 if (!m_bCanSet) 1761 if (!m_bCanSet)
1764 return FALSE; 1762 return FALSE;
1765 1763
1766 CFX_ByteString strMode; 1764 CFX_ByteString strMode;
1767 vp >> strMode; 1765 vp >> strMode;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 return TRUE; 1809 return TRUE;
1812 } 1810 }
1813 1811
1814 void Field::SetHighlight(CPDFSDK_Document* pDocument, 1812 void Field::SetHighlight(CPDFSDK_Document* pDocument,
1815 const CFX_WideString& swFieldName, 1813 const CFX_WideString& swFieldName,
1816 int nControlIndex, 1814 int nControlIndex,
1817 const CFX_ByteString& string) { 1815 const CFX_ByteString& string) {
1818 // Not supported. 1816 // Not supported.
1819 } 1817 }
1820 1818
1821 FX_BOOL Field::lineWidth(IFXJS_Context* cc, 1819 FX_BOOL Field::lineWidth(IJS_Context* cc,
1822 CJS_PropValue& vp, 1820 CJS_PropValue& vp,
1823 CFX_WideString& sError) { 1821 CFX_WideString& sError) {
1824 ASSERT(m_pDocument != NULL); 1822 ASSERT(m_pDocument != NULL);
1825 1823
1826 if (vp.IsSetting()) { 1824 if (vp.IsSetting()) {
1827 if (!m_bCanSet) 1825 if (!m_bCanSet)
1828 return FALSE; 1826 return FALSE;
1829 1827
1830 int iWidth; 1828 int iWidth;
1831 vp >> iWidth; 1829 vp >> iWidth;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 if (number != pWidget->GetBorderWidth()) { 1904 if (number != pWidget->GetBorderWidth()) {
1907 pWidget->SetBorderWidth(number); 1905 pWidget->SetBorderWidth(number);
1908 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); 1906 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
1909 } 1907 }
1910 } 1908 }
1911 } 1909 }
1912 } 1910 }
1913 } 1911 }
1914 } 1912 }
1915 1913
1916 FX_BOOL Field::multiline(IFXJS_Context* cc, 1914 FX_BOOL Field::multiline(IJS_Context* cc,
1917 CJS_PropValue& vp, 1915 CJS_PropValue& vp,
1918 CFX_WideString& sError) { 1916 CFX_WideString& sError) {
1919 ASSERT(m_pDocument != NULL); 1917 ASSERT(m_pDocument != NULL);
1920 1918
1921 if (vp.IsSetting()) { 1919 if (vp.IsSetting()) {
1922 if (!m_bCanSet) 1920 if (!m_bCanSet)
1923 return FALSE; 1921 return FALSE;
1924 1922
1925 bool bVP; 1923 bool bVP;
1926 vp >> bVP; 1924 vp >> bVP;
(...skipping 24 matching lines...) Expand all
1951 return TRUE; 1949 return TRUE;
1952 } 1950 }
1953 1951
1954 void Field::SetMultiline(CPDFSDK_Document* pDocument, 1952 void Field::SetMultiline(CPDFSDK_Document* pDocument,
1955 const CFX_WideString& swFieldName, 1953 const CFX_WideString& swFieldName,
1956 int nControlIndex, 1954 int nControlIndex,
1957 bool b) { 1955 bool b) {
1958 // Not supported. 1956 // Not supported.
1959 } 1957 }
1960 1958
1961 FX_BOOL Field::multipleSelection(IFXJS_Context* cc, 1959 FX_BOOL Field::multipleSelection(IJS_Context* cc,
1962 CJS_PropValue& vp, 1960 CJS_PropValue& vp,
1963 CFX_WideString& sError) { 1961 CFX_WideString& sError) {
1964 ASSERT(m_pDocument != NULL); 1962 ASSERT(m_pDocument != NULL);
1965 1963
1966 if (vp.IsSetting()) { 1964 if (vp.IsSetting()) {
1967 if (!m_bCanSet) 1965 if (!m_bCanSet)
1968 return FALSE; 1966 return FALSE;
1969 1967
1970 bool bVP; 1968 bool bVP;
1971 vp >> bVP; 1969 vp >> bVP;
(...skipping 25 matching lines...) Expand all
1997 return TRUE; 1995 return TRUE;
1998 } 1996 }
1999 1997
2000 void Field::SetMultipleSelection(CPDFSDK_Document* pDocument, 1998 void Field::SetMultipleSelection(CPDFSDK_Document* pDocument,
2001 const CFX_WideString& swFieldName, 1999 const CFX_WideString& swFieldName,
2002 int nControlIndex, 2000 int nControlIndex,
2003 bool b) { 2001 bool b) {
2004 // Not supported. 2002 // Not supported.
2005 } 2003 }
2006 2004
2007 FX_BOOL Field::name(IFXJS_Context* cc, 2005 FX_BOOL Field::name(IJS_Context* cc,
2008 CJS_PropValue& vp, 2006 CJS_PropValue& vp,
2009 CFX_WideString& sError) { 2007 CFX_WideString& sError) {
2010 if (!vp.IsGetting()) 2008 if (!vp.IsGetting())
2011 return FALSE; 2009 return FALSE;
2012 2010
2013 CFX_PtrArray FieldArray; 2011 CFX_PtrArray FieldArray;
2014 GetFormFields(m_FieldName, FieldArray); 2012 GetFormFields(m_FieldName, FieldArray);
2015 if (FieldArray.GetSize() <= 0) 2013 if (FieldArray.GetSize() <= 0)
2016 return FALSE; 2014 return FALSE;
2017 2015
2018 vp << m_FieldName; 2016 vp << m_FieldName;
2019 2017
2020 return TRUE; 2018 return TRUE;
2021 } 2019 }
2022 2020
2023 FX_BOOL Field::numItems(IFXJS_Context* cc, 2021 FX_BOOL Field::numItems(IJS_Context* cc,
2024 CJS_PropValue& vp, 2022 CJS_PropValue& vp,
2025 CFX_WideString& sError) { 2023 CFX_WideString& sError) {
2026 CFX_PtrArray FieldArray; 2024 CFX_PtrArray FieldArray;
2027 GetFormFields(m_FieldName, FieldArray); 2025 GetFormFields(m_FieldName, FieldArray);
2028 if (FieldArray.GetSize() <= 0) 2026 if (FieldArray.GetSize() <= 0)
2029 return FALSE; 2027 return FALSE;
2030 2028
2031 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 2029 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
2032 ASSERT(pFormField != NULL); 2030 ASSERT(pFormField != NULL);
2033 2031
2034 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && 2032 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
2035 pFormField->GetFieldType() != FIELDTYPE_LISTBOX) 2033 pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
2036 return FALSE; 2034 return FALSE;
2037 2035
2038 if (!vp.IsGetting()) 2036 if (!vp.IsGetting())
2039 return FALSE; 2037 return FALSE;
2040 2038
2041 vp << (int32_t)pFormField->CountOptions(); 2039 vp << (int32_t)pFormField->CountOptions();
2042 2040
2043 return TRUE; 2041 return TRUE;
2044 } 2042 }
2045 2043
2046 FX_BOOL Field::page(IFXJS_Context* cc, 2044 FX_BOOL Field::page(IJS_Context* cc,
2047 CJS_PropValue& vp, 2045 CJS_PropValue& vp,
2048 CFX_WideString& sError) { 2046 CFX_WideString& sError) {
2049 if (!vp.IsGetting()) 2047 if (!vp.IsGetting())
2050 return FALSE; 2048 return FALSE;
2051 2049
2052 CFX_PtrArray FieldArray; 2050 CFX_PtrArray FieldArray;
2053 GetFormFields(m_FieldName, FieldArray); 2051 GetFormFields(m_FieldName, FieldArray);
2054 if (FieldArray.GetSize() <= 0) 2052 if (FieldArray.GetSize() <= 0)
2055 return FALSE; 2053 return FALSE;
2056 2054
(...skipping 26 matching lines...) Expand all
2083 } 2081 }
2084 2082
2085 vp << PageArray; 2083 vp << PageArray;
2086 } else { 2084 } else {
2087 vp << (int32_t)-1; 2085 vp << (int32_t)-1;
2088 } 2086 }
2089 2087
2090 return TRUE; 2088 return TRUE;
2091 } 2089 }
2092 2090
2093 FX_BOOL Field::password(IFXJS_Context* cc, 2091 FX_BOOL Field::password(IJS_Context* cc,
2094 CJS_PropValue& vp, 2092 CJS_PropValue& vp,
2095 CFX_WideString& sError) { 2093 CFX_WideString& sError) {
2096 ASSERT(m_pDocument != NULL); 2094 ASSERT(m_pDocument != NULL);
2097 2095
2098 if (vp.IsSetting()) { 2096 if (vp.IsSetting()) {
2099 if (!m_bCanSet) 2097 if (!m_bCanSet)
2100 return FALSE; 2098 return FALSE;
2101 2099
2102 bool bVP; 2100 bool bVP;
2103 vp >> bVP; 2101 vp >> bVP;
(...skipping 24 matching lines...) Expand all
2128 return TRUE; 2126 return TRUE;
2129 } 2127 }
2130 2128
2131 void Field::SetPassword(CPDFSDK_Document* pDocument, 2129 void Field::SetPassword(CPDFSDK_Document* pDocument,
2132 const CFX_WideString& swFieldName, 2130 const CFX_WideString& swFieldName,
2133 int nControlIndex, 2131 int nControlIndex,
2134 bool b) { 2132 bool b) {
2135 // Not supported. 2133 // Not supported.
2136 } 2134 }
2137 2135
2138 FX_BOOL Field::print(IFXJS_Context* cc, 2136 FX_BOOL Field::print(IJS_Context* cc,
2139 CJS_PropValue& vp, 2137 CJS_PropValue& vp,
2140 CFX_WideString& sError) { 2138 CFX_WideString& sError) {
2141 ASSERT(m_pDocument != NULL); 2139 ASSERT(m_pDocument != NULL);
2142 2140
2143 CPDFSDK_InterForm* pInterForm = 2141 CPDFSDK_InterForm* pInterForm =
2144 (CPDFSDK_InterForm*)m_pDocument->GetInterForm(); 2142 (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
2145 ASSERT(pInterForm != NULL); 2143 ASSERT(pInterForm != NULL);
2146 2144
2147 CFX_PtrArray FieldArray; 2145 CFX_PtrArray FieldArray;
2148 GetFormFields(m_FieldName, FieldArray); 2146 GetFormFields(m_FieldName, FieldArray);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
2213 2211
2214 if (pWidget->GetFlags() & ANNOTFLAG_PRINT) 2212 if (pWidget->GetFlags() & ANNOTFLAG_PRINT)
2215 vp << true; 2213 vp << true;
2216 else 2214 else
2217 vp << false; 2215 vp << false;
2218 } 2216 }
2219 2217
2220 return TRUE; 2218 return TRUE;
2221 } 2219 }
2222 2220
2223 FX_BOOL Field::radiosInUnison(IFXJS_Context* cc, 2221 FX_BOOL Field::radiosInUnison(IJS_Context* cc,
2224 CJS_PropValue& vp, 2222 CJS_PropValue& vp,
2225 CFX_WideString& sError) { 2223 CFX_WideString& sError) {
2226 ASSERT(m_pDocument != NULL); 2224 ASSERT(m_pDocument != NULL);
2227 2225
2228 CFX_PtrArray FieldArray; 2226 CFX_PtrArray FieldArray;
2229 GetFormFields(m_FieldName, FieldArray); 2227 GetFormFields(m_FieldName, FieldArray);
2230 if (FieldArray.GetSize() <= 0) 2228 if (FieldArray.GetSize() <= 0)
2231 return FALSE; 2229 return FALSE;
2232 2230
2233 if (vp.IsSetting()) { 2231 if (vp.IsSetting()) {
(...skipping 12 matching lines...) Expand all
2246 2244
2247 if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON) 2245 if (pFormField->GetFieldFlags() & FIELDFLAG_RADIOSINUNISON)
2248 vp << true; 2246 vp << true;
2249 else 2247 else
2250 vp << false; 2248 vp << false;
2251 } 2249 }
2252 2250
2253 return TRUE; 2251 return TRUE;
2254 } 2252 }
2255 2253
2256 FX_BOOL Field::readonly(IFXJS_Context* cc, 2254 FX_BOOL Field::readonly(IJS_Context* cc,
2257 CJS_PropValue& vp, 2255 CJS_PropValue& vp,
2258 CFX_WideString& sError) { 2256 CFX_WideString& sError) {
2259 ASSERT(m_pDocument != NULL); 2257 ASSERT(m_pDocument != NULL);
2260 2258
2261 CFX_PtrArray FieldArray; 2259 CFX_PtrArray FieldArray;
2262 GetFormFields(m_FieldName, FieldArray); 2260 GetFormFields(m_FieldName, FieldArray);
2263 if (FieldArray.GetSize() <= 0) 2261 if (FieldArray.GetSize() <= 0)
2264 return FALSE; 2262 return FALSE;
2265 2263
2266 if (vp.IsSetting()) { 2264 if (vp.IsSetting()) {
2267 if (!m_bCanSet) 2265 if (!m_bCanSet)
2268 return FALSE; 2266 return FALSE;
2269 2267
2270 bool bVP; 2268 bool bVP;
2271 vp >> bVP; 2269 vp >> bVP;
2272 2270
2273 } else { 2271 } else {
2274 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 2272 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
2275 ASSERT(pFormField != NULL); 2273 ASSERT(pFormField != NULL);
2276 2274
2277 if (pFormField->GetFieldFlags() & FIELDFLAG_READONLY) 2275 if (pFormField->GetFieldFlags() & FIELDFLAG_READONLY)
2278 vp << true; 2276 vp << true;
2279 else 2277 else
2280 vp << false; 2278 vp << false;
2281 } 2279 }
2282 2280
2283 return TRUE; 2281 return TRUE;
2284 } 2282 }
2285 2283
2286 FX_BOOL Field::rect(IFXJS_Context* cc, 2284 FX_BOOL Field::rect(IJS_Context* cc,
2287 CJS_PropValue& vp, 2285 CJS_PropValue& vp,
2288 CFX_WideString& sError) { 2286 CFX_WideString& sError) {
2289 ASSERT(m_pDocument != NULL); 2287 ASSERT(m_pDocument != NULL);
2290 2288
2291 if (vp.IsSetting()) { 2289 if (vp.IsSetting()) {
2292 if (!m_bCanSet) 2290 if (!m_bCanSet)
2293 return FALSE; 2291 return FALSE;
2294 if (!vp.IsArrayObject()) 2292 if (!vp.IsArrayObject())
2295 return FALSE; 2293 return FALSE;
2296 2294
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 pWidget->SetRect(crRect); 2421 pWidget->SetRect(crRect);
2424 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE); 2422 UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
2425 } 2423 }
2426 } 2424 }
2427 } 2425 }
2428 } 2426 }
2429 } 2427 }
2430 } 2428 }
2431 } 2429 }
2432 2430
2433 FX_BOOL Field::required(IFXJS_Context* cc, 2431 FX_BOOL Field::required(IJS_Context* cc,
2434 CJS_PropValue& vp, 2432 CJS_PropValue& vp,
2435 CFX_WideString& sError) { 2433 CFX_WideString& sError) {
2436 ASSERT(m_pDocument != NULL); 2434 ASSERT(m_pDocument != NULL);
2437 2435
2438 CFX_PtrArray FieldArray; 2436 CFX_PtrArray FieldArray;
2439 GetFormFields(m_FieldName, FieldArray); 2437 GetFormFields(m_FieldName, FieldArray);
2440 if (FieldArray.GetSize() <= 0) 2438 if (FieldArray.GetSize() <= 0)
2441 return FALSE; 2439 return FALSE;
2442 2440
2443 if (vp.IsSetting()) { 2441 if (vp.IsSetting()) {
(...skipping 12 matching lines...) Expand all
2456 2454
2457 if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED) 2455 if (pFormField->GetFieldFlags() & FIELDFLAG_REQUIRED)
2458 vp << true; 2456 vp << true;
2459 else 2457 else
2460 vp << false; 2458 vp << false;
2461 } 2459 }
2462 2460
2463 return TRUE; 2461 return TRUE;
2464 } 2462 }
2465 2463
2466 FX_BOOL Field::richText(IFXJS_Context* cc, 2464 FX_BOOL Field::richText(IJS_Context* cc,
2467 CJS_PropValue& vp, 2465 CJS_PropValue& vp,
2468 CFX_WideString& sError) { 2466 CFX_WideString& sError) {
2469 ASSERT(m_pDocument != NULL); 2467 ASSERT(m_pDocument != NULL);
2470 2468
2471 if (vp.IsSetting()) { 2469 if (vp.IsSetting()) {
2472 if (!m_bCanSet) 2470 if (!m_bCanSet)
2473 return FALSE; 2471 return FALSE;
2474 2472
2475 bool bVP; 2473 bool bVP;
2476 vp >> bVP; 2474 vp >> bVP;
(...skipping 24 matching lines...) Expand all
2501 return TRUE; 2499 return TRUE;
2502 } 2500 }
2503 2501
2504 void Field::SetRichText(CPDFSDK_Document* pDocument, 2502 void Field::SetRichText(CPDFSDK_Document* pDocument,
2505 const CFX_WideString& swFieldName, 2503 const CFX_WideString& swFieldName,
2506 int nControlIndex, 2504 int nControlIndex,
2507 bool b) { 2505 bool b) {
2508 // Not supported. 2506 // Not supported.
2509 } 2507 }
2510 2508
2511 FX_BOOL Field::richValue(IFXJS_Context* cc, 2509 FX_BOOL Field::richValue(IJS_Context* cc,
2512 CJS_PropValue& vp, 2510 CJS_PropValue& vp,
2513 CFX_WideString& sError) { 2511 CFX_WideString& sError) {
2514 return TRUE; 2512 return TRUE;
2515 if (vp.IsSetting()) { 2513 if (vp.IsSetting()) {
2516 if (!m_bCanSet) 2514 if (!m_bCanSet)
2517 return FALSE; 2515 return FALSE;
2518 ; 2516 ;
2519 } else { 2517 } else {
2520 ; 2518 ;
2521 } 2519 }
2522 return TRUE; 2520 return TRUE;
2523 } 2521 }
2524 2522
2525 void Field::SetRichValue(CPDFSDK_Document* pDocument, 2523 void Field::SetRichValue(CPDFSDK_Document* pDocument,
2526 const CFX_WideString& swFieldName, 2524 const CFX_WideString& swFieldName,
2527 int nControlIndex) { 2525 int nControlIndex) {
2528 // Not supported. 2526 // Not supported.
2529 } 2527 }
2530 2528
2531 FX_BOOL Field::rotation(IFXJS_Context* cc, 2529 FX_BOOL Field::rotation(IJS_Context* cc,
2532 CJS_PropValue& vp, 2530 CJS_PropValue& vp,
2533 CFX_WideString& sError) { 2531 CFX_WideString& sError) {
2534 ASSERT(m_pDocument != NULL); 2532 ASSERT(m_pDocument != NULL);
2535 2533
2536 if (vp.IsSetting()) { 2534 if (vp.IsSetting()) {
2537 if (!m_bCanSet) 2535 if (!m_bCanSet)
2538 return FALSE; 2536 return FALSE;
2539 2537
2540 int nVP; 2538 int nVP;
2541 vp >> nVP; 2539 vp >> nVP;
(...skipping 22 matching lines...) Expand all
2564 return TRUE; 2562 return TRUE;
2565 } 2563 }
2566 2564
2567 void Field::SetRotation(CPDFSDK_Document* pDocument, 2565 void Field::SetRotation(CPDFSDK_Document* pDocument,
2568 const CFX_WideString& swFieldName, 2566 const CFX_WideString& swFieldName,
2569 int nControlIndex, 2567 int nControlIndex,
2570 int number) { 2568 int number) {
2571 // Not supported. 2569 // Not supported.
2572 } 2570 }
2573 2571
2574 FX_BOOL Field::strokeColor(IFXJS_Context* cc, 2572 FX_BOOL Field::strokeColor(IJS_Context* cc,
2575 CJS_PropValue& vp, 2573 CJS_PropValue& vp,
2576 CFX_WideString& sError) { 2574 CFX_WideString& sError) {
2577 ASSERT(m_pDocument != NULL); 2575 ASSERT(m_pDocument != NULL);
2578 2576
2579 if (vp.IsSetting()) { 2577 if (vp.IsSetting()) {
2580 if (!m_bCanSet) 2578 if (!m_bCanSet)
2581 return FALSE; 2579 return FALSE;
2582 2580
2583 if (!vp.IsArrayObject()) 2581 if (!vp.IsArrayObject())
2584 return FALSE; 2582 return FALSE;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 return TRUE; 2637 return TRUE;
2640 } 2638 }
2641 2639
2642 void Field::SetStrokeColor(CPDFSDK_Document* pDocument, 2640 void Field::SetStrokeColor(CPDFSDK_Document* pDocument,
2643 const CFX_WideString& swFieldName, 2641 const CFX_WideString& swFieldName,
2644 int nControlIndex, 2642 int nControlIndex,
2645 const CPWL_Color& color) { 2643 const CPWL_Color& color) {
2646 // Not supported. 2644 // Not supported.
2647 } 2645 }
2648 2646
2649 FX_BOOL Field::style(IFXJS_Context* cc, 2647 FX_BOOL Field::style(IJS_Context* cc,
2650 CJS_PropValue& vp, 2648 CJS_PropValue& vp,
2651 CFX_WideString& sError) { 2649 CFX_WideString& sError) {
2652 ASSERT(m_pDocument != NULL); 2650 ASSERT(m_pDocument != NULL);
2653 2651
2654 if (vp.IsSetting()) { 2652 if (vp.IsSetting()) {
2655 if (!m_bCanSet) 2653 if (!m_bCanSet)
2656 return FALSE; 2654 return FALSE;
2657 2655
2658 CFX_ByteString csBCaption; 2656 CFX_ByteString csBCaption;
2659 vp >> csBCaption; 2657 vp >> csBCaption;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 return TRUE; 2708 return TRUE;
2711 } 2709 }
2712 2710
2713 void Field::SetStyle(CPDFSDK_Document* pDocument, 2711 void Field::SetStyle(CPDFSDK_Document* pDocument,
2714 const CFX_WideString& swFieldName, 2712 const CFX_WideString& swFieldName,
2715 int nControlIndex, 2713 int nControlIndex,
2716 const CFX_ByteString& string) { 2714 const CFX_ByteString& string) {
2717 // Not supported. 2715 // Not supported.
2718 } 2716 }
2719 2717
2720 FX_BOOL Field::submitName(IFXJS_Context* cc, 2718 FX_BOOL Field::submitName(IJS_Context* cc,
2721 CJS_PropValue& vp, 2719 CJS_PropValue& vp,
2722 CFX_WideString& sError) { 2720 CFX_WideString& sError) {
2723 return TRUE; 2721 return TRUE;
2724 } 2722 }
2725 2723
2726 FX_BOOL Field::textColor(IFXJS_Context* cc, 2724 FX_BOOL Field::textColor(IJS_Context* cc,
2727 CJS_PropValue& vp, 2725 CJS_PropValue& vp,
2728 CFX_WideString& sError) { 2726 CFX_WideString& sError) {
2729 ASSERT(m_pDocument != NULL); 2727 ASSERT(m_pDocument != NULL);
2730 2728
2731 if (vp.IsSetting()) { 2729 if (vp.IsSetting()) {
2732 if (!m_bCanSet) 2730 if (!m_bCanSet)
2733 return FALSE; 2731 return FALSE;
2734 2732
2735 CJS_Array crArray(m_isolate); 2733 CJS_Array crArray(m_isolate);
2736 if (!vp.IsArrayObject()) 2734 if (!vp.IsArrayObject())
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 return TRUE; 2778 return TRUE;
2781 } 2779 }
2782 2780
2783 void Field::SetTextColor(CPDFSDK_Document* pDocument, 2781 void Field::SetTextColor(CPDFSDK_Document* pDocument,
2784 const CFX_WideString& swFieldName, 2782 const CFX_WideString& swFieldName,
2785 int nControlIndex, 2783 int nControlIndex,
2786 const CPWL_Color& color) { 2784 const CPWL_Color& color) {
2787 // Not supported. 2785 // Not supported.
2788 } 2786 }
2789 2787
2790 FX_BOOL Field::textFont(IFXJS_Context* cc, 2788 FX_BOOL Field::textFont(IJS_Context* cc,
2791 CJS_PropValue& vp, 2789 CJS_PropValue& vp,
2792 CFX_WideString& sError) { 2790 CFX_WideString& sError) {
2793 ASSERT(m_pDocument != NULL); 2791 ASSERT(m_pDocument != NULL);
2794 2792
2795 if (vp.IsSetting()) { 2793 if (vp.IsSetting()) {
2796 if (!m_bCanSet) 2794 if (!m_bCanSet)
2797 return FALSE; 2795 return FALSE;
2798 2796
2799 CFX_ByteString csFontName; 2797 CFX_ByteString csFontName;
2800 vp >> csFontName; 2798 vp >> csFontName;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2837 return TRUE; 2835 return TRUE;
2838 } 2836 }
2839 2837
2840 void Field::SetTextFont(CPDFSDK_Document* pDocument, 2838 void Field::SetTextFont(CPDFSDK_Document* pDocument,
2841 const CFX_WideString& swFieldName, 2839 const CFX_WideString& swFieldName,
2842 int nControlIndex, 2840 int nControlIndex,
2843 const CFX_ByteString& string) { 2841 const CFX_ByteString& string) {
2844 // Not supported. 2842 // Not supported.
2845 } 2843 }
2846 2844
2847 FX_BOOL Field::textSize(IFXJS_Context* cc, 2845 FX_BOOL Field::textSize(IJS_Context* cc,
2848 CJS_PropValue& vp, 2846 CJS_PropValue& vp,
2849 CFX_WideString& sError) { 2847 CFX_WideString& sError) {
2850 ASSERT(m_pDocument != NULL); 2848 ASSERT(m_pDocument != NULL);
2851 2849
2852 if (vp.IsSetting()) { 2850 if (vp.IsSetting()) {
2853 if (!m_bCanSet) 2851 if (!m_bCanSet)
2854 return FALSE; 2852 return FALSE;
2855 2853
2856 int nVP; 2854 int nVP;
2857 vp >> nVP; 2855 vp >> nVP;
(...skipping 29 matching lines...) Expand all
2887 return TRUE; 2885 return TRUE;
2888 } 2886 }
2889 2887
2890 void Field::SetTextSize(CPDFSDK_Document* pDocument, 2888 void Field::SetTextSize(CPDFSDK_Document* pDocument,
2891 const CFX_WideString& swFieldName, 2889 const CFX_WideString& swFieldName,
2892 int nControlIndex, 2890 int nControlIndex,
2893 int number) { 2891 int number) {
2894 // Not supported. 2892 // Not supported.
2895 } 2893 }
2896 2894
2897 FX_BOOL Field::type(IFXJS_Context* cc, 2895 FX_BOOL Field::type(IJS_Context* cc,
2898 CJS_PropValue& vp, 2896 CJS_PropValue& vp,
2899 CFX_WideString& sError) { 2897 CFX_WideString& sError) {
2900 ASSERT(m_pDocument != NULL); 2898 ASSERT(m_pDocument != NULL);
2901 2899
2902 if (!vp.IsGetting()) 2900 if (!vp.IsGetting())
2903 return FALSE; 2901 return FALSE;
2904 2902
2905 CFX_PtrArray FieldArray; 2903 CFX_PtrArray FieldArray;
2906 GetFormFields(m_FieldName, FieldArray); 2904 GetFormFields(m_FieldName, FieldArray);
2907 if (FieldArray.GetSize() <= 0) 2905 if (FieldArray.GetSize() <= 0)
(...skipping 28 matching lines...) Expand all
2936 vp << L"signature"; 2934 vp << L"signature";
2937 break; 2935 break;
2938 default: 2936 default:
2939 vp << L"unknown"; 2937 vp << L"unknown";
2940 break; 2938 break;
2941 } 2939 }
2942 2940
2943 return TRUE; 2941 return TRUE;
2944 } 2942 }
2945 2943
2946 FX_BOOL Field::userName(IFXJS_Context* cc, 2944 FX_BOOL Field::userName(IJS_Context* cc,
2947 CJS_PropValue& vp, 2945 CJS_PropValue& vp,
2948 CFX_WideString& sError) { 2946 CFX_WideString& sError) {
2949 ASSERT(m_pDocument != NULL); 2947 ASSERT(m_pDocument != NULL);
2950 2948
2951 if (vp.IsSetting()) { 2949 if (vp.IsSetting()) {
2952 if (!m_bCanSet) 2950 if (!m_bCanSet)
2953 return FALSE; 2951 return FALSE;
2954 2952
2955 CFX_WideString swName; 2953 CFX_WideString swName;
2956 vp >> swName; 2954 vp >> swName;
(...skipping 18 matching lines...) Expand all
2975 return TRUE; 2973 return TRUE;
2976 } 2974 }
2977 2975
2978 void Field::SetUserName(CPDFSDK_Document* pDocument, 2976 void Field::SetUserName(CPDFSDK_Document* pDocument,
2979 const CFX_WideString& swFieldName, 2977 const CFX_WideString& swFieldName,
2980 int nControlIndex, 2978 int nControlIndex,
2981 const CFX_WideString& string) { 2979 const CFX_WideString& string) {
2982 // Not supported. 2980 // Not supported.
2983 } 2981 }
2984 2982
2985 FX_BOOL Field::value(IFXJS_Context* cc, 2983 FX_BOOL Field::value(IJS_Context* cc,
2986 CJS_PropValue& vp, 2984 CJS_PropValue& vp,
2987 CFX_WideString& sError) { 2985 CFX_WideString& sError) {
2988 ASSERT(m_pDocument != NULL); 2986 ASSERT(m_pDocument != NULL);
2989 2987
2990 if (vp.IsSetting()) { 2988 if (vp.IsSetting()) {
2991 if (!m_bCanSet) 2989 if (!m_bCanSet)
2992 return FALSE; 2990 return FALSE;
2993 2991
2994 CJS_WideStringArray strArray; 2992 CJS_WideStringArray strArray;
2995 2993
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 3157
3160 UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); 3158 UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
3161 } 3159 }
3162 } break; 3160 } break;
3163 default: 3161 default:
3164 break; 3162 break;
3165 } 3163 }
3166 } 3164 }
3167 } 3165 }
3168 3166
3169 FX_BOOL Field::valueAsString(IFXJS_Context* cc, 3167 FX_BOOL Field::valueAsString(IJS_Context* cc,
3170 CJS_PropValue& vp, 3168 CJS_PropValue& vp,
3171 CFX_WideString& sError) { 3169 CFX_WideString& sError) {
3172 ASSERT(m_pDocument != NULL); 3170 ASSERT(m_pDocument != NULL);
3173 3171
3174 if (!vp.IsGetting()) 3172 if (!vp.IsGetting())
3175 return FALSE; 3173 return FALSE;
3176 3174
3177 CFX_PtrArray FieldArray; 3175 CFX_PtrArray FieldArray;
3178 GetFormFields(m_FieldName, FieldArray); 3176 GetFormFields(m_FieldName, FieldArray);
3179 if (FieldArray.GetSize() <= 0) 3177 if (FieldArray.GetSize() <= 0)
(...skipping 27 matching lines...) Expand all
3207 vp << L""; 3205 vp << L"";
3208 } else 3206 } else
3209 vp << pFormField->GetValue().c_str(); 3207 vp << pFormField->GetValue().c_str();
3210 3208
3211 return TRUE; 3209 return TRUE;
3212 } 3210 }
3213 3211
3214 /* --------------------------------- methods --------------------------------- 3212 /* --------------------------------- methods ---------------------------------
3215 */ 3213 */
3216 3214
3217 FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, 3215 FX_BOOL Field::browseForFileToSubmit(IJS_Context* cc,
3218 const CJS_Parameters& params, 3216 const CJS_Parameters& params,
3219 CJS_Value& vRet, 3217 CJS_Value& vRet,
3220 CFX_WideString& sError) { 3218 CFX_WideString& sError) {
3221 ASSERT(m_pDocument != NULL); 3219 ASSERT(m_pDocument != NULL);
3222 3220
3223 CFX_PtrArray FieldArray; 3221 CFX_PtrArray FieldArray;
3224 GetFormFields(m_FieldName, FieldArray); 3222 GetFormFields(m_FieldName, FieldArray);
3225 if (FieldArray.GetSize() <= 0) 3223 if (FieldArray.GetSize() <= 0)
3226 return FALSE; 3224 return FALSE;
3227 3225
3228 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 3226 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
3229 ASSERT(pFormField != NULL); 3227 ASSERT(pFormField != NULL);
3230 3228
3231 CPDFDoc_Environment* pApp = m_pDocument->GetEnv(); 3229 CPDFDoc_Environment* pApp = m_pDocument->GetEnv();
3232 ASSERT(pApp != NULL); 3230 ASSERT(pApp != NULL);
3233 3231
3234 if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) && 3232 if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
3235 (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD)) { 3233 (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD)) {
3236 CFX_WideString wsFileName = pApp->JS_fieldBrowse(); 3234 CFX_WideString wsFileName = pApp->JS_fieldBrowse();
3237 if (!wsFileName.IsEmpty()) { 3235 if (!wsFileName.IsEmpty()) {
3238 pFormField->SetValue(wsFileName); 3236 pFormField->SetValue(wsFileName);
3239 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); 3237 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
3240 } 3238 }
3241 } else 3239 } else
3242 return FALSE; 3240 return FALSE;
3243 3241
3244 return TRUE; 3242 return TRUE;
3245 } 3243 }
3246 3244
3247 FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, 3245 FX_BOOL Field::buttonGetCaption(IJS_Context* cc,
3248 const CJS_Parameters& params, 3246 const CJS_Parameters& params,
3249 CJS_Value& vRet, 3247 CJS_Value& vRet,
3250 CFX_WideString& sError) { 3248 CFX_WideString& sError) {
3251 ASSERT(m_pDocument != NULL); 3249 ASSERT(m_pDocument != NULL);
3252 3250
3253 int nface = 0; 3251 int nface = 0;
3254 int iSize = params.size(); 3252 int iSize = params.size();
3255 if (iSize >= 1) 3253 if (iSize >= 1)
3256 nface = params[0].ToInt(); 3254 nface = params[0].ToInt();
3257 3255
(...skipping 19 matching lines...) Expand all
3277 else if (nface == 2) 3275 else if (nface == 2)
3278 vRet = pFormControl->GetRolloverCaption().c_str(); 3276 vRet = pFormControl->GetRolloverCaption().c_str();
3279 else 3277 else
3280 return FALSE; 3278 return FALSE;
3281 3279
3282 return TRUE; 3280 return TRUE;
3283 } 3281 }
3284 3282
3285 //#pragma warning(disable: 4800) 3283 //#pragma warning(disable: 4800)
3286 3284
3287 FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, 3285 FX_BOOL Field::buttonGetIcon(IJS_Context* cc,
3288 const CJS_Parameters& params, 3286 const CJS_Parameters& params,
3289 CJS_Value& vRet, 3287 CJS_Value& vRet,
3290 CFX_WideString& sError) { 3288 CFX_WideString& sError) {
3291 ASSERT(m_pDocument != NULL); 3289 ASSERT(m_pDocument != NULL);
3292 3290
3293 int nface = 0; 3291 int nface = 0;
3294 int iSize = params.size(); 3292 int iSize = params.size();
3295 if (iSize >= 1) 3293 if (iSize >= 1)
3296 nface = params[0].ToInt(); 3294 nface = params[0].ToInt();
3297 3295
(...skipping 28 matching lines...) Expand all
3326 pIconStream = pFormControl->GetRolloverIcon(); 3324 pIconStream = pFormControl->GetRolloverIcon();
3327 else 3325 else
3328 return FALSE; 3326 return FALSE;
3329 3327
3330 pIcon->SetStream(pIconStream); 3328 pIcon->SetStream(pIconStream);
3331 vRet = pJS_Icon; 3329 vRet = pJS_Icon;
3332 3330
3333 return TRUE; 3331 return TRUE;
3334 } 3332 }
3335 3333
3336 FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, 3334 FX_BOOL Field::buttonImportIcon(IJS_Context* cc,
3337 const CJS_Parameters& params, 3335 const CJS_Parameters& params,
3338 CJS_Value& vRet, 3336 CJS_Value& vRet,
3339 CFX_WideString& sError) { 3337 CFX_WideString& sError) {
3340 #if 0 3338 #if 0
3341 ASSERT(m_pDocument != NULL); 3339 ASSERT(m_pDocument != NULL);
3342 3340
3343 CFX_PtrArray FieldArray; 3341 CFX_PtrArray FieldArray;
3344 GetFormFields(m_FieldName,FieldArray); 3342 GetFormFields(m_FieldName,FieldArray);
3345 if (FieldArray.GetSize() <= 0) return FALSE; 3343 if (FieldArray.GetSize() <= 0) return FALSE;
3346 3344
(...skipping 24 matching lines...) Expand all
3371 if (!pFormControl)return FALSE; 3369 if (!pFormControl)return FALSE;
3372 3370
3373 pFormControl->SetNormalIcon(pStream); 3371 pFormControl->SetNormalIcon(pStream);
3374 UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE); 3372 UpdateFormControl(m_pDocument, pFormControl, TRUE, TRUE, TRUE);
3375 3373
3376 vRet = 0; 3374 vRet = 0;
3377 #endif // 0 3375 #endif // 0
3378 return TRUE; 3376 return TRUE;
3379 } 3377 }
3380 3378
3381 FX_BOOL Field::buttonSetCaption(IFXJS_Context* cc, 3379 FX_BOOL Field::buttonSetCaption(IJS_Context* cc,
3382 const CJS_Parameters& params, 3380 const CJS_Parameters& params,
3383 CJS_Value& vRet, 3381 CJS_Value& vRet,
3384 CFX_WideString& sError) { 3382 CFX_WideString& sError) {
3385 return FALSE; 3383 return FALSE;
3386 } 3384 }
3387 3385
3388 FX_BOOL Field::buttonSetIcon(IFXJS_Context* cc, 3386 FX_BOOL Field::buttonSetIcon(IJS_Context* cc,
3389 const CJS_Parameters& params, 3387 const CJS_Parameters& params,
3390 CJS_Value& vRet, 3388 CJS_Value& vRet,
3391 CFX_WideString& sError) { 3389 CFX_WideString& sError) {
3392 return FALSE; 3390 return FALSE;
3393 } 3391 }
3394 3392
3395 FX_BOOL Field::checkThisBox(IFXJS_Context* cc, 3393 FX_BOOL Field::checkThisBox(IJS_Context* cc,
3396 const CJS_Parameters& params, 3394 const CJS_Parameters& params,
3397 CJS_Value& vRet, 3395 CJS_Value& vRet,
3398 CFX_WideString& sError) { 3396 CFX_WideString& sError) {
3399 ASSERT(m_pDocument != NULL); 3397 ASSERT(m_pDocument != NULL);
3400 3398
3401 if (!m_bCanSet) 3399 if (!m_bCanSet)
3402 return FALSE; 3400 return FALSE;
3403 3401
3404 int iSize = params.size(); 3402 int iSize = params.size();
3405 if (iSize < 1) 3403 if (iSize < 1)
(...skipping 20 matching lines...) Expand all
3426 return FALSE; 3424 return FALSE;
3427 if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON) 3425 if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)
3428 pFormField->CheckControl(nWidget, bCheckit, TRUE); 3426 pFormField->CheckControl(nWidget, bCheckit, TRUE);
3429 else 3427 else
3430 pFormField->CheckControl(nWidget, bCheckit, TRUE); 3428 pFormField->CheckControl(nWidget, bCheckit, TRUE);
3431 3429
3432 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); 3430 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
3433 return TRUE; 3431 return TRUE;
3434 } 3432 }
3435 3433
3436 FX_BOOL Field::clearItems(IFXJS_Context* cc, 3434 FX_BOOL Field::clearItems(IJS_Context* cc,
3437 const CJS_Parameters& params, 3435 const CJS_Parameters& params,
3438 CJS_Value& vRet, 3436 CJS_Value& vRet,
3439 CFX_WideString& sError) { 3437 CFX_WideString& sError) {
3440 return TRUE; 3438 return TRUE;
3441 } 3439 }
3442 3440
3443 FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, 3441 FX_BOOL Field::defaultIsChecked(IJS_Context* cc,
3444 const CJS_Parameters& params, 3442 const CJS_Parameters& params,
3445 CJS_Value& vRet, 3443 CJS_Value& vRet,
3446 CFX_WideString& sError) { 3444 CFX_WideString& sError) {
3447 ASSERT(m_pDocument != NULL); 3445 ASSERT(m_pDocument != NULL);
3448 3446
3449 if (!m_bCanSet) 3447 if (!m_bCanSet)
3450 return FALSE; 3448 return FALSE;
3451 3449
3452 int iSize = params.size(); 3450 int iSize = params.size();
3453 if (iSize < 1) 3451 if (iSize < 1)
(...skipping 15 matching lines...) Expand all
3469 } 3467 }
3470 if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) || 3468 if ((pFormField->GetFieldType() == FIELDTYPE_CHECKBOX) ||
3471 (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)) { 3469 (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON)) {
3472 vRet = TRUE; 3470 vRet = TRUE;
3473 } else 3471 } else
3474 vRet = FALSE; 3472 vRet = FALSE;
3475 3473
3476 return TRUE; 3474 return TRUE;
3477 } 3475 }
3478 3476
3479 FX_BOOL Field::deleteItemAt(IFXJS_Context* cc, 3477 FX_BOOL Field::deleteItemAt(IJS_Context* cc,
3480 const CJS_Parameters& params, 3478 const CJS_Parameters& params,
3481 CJS_Value& vRet, 3479 CJS_Value& vRet,
3482 CFX_WideString& sError) { 3480 CFX_WideString& sError) {
3483 return TRUE; 3481 return TRUE;
3484 } 3482 }
3485 3483
3486 int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) { 3484 int JS_COMPARESTRING(CFX_WideString* ps1, CFX_WideString* ps2) {
3487 ASSERT(ps1 != NULL); 3485 ASSERT(ps1 != NULL);
3488 ASSERT(ps2 != NULL); 3486 ASSERT(ps2 != NULL);
3489 3487
3490 return ps1->Compare(*ps2); 3488 return ps1->Compare(*ps2);
3491 } 3489 }
3492 3490
3493 FX_BOOL Field::getArray(IFXJS_Context* cc, 3491 FX_BOOL Field::getArray(IJS_Context* cc,
3494 const CJS_Parameters& params, 3492 const CJS_Parameters& params,
3495 CJS_Value& vRet, 3493 CJS_Value& vRet,
3496 CFX_WideString& sError) { 3494 CFX_WideString& sError) {
3497 ASSERT(m_pDocument != NULL); 3495 ASSERT(m_pDocument != NULL);
3498 3496
3499 CFX_PtrArray FieldArray; 3497 CFX_PtrArray FieldArray;
3500 GetFormFields(m_FieldName, FieldArray); 3498 GetFormFields(m_FieldName, FieldArray);
3501 if (FieldArray.GetSize() <= 0) 3499 if (FieldArray.GetSize() <= 0)
3502 return FALSE; 3500 return FALSE;
3503 3501
(...skipping 27 matching lines...) Expand all
3531 CJS_Value FormFieldValue(m_isolate); 3529 CJS_Value FormFieldValue(m_isolate);
3532 FormFieldValue = pJSField; 3530 FormFieldValue = pJSField;
3533 FormFieldArray.SetElement(j, FormFieldValue); 3531 FormFieldArray.SetElement(j, FormFieldValue);
3534 } 3532 }
3535 3533
3536 vRet = FormFieldArray; 3534 vRet = FormFieldArray;
3537 swSort.RemoveAll(); 3535 swSort.RemoveAll();
3538 return TRUE; 3536 return TRUE;
3539 } 3537 }
3540 3538
3541 FX_BOOL Field::getItemAt(IFXJS_Context* cc, 3539 FX_BOOL Field::getItemAt(IJS_Context* cc,
3542 const CJS_Parameters& params, 3540 const CJS_Parameters& params,
3543 CJS_Value& vRet, 3541 CJS_Value& vRet,
3544 CFX_WideString& sError) { 3542 CFX_WideString& sError) {
3545 ASSERT(m_pDocument != NULL); 3543 ASSERT(m_pDocument != NULL);
3546 int iSize = params.size(); 3544 int iSize = params.size();
3547 3545
3548 int nIdx = -1; 3546 int nIdx = -1;
3549 if (iSize >= 1) 3547 if (iSize >= 1)
3550 nIdx = params[0].ToInt(); 3548 nIdx = params[0].ToInt();
3551 3549
(...skipping 20 matching lines...) Expand all
3572 else 3570 else
3573 vRet = strval.c_str(); 3571 vRet = strval.c_str();
3574 } else 3572 } else
3575 vRet = pFormField->GetOptionLabel(nIdx).c_str(); 3573 vRet = pFormField->GetOptionLabel(nIdx).c_str();
3576 } else 3574 } else
3577 return FALSE; 3575 return FALSE;
3578 3576
3579 return TRUE; 3577 return TRUE;
3580 } 3578 }
3581 3579
3582 FX_BOOL Field::getLock(IFXJS_Context* cc, 3580 FX_BOOL Field::getLock(IJS_Context* cc,
3583 const CJS_Parameters& params, 3581 const CJS_Parameters& params,
3584 CJS_Value& vRet, 3582 CJS_Value& vRet,
3585 CFX_WideString& sError) { 3583 CFX_WideString& sError) {
3586 return FALSE; 3584 return FALSE;
3587 } 3585 }
3588 3586
3589 FX_BOOL Field::insertItemAt(IFXJS_Context* cc, 3587 FX_BOOL Field::insertItemAt(IJS_Context* cc,
3590 const CJS_Parameters& params, 3588 const CJS_Parameters& params,
3591 CJS_Value& vRet, 3589 CJS_Value& vRet,
3592 CFX_WideString& sError) { 3590 CFX_WideString& sError) {
3593 return TRUE; 3591 return TRUE;
3594 } 3592 }
3595 3593
3596 FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, 3594 FX_BOOL Field::isBoxChecked(IJS_Context* cc,
3597 const CJS_Parameters& params, 3595 const CJS_Parameters& params,
3598 CJS_Value& vRet, 3596 CJS_Value& vRet,
3599 CFX_WideString& sError) { 3597 CFX_WideString& sError) {
3600 ASSERT(m_pDocument != NULL); 3598 ASSERT(m_pDocument != NULL);
3601 3599
3602 int nIndex = -1; 3600 int nIndex = -1;
3603 if (params.size() >= 1) 3601 if (params.size() >= 1)
3604 nIndex = params[0].ToInt(); 3602 nIndex = params[0].ToInt();
3605 3603
3606 CFX_PtrArray FieldArray; 3604 CFX_PtrArray FieldArray;
(...skipping 14 matching lines...) Expand all
3621 if (pFormField->GetControl(nIndex)->IsChecked() != 0) 3619 if (pFormField->GetControl(nIndex)->IsChecked() != 0)
3622 vRet = TRUE; 3620 vRet = TRUE;
3623 else 3621 else
3624 vRet = FALSE; 3622 vRet = FALSE;
3625 } else 3623 } else
3626 vRet = FALSE; 3624 vRet = FALSE;
3627 3625
3628 return TRUE; 3626 return TRUE;
3629 } 3627 }
3630 3628
3631 FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, 3629 FX_BOOL Field::isDefaultChecked(IJS_Context* cc,
3632 const CJS_Parameters& params, 3630 const CJS_Parameters& params,
3633 CJS_Value& vRet, 3631 CJS_Value& vRet,
3634 CFX_WideString& sError) { 3632 CFX_WideString& sError) {
3635 ASSERT(m_pDocument != NULL); 3633 ASSERT(m_pDocument != NULL);
3636 3634
3637 int nIndex = -1; 3635 int nIndex = -1;
3638 if (params.size() >= 1) 3636 if (params.size() >= 1)
3639 nIndex = params[0].ToInt(); 3637 nIndex = params[0].ToInt();
3640 3638
3641 CFX_PtrArray FieldArray; 3639 CFX_PtrArray FieldArray;
(...skipping 13 matching lines...) Expand all
3655 if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0) 3653 if (pFormField->GetControl(nIndex)->IsDefaultChecked() != 0)
3656 vRet = TRUE; 3654 vRet = TRUE;
3657 else 3655 else
3658 vRet = FALSE; 3656 vRet = FALSE;
3659 } else 3657 } else
3660 vRet = FALSE; 3658 vRet = FALSE;
3661 3659
3662 return TRUE; 3660 return TRUE;
3663 } 3661 }
3664 3662
3665 FX_BOOL Field::setAction(IFXJS_Context* cc, 3663 FX_BOOL Field::setAction(IJS_Context* cc,
3666 const CJS_Parameters& params, 3664 const CJS_Parameters& params,
3667 CJS_Value& vRet, 3665 CJS_Value& vRet,
3668 CFX_WideString& sError) { 3666 CFX_WideString& sError) {
3669 return TRUE; 3667 return TRUE;
3670 } 3668 }
3671 3669
3672 FX_BOOL Field::setFocus(IFXJS_Context* cc, 3670 FX_BOOL Field::setFocus(IJS_Context* cc,
3673 const CJS_Parameters& params, 3671 const CJS_Parameters& params,
3674 CJS_Value& vRet, 3672 CJS_Value& vRet,
3675 CFX_WideString& sError) { 3673 CFX_WideString& sError) {
3676 ASSERT(m_pDocument != NULL); 3674 ASSERT(m_pDocument != NULL);
3677 3675
3678 CFX_PtrArray FieldArray; 3676 CFX_PtrArray FieldArray;
3679 GetFormFields(m_FieldName, FieldArray); 3677 GetFormFields(m_FieldName, FieldArray);
3680 if (FieldArray.GetSize() <= 0) 3678 if (FieldArray.GetSize() <= 0)
3681 return FALSE; 3679 return FALSE;
3682 3680
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
3715 } 3713 }
3716 } 3714 }
3717 3715
3718 if (pWidget) { 3716 if (pWidget) {
3719 m_pDocument->SetFocusAnnot(pWidget); 3717 m_pDocument->SetFocusAnnot(pWidget);
3720 } 3718 }
3721 3719
3722 return TRUE; 3720 return TRUE;
3723 } 3721 }
3724 3722
3725 FX_BOOL Field::setItems(IFXJS_Context* cc, 3723 FX_BOOL Field::setItems(IJS_Context* cc,
3726 const CJS_Parameters& params, 3724 const CJS_Parameters& params,
3727 CJS_Value& vRet, 3725 CJS_Value& vRet,
3728 CFX_WideString& sError) { 3726 CFX_WideString& sError) {
3729 return TRUE; 3727 return TRUE;
3730 } 3728 }
3731 3729
3732 FX_BOOL Field::setLock(IFXJS_Context* cc, 3730 FX_BOOL Field::setLock(IJS_Context* cc,
3733 const CJS_Parameters& params, 3731 const CJS_Parameters& params,
3734 CJS_Value& vRet, 3732 CJS_Value& vRet,
3735 CFX_WideString& sError) { 3733 CFX_WideString& sError) {
3736 return FALSE; 3734 return FALSE;
3737 } 3735 }
3738 3736
3739 FX_BOOL Field::signatureGetModifications(IFXJS_Context* cc, 3737 FX_BOOL Field::signatureGetModifications(IJS_Context* cc,
3740 const CJS_Parameters& params, 3738 const CJS_Parameters& params,
3741 CJS_Value& vRet, 3739 CJS_Value& vRet,
3742 CFX_WideString& sError) { 3740 CFX_WideString& sError) {
3743 return FALSE; 3741 return FALSE;
3744 } 3742 }
3745 3743
3746 FX_BOOL Field::signatureGetSeedValue(IFXJS_Context* cc, 3744 FX_BOOL Field::signatureGetSeedValue(IJS_Context* cc,
3747 const CJS_Parameters& params, 3745 const CJS_Parameters& params,
3748 CJS_Value& vRet, 3746 CJS_Value& vRet,
3749 CFX_WideString& sError) { 3747 CFX_WideString& sError) {
3750 return FALSE; 3748 return FALSE;
3751 } 3749 }
3752 3750
3753 FX_BOOL Field::signatureInfo(IFXJS_Context* cc, 3751 FX_BOOL Field::signatureInfo(IJS_Context* cc,
3754 const CJS_Parameters& params, 3752 const CJS_Parameters& params,
3755 CJS_Value& vRet, 3753 CJS_Value& vRet,
3756 CFX_WideString& sError) { 3754 CFX_WideString& sError) {
3757 return FALSE; 3755 return FALSE;
3758 } 3756 }
3759 3757
3760 FX_BOOL Field::signatureSetSeedValue(IFXJS_Context* cc, 3758 FX_BOOL Field::signatureSetSeedValue(IJS_Context* cc,
3761 const CJS_Parameters& params, 3759 const CJS_Parameters& params,
3762 CJS_Value& vRet, 3760 CJS_Value& vRet,
3763 CFX_WideString& sError) { 3761 CFX_WideString& sError) {
3764 return FALSE; 3762 return FALSE;
3765 } 3763 }
3766 3764
3767 FX_BOOL Field::signatureSign(IFXJS_Context* cc, 3765 FX_BOOL Field::signatureSign(IJS_Context* cc,
3768 const CJS_Parameters& params, 3766 const CJS_Parameters& params,
3769 CJS_Value& vRet, 3767 CJS_Value& vRet,
3770 CFX_WideString& sError) { 3768 CFX_WideString& sError) {
3771 return FALSE; 3769 return FALSE;
3772 } 3770 }
3773 3771
3774 FX_BOOL Field::signatureValidate(IFXJS_Context* cc, 3772 FX_BOOL Field::signatureValidate(IJS_Context* cc,
3775 const CJS_Parameters& params, 3773 const CJS_Parameters& params,
3776 CJS_Value& vRet, 3774 CJS_Value& vRet,
3777 CFX_WideString& sError) { 3775 CFX_WideString& sError) {
3778 return FALSE; 3776 return FALSE;
3779 } 3777 }
3780 3778
3781 FX_BOOL Field::source(IFXJS_Context* cc, 3779 FX_BOOL Field::source(IJS_Context* cc,
3782 CJS_PropValue& vp, 3780 CJS_PropValue& vp,
3783 CFX_WideString& sError) { 3781 CFX_WideString& sError) {
3784 if (vp.IsGetting()) { 3782 if (vp.IsGetting()) {
3785 vp << (CJS_Object*)NULL; 3783 vp << (CJS_Object*)NULL;
3786 } 3784 }
3787 3785
3788 return TRUE; 3786 return TRUE;
3789 } 3787 }
3790 3788
3791 /////////////////////////////////////////// delay 3789 /////////////////////////////////////////// delay
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4039 #define JS_FIELD_MINWIDTH 1 4037 #define JS_FIELD_MINWIDTH 1
4040 #define JS_FIELD_MINHEIGHT 1 4038 #define JS_FIELD_MINHEIGHT 1
4041 4039
4042 void Field::AddField(CPDFSDK_Document* pDocument, 4040 void Field::AddField(CPDFSDK_Document* pDocument,
4043 int nPageIndex, 4041 int nPageIndex,
4044 int nFieldType, 4042 int nFieldType,
4045 const CFX_WideString& sName, 4043 const CFX_WideString& sName,
4046 const CPDF_Rect& rcCoords) { 4044 const CPDF_Rect& rcCoords) {
4047 // Not supported. 4045 // Not supported.
4048 } 4046 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Field.h ('k') | fpdfsdk/src/javascript/Icon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698