KMSystemMenu.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // KMSystemMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/4/24.
  6. //
  7. import Cocoa
  8. class KMSystemMenu: NSObject {
  9. public struct File {
  10. }
  11. public struct Edit {
  12. }
  13. public struct View {
  14. }
  15. public struct Annotation {
  16. }
  17. public struct PDF {
  18. }
  19. public struct Goto {
  20. }
  21. public struct Tool {
  22. }
  23. public struct Window {
  24. }
  25. public static func isFileSelector(sel: Selector) -> Bool {
  26. return KMSystemMenu.File.actions().contains(sel)
  27. }
  28. public static func isEditSelector(sel: Selector) -> Bool {
  29. return KMSystemMenu.Edit.actions().contains(sel)
  30. }
  31. public static func isViewSelector(sel: Selector) -> Bool {
  32. return KMSystemMenu.View.actions().contains(sel)
  33. }
  34. public static func isAnnotationSelector(sel: Selector) -> Bool {
  35. return KMSystemMenu.Annotation.actions().contains(sel)
  36. }
  37. public static func isPDFSelector(sel: Selector) -> Bool {
  38. return KMSystemMenu.PDF.actions().contains(sel)
  39. }
  40. public static func isGotoSelector(sel: Selector) -> Bool {
  41. return KMSystemMenu.Goto.actions().contains(sel)
  42. }
  43. public static func isToolSelector(sel: Selector) -> Bool {
  44. return KMSystemMenu.Tool.actions().contains(sel)
  45. }
  46. public static func isWindowSelector(sel: Selector) -> Bool {
  47. return KMSystemMenu.Window.actions().contains(sel)
  48. }
  49. }