KMSystemFileMenu.swift 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. //
  2. // KMSystemFileMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/12/26.
  6. //
  7. import Foundation
  8. protocol KMSystemFileMenuProtocol {
  9. /// New
  10. func menuItemAction_newDocumentFromClipboard(_ sender: Any?)
  11. func menuItemAction_newDocumetFromImage(_ sender: Any?)
  12. func menuItemAction_importFromWebPage(_ sender: Any?)
  13. /// screenShot
  14. func menuItemAction_screenShotSelectArea(_ sender: Any?)
  15. func menuItemAction_screenShotWindow(_ sender: Any?)
  16. func menuItemAction_screenShotFullScreenDelay(_ sender: Any?)
  17. func menuItemAction_screenShotFullScreen(_ sender: Any?)
  18. func menuItemClick_saveAsFlattenedPDF(_ sender: Any)
  19. func menuItemClick_mergePDF(_ sender: Any)
  20. func menuItemClick_Compress(_ sender: Any)
  21. func menuItemClick_ExportNote(_ sender: Any)
  22. func menuItemClick_Convert(_ sender: Any)
  23. func menuItemAction_ConvertToWord(_ sender: Any)
  24. func menuItemAction_ConvertToExcel(_ sender: Any)
  25. func menuItemAction_ConvertToPPT(_ sender: Any)
  26. func menuItemAction_ConvertToRTF(_ sender: Any)
  27. func menuItemAction_ConvertToHTML(_ sender: Any)
  28. func menuItemAction_ConvertToText(_ sender: Any)
  29. func menuItemAction_ConvertToCSV(_ sender: Any)
  30. func menuItemAction_ConvertToImage(_ sender: Any)
  31. func menuItemClick_SettingPassword(_ sender: Any)
  32. func menuItemClick_RemovePassword(_ sender: Any)
  33. func menuItemAction_closeWindow(_ sender: Any)
  34. func menuItemAction_closeAllWindows(_ sender: Any)
  35. func menuItemAction_closeTagPage(_ sender: Any)
  36. func menuItemAction_showInFinder(_ sender: Any)
  37. func menuItemAction_property(_ sender: Any)
  38. func menuItemAction_print(_ sender: Any)
  39. func newDocumentFromClipboard(_ sender: Any?)
  40. func newDocumentFromImage(_ sender: Any?)
  41. func importFromWebPage(_ sender: Any?)
  42. func screenShot_SelectArea(_ sender: Any?)
  43. func screenShot_Window(_ sender: Any?)
  44. func screenShot_FullScreenDelay(_ sender: Any?)
  45. func screenShot_FullScreen(_ sender: Any?)
  46. }
  47. extension KMSystemFileMenuProtocol {
  48. func menuItemClick_Convert(_ sender: Any) {}
  49. func menuItemAction_newDocumentFromClipboard(_ sender: Any?) {}
  50. func menuItemAction_newDocumetFromImage(_ sender: Any?) {}
  51. func menuItemAction_importFromWebPage(_ sender: Any?) {}
  52. func menuItemAction_screenShotSelectArea(_ sender: Any?) {}
  53. func menuItemAction_screenShotWindow(_ sender: Any?) {}
  54. func menuItemAction_screenShotFullScreenDelay(_ sender: Any?) {}
  55. func menuItemAction_screenShotFullScreen(_ sender: Any?) {}
  56. func newDocumentFromClipboard(_ sender: Any?) {}
  57. func newDocumentFromImage(_ sender: Any?) {}
  58. func importFromWebPage(_ sender: Any?) {}
  59. func screenShot_SelectArea(_ sender: Any?) {}
  60. func screenShot_Window(_ sender: Any?) {}
  61. func screenShot_FullScreenDelay(_ sender: Any?) {}
  62. func screenShot_FullScreen(_ sender: Any?) {}
  63. }
  64. extension KMSystemMenu.File {
  65. public static let saveAsFlattenedPDFSelector = NSSelectorFromString("menuItemClick_saveAsFlattenedPDF:")
  66. public static let mergePDFSelector = NSSelectorFromString("menuItemClick_mergePDF:")
  67. public static let compressSelector = NSSelectorFromString("menuItemClick_Compress:")
  68. public static let exportNoteSelector = NSSelectorFromString("menuItemClick_ExportNote:")
  69. public static let convertSelector = NSSelectorFromString("menuItemClick_Convert:")
  70. public static let convertToWordSelector = NSSelectorFromString("menuItemAction_ConvertToWord:")
  71. public static let convertToExcelSelector = NSSelectorFromString("menuItemAction_ConvertToExcel:")
  72. public static let convertToPPTSelector = NSSelectorFromString("menuItemAction_ConvertToPPT:")
  73. public static let convertToRTFSelector = NSSelectorFromString("menuItemAction_ConvertToRTF:")
  74. public static let convertToHTMLSelector = NSSelectorFromString("menuItemAction_ConvertToHTML:")
  75. public static let convertToTextSelector = NSSelectorFromString("menuItemAction_ConvertToText:")
  76. public static let convertToCSVSelector = NSSelectorFromString("menuItemAction_ConvertToCSV:")
  77. public static let convertToImageSelector = NSSelectorFromString("menuItemAction_ConvertToImage:")
  78. public static let settingPasswordSelector = NSSelectorFromString("menuItemClick_SettingPassword:")
  79. public static let removePasswordSelector = NSSelectorFromString("menuItemClick_RemovePassword:")
  80. public static let closeWindowSelector = NSSelectorFromString("menuItemAction_closeWindow:")
  81. public static let closeAllWindowsSelector = NSSelectorFromString("menuItemAction_closeAllWindows:")
  82. public static let closeTagPageSelector = NSSelectorFromString("menuItemAction_closeTagPage:")
  83. public static let showInFinderSelector = NSSelectorFromString("menuItemAction_showInFinder:")
  84. public static let propertySelector = NSSelectorFromString("menuItemAction_property:")
  85. public static let printSelector = NSSelectorFromString("menuItemAction_print:")
  86. public static let newDocumentFromClipboardSelector = NSSelectorFromString("newDocumentFromClipboard:")
  87. public static let newDocumentFromImageSelector = NSSelectorFromString("newDocumentFromImage:")
  88. public static let importFromWebPageSelector = NSSelectorFromString("importFromWebPage:")
  89. public static let screenShotSelectAreaSelector = NSSelectorFromString("screenShot_SelectArea:")
  90. public static let screenShotWindowSelector = NSSelectorFromString("screenShot_Window:")
  91. public static let screenShotFullScreenDelaySelector = NSSelectorFromString("screenShot_FullScreenDelay:")
  92. public static let screenShotFullScreenSelector = NSSelectorFromString("screenShot_FullScreen:")
  93. public static func actions() -> [Selector] {
  94. return [self.saveAsFlattenedPDFSelector, self.mergePDFSelector, self.compressSelector, self.exportNoteSelector,
  95. // convert
  96. self.convertSelector, self.convertToWordSelector, self.convertToExcelSelector, self.convertToPPTSelector,
  97. self.convertToRTFSelector, self.convertToHTMLSelector, self.convertToTextSelector, self.convertToCSVSelector,
  98. self.convertToImageSelector,
  99. // secure
  100. self.settingPasswordSelector, self.removePasswordSelector,
  101. // other
  102. self.closeWindowSelector, self.closeAllWindowsSelector, self.closeTagPageSelector,
  103. self.showInFinderSelector, self.propertySelector,
  104. self.printSelector,
  105. self.newDocumentFromClipboardSelector, self.newDocumentFromImageSelector, self.importFromWebPageSelector,
  106. self.screenShotSelectAreaSelector, self.screenShotWindowSelector, self.screenShotFullScreenDelaySelector, self.screenShotFullScreenSelector]
  107. }
  108. }