KMSystemFileMenu.swift 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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_Convert(_ sender: Any)
  22. func menuItemAction_ConvertToWord(_ sender: Any)
  23. func menuItemAction_ConvertToExcel(_ sender: Any)
  24. func menuItemAction_ConvertToPPT(_ sender: Any)
  25. func menuItemAction_ConvertToRTF(_ sender: Any)
  26. func menuItemAction_ConvertToHTML(_ sender: Any)
  27. func menuItemAction_ConvertToText(_ sender: Any)
  28. func menuItemAction_ConvertToCSV(_ sender: Any)
  29. func menuItemAction_ConvertToImage(_ sender: Any)
  30. func menuItemClick_SettingPassword(_ sender: Any)
  31. func menuItemClick_RemovePassword(_ sender: Any)
  32. func menuItemAction_closeWindow(_ sender: Any)
  33. func menuItemAction_closeAllWindows(_ sender: Any)
  34. func menuItemAction_closeTagPage(_ sender: Any)
  35. func menuItemAction_showInFinder(_ sender: Any)
  36. func menuItemAction_property(_ sender: Any)
  37. func menuItemAction_print(_ sender: Any)
  38. func newDocumentFromClipboard(_ sender: Any?)
  39. func newDocumentFromImage(_ sender: Any?)
  40. func importFromWebPage(_ sender: Any?)
  41. func screenShot_SelectArea(_ sender: Any?)
  42. func screenShot_Window(_ sender: Any?)
  43. func screenShot_FullScreenDelay(_ sender: Any?)
  44. func screenShot_FullScreen(_ sender: Any?)
  45. }
  46. extension KMSystemFileMenuProtocol {
  47. func menuItemClick_Convert(_ sender: Any) {}
  48. func menuItemAction_newDocumentFromClipboard(_ sender: Any?) {}
  49. func menuItemAction_newDocumetFromImage(_ sender: Any?) {}
  50. func menuItemAction_importFromWebPage(_ sender: Any?) {}
  51. func menuItemAction_screenShotSelectArea(_ sender: Any?) {}
  52. func menuItemAction_screenShotWindow(_ sender: Any?) {}
  53. func menuItemAction_screenShotFullScreenDelay(_ sender: Any?) {}
  54. func menuItemAction_screenShotFullScreen(_ sender: Any?) {}
  55. func newDocumentFromClipboard(_ sender: Any?) {}
  56. func newDocumentFromImage(_ sender: Any?) {}
  57. func importFromWebPage(_ sender: Any?) {}
  58. func screenShot_SelectArea(_ sender: Any?) {}
  59. func screenShot_Window(_ sender: Any?) {}
  60. func screenShot_FullScreenDelay(_ sender: Any?) {}
  61. func screenShot_FullScreen(_ sender: Any?) {}
  62. }
  63. extension KMSystemMenu.File {
  64. public static let saveAsFlattenedPDFSelector = NSSelectorFromString("menuItemClick_saveAsFlattenedPDF:")
  65. public static let mergePDFSelector = NSSelectorFromString("menuItemClick_mergePDF:")
  66. public static let compressSelector = NSSelectorFromString("menuItemClick_Compress:")
  67. public static let convertSelector = NSSelectorFromString("menuItemClick_Convert:")
  68. public static let convertToWordSelector = NSSelectorFromString("menuItemAction_ConvertToWord:")
  69. public static let convertToExcelSelector = NSSelectorFromString("menuItemAction_ConvertToExcel:")
  70. public static let convertToPPTSelector = NSSelectorFromString("menuItemAction_ConvertToPPT:")
  71. public static let convertToRTFSelector = NSSelectorFromString("menuItemAction_ConvertToRTF:")
  72. public static let convertToHTMLSelector = NSSelectorFromString("menuItemAction_ConvertToHTML:")
  73. public static let convertToTextSelector = NSSelectorFromString("menuItemAction_ConvertToText:")
  74. public static let convertToCSVSelector = NSSelectorFromString("menuItemAction_ConvertToCSV:")
  75. public static let convertToImageSelector = NSSelectorFromString("menuItemAction_ConvertToImage:")
  76. public static let settingPasswordSelector = NSSelectorFromString("menuItemClick_SettingPassword:")
  77. public static let removePasswordSelector = NSSelectorFromString("menuItemClick_RemovePassword:")
  78. public static let closeWindowSelector = NSSelectorFromString("menuItemAction_closeWindow:")
  79. public static let closeAllWindowsSelector = NSSelectorFromString("menuItemAction_closeAllWindows:")
  80. public static let closeTagPageSelector = NSSelectorFromString("menuItemAction_closeTagPage:")
  81. public static let showInFinderSelector = NSSelectorFromString("menuItemAction_showInFinder:")
  82. public static let propertySelector = NSSelectorFromString("menuItemAction_property:")
  83. public static let printSelector = NSSelectorFromString("menuItemAction_print:")
  84. public static let newDocumentFromClipboardSelector = NSSelectorFromString("newDocumentFromClipboard:")
  85. public static let newDocumentFromImageSelector = NSSelectorFromString("newDocumentFromImage:")
  86. public static let importFromWebPageSelector = NSSelectorFromString("importFromWebPage:")
  87. public static let screenShotSelectAreaSelector = NSSelectorFromString("screenShot_SelectArea:")
  88. public static let screenShotWindowSelector = NSSelectorFromString("screenShot_Window:")
  89. public static let screenShotFullScreenDelaySelector = NSSelectorFromString("screenShot_FullScreenDelay:")
  90. public static let screenShotFullScreenSelector = NSSelectorFromString("screenShot_FullScreen:")
  91. public static func actions() -> [Selector] {
  92. return [self.saveAsFlattenedPDFSelector, self.mergePDFSelector, self.compressSelector,
  93. // convert
  94. self.convertSelector, self.convertToWordSelector, self.convertToExcelSelector, self.convertToPPTSelector,
  95. self.convertToRTFSelector, self.convertToHTMLSelector, self.convertToTextSelector, self.convertToCSVSelector,
  96. self.convertToImageSelector,
  97. // secure
  98. self.settingPasswordSelector, self.removePasswordSelector,
  99. // other
  100. self.closeWindowSelector, self.closeAllWindowsSelector, self.closeTagPageSelector,
  101. self.showInFinderSelector, self.propertySelector,
  102. self.printSelector,
  103. self.newDocumentFromClipboardSelector, self.newDocumentFromImageSelector, self.importFromWebPageSelector,
  104. self.screenShotSelectAreaSelector, self.screenShotWindowSelector, self.screenShotFullScreenDelaySelector, self.screenShotFullScreenSelector]
  105. }
  106. }