KMSystemViewMenu.swift 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //
  2. // KMSystemViewMenu.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/12/26.
  6. //
  7. import Foundation
  8. protocol KMSystemViewMenuProtocol {
  9. // scale
  10. func menuItemAction_adjustWidth(_ sender: Any)
  11. func menuItemAction_adjustPage(_ sender: Any)
  12. func menuItemAction_size(_ sender: Any)
  13. func menuItemAction_zoomOut(_ sender: Any)
  14. func menuItemAction_zoomIn(_ sender: Any)
  15. // page show
  16. func menuItemAction_singlePage(_ sender: Any)
  17. func menuItemAction_singlePageContinue(_ sender: Any)
  18. func menuItemAction_doublePage(_ sender: Any)
  19. func menuItemAction_doublePageContinue(_ sender: Any)
  20. func menuItemAction_bookMode(_ sender: Any)
  21. func menuItemAction_readMode(_ sender: Any)
  22. func menuItemAction_showSplitPage(_ sender: Any)
  23. func menuItemAction_autoScrol(_ sender: Any)
  24. func menuItemAction_autoScrolSetting(_ sender: Any)
  25. // rotate
  26. func menuItemAction_rotateLeft(_ sender: Any)
  27. func menuItemAction_rotateRight(_ sender: Any)
  28. func menuItemAction_rotateAllPageLeft(_ sender: Any)
  29. func menuItemAction_rotateAllPageRight(_ sender: Any)
  30. // split screen
  31. func menuItemAction_splitScreenVerti(_ sender: Any)
  32. func menuItemAction_splitScreenHorti(_ sender: Any)
  33. func menuItemAction_splitScreenNo(_ sender: Any)
  34. func menuItemAction_view_readMode(_ sender: Any)
  35. func menuItemAction_enterFullScreen(_ sender: Any)
  36. func menuItemAction_hiddenLeftSide(_ sender: Any)
  37. func menuItemAction_hiddenRightSide(_ sender: Any)
  38. func menuItemAction_thumai(_ sender: Any)
  39. func menuItemAction_outline(_ sender: Any)
  40. func menuItemAction_bookmark(_ sender: Any)
  41. func menuItemAction_annotation(_ sender: Any)
  42. func menuItemAction_search(_ sender: Any)
  43. func menuItemAction_topic(_ sender: Any)
  44. func menuItemAction_hiddenPageIndicator(_ sender: Any)
  45. func togglePresentation(_ sender: Any?)
  46. func chooseTransition(_ sender: Any?)
  47. func toggleAutoFlow(_ sender: Any?)
  48. func chooseAutoFlowSetting(_ sender: Any?)
  49. func toggleReadingBar(_ sender: Any?)
  50. func toggleLeftSidePane(_ sender: Any?)
  51. func changeLeftSidePaneState(_ sender: Any?)
  52. func splitViewAction(_ sender: Any?)
  53. func themesColor(_ sender: Any?)
  54. func toggleStatusBar(_ sender: Any?)
  55. func toggleToolbarShow(_ sender: Any?)
  56. }
  57. extension KMSystemViewMenuProtocol {
  58. func menuItemAction_autoScrol(_ sender: Any) {}
  59. func menuItemAction_autoScrolSetting(_ sender: Any) {}
  60. func menuItemAction_splitScreenVerti(_ sender: Any) {}
  61. func menuItemAction_splitScreenHorti(_ sender: Any) {}
  62. func menuItemAction_splitScreenNo(_ sender: Any) {}
  63. func menuItemAction_enterFullScreen(_ sender: Any) {}
  64. func menuItemAction_topic(_ sender: Any) {}
  65. }
  66. extension KMSystemMenu.View {
  67. // scale
  68. public static let adjustWidthSelector = NSSelectorFromString("menuItemAction_adjustWidth:")
  69. public static let adjustPageSelector = NSSelectorFromString("menuItemAction_adjustPage:")
  70. public static let sizeSelector = NSSelectorFromString("menuItemAction_size:")
  71. public static let zoomOutSelector = NSSelectorFromString("menuItemAction_zoomOut:")
  72. public static let zoomInSelector = NSSelectorFromString("menuItemAction_zoomIn:")
  73. // page show
  74. public static let singlePageSelector = NSSelectorFromString("menuItemAction_singlePage:")
  75. public static let singlePageContinueSelector = NSSelectorFromString("menuItemAction_singlePageContinue:")
  76. public static let doublePageSelector = NSSelectorFromString("menuItemAction_doublePage:")
  77. public static let doublePageContinueSelector = NSSelectorFromString("menuItemAction_doublePageContinue:")
  78. public static let bookModeSelector = NSSelectorFromString("menuItemAction_bookMode:")
  79. public static let readModeSelector = NSSelectorFromString("menuItemAction_readMode:")
  80. public static let showSplitPageSelector = NSSelectorFromString("menuItemAction_showSplitPage:")
  81. public static let autoScrolSelector = NSSelectorFromString("menuItemAction_autoScrol:")
  82. public static let autoScrolSettingSelector = NSSelectorFromString("menuItemAction_autoScrolSetting:")
  83. // rotate
  84. public static let rotateLeftSelector = NSSelectorFromString("menuItemAction_rotateLeft:")
  85. public static let rotateRightSelector = NSSelectorFromString("menuItemAction_rotateRight:")
  86. public static let rotateAllPageLeftSelector = NSSelectorFromString("menuItemAction_rotateAllPageLeft:")
  87. public static let rotateAllPageRightSelector = NSSelectorFromString("menuItemAction_rotateAllPageRight:")
  88. // split screen
  89. public static let splitScreenVertiSelector = NSSelectorFromString("menuItemAction_splitScreenVerti:")
  90. public static let splitScreenHortiSelector = NSSelectorFromString("menuItemAction_splitScreenHorti:")
  91. public static let splitScreenNoSelector = NSSelectorFromString("menuItemAction_splitScreenNo:")
  92. public static let viewReadModeSelector = NSSelectorFromString("menuItemAction_view_readMode:")
  93. public static let enterFullScreenSelector = NSSelectorFromString("menuItemAction_enterFullScreen:")
  94. public static let hiddenLeftSideSelector = NSSelectorFromString("menuItemAction_hiddenLeftSide:")
  95. public static let hiddenRightSideSelector = NSSelectorFromString("menuItemAction_hiddenRightSide:")
  96. public static let thumaiSelector = NSSelectorFromString("menuItemAction_thumai:")
  97. public static let outlineSelector = NSSelectorFromString("menuItemAction_outline:")
  98. public static let bookmarkSelector = NSSelectorFromString("menuItemAction_bookmark:")
  99. public static let annotationSelector = NSSelectorFromString("menuItemAction_annotation:")
  100. public static let searchSelector = NSSelectorFromString("menuItemAction_search:")
  101. public static let topicSelector = NSSelectorFromString("menuItemAction_topic:")
  102. public static let hiddenPageIndicatorSelector = NSSelectorFromString("menuItemAction_hiddenPageIndicator:")
  103. public static let togglePresentationSelector = NSSelectorFromString("togglePresentation:")
  104. public static let chooseTransitionSelector = NSSelectorFromString("chooseTransition:")
  105. public static let toggleAutoFlowSelector = NSSelectorFromString("toggleAutoFlow:")
  106. public static let chooseAutoFlowSettingSelector = NSSelectorFromString("chooseAutoFlowSetting:")
  107. public static let toggleReadingBarSelector = NSSelectorFromString("toggleReadingBar:")
  108. public static let toggleLeftSidePaneSelector = NSSelectorFromString("toggleLeftSidePane:")
  109. public static let changeLeftSidePaneStateSelector = NSSelectorFromString("changeLeftSidePaneState:")
  110. public static let splitViewActionSelector = NSSelectorFromString("splitViewAction:")
  111. public static let themesColorSelector = NSSelectorFromString("themesColor:")
  112. public static let toggleStatusBarSelector = NSSelectorFromString("toggleStatusBar:")
  113. public static let toggleToolbarShowSelector = NSSelectorFromString("toggleToolbarShow:")
  114. public static func actions() -> [Selector] {
  115. return [self.adjustWidthSelector, self.adjustPageSelector, self.sizeSelector, self.zoomOutSelector, self.zoomInSelector,
  116. // page show
  117. self.singlePageSelector, self.singlePageContinueSelector, self.doublePageSelector, self.doublePageContinueSelector,
  118. self.bookModeSelector, self.readModeSelector, self.showSplitPageSelector, self.autoScrolSelector,
  119. self.autoScrolSettingSelector,
  120. // rotate
  121. self.rotateLeftSelector, self.rotateRightSelector, self.rotateAllPageLeftSelector, self.rotateAllPageRightSelector,
  122. // split screen
  123. self.splitScreenVertiSelector, self.splitScreenHortiSelector, self.splitScreenNoSelector,
  124. self.viewReadModeSelector, self.enterFullScreenSelector,
  125. self.hiddenLeftSideSelector, self.hiddenRightSideSelector,
  126. self.thumaiSelector, self.outlineSelector, self.bookmarkSelector, self.annotationSelector,
  127. self.searchSelector, self.topicSelector, self.hiddenPageIndicatorSelector,
  128. self.togglePresentationSelector, self.chooseTransitionSelector,
  129. self.toggleAutoFlowSelector, self.chooseAutoFlowSettingSelector,
  130. self.toggleReadingBarSelector,
  131. self.toggleLeftSidePaneSelector,
  132. self.changeLeftSidePaneStateSelector,
  133. self.splitViewActionSelector,
  134. self.themesColorSelector,
  135. self.toggleStatusBarSelector, self.toggleToolbarShowSelector]
  136. }
  137. }