RCTDocumentManager.m 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. // Copyright © 2014-2025 PDF Technologies, Inc. All Rights Reserved.
  2. //
  3. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  4. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  5. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  6. // This notice may not be removed from this file.
  7. //
  8. #import <React/RCTBridgeModule.h>
  9. @interface RCT_EXTERN_MODULE(CPDFViewManager, NSObject)
  10. RCT_EXTERN_METHOD(save:(NSInteger)tag
  11. withResolver:(RCTPromiseResolveBlock)resolve
  12. withRejecter:(RCTPromiseRejectBlock)reject)
  13. RCT_EXTERN_METHOD(setMargins:(NSInteger)tag
  14. withEdges:[Int]edges)
  15. RCT_EXTERN_METHOD(removeAllAnnotations:(NSInteger)tag
  16. withResolver:(RCTPromiseResolveBlock)resolve
  17. withRejecter:(RCTPromiseRejectBlock)reject)
  18. RCT_EXTERN_METHOD(importAnnotations:(NSInteger)tag
  19. withXfdfFile:(NSURL *)xfdfFile
  20. withResolver:(RCTPromiseResolveBlock)resolve
  21. withRejecter:(RCTPromiseRejectBlock)reject)
  22. RCT_EXTERN_METHOD(exportAnnotations:(NSInteger)tag
  23. withResolver:(RCTPromiseResolveBlock)resolve
  24. withRejecter:(RCTPromiseRejectBlock)reject)
  25. RCT_EXTERN_METHOD(setDisplayPageIndex:(NSInteger)tag
  26. withPageIndex:(NSInteger)pageIndex)
  27. RCT_EXTERN_METHOD(getCurrentPageIndex:(NSInteger)tag
  28. withResolver:(RCTPromiseResolveBlock)resolve
  29. withRejecter:(RCTPromiseRejectBlock)reject)
  30. RCT_EXTERN_METHOD(hasChange:(NSInteger)tag
  31. withResolver:(RCTPromiseResolveBlock)resolve
  32. withRejecter:(RCTPromiseRejectBlock)reject)
  33. RCT_EXTERN_METHOD(setScale:(NSInteger)tag
  34. withScaleValue:(nonnull NSNumber *) scale)
  35. RCT_EXTERN_METHOD(getScale:(NSInteger)tag
  36. withResolver:(RCTPromiseResolveBlock)resolve
  37. withRejecter:(RCTPromiseRejectBlock)reject)
  38. RCT_EXTERN_METHOD(setReadBackgroundColor:(NSInteger)tag
  39. withThemes:(NSDictionary) themes)
  40. RCT_EXTERN_METHOD(getReadBackgroundColor:(NSInteger)tag
  41. withResolver:(RCTPromiseResolveBlock)resolve
  42. withRejecter:(RCTPromiseRejectBlock)reject)
  43. RCT_EXTERN_METHOD(setFormFieldHighlight:(NSInteger)tag
  44. withFormFieldHighlight:(BOOL) formFieldHighlight)
  45. RCT_EXTERN_METHOD(isFormFieldHighlight:(NSInteger)tag
  46. withResolver:(RCTPromiseResolveBlock)resolve
  47. withRejecter:(RCTPromiseRejectBlock)reject)
  48. RCT_EXTERN_METHOD(setLinkHighlight:(NSInteger)tag
  49. withLinkHighlight:(BOOL) linkHighlight)
  50. RCT_EXTERN_METHOD(isLinkHighlight:(NSInteger)tag
  51. withResolver:(RCTPromiseResolveBlock)resolve
  52. withRejecter:(RCTPromiseRejectBlock)reject)
  53. RCT_EXTERN_METHOD(setVerticalMode:(NSInteger)tag
  54. withVerticalMode:(BOOL) isVerticalMode)
  55. RCT_EXTERN_METHOD(isVerticalMode:(NSInteger)tag
  56. withResolver:(RCTPromiseResolveBlock)resolve
  57. withRejecter:(RCTPromiseRejectBlock)reject)
  58. RCT_EXTERN_METHOD(setContinueMode:(NSInteger)tag
  59. withContiueMode:(BOOL) isContinueMode)
  60. RCT_EXTERN_METHOD(isContinueMode:(NSInteger)tag
  61. withResolver:(RCTPromiseResolveBlock)resolve
  62. withRejecter:(RCTPromiseRejectBlock)reject)
  63. RCT_EXTERN_METHOD(setDoublePageMode:(NSInteger)tag
  64. withDoublePageMode:(BOOL) isDoublePageMode)
  65. RCT_EXTERN_METHOD(isDoublePageMode:(NSInteger)tag
  66. withResolver:(RCTPromiseResolveBlock)resolve
  67. withRejecter:(RCTPromiseRejectBlock)reject)
  68. RCT_EXTERN_METHOD(setCoverPageMode:(NSInteger)tag
  69. withCoverPageMode:(BOOL) isCoverPageMode)
  70. RCT_EXTERN_METHOD(isCoverPageMode:(NSInteger)tag
  71. withResolver:(RCTPromiseResolveBlock)resolve
  72. withRejecter:(RCTPromiseRejectBlock)reject)
  73. RCT_EXTERN_METHOD(setCropMode:(NSInteger)tag
  74. withCropMode:(BOOL) isCropMode)
  75. RCT_EXTERN_METHOD(isCropMode:(NSInteger)tag
  76. withResolver:(RCTPromiseResolveBlock)resolve
  77. withRejecter:(RCTPromiseRejectBlock)reject)
  78. RCT_EXTERN_METHOD(setPreviewMode:(NSInteger *)tag
  79. withViewMode:(NSString) viewMode)
  80. RCT_EXTERN_METHOD(getPreviewMode:(NSInteger *)tag
  81. withResolver:(RCTPromiseResolveBlock)resolve
  82. withRejecter:(RCTPromiseRejectBlock)reject)
  83. RCT_EXTERN_METHOD(showThumbnailView:(NSInteger *)tag
  84. withEditMode:(BOOL) editMode)
  85. RCT_EXTERN_METHOD(showBotaView:(NSInteger *)tag)
  86. RCT_EXTERN_METHOD(showAddWatermarkView:(NSInteger *)tag)
  87. RCT_EXTERN_METHOD(showSecurityView:(NSInteger *)tag)
  88. RCT_EXTERN_METHOD(showDisplaySettingView:(NSInteger *)tag)
  89. RCT_EXTERN_METHOD(enterSnipMode:(NSInteger *)tag)
  90. RCT_EXTERN_METHOD(exitSnipMode:(NSInteger *)tag)
  91. RCT_EXTERN_METHOD(open:(NSInteger *)tag
  92. withDocument:(NSURL *) document
  93. withPassword:(NSString *) password
  94. withResolver:(RCTPromiseResolveBlock)resolve
  95. withRejecter:(RCTPromiseRejectBlock)reject)
  96. RCT_EXTERN_METHOD(getFileName:(NSInteger *) tag
  97. withResolver:(RCTPromiseResolveBlock)resolve
  98. withRejecter:(RCTPromiseRejectBlock)reject)
  99. RCT_EXTERN_METHOD(isEncrypted:(NSInteger *) tag
  100. withResolver:(RCTPromiseResolveBlock)resolve
  101. withRejecter:(RCTPromiseRejectBlock)reject)
  102. RCT_EXTERN_METHOD(isImageDoc:(NSInteger *) tag
  103. withResolver:(RCTPromiseResolveBlock)resolve
  104. withRejecter:(RCTPromiseRejectBlock)reject)
  105. RCT_EXTERN_METHOD(getPermissions:(NSInteger *) tag
  106. withResolver:(RCTPromiseResolveBlock)resolve
  107. withRejecter:(RCTPromiseRejectBlock)reject)
  108. RCT_EXTERN_METHOD(getPageCount:(NSInteger *) tag
  109. withResolver:(RCTPromiseResolveBlock)resolve
  110. withRejecter:(RCTPromiseRejectBlock)reject)
  111. RCT_EXTERN_METHOD(checkOwnerUnlocked:(NSInteger *) tag
  112. withResolver:(RCTPromiseResolveBlock)resolve
  113. withRejecter:(RCTPromiseRejectBlock)reject)
  114. RCT_EXTERN_METHOD(checkOwnerPassword:(NSInteger *) tag
  115. withPassword:(NSString *) password
  116. withResolver:(RCTPromiseResolveBlock)resolve
  117. withRejecter:(RCTPromiseRejectBlock)reject)
  118. RCT_EXTERN_METHOD(removePassword:(NSInteger *) tag
  119. withResolver:(RCTPromiseResolveBlock)resolve
  120. withRejecter:(RCTPromiseRejectBlock)reject)
  121. RCT_EXTERN_METHOD(setPassword:(NSInteger *) tag
  122. withInfo:(NSDictionary) info
  123. withResolver:(RCTPromiseResolveBlock)resolve
  124. withRejecter:(RCTPromiseRejectBlock)reject)
  125. RCT_EXTERN_METHOD(getEncryptAlgo:(NSInteger *) tag
  126. withResolver:(RCTPromiseResolveBlock)resolve
  127. withRejecter:(RCTPromiseRejectBlock)reject)
  128. + (BOOL)requiresMainQueueSetup
  129. {
  130. return NO;
  131. }
  132. @end