KMSystemAnnotationMenu.swift 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //
  2. // KMSystemAnnotationMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/12/26.
  6. //
  7. import Foundation
  8. protocol KMSystemAnnotationMenuProtocol: NSObjectProtocol {
  9. func menuItemAction_highlight(_ sender: Any)
  10. func menuItemAction_underline(_ sender: Any)
  11. func menuItemAction_deleteLine(_ sender: Any)
  12. func menuItemAction_wavyLine(_ sender: Any)
  13. func menuItemAction_freehand(_ sender: Any)
  14. func menuItemAction_text(_ sender: Any)
  15. func menuItemAction_note(_ sender: Any)
  16. func menuItemAction_squre(_ sender: Any)
  17. func menuItemAction_circle(_ sender: Any)
  18. func menuItemAction_arrow(_ sender: Any)
  19. func menuItemAction_line(_ sender: Any)
  20. // link
  21. func menuItemAction_link(_ sender: Any)
  22. func menuItemAction_linkPage(_ sender: Any)
  23. func menuItemAction_linkHttps(_ sender: Any)
  24. func menuItemAction_linkEmail(_ sender: Any)
  25. func notesLink(_ sender: Any)
  26. // stamp
  27. func menuItemAction_stamp(_ sender: Any)
  28. func menuItemAction_stampStandard(_ sender: Any)
  29. func menuItemAction_stampDynamic(_ sender: Any)
  30. func menuItemAction_stampCustom(_ sender: Any)
  31. func notesStamp(_ sender: Any)
  32. func menuItemAction_signure(_ sender: Any)
  33. func image(_ sender: Any)
  34. func table(_ sender: Any)
  35. func addForm(_ sender: Any)
  36. func editNote(_ sender: Any)
  37. func menuItemAction_hiddenAllAnnotation(_ sender: Any)
  38. func menuItemAction_clearAllAnnotation(_ sender: Any)
  39. }
  40. extension KMSystemAnnotationMenuProtocol {
  41. func menuItemAction_linkHttps(_ sender: Any) {}
  42. func menuItemAction_linkEmail(_ sender: Any) {}
  43. func notesLink(_ sender: Any) {}
  44. func menuItemAction_stampStandard(_ sender: Any) {}
  45. func menuItemAction_stampDynamic(_ sender: Any) {}
  46. func menuItemAction_stampCustom(_ sender: Any) {}
  47. func notesStamp(_ sender: Any) {}
  48. func image(_ sender: Any) {}
  49. func table(_ sender: Any) {}
  50. func addForm(_ sender: Any) {}
  51. func editNote(_ sender: Any) {}
  52. }
  53. extension KMSystemMenu.Annotation {
  54. public static let highlightSelector = NSSelectorFromString("menuItemAction_highlight:")
  55. public static let underlineSelector = NSSelectorFromString("menuItemAction_underline:")
  56. public static let strikeOutSelector = NSSelectorFromString("menuItemAction_deleteLine:")
  57. public static let wavyLineSelector = NSSelectorFromString("menuItemAction_wavyLine:")
  58. public static let freehandSelector = NSSelectorFromString("menuItemAction_freehand:")
  59. public static let textSelector = NSSelectorFromString("menuItemAction_text:")
  60. public static let noteSelector = NSSelectorFromString("menuItemAction_note:")
  61. public static let squreSelector = NSSelectorFromString("menuItemAction_squre:")
  62. public static let circleSelector = NSSelectorFromString("menuItemAction_circle:")
  63. public static let arrowSelector = NSSelectorFromString("menuItemAction_arrow:")
  64. public static let lineSelector = NSSelectorFromString("menuItemAction_line:")
  65. public static let linkSelector = NSSelectorFromString("menuItemAction_link:")
  66. public static let linkPageSelector = NSSelectorFromString("menuItemAction_linkPage:")
  67. public static let linkHttpsSelector = NSSelectorFromString("menuItemAction_linkHttps:")
  68. public static let linkEmailSelector = NSSelectorFromString("menuItemAction_linkEmail:")
  69. public static let notesLinkSelector = NSSelectorFromString("notesLink:")
  70. public static let stampSelector = NSSelectorFromString("menuItemAction_stamp:")
  71. public static let stampStandardSelector = NSSelectorFromString("menuItemAction_stampStandard:")
  72. public static let stampDynamicSelector = NSSelectorFromString("menuItemAction_stampDynamic:")
  73. public static let stampCustomSelector = NSSelectorFromString("menuItemAction_stampCustom:")
  74. public static let notesStampSelector = NSSelectorFromString("notesStamp:")
  75. public static let signureSelector = NSSelectorFromString("menuItemAction_signure:")
  76. public static let imageSelector = NSSelectorFromString("image:")
  77. public static let tableSelector = NSSelectorFromString("table:")
  78. public static let addFormSelector = NSSelectorFromString("addForm:")
  79. public static let editNoteSelector = NSSelectorFromString("editNote:")
  80. public static let hiddenAllSelector = NSSelectorFromString("menuItemAction_hiddenAllAnnotation:")
  81. public static let clearAllSelector = NSSelectorFromString("menuItemAction_clearAllAnnotation:")
  82. public static func actions() -> [Selector] {
  83. return [self.highlightSelector, self.underlineSelector, self.strikeOutSelector, self.wavyLineSelector, self.freehandSelector, self.textSelector, self.noteSelector, self.squreSelector, self.circleSelector,
  84. self.arrowSelector, self.lineSelector,
  85. // link
  86. self.linkSelector, self.linkPageSelector, self.linkHttpsSelector, self.linkEmailSelector, self.notesLinkSelector,
  87. // stamp
  88. self.stampSelector, self.stampStandardSelector, self.stampDynamicSelector, self.stampCustomSelector, self.notesStampSelector,
  89. // other
  90. self.signureSelector, self.imageSelector, self.tableSelector, self.addFormSelector, self.editNoteSelector,
  91. self.hiddenAllSelector, self.clearAllSelector]
  92. }
  93. }