-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathDocumentViewViewManager.java
More file actions
1484 lines (1270 loc) · 60.2 KB
/
DocumentViewViewManager.java
File metadata and controls
1484 lines (1270 loc) · 60.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.pdftron.reactnative.viewmanagers;
import android.content.Intent;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.pdftron.common.PDFNetException;
import com.pdftron.pdf.dialog.signature.SignatureDialogFragment;
import com.pdftron.pdf.utils.PdfViewCtrlSettingsManager;
import com.pdftron.pdf.utils.ShortcutHelper;
import com.pdftron.reactnative.views.DocumentView;
public class DocumentViewViewManager extends ViewGroupManager<DocumentView> {
private static final String REACT_CLASS = "RCTDocumentView";
private SparseArray<DocumentView> mDocumentViews = new SparseArray<>();
@Override
public String getName() {
return REACT_CLASS;
}
private View.OnAttachStateChangeListener mOnAttachStateChangeListener = new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View v) {
DocumentView documentView = (DocumentView) v;
Log.d(getName(), "add to map: " + v.getId());
mDocumentViews.put(v.getId(), documentView);
}
@Override
public void onViewDetachedFromWindow(View v) {
Log.d(getName(), "remove from map: " + v.getId());
mDocumentViews.remove(v.getId());
}
};
@Override
protected DocumentView createViewInstance(ThemedReactContext reactContext) {
DocumentView documentView = new DocumentView(reactContext);
documentView.setup(reactContext);
documentView.addOnAttachStateChangeListener(mOnAttachStateChangeListener);
return documentView;
}
@ReactProp(name = "fontSize")
public void setFontSize(DocumentView documentView, int fontSize) {
documentView.setFontSize(fontSize);
}
@ReactProp(name = "signatureArrayUrl")
public void setSignatureArrayUrl(DocumentView documentView, @NonNull ReadableArray array) {
documentView.setSignatureArrayUrl(array);
}
@ReactProp(name = "document")
public void setDocument(DocumentView documentView, @NonNull String filepath) {
documentView.setDocument(filepath);
}
@ReactProp(name = "source")
public void setSource(DocumentView documentView, @NonNull String filepath) {
documentView.setDocument(filepath);
}
@ReactProp(name = "password")
public void setPassword(DocumentView documentView, @Nullable String password) {
documentView.setPassword(password);
}
@ReactProp(name = "leadingNavButtonIcon")
public void setNavButtonIcon(DocumentView documentView, @NonNull String resName) {
documentView.setNavResName(resName);
}
@ReactProp(name = "enableAntialiasing")
public void setAntiAliasing(DocumentView documentView, boolean enableAntialiasing) throws PDFNetException {
documentView.setAntiAliasing(enableAntialiasing);
}
@ReactProp(name = "showLeadingNavButton")
public void setShowNavButton(DocumentView documentView, boolean show) {
documentView.setShowNavIcon(show);
}
@ReactProp(name = "overflowMenuButtonIcon")
public void setOverflowMenuButtonIcon(DocumentView documentView, @NonNull String resName) {
documentView.setOverflowResName(resName);
}
@ReactProp(name = "disabledElements")
public void setDisabledElements(DocumentView documentView, @NonNull ReadableArray array) {
documentView.setDisabledElements(array);
}
@ReactProp(name = "disabledTools")
public void setDisabledTools(DocumentView documentView, @NonNull ReadableArray array) {
documentView.setDisabledTools(array);
}
@ReactProp(name = "rememberLastUsedTool")
public void setRememberLastUsedTool(DocumentView documentView, boolean rememberLastUsedTool) {
documentView.setRememberLastUsedTool(rememberLastUsedTool);
}
@ReactProp(name = "customHeaders")
public void setCustomHeaders(DocumentView documentView, @Nullable ReadableMap map) {
documentView.setCustomHeaders(map);
}
@ReactProp(name = "documentExtension")
public void setDocumentExtension(DocumentView documentView, String documentExtension) {
documentView.setDocumentExtension(documentExtension);
}
@ReactProp(name = "initialPageNumber")
public void setInitialPageNumber(DocumentView documentView, int pageNum) {
documentView.setInitialPageNumber(pageNum);
}
@ReactProp(name = "page")
public void setPage(DocumentView documentView, int pageNum) {
documentView.setInitialPageNumber(pageNum);
}
@ReactProp(name = "pageNumber")
public void setPageNumber(DocumentView documentView, int pageNum) {
documentView.setPageNumber(pageNum);
}
@ReactProp(name = "topToolbarEnabled")
public void setTopToolbarEnabled(DocumentView documentView, boolean topToolbarEnabled) {
documentView.setTopToolbarEnabled(topToolbarEnabled);
}
@ReactProp(name = "bottomToolbarEnabled")
public void setBottomToolbarEnabled(DocumentView documentView, boolean bottomToolbarEnabled) {
documentView.setBottomToolbarEnabled(bottomToolbarEnabled);
}
@ReactProp(name = "bottomToolbar")
public void bottomToolbar(DocumentView documentView, @NonNull ReadableArray bottomToolbarItems) {
documentView.bottomToolbar(bottomToolbarItems);
}
@ReactProp(name = "hideToolbarsOnTap")
public void setHideToolbarsOnTap(DocumentView documentView, boolean hideToolbarsOnTap) {
documentView.setHideToolbarsOnTap(hideToolbarsOnTap);
}
@ReactProp(name = "tabletLayoutEnabled")
public void setTabletLayoutEnabled(DocumentView documentView, boolean tabletLayoutEnabled) {
documentView.setTabletLayoutEnabled(tabletLayoutEnabled);
}
@ReactProp(name = "documentSliderEnabled")
public void setDocumentSliderEnabled(DocumentView documentView, boolean documentSliderEnabled) {
documentView.setDocumentSliderEnabled(documentSliderEnabled);
}
@ReactProp(name = "downloadDialogEnabled")
public void setDownloadDialogEnabled(DocumentView documentView, boolean downloadDialogEnabled) {
documentView.setDownloadDialogEnabled(downloadDialogEnabled);
}
@ReactProp(name = "pageIndicatorEnabled")
public void setPageIndicatorEnabled(DocumentView documentView, boolean pageIndicatorEnabled) {
documentView.setPageIndicatorEnabled(pageIndicatorEnabled);
}
@ReactProp(name = "readOnly")
public void setReadOnly(DocumentView documentView, boolean readOnly) {
documentView.setReadOnly(readOnly);
}
@ReactProp(name = "fitMode")
public void setFitMode(DocumentView documentView, String fitMode) {
documentView.setFitMode(fitMode);
}
@ReactProp(name = "fitPolicy")
public void setFitPolicy(DocumentView documentView, int fitPolicy) {
documentView.setFitPolicy(fitPolicy);
}
@ReactProp(name = "maintainZoomEnabled")
public void setMaintainZoomEnabled(DocumentView documentView, boolean maintainZoomEnabled) {
documentView.setMaintainZoomEnabled(maintainZoomEnabled);
}
@ReactProp(name = "layoutMode")
public void setLayoutMode(DocumentView documentView, String layoutMode) {
documentView.setLayoutMode(layoutMode);
}
@ReactProp(name = "padStatusBar")
public void setPadStatusBar(DocumentView documentView, boolean padStatusBar) {
documentView.setPadStatusBar(padStatusBar);
}
@ReactProp(name = "continuousAnnotationEditing")
public void setContinuousAnnotationEditing(DocumentView documentView, boolean contEditing) {
documentView.setContinuousAnnotationEditing(contEditing);
}
@ReactProp(name = "annotationAuthor")
public void setAnnotationAuthor(DocumentView documentView, String author) {
documentView.setAnnotationAuthor(author);
}
@ReactProp(name = "showSavedSignatures")
public void setShowSavedSignatures(DocumentView documentView, boolean show) {
documentView.setShowSavedSignatures(show);
}
@ReactProp(name = "isBase64String")
public void setIsBase64String(DocumentView documentView, boolean isBase64) {
documentView.setIsBase64String(isBase64);
}
@ReactProp(name = "base64FileExtension")
public void setBase64FileExtension(DocumentView documentView, String base64Extension) {
documentView.setBase64FileExtension(base64Extension);
}
@ReactProp(name = "autoSaveEnabled")
public void setAutoSaveEnabled(DocumentView documentView, boolean autoSaveEnabled) {
documentView.setAutoSaveEnabled(autoSaveEnabled);
}
@ReactProp(name = "useStylusAsPen")
public void setUseStylusAsPen(DocumentView documentView, boolean useStylusAsPen) {
documentView.setUseStylusAsPen(useStylusAsPen);
}
@ReactProp(name = "collabEnabled")
public void setCollabEnabled(DocumentView documentView, boolean collabEnabled) {
documentView.setCollabEnabled(collabEnabled);
}
@ReactProp(name = "currentUser")
public void setCurrentUser(DocumentView documentView, String currentUser) {
documentView.setCurrentUser(currentUser);
}
@ReactProp(name = "currentUserName")
public void setCurrentUserName(DocumentView documentView, String currentUserName) {
documentView.setCurrentUserName(currentUserName);
}
@ReactProp(name = "annotationManagerEditMode")
public void annotationManagerEditMode(DocumentView documentView, String annotationManagerEditMode) {
documentView.setAnnotationManagerEditMode(annotationManagerEditMode);
}
@ReactProp(name = "annotationManagerUndoMode")
public void annotationManagerUndoMode(DocumentView documentView, String annotationManagerUndoMode) {
documentView.setAnnotationManagerUndoMode(annotationManagerUndoMode);
}
@ReactProp(name = "annotationMenuItems")
public void setAnnotationMenuItems(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setAnnotationMenuItems(items);
}
@ReactProp(name = "longPressMenuItems")
public void setLongPressMenuItems(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setLongPressMenuItems(items);
}
@ReactProp(name = "longPressMenuEnabled")
public void setLongPressMenuEnabled(DocumentView documentView, boolean longPressMenuEnabled) {
documentView.setLongPressMenuEnabled(longPressMenuEnabled);
}
@ReactProp(name = "defaultEraserType")
public void setDefaultEraserType(DocumentView documentView, String eraserType) {
documentView.setDefaultEraserType(eraserType);
}
@ReactProp(name = "hideAnnotationMenu")
public void setHideAnnotationMenu(DocumentView documentView, @NonNull ReadableArray tools) {
documentView.setHideAnnotationMenu(tools);
}
@ReactProp(name = "pageChangeOnTap")
public void setPageChangeOnTap(DocumentView documentView, boolean pageChangeOnTap) {
documentView.setPageChangeOnTap(pageChangeOnTap);
}
@ReactProp(name = "multiTabEnabled")
public void setMultiTabEnabled(DocumentView documentView, boolean multiTab) {
documentView.setMultiTabEnabled(multiTab);
}
@ReactProp(name = "tabTitle")
public void setTabTitle(DocumentView documentView, String tabTitle) {
documentView.setTabTitle(tabTitle);
}
@ReactProp(name = "maxTabCount")
public void setMaxTabCount(DocumentView documentView, int maxTabCount) {
documentView.setMaxTabCount(maxTabCount);
}
@ReactProp(name = "thumbnailViewEditingEnabled")
public void setThumbnailViewEditingEnabled(DocumentView documentView, boolean thumbnailViewEditingEnabled) {
documentView.setThumbnailViewEditingEnabled(thumbnailViewEditingEnabled);
}
@ReactProp(name = "imageInReflowEnabled")
public void setImageInReflowEnabled(DocumentView documentView, boolean imageInReflowEnabled) {
documentView.setImageInReflowEnabled(imageInReflowEnabled);
}
@ReactProp(name = "reflowOrientation")
public void setReflowOrientation(DocumentView documentView, String reflowOrientation) {
documentView.setReflowOrientation(reflowOrientation);
}
@ReactProp(name = "selectAnnotationAfterCreation")
public void setSelectAnnotationAfterCreation(DocumentView documentView, boolean selectAnnotationAfterCreation) {
documentView.setSelectAnnotationAfterCreation(selectAnnotationAfterCreation);
}
@ReactProp(name = "overrideAnnotationMenuBehavior")
public void setOverrideAnnotationMenuBehavior(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setOverrideAnnotationMenuBehavior(items);
}
@ReactProp(name = "overrideLongPressMenuBehavior")
public void setOverrideLongPressMenuBehavior(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setOverrideLongPressMenuBehavior(items);
}
@ReactProp(name = "overrideBehavior")
public void setOverrideBehavior(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setOverrideBehavior(items);
}
@ReactProp(name = "followSystemDarkMode")
public void setFollowSystemDarkMode(DocumentView documentView, boolean followSystem) {
PdfViewCtrlSettingsManager.setFollowSystemDarkMode(documentView.getContext(), followSystem);
}
@ReactProp(name = "signSignatureFieldsWithStamps")
public void setSignSignatureFieldsWithStamps(DocumentView documentView, boolean signWithStamp) {
documentView.setSignSignatureFieldsWithStamps(signWithStamp);
}
@ReactProp(name = "annotationPermissionCheckEnabled")
public void setAnnotationPermissionCheckEnabled(DocumentView documentView, boolean annotPermissionCheckEnabled) {
documentView.setAnnotationPermissionCheckEnabled(annotPermissionCheckEnabled);
}
@ReactProp(name = "annotationToolbars")
public void setAnnotationToolbars(DocumentView documentView, ReadableArray toolbars) {
documentView.setAnnotationToolbars(toolbars);
}
@ReactProp(name = "initialToolbar")
public void setInitialToolbar(DocumentView documentView, String toolbarTag) {
documentView.setInitialToolbar(toolbarTag);
}
@ReactProp(name = "hideDefaultAnnotationToolbars")
public void setHideDefaultAnnotationToolbars(DocumentView documentView, ReadableArray tags) {
documentView.setHideDefaultAnnotationToolbars(tags);
}
@ReactProp(name = "hideAnnotationToolbarSwitcher")
public void setHideAnnotationToolbarSwitcher(DocumentView documentView, boolean hide) {
documentView.setHideAnnotationToolbarSwitcher(hide);
}
@ReactProp(name = "hideTopToolbars")
public void setHideTopToolbars(DocumentView documentView, boolean hide) {
documentView.setHideTopToolbars(hide);
}
@ReactProp(name = "hideTopAppNavBar")
public void setHideTopAppNavBar(DocumentView documentView, boolean hide) {
documentView.setHideTopAppNavBar(hide);
}
@ReactProp(name = "hideThumbnailFilterModes")
public void setHideThumbnailFilterModes(DocumentView documentView, ReadableArray filterModes) {
documentView.setHideThumbnailFilterModes(filterModes);
}
@ReactProp(name = "hideViewModeItems")
public void hideViewModeItems(DocumentView documentView, ReadableArray viewModePickerItems) {
documentView.viewModePickerItems(viewModePickerItems);
}
@ReactProp(name = "zoom")
public void setZoom(DocumentView documentView, double zoom) {
documentView.setZoom(zoom);
}
@ReactProp(name = "scale")
public void setScale(DocumentView documentView, double scale) {
documentView.setZoom(scale);
}
@ReactProp(name = "horizontalScrollPos")
public void setHorizontalScrollPos(DocumentView documentView, double horizontalScrollPos) {
documentView.setHorizontalScrollPos(horizontalScrollPos);
}
@ReactProp(name = "verticalScrollPos")
public void setVerticalScrollPos(DocumentView documentView, double verticalScrollPos) {
documentView.setVerticalScrollPos(verticalScrollPos);
}
@ReactProp(name = "pageStackEnabled")
public void setPageStackEnabled(DocumentView documentView, boolean pageStackEnabled) {
documentView.setPageStackEnabled(pageStackEnabled);
}
@ReactProp(name = "hideToolbarsOnAppear")
public void setHideToolbarsOnAppear(DocumentView documentView, boolean hideToolbarsOnAppear) {
documentView.setHideToolbarsOnAppear(hideToolbarsOnAppear);
}
@ReactProp(name = "showQuickNavigationButton")
public void setShowQuickNavigationButton(DocumentView documentView, boolean showQuickNavigationButton) {
documentView.setShowQuickNavigationButton(showQuickNavigationButton);
}
@ReactProp(name = "photoPickerEnabled")
public void setPhotoPickerEnabled(DocumentView documentView, boolean photoPickerEnabled) {
documentView.setPhotoPickerEnabled(photoPickerEnabled);
}
@ReactProp(name = "autoResizeFreeTextEnabled")
public void setAutoResizeFreeTextEnabled(DocumentView documentView, boolean autoResizeFreeTextEnabled) {
documentView.setAutoResizeFreeTextEnabled(autoResizeFreeTextEnabled);
}
@ReactProp(name = "annotationsListEditingEnabled")
public void setAnnotationsListEditingEnabled(DocumentView documentView, boolean annotationsListEditingEnabled) {
documentView.setAnnotationsListEditingEnabled(annotationsListEditingEnabled);
}
@ReactProp(name = "userBookmarksListEditingEnabled")
public void setUserBookmarksListEditingEnabled(DocumentView documentView, boolean userBookmarksListEditingEnabled) {
documentView.setUserBookmarksListEditingEnabled(userBookmarksListEditingEnabled);
}
@ReactProp(name = "excludedAnnotationListTypes")
public void setExcludedAnnotationListTypes(DocumentView documentView, ReadableArray excludedTypes) {
documentView.setExcludedAnnotationListTypes(excludedTypes);
}
@ReactProp(name = "showNavigationListAsSidePanelOnLargeDevices")
public void setShowNavigationListAsSidePanelOnLargeDevices(DocumentView documentView,
boolean showNavigationListAsSidePanelOnLargeDevices) {
documentView.setShowNavigationListAsSidePanelOnLargeDevices(showNavigationListAsSidePanelOnLargeDevices);
}
@ReactProp(name = "restrictDownloadUsage")
public void setRestrictDownloadUsage(DocumentView documentView, boolean restrictDownloadUsage) {
documentView.setRestrictDownloadUsage(restrictDownloadUsage);
}
@ReactProp(name = "exportPath")
public void setExportPath(DocumentView documentView, String exportPath) {
documentView.setExportPath(exportPath);
}
@ReactProp(name = "openUrlPath")
public void setOpenUrlPath(DocumentView documentView, String openUrlPath) {
documentView.setOpenUrlPath(openUrlPath);
}
@ReactProp(name = "inkMultiStrokeEnabled")
public void setInkMultiStrokeEnabled(DocumentView documentView, boolean inkMultiStrokeEnabled) {
documentView.setInkMultiStrokeEnabled(inkMultiStrokeEnabled);
}
@ReactProp(name = "keyboardShortcutsEnabled")
public void setKeyboardShortcutsEnabled(DocumentView documentView, boolean keyboardShortcutsEnabled) {
ShortcutHelper.enable(keyboardShortcutsEnabled);
}
@ReactProp(name = "storeNewSignature")
public void setStoreNewSignature(DocumentView documentView, boolean storeNewSignature) {
documentView.setStoreNewSignature(storeNewSignature);
}
@ReactProp(name = "disableEditingByAnnotationType")
public void setDisableEditingByAnnotationType(DocumentView documentView, ReadableArray annotationTypes) {
documentView.setDisableEditingByAnnotationType(annotationTypes);
}
@ReactProp(name = "saveStateEnabled")
public void setSaveStateEnabled(DocumentView documentView, boolean saveState) {
documentView.setSaveStateEnabled(saveState);
}
@ReactProp(name = "openSavedCopyInNewTab")
public void setOpenSavedCopyInNewTab(DocumentView documentView, boolean openSavedCopyInNewTab) {
documentView.setOpenSavedCopyInNewTab(openSavedCopyInNewTab);
}
@ReactProp(name = "replyReviewStateEnabled")
public void setReplyReviewStateEnabled(DocumentView documentView, boolean replyReviewStateEnabled) {
documentView.setReplyReviewStateEnabled(replyReviewStateEnabled);
}
@ReactProp(name = "topAppNavBarRightBar")
public void setTopAppNavBarRightBar(DocumentView documentView, ReadableArray menus) {
documentView.setTopAppNavBarRightBar(menus);
}
@ReactProp(name = "hidePresetBar")
public void setHidePresetBar(DocumentView documentView, boolean hidePresetBar) {
documentView.setHidePresetBar(hidePresetBar);
}
@ReactProp(name = "hideThumbnailsViewItems")
public void setHideThumbnailsViewItems(DocumentView documentView, ReadableArray thumbnailViewItems) {
documentView.setHideThumbnailsViewItems(thumbnailViewItems);
}
@ReactProp(name = "highlighterSmoothingEnabled")
public void setHighlighterSmoothingEnabled(DocumentView documentView, boolean highlighterSmoothingEnabled) {
documentView.setHighlighterSmoothingEnabled(highlighterSmoothingEnabled);
}
@ReactProp(name = "maxSignatureCount")
public void setMaxSignatureCount(DocumentView documentView, int maxSignatureCount) {
SignatureDialogFragment.MAX_SIGNATURES = maxSignatureCount;
}
// Hygen Generated Props
@ReactProp(name = "enableReadingModeQuickMenu")
public void setEnableReadingModeQuickMenu(DocumentView documentView, boolean enabled) {
documentView.setEnableReadingModeQuickMenu(enabled);
}
@ReactProp(name = "forceAppTheme")
public void setForceAppTheme(DocumentView documentView, @NonNull String forcedAppThemeItems) {
documentView.setForceAppTheme(forcedAppThemeItems);
}
@ReactProp(name = "signatureColors")
public void setSignatureColors(DocumentView documentView, @NonNull ReadableArray signatureColors) {
documentView.setSignatureColors(signatureColors);
}
@ReactProp(name = "overrideToolbarButtonBehavior")
public void setOverrideToolbarButtonBehavior(DocumentView documentView, @NonNull ReadableArray items) {
documentView.setOverrideToolbarButtonBehavior(items);
}
public void importBookmarkJson(int tag, String bookmarkJson) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.importBookmarkJson(bookmarkJson);
} else {
throw new PDFNetException("", 0L, getName(), "importBookmarkJson", "Unable to find DocumentView.");
}
}
public void openBookmarkList(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.openBookmarkList();
} else {
throw new PDFNetException("", 0L, getName(), "openBookmarkList", "Unable to find DocumentView.");
}
}
public void importAnnotationCommand(int tag, String xfdfCommand, boolean initialLoad) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.importAnnotationCommand(xfdfCommand, initialLoad);
} else {
throw new PDFNetException("", 0L, getName(), "importAnnotationCommand",
"set collabEnabled to true is required.");
}
}
public WritableArray importAnnotations(int tag, String xfdf, boolean replace) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.importAnnotations(xfdf, replace);
} else {
throw new PDFNetException("", 0L, getName(), "importAnnotations", "Unable to find DocumentView.");
}
}
public String exportAnnotations(int tag, ReadableMap options) throws Exception {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.exportAnnotations(options);
} else {
throw new PDFNetException("", 0L, getName(), "exportAnnotations", "Unable to find DocumentView.");
}
}
public String saveDocument(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.saveDocument();
} else {
throw new PDFNetException("", 0L, getName(), "saveDocument", "Unable to find DocumentView.");
}
}
public void flattenAnnotations(int tag, boolean formsOnly) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.flattenAnnotations(formsOnly);
} else {
throw new PDFNetException("", 0L, getName(), "flattenAnnotations", "Unable to find DocumentView.");
}
}
public String getDocumentPath(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getDocumentPath();
} else {
throw new PDFNetException("", 0L, getName(), "setToolMode", "Unable to find DocumentView.");
}
}
public WritableArray getAllFields(int tag, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getAllFields(pageNumber);
} else {
throw new PDFNetException("", 0L, getName(), "getAllFields", "Unable to find DocumentView.");
}
}
public void setToolMode(int tag, String item) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setToolMode(item);
} else {
throw new PDFNetException("", 0L, getName(), "setToolMode", "Unable to find DocumentView.");
}
}
public boolean commitTool(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.commitTool();
} else {
throw new PDFNetException("", 0L, getName(), "commitTool", "Unable to find DocumentView.");
}
}
public void setCurrentToolbar(int tag, String toolbarTag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setCurrentToolbar(toolbarTag);
} else {
throw new PDFNetException("", 0L, getName(), "setCurrentToolbar", "Unable to find DocumentView.");
}
}
public int getPageCount(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getPageCount();
} else {
throw new PDFNetException("", 0L, getName(), "getPageCount", "Unable to find DocumentView.");
}
}
public void setFlagForFields(int tag, ReadableArray fields, Integer flag, Boolean value) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setFlagForFields(fields, flag, value);
} else {
throw new PDFNetException("", 0L, getName(), "setFlagForFields", "Unable to find DocumentView.");
}
}
public void setValuesForFields(int tag, ReadableMap map) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setValuesForFields(map);
} else {
throw new PDFNetException("", 0L, getName(), "setValuesForFields", "Unable to find DocumentView.");
}
}
public WritableMap getField(int tag, String fieldName) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getField(fieldName);
} else {
throw new PDFNetException("", 0L, getName(), "getField", "Unable to find DocumentView.");
}
}
public void deleteAnnotations(int tag, ReadableArray annots) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.deleteAnnotations(annots);
} else {
throw new PDFNetException("", 0L, getName(), "deleteAnnotations", "Unable to find DocumentView.");
}
}
public ReadableMap getAnnotationAt(int tag, int x, int y, double distanceThreshold, double minimumLineWeight)
throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getAnnotationAt(x, y, distanceThreshold, minimumLineWeight);
} else {
throw new PDFNetException("", 0L, getName(), "getAnnotationAt", "Unable to find DocumentView.");
}
}
public ReadableArray getAnnotationListAt(int tag, int x1, int y1, int x2, int y2) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getAnnotationListAt(x1, y1, x2, y2);
} else {
throw new PDFNetException("", 0L, getName(), "getAnnotationListAt", "Unable to find DocumentView.");
}
}
public ReadableArray getAnnotationListOnPage(int tag, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getAnnotationListOnPage(pageNumber);
} else {
throw new PDFNetException("", 0L, getName(), "getAnnotationListOnPage", "Unable to find DocumentView.");
}
}
public void openAnnotationList(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.openAnnotationList();
} else {
throw new PDFNetException("", 0L, getName(), "openAnnotationList", "Unable to find DocumentView.");
}
}
public String getCustomDataForAnnotation(int tag, String annotationID, int pageNumber, String key)
throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getCustomDataForAnnotation(annotationID, pageNumber, key);
} else {
throw new PDFNetException("", 0L, getName(), "getCustomDataForAnnotation", "Unable to find DocumentView.");
}
}
public void setAnnotationToolbarItemEnabled(int tag, String itemId, boolean enable) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setAnnotationToolbarItemEnabled(itemId, enable);
} else {
throw new PDFNetException("", 0L, getName(), "setAnnotationToolbarItemEnabled", "Unable to find DocumentView.");
}
}
public boolean handleBackButton(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.handleBackButton();
} else {
throw new PDFNetException("", 0L, getName(), "handleBackButton", "Unable to find DocumentView.");
}
}
public void setFlagsForAnnotations(int tag, ReadableArray annotationFlagList) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setFlagsForAnnotations(annotationFlagList);
} else {
throw new PDFNetException("", 0L, getName(), "setFlagsForAnnotation", "Unable to find DocumentView.");
}
}
public void selectAnnotation(int tag, String annotId, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.selectAnnotation(annotId, pageNumber);
} else {
throw new PDFNetException("", 0L, getName(), "selectAnnotation", "Unable to find DocumentView.");
}
}
public void setPropertiesForAnnotation(int tag, String annotId, int pageNumber, ReadableMap propertyMap)
throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setPropertiesForAnnotation(annotId, pageNumber, propertyMap);
} else {
throw new PDFNetException("", 0L, getName(), "setPropertiesForAnnotation", "Unable to find DocumentView.");
}
}
public WritableMap getPropertiesForAnnotation(int tag, String annotId, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getPropertiesForAnnotation(annotId, pageNumber);
} else {
throw new PDFNetException("", 0L, getName(), "getPropertiesForAnnotation", "Unable to find DocumentView.");
}
}
public void setDrawAnnotations(int tag, boolean drawAnnotations) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setDrawAnnotations(drawAnnotations);
} else {
throw new PDFNetException("", 0L, getName(), "setVisibilityForAnnotation", "Unable to find DocumentView.");
}
}
public void setVisibilityForAnnotation(int tag, String annotId, int pageNumber, boolean visibility)
throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setVisibilityForAnnotation(annotId, pageNumber, visibility);
} else {
throw new PDFNetException("", 0L, getName(), "setVisibilityForAnnotation", "Unable to find DocumentView.");
}
}
public void setHighlightFields(int tag, boolean highlightFields) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setHighlightFields(highlightFields);
} else {
throw new PDFNetException("", 0L, getName(), "setHighlightFields", "Unable to find DocumentView.");
}
}
public void closeAllTabs(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.closeAllTabs();
} else {
throw new PDFNetException("", 0L, getName(), "closeAllTabs", "Unable to find DocumentView.");
}
}
public void openTabSwitcher(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.openTabSwitcher();
} else {
throw new PDFNetException("", 0L, getName(), "openTabSwitcher", "Unable to find DocumentView.");
}
}
public WritableMap getPageCropBox(int tag, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getPageCropBox(pageNumber);
} else {
throw new PDFNetException("", 0L, getName(), "getPageCropBox", "Unable to find DocumentView.");
}
}
public boolean setCurrentPage(int tag, int pageNumber) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
boolean setResult = documentView.setCurrentPage(pageNumber);
return setResult;
} else {
throw new PDFNetException("", 0L, getName(), "setCurrentPage", "Unable to find DocumentView.");
}
}
public WritableArray getVisiblePages(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getVisiblePages();
} else {
throw new PDFNetException("", 0L, getName(), "getVisiblePages", "Unable to find DocumentView.");
}
}
public int getPageRotation(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
int rotation = documentView.getPageRotation();
return rotation;
} else {
throw new PDFNetException("", 0L, getName(), "getPageRotation", "Unable to find DocumentView.");
}
}
public void rotateClockwise(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.rotateClockwise();
} else {
throw new PDFNetException("", 0L, getName(), "rotateClockwise", "Unable to find DocumentView.");
}
}
public void rotateCounterClockwise(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.rotateCounterClockwise();
} else {
throw new PDFNetException("", 0L, getName(), "rotateCounterClockwise", "Unable to find DocumentView.");
}
}
public boolean gotoPreviousPage(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
boolean setResult = documentView.gotoPreviousPage();
return setResult;
} else {
throw new PDFNetException("", 0L, getName(), "gotoPreviousPage", "Unable to find DocumentView.");
}
}
public boolean gotoNextPage(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
boolean setResult = documentView.gotoNextPage();
return setResult;
} else {
throw new PDFNetException("", 0L, getName(), "gotoNextPage", "Unable to find DocumentView.");
}
}
public boolean gotoFirstPage(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
boolean setResult = documentView.gotoFirstPage();
return setResult;
} else {
throw new PDFNetException("", 0L, getName(), "gotoFirstPage", "Unable to find DocumentView.");
}
}
public boolean gotoLastPage(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
boolean setResult = documentView.gotoLastPage();
return setResult;
} else {
throw new PDFNetException("", 0L, getName(), "gotoLastPage", "Unable to find DocumentView.");
}
}
public double getZoom(int tag) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
return documentView.getZoom();
} else {
throw new PDFNetException("", 0L, getName(), "getZoom", "Unable to find DocumentView.");
}
}
public void setZoomLimits(int tag, String zoomLimitMode, double minimum, double maximum) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.setZoomLimits(zoomLimitMode, minimum, maximum);
} else {
throw new PDFNetException("", 0L, getName(), "setZoomLimits", "Unable to find DocumentView.");
}
}
public void zoomWithCenter(int tag, double zoom, int x, int y) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {
documentView.zoomWithCenter(zoom, x, y);
} else {
throw new PDFNetException("", 0L, getName(), "zoomWithCenter", "Unable to find DocumentView.");
}
}
public void zoomToRect(int tag, int pageNumber, ReadableMap rect) throws PDFNetException {
DocumentView documentView = mDocumentViews.get(tag);
if (documentView != null) {