KMSystemToolMenu.swift 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. //
  2. // KMSystemToolMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/12/26.
  6. //
  7. import Foundation
  8. @objc protocol KMSystemToolMenuProtocol: NSObjectProtocol {
  9. @objc optional func getInfo(_ sender: Any?)
  10. @objc optional func orderFrontNotesPanel(_ sender: Any?)
  11. @objc optional func orderFrontLineInspector(_ sender: Any?)
  12. @objc optional func menuItemAction_textTool(_ sender: Any)
  13. @objc func menuItemAction_scrolTool(_ sender: Any)
  14. @objc func menuItemAction_zoomOutTool(_ sender: Any)
  15. @objc func menuItemAction_selectTool(_ sender: Any)
  16. @objc optional func menuItemAction_redact(_ sender: Any)
  17. @objc optional func menuItemAction_warkmark(_ sender: Any)
  18. @objc optional func menuItemAction_background(_ sender: Any)
  19. @objc optional func menuItemAction_headerfooter(_ sender: Any)
  20. @objc optional func menuItemAction_bates(_ sender: Any)
  21. @objc optional func menuItemAction_batch(_ sender: Any)
  22. @objc optional func extractImage(_ sender: Any?)
  23. @objc optional func changeToolMode(_ sender: Any?)
  24. // convert
  25. @objc optional func convert(_ sender: Any?)
  26. @objc optional func imageToPDF(_ sender: Any?)
  27. // ocr
  28. @objc optional func ocr(_ sender: Any?)
  29. @objc optional func pageEdit(_ sender: Any?)
  30. @objc optional func textEditAction(_ sender: Any?)
  31. // Editor
  32. @objc optional func compression(_ sender: Any?)
  33. @objc optional func merge(_ sender: Any?)
  34. @objc optional func security(_ sender: Any?)
  35. @objc optional func decryption(_ sender: Any?)
  36. // crop
  37. @objc optional func cropAll(_ sender: Any?)
  38. @objc optional func crop(_ sender: Any?)
  39. @objc optional func autoCropAll(_ sender: Any?)
  40. @objc optional func smartAutoCropAll(_ sender: Any?)
  41. @objc optional func cropOptionsModel(_ sender: Any?)
  42. @objc optional func selectToolModel(_ sender: Any?)
  43. // snapshot
  44. @objc optional func takeSnapshot(_ sender: Any?)
  45. @objc optional func takeSnapshotSelectContent(_ sender: Any?)
  46. @objc optional func addWatermark(_ sender: Any?)
  47. @objc optional func editWatermark(_ sender: Any?)
  48. @objc optional func batchAddWatermark(_ sender: Any?)
  49. @objc optional func batchRemoveWatermark(_ sender: Any?)
  50. @objc optional func removeWatermark(_ sender: Any?)
  51. @objc optional func templateWatermark(_ sender: Any?)
  52. @objc optional func addBackground(_ sender: Any?)
  53. @objc optional func removeBackground(_ sender: Any?)
  54. @objc optional func batchAddBackground(_ sender: Any?)
  55. @objc optional func batchRemoveBackground(_ sender: Any?)
  56. @objc optional func templateBackground(_ sender: Any?)
  57. @objc optional func addHeaderFooter(_ sender: Any?)
  58. @objc optional func removeHeaderFooter(_ sender: Any?)
  59. @objc optional func batchAddHeaderFooter(_ sender: Any?)
  60. @objc optional func batchRemoveHeaderFooter(_ sender: Any?)
  61. @objc optional func templateHeaderFooter(_ sender: Any?)
  62. @objc optional func addHeaderFooterBates(_ sender: Any?)
  63. @objc optional func removeHeaderFooterBates(_ sender: Any?)
  64. @objc optional func batchAddBates(_ sender: Any?)
  65. @objc optional func batchRemoveBates(_ sender: Any?)
  66. @objc optional func templateBates(_ sender: Any?)
  67. @objc optional func togglePoster(_ sender: Any?)
  68. @objc optional func toggleMultiple(_ sender: Any?)
  69. @objc optional func toggleBooklet(_ sender: Any?)
  70. @objc optional func rotateRight(_ sender: Any?)
  71. @objc optional func rotateLeft(_ sender: Any?)
  72. @objc optional func rotateAllRight(_ sender: Any?)
  73. @objc optional func rotateAllLeft(_ sender: Any?)
  74. @objc optional func autoSelectContent(_ sender: Any?)
  75. }
  76. extension KMSystemMenu.Tool {
  77. public static let getInfoSelector = NSSelectorFromString("getInfo:")
  78. public static let orderFrontNotesPanelSelector = NSSelectorFromString("orderFrontNotesPanel:")
  79. public static let orderFrontLineInspectorSelector = NSSelectorFromString("orderFrontLineInspector:")
  80. public static let textToolSelector = NSSelectorFromString("menuItemAction_textTool:")
  81. public static let scrolToolSelector = NSSelectorFromString("menuItemAction_scrolTool:")
  82. public static let zoomToolSelector = NSSelectorFromString("menuItemAction_zoomOutTool:")
  83. public static let selectToolSelector = NSSelectorFromString("menuItemAction_selectTool:")
  84. public static let redactSelector = NSSelectorFromString("menuItemAction_redact:")
  85. public static let warkmarkSelector = NSSelectorFromString("menuItemAction_warkmark:")
  86. public static let backgroundSelector = NSSelectorFromString("menuItemAction_background:")
  87. public static let headerfooterSelector = NSSelectorFromString("menuItemAction_headerfooter:")
  88. public static let batesSelector = NSSelectorFromString("menuItemAction_bates:")
  89. public static let batchSelector = NSSelectorFromString("menuItemAction_batch:")
  90. public static let extractImageSelector = NSSelectorFromString("extractImage:")
  91. public static let changeAnnotationModeSelector = NSSelectorFromString("changeAnnotationMode:")
  92. public static let changeToolModeSelector = NSSelectorFromString("changeToolMode:")
  93. // convert
  94. public static let convertSelector = NSSelectorFromString("convert:")
  95. public static let imageToPDFSelector = NSSelectorFromString("imageToPDF:")
  96. // ocr
  97. public static let ocrSelector = NSSelectorFromString("ocr:")
  98. public static let pageEditSelector = NSSelectorFromString("pageEdit:")
  99. public static let textEditSelector = NSSelectorFromString("textEditAction:")
  100. // Editor
  101. public static let compressSelector = NSSelectorFromString("compression:")
  102. public static let mergeSelector = NSSelectorFromString("merge:")
  103. public static let securitySelector = NSSelectorFromString("security:")
  104. public static let decryptionSelector = NSSelectorFromString("decryption:")
  105. // crop
  106. public static let cropAllSelector = NSSelectorFromString("cropAll:")
  107. public static let cropSelector = NSSelectorFromString("crop:")
  108. public static let autoCropAllSelector = NSSelectorFromString("autoCropAll:")
  109. public static let smartAutoCropAllSelector = NSSelectorFromString("smartAutoCropAll:")
  110. public static let cropOptionsSelector = NSSelectorFromString("cropOptionsModel:")
  111. public static let selectToolModelSelector = NSSelectorFromString("selectToolModel:")
  112. // snapshot
  113. public static let takeSnapshotSelector = NSSelectorFromString("takeSnapshot:")
  114. public static let takeSnapshotSelectContentSelector = NSSelectorFromString("takeSnapshotSelectContent:")
  115. public static let addWatermarkSelector = NSSelectorFromString("addWatermark:")
  116. public static let editWatermarkSelector = NSSelectorFromString("editWatermark:")
  117. public static let batchAddWatermarkSelector = NSSelectorFromString("batchAddWatermark:")
  118. public static let batchRemoveWatermarkSelector = NSSelectorFromString("batchRemoveWatermark:")
  119. public static let removeWatermarkSelector = NSSelectorFromString("removeWatermark:")
  120. public static let templateWatermarkSelector = NSSelectorFromString("templateWatermark:")
  121. // @objc optional func addBackground(_ sender: Any?)
  122. // @objc optional func removeBackground(_ sender: Any?)
  123. // @objc optional func batchAddBackground(_ sender: Any?)
  124. // @objc optional func batchRemoveBackground(_ sender: Any?)
  125. // @objc optional func templateBackground(_ sender: Any?)
  126. //
  127. // @objc optional func addHeaderFooter(_ sender: Any?)
  128. // @objc optional func removeHeaderFooter(_ sender: Any?)
  129. // @objc optional func batchAddHeaderFooter(_ sender: Any?)
  130. // @objc optional func batchRemoveHeaderFooter(_ sender: Any?)
  131. // @objc optional func templateHeaderFooter(_ sender: Any?)
  132. //
  133. // @objc optional func addHeaderFooterBates(_ sender: Any?)
  134. // @objc optional func removeHeaderFooterBates(_ sender: Any?)
  135. // @objc optional func batchAddBates(_ sender: Any?)
  136. // @objc optional func batchRemoveBates(_ sender: Any?)
  137. // @objc optional func templateBates(_ sender: Any?)
  138. public static let togglePosterSelector = NSSelectorFromString("togglePoster:")
  139. public static let toggleMultipleSelector = NSSelectorFromString("toggleMultiple:")
  140. public static let toggleBookletSelector = NSSelectorFromString("toggleBooklet:")
  141. // rotate
  142. public static let rotateRightSelector = NSSelectorFromString("rotateRight:")
  143. public static let rotateLeftSelector = NSSelectorFromString("rotateLeft:")
  144. public static let rotateAllRightSelector = NSSelectorFromString("rotateAllRight:")
  145. public static let rotateAllLeftSelector = NSSelectorFromString("rotateAllLeft:")
  146. public static let autoSelectContentSelector = NSSelectorFromString("autoSelectContent:")
  147. public static func actions() -> [Selector] {
  148. return [self.getInfoSelector ,self.orderFrontNotesPanelSelector, self.orderFrontLineInspectorSelector,
  149. self.textToolSelector, self.scrolToolSelector, self.zoomToolSelector, self.selectToolSelector,
  150. self.redactSelector, self.warkmarkSelector, self.backgroundSelector, self.headerfooterSelector,
  151. self.batesSelector, self.batchSelector,
  152. self.extractImageSelector, self.changeAnnotationModeSelector, self.changeToolModeSelector,
  153. // convert
  154. self.convertSelector, self.imageToPDFSelector,
  155. self.ocrSelector, self.pageEditSelector, self.textEditSelector,
  156. // Editor
  157. self.compressSelector, self.mergeSelector, self.securitySelector, self.decryptionSelector,
  158. // crop
  159. self.cropAllSelector, self.cropSelector, self.autoCropAllSelector, self.smartAutoCropAllSelector, self.cropOptionsSelector, self.selectToolModelSelector,
  160. // snapshot
  161. self.takeSnapshotSelector, self.takeSnapshotSelectContentSelector,
  162. self.togglePosterSelector, self.toggleMultipleSelector, self.toggleBookletSelector,
  163. // rotate
  164. self.rotateRightSelector, self.rotateLeftSelector, self.rotateAllLeftSelector, self.rotateAllRightSelector,
  165. self.autoSelectContentSelector
  166. ]
  167. }
  168. }