KMSystemMenu.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // KMSystemMenu.swift
  3. // PDF Master
  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 Goto {
  18. }
  19. public struct Tool {
  20. }
  21. public struct Window {
  22. }
  23. public static func isFileSelector(sel: Selector) -> Bool {
  24. return KMSystemMenu.File.actions().contains(sel)
  25. }
  26. public static func isEditSelector(sel: Selector) -> Bool {
  27. return KMSystemMenu.Edit.actions().contains(sel)
  28. }
  29. public static func isViewSelector(sel: Selector) -> Bool {
  30. return KMSystemMenu.View.actions().contains(sel)
  31. }
  32. public static func isAnnotationSelector(sel: Selector) -> Bool {
  33. return KMSystemMenu.Annotation.actions().contains(sel)
  34. }
  35. public static func isGotoSelector(sel: Selector) -> Bool {
  36. return KMSystemMenu.Goto.actions().contains(sel)
  37. }
  38. public static func isToolSelector(sel: Selector) -> Bool {
  39. return KMSystemMenu.Tool.actions().contains(sel)
  40. }
  41. public static func isWindowSelector(sel: Selector) -> Bool {
  42. return KMSystemMenu.Window.actions().contains(sel)
  43. }
  44. }