KMSystemEditMenu.swift 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // KMSystemEditMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/12/26.
  6. //
  7. import Foundation
  8. @objc protocol KMSystemEditMenuProtocol {
  9. @objc optional func undo(_ sender: Any?)
  10. @objc optional func redo(_ sender: Any?)
  11. @objc optional func cut(_ sender: Any?)
  12. @objc optional func copy(_ sender: Any?)
  13. @objc optional func paste(_ sender: Any?)
  14. @objc optional func delete(_ sender: Any?)
  15. @objc optional func menuItemAction_find(_ sender: Any)
  16. @objc optional func changeFont(_ sender: Any?)
  17. }
  18. extension KMSystemMenu.Edit {
  19. public static let undoSelector = NSSelectorFromString("undo:")
  20. public static let redoSelector = NSSelectorFromString("redo:")
  21. public static let cutSelector = NSSelectorFromString("cut:")
  22. public static let copySelector = NSSelectorFromString("copy:")
  23. public static let pasteSelector = NSSelectorFromString("paste:")
  24. public static let deleteSelector = NSSelectorFromString("delete:")
  25. public static let findSelector = NSSelectorFromString("menuItemAction_find:")
  26. public static let changeFontSelector = NSSelectorFromString("changeFont:")
  27. public static func actions() -> [Selector] {
  28. return [self.undoSelector, self.redoSelector,
  29. self.cutSelector, self.copySelector, self.pasteSelector, self.deleteSelector,
  30. self.findSelector,
  31. self.changeFontSelector]
  32. }
  33. }