KMSystemAnnotationMenu.swift 5.3 KB

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