KMSystemPDFMenu.swift 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // KMSystemPDFMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2024/1/8.
  6. //
  7. import Cocoa
  8. @objc protocol KMSystemPDFMenuProtocol: NSObjectProtocol {
  9. // PDF Display
  10. @objc optional func changeDisplayMode(_ sender: Any?)
  11. @objc optional func toggleDisplayAsBook(_ sender: Any?)
  12. @objc optional func toggleDisplayPageBreaks(_ sender: Any?)
  13. @objc optional func changeDisplayBox(_ sender: Any?)
  14. @objc optional func toggleAutoScale(_ sender: Any?)
  15. @objc optional func doZoomToActualSize(_ sender: Any?)
  16. @objc optional func doZoomToFit(_ sender: Any?)
  17. @objc optional func doZoomIn(_ sender: Any?)
  18. @objc optional func doZoomOut(_ sender: Any?)
  19. @objc optional func doMarqueeZoomTool(_ sender: Any?)
  20. @objc optional func highlightFormFiled(_ sender: Any?)
  21. @objc optional func highlightLinks(_ sender: Any?)
  22. @objc optional func resetForm(_ sender: Any?)
  23. @objc optional func removeAllAnnotation(_ sender: Any?)
  24. @objc optional func savePDFSettingToDefaults(_ sender: Any?)
  25. }
  26. extension KMSystemMenu.PDF {
  27. public static let changeDisplayModeSelector = NSSelectorFromString("changeDisplayMode:")
  28. public static let toggleDisplayAsBookSelector = NSSelectorFromString("toggleDisplayAsBook:")
  29. public static let toggleDisplayPageBreaksSelector = NSSelectorFromString("toggleDisplayPageBreaks:")
  30. public static let changeDisplayBoxSelector = NSSelectorFromString("changeDisplayBox:")
  31. public static let toggleAutoScaleSelector = NSSelectorFromString("toggleAutoScale:")
  32. public static let doZoomToActualSizeSelector = NSSelectorFromString("doZoomToActualSize:")
  33. public static let doZoomToFitSelector = NSSelectorFromString("doZoomToFit:")
  34. public static let doZoomInSelector = NSSelectorFromString("doZoomIn:")
  35. public static let doZoomOutSelector = NSSelectorFromString("doZoomOut:")
  36. public static let doMarqueeZoomToolSelector = NSSelectorFromString("doMarqueeZoomTool:")
  37. public static let highlightFormFiledSelector = NSSelectorFromString("highlightFormFiled:")
  38. public static let highlightLinksSelector = NSSelectorFromString("highlightLinks:")
  39. public static let resetFormSelector = NSSelectorFromString("resetForm:")
  40. public static let removeAllAnnotationSelector = NSSelectorFromString("removeAllAnnotation:")
  41. public static let savePDFSettingToDefaultsSelector = NSSelectorFromString("savePDFSettingToDefaults:")
  42. public static func actions() -> [Selector] {
  43. return [self.changeDisplayModeSelector, self.toggleDisplayAsBookSelector, self.toggleDisplayPageBreaksSelector, self.changeDisplayBoxSelector,
  44. self.toggleAutoScaleSelector, self.doZoomToActualSizeSelector, self.doZoomToFitSelector, self.doZoomInSelector, self.doZoomOutSelector, self.doMarqueeZoomToolSelector,
  45. self.highlightFormFiledSelector, self.highlightLinksSelector,
  46. self.resetFormSelector, self.removeAllAnnotationSelector,
  47. self.savePDFSettingToDefaultsSelector]
  48. }
  49. }