KMPDFMenuConfig.swift 97 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259
  1. //
  2. // KMPDFMenuConfig.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 2024/10/23.
  6. //
  7. import Foundation
  8. import KMComponentLibrary
  9. let PDFViewMenuIdentifier_Space = "PDFViewMenuIdentifier_Space"
  10. //MARK: -PageEdit
  11. let ThumbnailMenuIdentifier_Copy = "ThumbnailMenuIdentifier_Copy"
  12. let ThumbnailMenuIdentifier_Cut = "ThumbnailMenuIdentifier_Cut"
  13. let ThumbnailMenuIdentifier_Paste = "ThumbnailMenuIdentifier_Paste"
  14. let ThumbnailMenuIdentifier_Delete = "ThumbnailMenuIdentifier_Delete"
  15. let ThumbnailMenuIdentifier_RotateRight = "ThumbnailMenuIdentifier_RotateRight"
  16. let ThumbnailMenuIdentifier_RotateLeft = "ThumbnailMenuIdentifier_RotateLeft"
  17. let ThumbnailMenuIdentifier_InsertFile = "ThumbnailMenuIdentifier_InsertFile"
  18. let ThumbnailMenuIdentifier_InsertBlank = "ThumbnailMenuIdentifier_InsertBlank"
  19. let ThumbnailMenuIdentifier_Replace = "ThumbnailMenuIdentifier_Replace"
  20. let ThumbnailMenuIdentifier_Share = "ThumbnailMenuIdentifier_Share"
  21. let ThumbnailMenuIdentifier_Export = "ThumbnailMenuIdentifier_Export"
  22. let ThumbnailMenuIdentifier_PastNull = "ThumbnailMenuIdentifier_PastNull"
  23. let ThumbnailMenuIdentifier_FileShowSize = "ThumbnailMenuIdentifier_FileShowSize"
  24. //MARK: - 幻灯片
  25. let PDFViewMenuIdentifier_PageNext = "PDFViewMenuIdentifier_PageNext"
  26. let PDFViewMenuIdentifier_PagePrevious = "PDFViewMenuIdentifier_PagePrevious"
  27. let PDFViewMenuIdentifier_PageFirst = "PDFViewMenuIdentifier_PageFirst"
  28. let PDFViewMenuIdentifier_PageLast = "PDFViewMenuIdentifier_PageLast"
  29. let PDFViewMenuIdentifier_Presentation_LaserPoint = "PDFViewMenuIdentifier_Presentation_LaserPoint"
  30. let PDFViewMenuIdentifier_Presentation_Brush = "PDFViewMenuIdentifier_Presentation_Brush"
  31. let PDFViewMenuIdentifier_Presentation_Exit = "PDFViewMenuIdentifier_Presentation_Exit"
  32. //MARK: - 常规模式
  33. let PDFViewMenuIdentifier_Normal_AITool = "PDFViewMenuIdentifier_Normal_AITool"
  34. let PDFViewMenuIdentifier_Normal_AIRewrite = "PDFViewMenuIdentifier_Normal_AIRewrite"
  35. let PDFViewMenuIdentifier_Normal_AIProofread = "PDFViewMenuIdentifier_Normal_AIProofread"
  36. let PDFViewMenuIdentifier_Normal_AITranslate = "PDFViewMenuIdentifier_Normal_AITranslate"
  37. let PDFViewMenuIdentifier_Normal_Past = "PDFViewMenuIdentifier_Normal_Past"
  38. let PDFViewMenuIdentifier_Normal_SelectAllText = "PDFViewMenuIdentifier_Normal_SelectAllText"
  39. let PDFViewMenuIdentifier_Normal_AddBook = "PDFViewMenuIdentifier_Normal_AddBook"
  40. let PDFViewMenuIdentifier_Normal_ViewTools = "PDFViewMenuIdentifier_Normal_ViewTools"
  41. let PDFViewMenuIdentifier_Normal_TextTool = "PDFViewMenuIdentifier_Normal_TextTool"
  42. let PDFViewMenuIdentifier_Normal_MoveTool = "PDFViewMenuIdentifier_Normal_MoveTool"
  43. let PDFViewMenuIdentifier_Normal_SelectTool = "PDFViewMenuIdentifier_Normal_SelectTool"
  44. let PDFViewMenuIdentifier_Normal_MagnifyTool = "PDFViewMenuIdentifier_Normal_MagnifyTool"
  45. let PDFViewMenuIdentifier_Normal_SelectZoomTool = "PDFViewMenuIdentifier_Normal_SelectZoomTool"
  46. let PDFViewMenuIdentifier_Normal_PageView = "PDFViewMenuIdentifier_Normal_PageView"
  47. let PDFViewMenuIdentifier_Normal_Single = "PDFViewMenuIdentifier_Normal_Single"
  48. let PDFViewMenuIdentifier_Normal_SingleContinuous = "PDFViewMenuIdentifier_Normal_SingleContinuous"
  49. let PDFViewMenuIdentifier_Normal_TwoPages = "PDFViewMenuIdentifier_Normal_TwoPages"
  50. let PDFViewMenuIdentifier_Normal_TwoPagesContinuous = "PDFViewMenuIdentifier_Normal_TwoPagesContinuous"
  51. let PDFViewMenuIdentifier_Normal_BookMode = "PDFViewMenuIdentifier_Normal_BookMode"
  52. let PDFViewMenuIdentifier_Normal_ReadMode = "PDFViewMenuIdentifier_Normal_ReadMode"
  53. let PDFViewMenuIdentifier_Normal_Scale = "PDFViewMenuIdentifier_Normal_Scale"
  54. let PDFViewMenuIdentifier_Normal_ScaleWidth = "PDFViewMenuIdentifier_Normal_ScaleWidth"
  55. let PDFViewMenuIdentifier_Normal_ScalePage = "PDFViewMenuIdentifier_Normal_ScalePage"
  56. let PDFViewMenuIdentifier_Normal_ScaleOrg = "PDFViewMenuIdentifier_Normal_ScaleOrg"
  57. let PDFViewMenuIdentifier_Normal_ScaleZoomIn = "PDFViewMenuIdentifier_Normal_ScaleZoomIn"
  58. let PDFViewMenuIdentifier_Normal_ScaleZoomOut = "PDFViewMenuIdentifier_Normal_ScaleZoomOut"
  59. let PDFViewMenuIdentifier_Normal_PageRotate = "PDFViewMenuIdentifier_Normal_PageRotate"
  60. let PDFViewMenuIdentifier_Normal_RotateLeft = "PDFViewMenuIdentifier_Normal_RotateLeft"
  61. let PDFViewMenuIdentifier_Normal_RotateRight = "PDFViewMenuIdentifier_Normal_RotateRight"
  62. let PDFViewMenuIdentifier_Normal_PageNum = "PDFViewMenuIdentifier_Normal_PageNum"
  63. let PDFViewMenuIdentifier_Normal_EnterPageNum = "PDFViewMenuIdentifier_Normal_EnterPageNum"
  64. let PDFViewMenuIdentifier_Normal_PageBack = "PDFViewMenuIdentifier_Normal_PageBack"
  65. let PDFViewMenuIdentifier_Normal_PageForward = "PDFViewMenuIdentifier_Normal_PageForward"
  66. let PDFViewMenuIdentifier_Normal_AutoScroll = "PDFViewMenuIdentifier_Normal_AutoScroll"
  67. let PDFViewMenuIdentifier_Normal_HightForm = "PDFViewMenuIdentifier_Normal_HightForm"
  68. let PDFViewMenuIdentifier_Normal_HightLink = "PDFViewMenuIdentifier_Normal_HightLink"
  69. let PDFViewMenuIdentifier_Normal_RestForm = "PDFViewMenuIdentifier_Normal_RestForm"
  70. let PDFViewMenuIdentifier_Normal_Search = "PDFViewMenuIdentifier_Normal_Search"
  71. let PDFViewMenuIdentifier_Normal_Print = "PDFViewMenuIdentifier_Normal_Print"
  72. let PDFViewMenuIdentifier_Normal_Properties = "PDFViewMenuIdentifier_Normal_Properties"
  73. let PDFViewMenuIdentifier_Normal_Copy = "PDFViewMenuIdentifier_Normal_Copy"
  74. let PDFViewMenuIdentifier_Normal_Hight = "PDFViewMenuIdentifier_Normal_Hight"
  75. let PDFViewMenuIdentifier_Normal_Underline = "PDFViewMenuIdentifier_Normal_Underline"
  76. let PDFViewMenuIdentifier_Normal_Squiggly = "PDFViewMenuIdentifier_Normal_Squiggly"
  77. let PDFViewMenuIdentifier_Normal_StrikeOut = "PDFViewMenuIdentifier_Normal_StrikeOut"
  78. let PDFViewMenuIdentifier_Normal_Square = "PDFViewMenuIdentifier_Normal_Square"
  79. let PDFViewMenuIdentifier_Normal_Circle = "PDFViewMenuIdentifier_Normal_Circle"
  80. let PDFViewMenuIdentifier_Normal_AddOutLine = "PDFViewMenuIdentifier_Normal_AddOutLine"
  81. let PDFViewMenuIdentifier_Normal_TTS = "PDFViewMenuIdentifier_Normal_TTS"
  82. let PDFViewMenuIdentifier_Normal_SearchText = "PDFViewMenuIdentifier_Normal_SearchText"
  83. let PDFViewMenuIdentifier_Normal_SelectAllForm = "PDFViewMenuIdentifier_Normal_SelectAllForm"
  84. let PDFViewMenuIdentifier_Normal_ShowFormName = "PDFViewMenuIdentifier_Normal_ShowFormName"
  85. let PDFViewMenuIdentifier_Normal_SelectAllAnnotation = "PDFViewMenuIdentifier_Normal_SelectAllAnnotation"
  86. let PDFViewMenuIdentifier_Normal_ShowAnnotation = "PDFViewMenuIdentifier_Normal_ShowAnnotation"
  87. let PDFViewMenuIdentifier_Normal_CopyText = "PDFViewMenuIdentifier_Normal_CopyText"
  88. let PDFViewMenuIdentifier_Normal_Cut = "PDFViewMenuIdentifier_Normal_Cut"
  89. let PDFViewMenuIdentifier_Normal_Delete = "PDFViewMenuIdentifier_Normal_Delete"
  90. let PDFViewMenuIdentifier_Normal_ShowPopUI = "PDFViewMenuIdentifier_Normal_ShowPopUI"
  91. let PDFViewMenuIdentifier_Normal_LinkReade = "PDFViewMenuIdentifier_Normal_LinkReade"
  92. let PDFViewMenuIdentifier_Normal_SortAnnotation = "PDFViewMenuIdentifier_Normal_SortAnnotation"
  93. let PDFViewMenuIdentifier_Normal_SortFirstAnnotation = "PDFViewMenuIdentifier_Normal_SortFirstAnnotation"
  94. let PDFViewMenuIdentifier_Normal_SortTopAnnotation = "PDFViewMenuIdentifier_Normal_SortTopAnnotation"
  95. let PDFViewMenuIdentifier_Normal_SortBottomAnnotation = "PDFViewMenuIdentifier_Normal_SortBottomAnnotation"
  96. let PDFViewMenuIdentifier_Normal_SortLastAnnotation = "PDFViewMenuIdentifier_Normal_SortLastAnnotation"
  97. let PDFViewMenuIdentifier_Normal_Content = "PDFViewMenuIdentifier_Normal_Content"
  98. let PDFViewMenuIdentifier_Redact_Apply = "PDFViewMenuIdentifier_Redact_Apply"
  99. let PDFViewMenuIdentifier_Redact_Multipage = "PDFViewMenuIdentifier_Redact_Multipage"
  100. let PDFViewMenuIdentifier_Redact_Default = "PDFViewMenuIdentifier_Redact_Default"
  101. let PDFViewMenuIdentifier_Split_ViewMode = "PDFViewMenuIdentifier_Split_ViewMode"
  102. let PDFViewMenuIdentifier_Split_ViewSingleMode = "PDFViewMenuIdentifier_Split_ViewSingleMode"
  103. let PDFViewMenuIdentifier_Split_ViewVerticalMode = "PDFViewMenuIdentifier_Split_ViewVerticalMode"
  104. let PDFViewMenuIdentifier_Split_ViewHorizontalMode = "PDFViewMenuIdentifier_Split_ViewHorizontalMode"
  105. let PDFViewMenuIdentifier_Split_Sync = "PDFViewMenuIdentifier_Split_Sync"
  106. let PDFViewMenuIdentifier_Split_ShowBar = "PDFViewMenuIdentifier_Split_ShowBar"
  107. let PDFViewMenuIdentifier_Normal_Aligning = "PDFViewMenuIdentifier_Normal_Aligning"
  108. let PDFViewMenuIdentifier_Normal_LeftAlight = "PDFViewMenuIdentifier_Normal_LeftAlight"
  109. let PDFViewMenuIdentifier_Normal_VerticallyAlight = "PDFViewMenuIdentifier_Normal_VerticallyAlight"
  110. let PDFViewMenuIdentifier_Normal_RightAlight = "PDFViewMenuIdentifier_Normal_RightAlight"
  111. let PDFViewMenuIdentifier_Normal_TopAlight = "PDFViewMenuIdentifier_Normal_TopAlight"
  112. let PDFViewMenuIdentifier_Normal_HorizontallyAlight = "PDFViewMenuIdentifier_Normal_HorizontallyAlight"
  113. let PDFViewMenuIdentifier_Normal_BottomAlight = "PDFViewMenuIdentifier_Normal_BottomAlight"
  114. let PDFViewMenuIdentifier_Normal_DistributeHorizontally = "PDFViewMenuIdentifier_Normal_DistributeHorizontally"
  115. let PDFViewMenuIdentifier_Normal_DistributeVertically = "PDFViewMenuIdentifier_Normal_DistributeVertically"
  116. let PDFViewMenuIdentifier_Normal_Export = "PDFViewMenuIdentifier_Normal_Export"
  117. let PDFViewMenuIdentifier_Normal_ExportJPG = "PDFViewMenuIdentifier_Normal_ExportJPG"
  118. let PDFViewMenuIdentifier_Normal_ExportPNG = "PDFViewMenuIdentifier_Normal_ExportPNG"
  119. let PDFViewMenuIdentifier_Normal_ExportPDF = "PDFViewMenuIdentifier_Normal_ExportPDF"
  120. let PDFViewMenuIdentifier_Normal_RedactProperties = "PDFViewMenuIdentifier_Normal_RedactProperties"
  121. let PDFViewMenuIdentifier_Edit_Paste = "PDFViewMenuIdentifier_Edit_Paste"
  122. let PDFViewMenuIdentifier_Edit_NoStylePaste = "PDFViewMenuIdentifier_Edit_NoStylePaste"
  123. let PDFViewMenuIdentifier_Edit_SelectAll = "PDFViewMenuIdentifier_Edit_SelectAll"
  124. let PDFViewMenuIdentifier_Edit_AddLink = "PDFViewMenuIdentifier_Edit_AddLink"
  125. let PDFViewMenuIdentifier_Edit_AddText = "PDFViewMenuIdentifier_Edit_AddText"
  126. let PDFViewMenuIdentifier_Edit_AddImage = "PDFViewMenuIdentifier_Edit_AddImage"
  127. let PDFViewMenuIdentifier_Edit_Font = "PDFViewMenuIdentifier_Edit_Font"
  128. let PDFViewMenuIdentifier_Edit_FontBold = "PDFViewMenuIdentifier_Edit_FontBold"
  129. let PDFViewMenuIdentifier_Edit_FontItalic = "PDFViewMenuIdentifier_Edit_FontItalic"
  130. let PDFViewMenuIdentifier_Edit_FontUnderline = "PDFViewMenuIdentifier_Edit_FontUnderline"
  131. let PDFViewMenuIdentifier_Edit_FontStrikeout = "PDFViewMenuIdentifier_Edit_FontStrikeout"
  132. let PDFViewMenuIdentifier_Edit_FontZoomIn = "PDFViewMenuIdentifier_Edit_FontZoomIn"
  133. let PDFViewMenuIdentifier_Edit_FontZoomOut = "PDFViewMenuIdentifier_Edit_FontZoomOut"
  134. let PDFViewMenuIdentifier_Edit_FontColor = "PDFViewMenuIdentifier_Edit_FontColor"
  135. let PDFViewMenuIdentifier_Edit_FontName = "PDFViewMenuIdentifier_Edit_FontName"
  136. let PDFViewMenuIdentifier_Edit_FontH1Name = "PDFViewMenuIdentifier_Edit_FontH1Name"
  137. let PDFViewMenuIdentifier_Edit_FontH2Name = "PDFViewMenuIdentifier_Edit_FontH2Name"
  138. let PDFViewMenuIdentifier_Edit_FontH3Name = "PDFViewMenuIdentifier_Edit_FontH3Name"
  139. let PDFViewMenuIdentifier_Edit_FontB1Name = "PDFViewMenuIdentifier_Edit_FontB1Name"
  140. let PDFViewMenuIdentifier_Edit_FontB2Name = "PDFViewMenuIdentifier_Edit_FontB2Name"
  141. let PDFViewMenuIdentifier_Edit_FontB3Name = "PDFViewMenuIdentifier_Edit_FontB3Name"
  142. let PDFViewMenuIdentifier_Edit_FontAlight = "PDFViewMenuIdentifier_Edit_FontAlight"
  143. let PDFViewMenuIdentifier_Edit_FontLeftAlight = "PDFViewMenuIdentifier_Edit_FontLeftAlight"
  144. let PDFViewMenuIdentifier_Edit_FontCenterAlight = "PDFViewMenuIdentifier_Edit_FontCenterAlight"
  145. let PDFViewMenuIdentifier_Edit_FontRightAlight = "PDFViewMenuIdentifier_Edit_FontRightAlight"
  146. let PDFViewMenuIdentifier_Edit_FontJustAlight = "PDFViewMenuIdentifier_Edit_FontJustAlight"
  147. let PDFViewMenuIdentifier_Edit_RotateLeft = "PDFViewMenuIdentifier_Edit_RotateLeft"
  148. let PDFViewMenuIdentifier_Edit_RotateRight = "PDFViewMenuIdentifier_Edit_RotateRight"
  149. let PDFViewMenuIdentifier_Edit_HorizontalMirror = "PDFViewMenuIdentifier_Edit_HorizontalMirror"
  150. let PDFViewMenuIdentifier_Edit_VerticalMirror = "PDFViewMenuIdentifier_Edit_VerticalMirror"
  151. let PDFViewMenuIdentifier_Edit_Crop = "PDFViewMenuIdentifier_Edit_Crop"
  152. let PDFViewMenuIdentifier_Edit_Replace = "PDFViewMenuIdentifier_Edit_Replace"
  153. let BOTAMenuIdentifier_Annotation_Expand = "BOTAMenuIdentifier_Annotation_Expand"
  154. let BOTAMenuIdentifier_Annotation_Sort = "BOTAMenuIdentifier_Annotation_Sort"
  155. let BOTAMenuIdentifier_Annotation_SortPage = "BOTAMenuIdentifier_Annotation_SortPage"
  156. let BOTAMenuIdentifier_Annotation_SortAscTime = "BOTAMenuIdentifier_Annotation_SortAscTime"
  157. let BOTAMenuIdentifier_Annotation_SortDesTime = "BOTAMenuIdentifier_Annotation_SortDesTime"
  158. let BOTAMenuIdentifier_Annotation_Improt = "BOTAMenuIdentifier_Annotation_Improt"
  159. let BOTAMenuIdentifier_Annotation_Export = "BOTAMenuIdentifier_Annotation_Export"
  160. let BOTAMenuIdentifier_Annotation_RemoveAll = "BOTAMenuIdentifier_Annotation_RemoveAll"
  161. let BOTAMenuIdentifier_Annotation_DeleteRep = "BOTAMenuIdentifier_Annotation_DeleteRep"
  162. let BOTAMenuIdentifier_Annotation_EditNote = "BOTAMenuIdentifier_Annotation_EditNote"
  163. let BOTAMenuIdentifier_Annotation_AddMark = "BOTAMenuIdentifier_Annotation_AddMark"
  164. let BOTAMenuIdentifier_Annotation_AddRep = "BOTAMenuIdentifier_Annotation_AddRep"
  165. let BOTAMenuIdentifier_Annotation_RepState = "BOTAMenuIdentifier_Annotation_RepState"
  166. let BOTAMenuIdentifier_Annotation_RepStateNone = "BOTAMenuIdentifier_Annotation_RepStateNone"
  167. let BOTAMenuIdentifier_Annotation_RepStateAccepted = "BOTAMenuIdentifier_Annotation_RepStateAccepted"
  168. let BOTAMenuIdentifier_Annotation_RepStateRejected = "BOTAMenuIdentifier_Annotation_RepStateRejected"
  169. let BOTAMenuIdentifier_Annotation_RepStateCancelled = "BOTAMenuIdentifier_Annotation_RepStateCancelled"
  170. let BOTAMenuIdentifier_Annotation_RepStateCompleted = "BOTAMenuIdentifier_Annotation_RepStateCompleted"
  171. let BOTAMenuIdentifier_Annotation_DeleteSignRep = "BOTAMenuIdentifier_Annotation_DeleteSignRep"
  172. let BOTAMenuIdentifier_Annotation_DeleteMuteRep = "BOTAMenuIdentifier_Annotation_DeleteMuteRep"
  173. @objcMembers class KMPDFMenuConfig: NSString {
  174. class func aiMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  175. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  176. itemSelected: false,
  177. isDisabled: false,
  178. keyEquivalent: nil,
  179. text: KMLocalizedString("AI Tools"),
  180. identifier: PDFViewMenuIdentifier_Normal_AITool)
  181. var subMenuItemArr: [ComponentMenuitemProperty] = []
  182. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  183. itemSelected: false,
  184. isDisabled: false,
  185. keyEquivalent: nil,
  186. text: KMLocalizedString("AI Rewrite"),identifier: PDFViewMenuIdentifier_Normal_AIRewrite)
  187. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  188. itemSelected: false,
  189. isDisabled: false,
  190. keyEquivalent: nil,
  191. text: KMLocalizedString("AI Proofread"),identifier: PDFViewMenuIdentifier_Normal_AIProofread)
  192. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  193. itemSelected: false,
  194. isDisabled: false,
  195. keyEquivalent: nil,
  196. text: KMLocalizedString("AI Translate"),identifier: PDFViewMenuIdentifier_Normal_AITranslate)
  197. subMenuItemArr.append(subItem0Property)
  198. subMenuItemArr.append(subItem1Property)
  199. subMenuItemArr.append(subItem2Property)
  200. properties_Menuitem.subPropertys = subMenuItemArr
  201. return properties_Menuitem
  202. }
  203. class func viewModeMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  204. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  205. itemSelected: false,
  206. isDisabled: false,
  207. keyEquivalent: nil,
  208. text: KMLocalizedString("Tool Mode"),
  209. identifier: PDFViewMenuIdentifier_Normal_ViewTools)
  210. var subMenuItemArr: [ComponentMenuitemProperty] = []
  211. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  212. itemSelected: false,
  213. isDisabled: false,
  214. keyEquivalent: "⇧1",
  215. text: KMLocalizedString("Text"),identifier: PDFViewMenuIdentifier_Normal_TextTool)
  216. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  217. itemSelected: false,
  218. isDisabled: false,
  219. keyEquivalent: "⇧2",
  220. text: KMLocalizedString("Scroll"),identifier: PDFViewMenuIdentifier_Normal_MoveTool)
  221. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  222. itemSelected: false,
  223. isDisabled: false,
  224. keyEquivalent: "⇧3",
  225. text: KMLocalizedString("Magnify"),identifier: PDFViewMenuIdentifier_Normal_MagnifyTool)
  226. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  227. itemSelected: false,
  228. isDisabled: false,
  229. keyEquivalent: "⇧4",
  230. text: KMLocalizedString("Select"),identifier: PDFViewMenuIdentifier_Normal_SelectTool)
  231. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  232. itemSelected: false,
  233. isDisabled: false,
  234. keyEquivalent: "⇧5",
  235. text: KMLocalizedString("Area Zoom"),identifier: PDFViewMenuIdentifier_Normal_SelectZoomTool)
  236. subMenuItemArr.append(subItem0Property)
  237. subMenuItemArr.append(subItem1Property)
  238. subMenuItemArr.append(subItem2Property)
  239. subMenuItemArr.append(subItem3Property)
  240. subMenuItemArr.append(subItem4Property)
  241. properties_Menuitem.subPropertys = subMenuItemArr
  242. return properties_Menuitem
  243. }
  244. class func pageViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  245. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  246. itemSelected: false,
  247. isDisabled: false,
  248. keyEquivalent: nil,
  249. text: KMLocalizedString("PDF Display"),
  250. identifier: PDFViewMenuIdentifier_Normal_PageView)
  251. var subMenuItemArr: [ComponentMenuitemProperty] = []
  252. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  253. itemSelected: false,
  254. isDisabled: false,
  255. keyEquivalent: "⌃⌘1",
  256. text: KMLocalizedString("Single Page"),
  257. identifier: PDFViewMenuIdentifier_Normal_Single,
  258. representedObject: listView)
  259. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  260. itemSelected: false,
  261. isDisabled: false,
  262. keyEquivalent: "⌃⌘2",
  263. text: KMLocalizedString("Single Page Continuous"),
  264. identifier: PDFViewMenuIdentifier_Normal_SingleContinuous,
  265. representedObject: listView)
  266. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  267. itemSelected: false,
  268. isDisabled: false,
  269. keyEquivalent: "⌃⌘3",
  270. text: KMLocalizedString("Two Pages"),
  271. identifier: PDFViewMenuIdentifier_Normal_TwoPages,
  272. representedObject: listView)
  273. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  274. itemSelected: false,
  275. isDisabled: false,
  276. keyEquivalent: "⌃⌘4",
  277. text: KMLocalizedString("Two Pages Continuous"),
  278. identifier: PDFViewMenuIdentifier_Normal_TwoPagesContinuous,
  279. representedObject: listView)
  280. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  281. itemSelected: false,
  282. isDisabled: false,
  283. keyEquivalent: nil,
  284. text: KMLocalizedString("Book Mode"),identifier: PDFViewMenuIdentifier_Normal_BookMode,
  285. representedObject: listView)
  286. subMenuItemArr.append(subItem0Property)
  287. subMenuItemArr.append(subItem1Property)
  288. subMenuItemArr.append(subItem2Property)
  289. subMenuItemArr.append(subItem3Property)
  290. subMenuItemArr.append(subItem4Property)
  291. properties_Menuitem.subPropertys = subMenuItemArr
  292. return properties_Menuitem
  293. }
  294. class func scaleViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  295. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  296. itemSelected: false,
  297. isDisabled: false,
  298. keyEquivalent: nil,
  299. text: KMLocalizedString("Zoom"),
  300. identifier: PDFViewMenuIdentifier_Normal_Scale)
  301. var subMenuItemArr: [ComponentMenuitemProperty] = []
  302. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  303. itemSelected: false,
  304. isDisabled: false,
  305. keyEquivalent: "⌘1",
  306. text: KMLocalizedString("Zoom To Width"),identifier: PDFViewMenuIdentifier_Normal_ScaleWidth,
  307. representedObject: listView)
  308. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  309. itemSelected: false,
  310. isDisabled: false,
  311. keyEquivalent: "⌘2",
  312. text: KMLocalizedString("Automatically Resize"),identifier: PDFViewMenuIdentifier_Normal_ScalePage,
  313. representedObject: listView)
  314. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  315. itemSelected: false,
  316. isDisabled: false,
  317. keyEquivalent: "⌘0",
  318. text: KMLocalizedString("Actual Size"),identifier: PDFViewMenuIdentifier_Normal_ScaleOrg,
  319. representedObject: listView)
  320. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  321. itemSelected: false,
  322. isDisabled: false,
  323. keyEquivalent: "⌘+",
  324. text: KMLocalizedString("Zoom In"),identifier: PDFViewMenuIdentifier_Normal_ScaleZoomIn,
  325. representedObject: listView)
  326. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  327. itemSelected: false,
  328. isDisabled: false,
  329. keyEquivalent: "⌘-",
  330. text: KMLocalizedString("Zoom Out"),identifier: PDFViewMenuIdentifier_Normal_ScaleZoomOut,
  331. representedObject: listView)
  332. subMenuItemArr.append(subItem0Property)
  333. subMenuItemArr.append(subItem1Property)
  334. subMenuItemArr.append(subItem2Property)
  335. subMenuItemArr.append(subItem3Property)
  336. subMenuItemArr.append(subItem4Property)
  337. properties_Menuitem.subPropertys = subMenuItemArr
  338. return properties_Menuitem
  339. }
  340. class func pageRotateMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  341. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  342. itemSelected: false,
  343. isDisabled: false,
  344. keyEquivalent: nil,
  345. text: KMLocalizedString("Rotate Page"),
  346. identifier: PDFViewMenuIdentifier_Normal_PageRotate)
  347. var subMenuItemArr: [ComponentMenuitemProperty] = []
  348. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  349. itemSelected: false,
  350. isDisabled: false,
  351. keyEquivalent: "⌘L",
  352. text: KMLocalizedString("Rotate Left"),identifier: PDFViewMenuIdentifier_Normal_RotateLeft,
  353. representedObject: ["Object": listView, "theEvent": theEvent])
  354. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  355. itemSelected: false,
  356. isDisabled: false,
  357. keyEquivalent: "⌘R",
  358. text: KMLocalizedString("Rotate Right"),identifier: PDFViewMenuIdentifier_Normal_RotateRight,
  359. representedObject: ["Object": listView, "theEvent": theEvent])
  360. subMenuItemArr.append(subItem0Property)
  361. subMenuItemArr.append(subItem1Property)
  362. properties_Menuitem.subPropertys = subMenuItemArr
  363. return properties_Menuitem
  364. }
  365. class func pageNumMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  366. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  367. itemSelected: false,
  368. isDisabled: false,
  369. keyEquivalent: nil,
  370. text: KMLocalizedString("Page"),
  371. identifier: PDFViewMenuIdentifier_Normal_PageNum)
  372. var subMenuItemArr: [ComponentMenuitemProperty] = []
  373. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  374. itemSelected: false,
  375. isDisabled: false,
  376. keyEquivalent: "⌘▶",
  377. text: KMLocalizedString("Next Page"),identifier: PDFViewMenuIdentifier_PageNext,
  378. representedObject: listView)
  379. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  380. itemSelected: false,
  381. isDisabled: false,
  382. keyEquivalent: "⌘◀",
  383. text: KMLocalizedString("Previous Page"),identifier: PDFViewMenuIdentifier_PagePrevious,
  384. representedObject: listView)
  385. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  386. itemSelected: false,
  387. isDisabled: false,
  388. keyEquivalent: "⌘▲",
  389. text: KMLocalizedString("First"),identifier: PDFViewMenuIdentifier_PageFirst,
  390. representedObject: listView)
  391. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  392. itemSelected: false,
  393. isDisabled: false,
  394. keyEquivalent: "⌘▼",
  395. text: KMLocalizedString("Last"),identifier: PDFViewMenuIdentifier_PageLast,
  396. representedObject: listView)
  397. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  398. itemSelected: false,
  399. isDisabled: false,
  400. keyEquivalent: "⌥⌘G",
  401. text: KMLocalizedString("Go To Page…"),identifier: PDFViewMenuIdentifier_Normal_EnterPageNum,
  402. representedObject: listView)
  403. let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  404. itemSelected: false,
  405. isDisabled: false,
  406. keyEquivalent: "⌘[",
  407. text: KMLocalizedString("Forward"),identifier: PDFViewMenuIdentifier_Normal_PageForward,
  408. representedObject: listView)
  409. let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  410. itemSelected: false,
  411. isDisabled: false,
  412. keyEquivalent: "⌘]",
  413. text: KMLocalizedString("Back"),identifier: PDFViewMenuIdentifier_Normal_PageBack,
  414. representedObject: listView)
  415. subMenuItemArr.append(subItem0Property)
  416. subMenuItemArr.append(subItem1Property)
  417. subMenuItemArr.append(subItem2Property)
  418. subMenuItemArr.append(subItem3Property)
  419. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  420. subMenuItemArr.append(subItem4Property)
  421. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  422. subMenuItemArr.append(subItem5Property)
  423. subMenuItemArr.append(subItem6Property)
  424. properties_Menuitem.subPropertys = subMenuItemArr
  425. return properties_Menuitem
  426. }
  427. class func pasteNumMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  428. let past_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘V",
  429. text: KMLocalizedString("Paste"),
  430. identifier: PDFViewMenuIdentifier_Normal_Past,representedObject: theEvent)
  431. return past_Menuitem
  432. }
  433. class func seletAllMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  434. let selectAll_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
  435. text: KMLocalizedString("Select All"),
  436. identifier: PDFViewMenuIdentifier_Normal_SelectAllText,representedObject: listView)
  437. return selectAll_Menuitem
  438. }
  439. class func addBookMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  440. var pagePoint = NSPoint.zero
  441. var isHoveBookMark = false
  442. if let page = listView?.pageAndPoint(&pagePoint, for: theEvent, nearest: true) {
  443. isHoveBookMark = listView?.document.bookmark(forPageIndex: UInt(page.pageIndex())) != nil
  444. }
  445. var text = KMLocalizedString("Add Bookmark")
  446. if isHoveBookMark == true {
  447. text = KMLocalizedString("Remove Bookmark")
  448. }
  449. let addBook_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  450. text: text,
  451. identifier: PDFViewMenuIdentifier_Normal_AddBook,representedObject: theEvent)
  452. return addBook_Menuitem
  453. }
  454. class func readerModeItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  455. let readModel = UserDefaults.standard.bool(forKey: CPDFViewIsReadModeKey)
  456. var text = KMLocalizedString("Read Mode On")
  457. if readModel == true {
  458. text = KMLocalizedString("Read Mode Off")
  459. } else {
  460. text = KMLocalizedString("Read Mode On")
  461. }
  462. let readerMode_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  463. text: text,
  464. identifier: PDFViewMenuIdentifier_Normal_ReadMode,representedObject: theEvent)
  465. return readerMode_Menuitem
  466. }
  467. class func scrollMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  468. let scroll_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  469. text: KMLocalizedString("Auto Scroll"),
  470. identifier: PDFViewMenuIdentifier_Normal_AutoScroll,representedObject: theEvent)
  471. if ((listView?.isAutoFlow()) == true) {
  472. scroll_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
  473. }
  474. return scroll_Menuitem
  475. }
  476. class func hightLinkMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  477. let hightLink_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  478. text: KMLocalizedString("Highlight Links"),
  479. identifier: PDFViewMenuIdentifier_Normal_HightLink,representedObject: theEvent)
  480. let highlightLinkFiled = CPDFKitConfig.sharedInstance().enableLinkFieldHighlight()
  481. if highlightLinkFiled {
  482. hightLink_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
  483. }
  484. return hightLink_Menuitem
  485. }
  486. class func hightFormMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  487. let hightForm_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  488. text: KMLocalizedString("Highlight Form Fields"),
  489. identifier: PDFViewMenuIdentifier_Normal_HightForm,representedObject: theEvent)
  490. let highlightFormFiled = CPDFKitConfig.sharedInstance().enableFormFieldHighlight()
  491. if highlightFormFiled {
  492. hightForm_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
  493. }
  494. return hightForm_Menuitem
  495. }
  496. class func resetFormItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  497. let resetForm_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  498. text: KMLocalizedString("Reset Form"),
  499. identifier: PDFViewMenuIdentifier_Normal_RestForm,representedObject: listView)
  500. return resetForm_Menuitem
  501. }
  502. class func searchItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  503. let search_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘F",
  504. text: KMLocalizedString("Search"),
  505. identifier: PDFViewMenuIdentifier_Normal_Search,representedObject: theEvent)
  506. return search_Menuitem
  507. }
  508. class func printProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  509. let print_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘P",
  510. text: KMLocalizedString("Print"),
  511. identifier: PDFViewMenuIdentifier_Normal_Print,representedObject: listView)
  512. return print_Menuitem
  513. }
  514. class func propertieItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  515. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘D",
  516. text: KMLocalizedString("Properties..."),
  517. identifier: PDFViewMenuIdentifier_Normal_Properties,representedObject: listView)
  518. return propertie_Menuitem
  519. }
  520. class func copyItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  521. let copy_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘C",
  522. text: KMLocalizedString("Copy"),
  523. identifier: PDFViewMenuIdentifier_Normal_Copy,representedObject: theEvent)
  524. return copy_Menuitem
  525. }
  526. class func hightMarkItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  527. let hightMark_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘H",
  528. text: KMLocalizedString("Highlight"),
  529. identifier: PDFViewMenuIdentifier_Normal_Hight,representedObject: theEvent)
  530. return hightMark_Menuitem
  531. }
  532. class func underLineItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  533. let underLine_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘U",
  534. text: KMLocalizedString("Underline"),
  535. identifier: PDFViewMenuIdentifier_Normal_Underline,representedObject: theEvent)
  536. return underLine_Menuitem
  537. }
  538. class func strikethroughItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  539. let strikethrough_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘D",
  540. text: KMLocalizedString("Strikethrough"),
  541. identifier: PDFViewMenuIdentifier_Normal_StrikeOut,representedObject: theEvent)
  542. return strikethrough_Menuitem
  543. }
  544. class func squigglyItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  545. let squiggly_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘V",
  546. text: KMLocalizedString("Squiggly"),
  547. identifier: PDFViewMenuIdentifier_Normal_Squiggly,representedObject: theEvent)
  548. return squiggly_Menuitem
  549. }
  550. class func squareItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  551. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘R",
  552. text: KMLocalizedString("Rectangle"),
  553. identifier: PDFViewMenuIdentifier_Normal_Square,representedObject: theEvent)
  554. return propertie_Menuitem
  555. }
  556. class func circleItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  557. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌃⌘O",
  558. text: KMLocalizedString("Circle"),
  559. identifier: PDFViewMenuIdentifier_Normal_Circle,representedObject: theEvent)
  560. return propertie_Menuitem
  561. }
  562. class func addOutlineItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  563. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  564. text: KMLocalizedString("Add Outline Item"),
  565. identifier: PDFViewMenuIdentifier_Normal_AddOutLine,representedObject: theEvent)
  566. return propertie_Menuitem
  567. }
  568. class func ttsItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  569. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  570. text: KMLocalizedString("TTS"),
  571. identifier: PDFViewMenuIdentifier_Normal_TTS,representedObject: theEvent)
  572. return propertie_Menuitem
  573. }
  574. class func searchTextItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  575. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  576. text: KMLocalizedString("Search") + " " + "\"" + (listView?.currentSelection.string() ?? "") + "\"",
  577. identifier: PDFViewMenuIdentifier_Normal_SearchText,representedObject: listView)
  578. return propertie_Menuitem
  579. }
  580. class func selectAllFormItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  581. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
  582. text: KMLocalizedString("Select All"),
  583. identifier: PDFViewMenuIdentifier_Normal_SelectAllForm,representedObject: listView)
  584. return propertie_Menuitem
  585. }
  586. class func showFormNameItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  587. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  588. text: KMLocalizedString("Display name"),
  589. identifier: PDFViewMenuIdentifier_Normal_ShowFormName,representedObject: listView)
  590. if(listView?.showFormFieldName == true) {
  591. propertie_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
  592. }
  593. return propertie_Menuitem
  594. }
  595. class func selectAllAnnoationItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  596. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌥⌘A",
  597. text: KMLocalizedString("Select All Annotation"),
  598. identifier: PDFViewMenuIdentifier_Normal_SelectAllAnnotation,representedObject: listView)
  599. return propertie_Menuitem
  600. }
  601. class func showAnnoationItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  602. let hideNotes = listView?.hideNotes
  603. var text = KMLocalizedString("Show Note")
  604. if hideNotes == true {
  605. text = KMLocalizedString("Show Note")
  606. } else {
  607. text = KMLocalizedString("Hiden Note")
  608. }
  609. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  610. text: text,
  611. identifier: PDFViewMenuIdentifier_Normal_ShowAnnotation,representedObject: listView)
  612. return propertie_Menuitem
  613. }
  614. class func copyTextItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  615. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘C",
  616. text: KMLocalizedString("Copy Text"),
  617. identifier: PDFViewMenuIdentifier_Normal_CopyText,representedObject: theEvent)
  618. return propertie_Menuitem
  619. }
  620. class func cutProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  621. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘X",
  622. text: KMLocalizedString("Cut"),
  623. identifier: PDFViewMenuIdentifier_Normal_Cut,representedObject: theEvent)
  624. return propertie_Menuitem
  625. }
  626. class func deleteProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  627. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌫",
  628. text: KMLocalizedString("Delete"),
  629. identifier: PDFViewMenuIdentifier_Normal_Delete,representedObject: theEvent)
  630. return propertie_Menuitem
  631. }
  632. class func showPopProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
  633. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  634. text: KMLocalizedString("Show Levitating tools..."),
  635. identifier: PDFViewMenuIdentifier_Normal_ShowPopUI,representedObject: theEvent)
  636. return propertie_Menuitem
  637. }
  638. class func linkReadProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  639. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  640. text: KMLocalizedString("Preview"),
  641. identifier: PDFViewMenuIdentifier_Normal_LinkReade,representedObject: theEvent)
  642. return propertie_Menuitem
  643. }
  644. class func sortAnnotationMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  645. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
  646. itemSelected: false,
  647. isDisabled: false,
  648. keyEquivalent: nil,
  649. text: KMLocalizedString("Sort"),
  650. identifier: PDFViewMenuIdentifier_Normal_SortAnnotation)
  651. var subMenuItemArr: [ComponentMenuitemProperty] = []
  652. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Bring to Front"),identifier: PDFViewMenuIdentifier_Normal_SortFirstAnnotation,
  653. representedObject: listView)
  654. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Bring Forward"),identifier: PDFViewMenuIdentifier_Normal_SortTopAnnotation,
  655. representedObject: listView)
  656. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  657. text: KMLocalizedString("Send Backward"),identifier: PDFViewMenuIdentifier_Normal_SortBottomAnnotation,
  658. representedObject: listView)
  659. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Send to Back"),identifier: PDFViewMenuIdentifier_Normal_SortLastAnnotation,
  660. representedObject: listView)
  661. subMenuItemArr.append(subItem0Property)
  662. subMenuItemArr.append(subItem1Property)
  663. subMenuItemArr.append(subItem2Property)
  664. subMenuItemArr.append(subItem3Property)
  665. properties_Menuitem.subPropertys = subMenuItemArr
  666. return properties_Menuitem
  667. }
  668. class func editContentProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  669. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  670. text: KMLocalizedString("Edit"),
  671. identifier: PDFViewMenuIdentifier_Normal_Content,representedObject: theEvent)
  672. return propertie_Menuitem
  673. }
  674. class func redactApplyProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  675. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  676. text: KMLocalizedString("Apply Redactions"),
  677. identifier: PDFViewMenuIdentifier_Redact_Apply,representedObject: listView)
  678. return propertie_Menuitem
  679. }
  680. class func redactMultiPageProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  681. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  682. text: KMLocalizedString("Repeat Mark Across Pages"),
  683. identifier: PDFViewMenuIdentifier_Redact_Multipage,representedObject: listView)
  684. return propertie_Menuitem
  685. }
  686. class func redactDefaultProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  687. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  688. text: KMLocalizedString("Make Current Properties Default"),
  689. identifier: PDFViewMenuIdentifier_Redact_Default,representedObject: listView)
  690. return propertie_Menuitem
  691. }
  692. class func splitViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  693. let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Split View"),
  694. identifier: PDFViewMenuIdentifier_Split_ViewMode)
  695. var subMenuItemArr: [ComponentMenuitemProperty] = []
  696. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Single"),identifier: PDFViewMenuIdentifier_Split_ViewSingleMode,
  697. representedObject: listView)
  698. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Horizontal"),identifier: PDFViewMenuIdentifier_Split_ViewHorizontalMode,
  699. representedObject: listView)
  700. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  701. text: KMLocalizedString("Vertical"),identifier: PDFViewMenuIdentifier_Split_ViewVerticalMode,
  702. representedObject: listView)
  703. subMenuItemArr.append(subItem0Property)
  704. subMenuItemArr.append(subItem1Property)
  705. subMenuItemArr.append(subItem2Property)
  706. properties_Menuitem.subPropertys = subMenuItemArr
  707. return properties_Menuitem
  708. }
  709. class func splitSyncProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  710. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  711. text: KMLocalizedString("Scroll and zoom simultaneously"),
  712. identifier: PDFViewMenuIdentifier_Split_Sync,representedObject: listView)
  713. return propertie_Menuitem
  714. }
  715. class func showBarProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  716. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  717. text: KMLocalizedString("Show Status Bar"),
  718. identifier: PDFViewMenuIdentifier_Split_ShowBar,representedObject: listView)
  719. if(listView?.isShowSplitBar == true) {
  720. propertie_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
  721. }
  722. return propertie_Menuitem
  723. }
  724. class func objectAlightProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  725. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  726. text: KMLocalizedString("Align"),
  727. identifier: PDFViewMenuIdentifier_Normal_Aligning,representedObject: listView)
  728. var subMenuItemArr: [ComponentMenuitemProperty] = []
  729. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Align Left"),identifier: PDFViewMenuIdentifier_Normal_LeftAlight,
  730. representedObject: listView)
  731. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Align Vertically"),identifier: PDFViewMenuIdentifier_Normal_HorizontallyAlight,
  732. representedObject: listView)
  733. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  734. text: KMLocalizedString("Align Right"),identifier: PDFViewMenuIdentifier_Normal_RightAlight,
  735. representedObject: listView)
  736. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  737. text: KMLocalizedString("Align Top"),identifier: PDFViewMenuIdentifier_Normal_TopAlight,
  738. representedObject: listView)
  739. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  740. text: KMLocalizedString("Align Horizontally"),identifier: PDFViewMenuIdentifier_Normal_HorizontallyAlight,
  741. representedObject: listView)
  742. let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  743. text: KMLocalizedString("Align Bottom"),identifier: PDFViewMenuIdentifier_Normal_BottomAlight,
  744. representedObject: listView)
  745. let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  746. text: KMLocalizedString("Distribute Vertically"),identifier: PDFViewMenuIdentifier_Normal_DistributeVertically,
  747. representedObject: listView)
  748. let subItem7Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  749. text: KMLocalizedString("Distribute Horizontally"),identifier: PDFViewMenuIdentifier_Normal_DistributeHorizontally,
  750. representedObject: listView)
  751. subMenuItemArr.append(subItem0Property)
  752. subMenuItemArr.append(subItem1Property)
  753. subMenuItemArr.append(subItem2Property)
  754. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  755. subMenuItemArr.append(subItem3Property)
  756. subMenuItemArr.append(subItem4Property)
  757. subMenuItemArr.append(subItem5Property)
  758. if listView?.activeAnnotations.count ?? 0 > 3 || listView?.km_EditingAreas().count ?? 0 > 3 {
  759. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  760. subMenuItemArr.append(subItem6Property)
  761. subMenuItemArr.append(subItem7Property)
  762. }
  763. propertie_Menuitem.subPropertys = subMenuItemArr
  764. return propertie_Menuitem
  765. }
  766. class func exportProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  767. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  768. text: KMLocalizedString("Export"),
  769. identifier: PDFViewMenuIdentifier_Normal_Export,representedObject: listView)
  770. var subMenuItemArr: [ComponentMenuitemProperty] = []
  771. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("JPG"),identifier: PDFViewMenuIdentifier_Normal_ExportJPG,
  772. representedObject: listView)
  773. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("PNG"),identifier: PDFViewMenuIdentifier_Normal_ExportPNG,
  774. representedObject: listView)
  775. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  776. text: KMLocalizedString("PDF"),identifier: PDFViewMenuIdentifier_Normal_ExportPNG,
  777. representedObject: listView)
  778. subMenuItemArr.append(subItem0Property)
  779. subMenuItemArr.append(subItem1Property)
  780. subMenuItemArr.append(subItem2Property)
  781. propertie_Menuitem.subPropertys = subMenuItemArr
  782. return propertie_Menuitem
  783. }
  784. class func editPastProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  785. let past_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘V",
  786. text: KMLocalizedString("Paste and Match Style"),
  787. identifier: PDFViewMenuIdentifier_Edit_Paste,representedObject: theEvent)
  788. return past_Menuitem
  789. }
  790. class func editPastNoStyleProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  791. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⇧⌘V",
  792. text: KMLocalizedString("Paste"),
  793. identifier: PDFViewMenuIdentifier_Edit_NoStylePaste,representedObject: listView)
  794. return propertie_Menuitem
  795. }
  796. class func editSelectAllProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  797. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
  798. text: KMLocalizedString("Select All"),
  799. identifier: PDFViewMenuIdentifier_Edit_SelectAll,representedObject: listView)
  800. return propertie_Menuitem
  801. }
  802. class func addLinkProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  803. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⇧⌘L",
  804. text: KMLocalizedString("Link"),
  805. identifier: PDFViewMenuIdentifier_Edit_AddLink,representedObject: listView)
  806. return propertie_Menuitem
  807. }
  808. class func addTextProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  809. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  810. text: KMLocalizedString("Add Text"),
  811. identifier: PDFViewMenuIdentifier_Edit_AddText,representedObject: listView)
  812. return propertie_Menuitem
  813. }
  814. class func addImageProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  815. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  816. text: KMLocalizedString("Add Image"),
  817. identifier: PDFViewMenuIdentifier_Edit_AddImage,representedObject: listView)
  818. return propertie_Menuitem
  819. }
  820. class func editFontProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  821. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  822. text: KMLocalizedString("Font"),
  823. identifier: PDFViewMenuIdentifier_Edit_Font,
  824. representedObject: listView)
  825. var subMenuItemArr: [ComponentMenuitemProperty] = []
  826. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘B",text: KMLocalizedString("Bold"),identifier: PDFViewMenuIdentifier_Edit_FontBold,
  827. representedObject: listView)
  828. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘I",text: KMLocalizedString("Italic"),identifier: PDFViewMenuIdentifier_Edit_FontItalic,
  829. representedObject: listView)
  830. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  831. keyEquivalent: "⌘U",text: KMLocalizedString("Underline"),identifier: PDFViewMenuIdentifier_Edit_FontUnderline,
  832. representedObject: listView)
  833. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  834. keyEquivalent: nil,text: KMLocalizedString("Strikethrough"),identifier: PDFViewMenuIdentifier_Edit_FontStrikeout,
  835. representedObject: listView)
  836. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  837. keyEquivalent: "⌥⌘+",text: KMLocalizedString("Bigger"),identifier: PDFViewMenuIdentifier_Edit_FontZoomIn,
  838. representedObject: listView)
  839. let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  840. keyEquivalent: "⌥⌘-",text: KMLocalizedString("Smaller"),identifier: PDFViewMenuIdentifier_Edit_FontZoomOut,
  841. representedObject: listView)
  842. let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  843. keyEquivalent: "⇧⌘C",text: KMLocalizedString("Font Color"),identifier: PDFViewMenuIdentifier_Edit_FontColor,
  844. representedObject: listView)
  845. subMenuItemArr.append(subItem0Property)
  846. subMenuItemArr.append(subItem1Property)
  847. subMenuItemArr.append(subItem2Property)
  848. subMenuItemArr.append(subItem3Property)
  849. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  850. subMenuItemArr.append(subItem4Property)
  851. subMenuItemArr.append(subItem5Property)
  852. subMenuItemArr.append(ComponentMenuitemProperty.divider())
  853. subMenuItemArr.append(subItem6Property)
  854. propertie_Menuitem.subPropertys = subMenuItemArr
  855. return propertie_Menuitem
  856. }
  857. class func editFontNameProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  858. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  859. text: KMLocalizedString("Default Style"),
  860. identifier: PDFViewMenuIdentifier_Edit_FontName,
  861. representedObject: listView)
  862. var subMenuItemArr: [ComponentMenuitemProperty] = []
  863. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,text: KMLocalizedString("H1 Headline"),identifier: PDFViewMenuIdentifier_Edit_FontH1Name,
  864. representedObject: listView)
  865. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,text: KMLocalizedString("H2 Title"),identifier: PDFViewMenuIdentifier_Edit_FontH2Name,
  866. representedObject: listView)
  867. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  868. keyEquivalent: nil,text: KMLocalizedString("H3 Subtitle"),identifier: PDFViewMenuIdentifier_Edit_FontH3Name,
  869. representedObject: listView)
  870. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  871. keyEquivalent: nil,text: KMLocalizedString("B1 Text"),identifier: PDFViewMenuIdentifier_Edit_FontB1Name,
  872. representedObject: listView)
  873. let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  874. keyEquivalent: nil,text: KMLocalizedString("B2 Small Text"),identifier: PDFViewMenuIdentifier_Edit_FontB2Name,
  875. representedObject: listView)
  876. let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  877. keyEquivalent: nil,text: KMLocalizedString("B3 Describtion"),identifier: PDFViewMenuIdentifier_Edit_FontB3Name, representedObject: listView)
  878. subMenuItemArr.append(subItem0Property)
  879. subMenuItemArr.append(subItem1Property)
  880. subMenuItemArr.append(subItem2Property)
  881. subMenuItemArr.append(subItem3Property)
  882. subMenuItemArr.append(subItem4Property)
  883. subMenuItemArr.append(subItem5Property)
  884. propertie_Menuitem.subPropertys = subMenuItemArr
  885. return propertie_Menuitem
  886. }
  887. class func editFontAlighProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  888. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  889. text: KMLocalizedString("Align"),
  890. identifier: PDFViewMenuIdentifier_Edit_FontAlight,representedObject: listView)
  891. var subMenuItemArr: [ComponentMenuitemProperty] = []
  892. let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘{",text: KMLocalizedString("Align Left"),identifier: PDFViewMenuIdentifier_Edit_FontLeftAlight,
  893. representedObject: listView)
  894. let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘|",text: KMLocalizedString("Center"),identifier: PDFViewMenuIdentifier_Edit_FontCenterAlight,
  895. representedObject: listView)
  896. let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  897. keyEquivalent: "⌘}",text: KMLocalizedString("Align Right"),identifier: PDFViewMenuIdentifier_Edit_FontRightAlight,
  898. representedObject: listView)
  899. let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
  900. keyEquivalent: nil,text: KMLocalizedString("Align both ends"),identifier: PDFViewMenuIdentifier_Edit_FontJustAlight,
  901. representedObject: listView)
  902. subMenuItemArr.append(subItem0Property)
  903. subMenuItemArr.append(subItem1Property)
  904. subMenuItemArr.append(subItem2Property)
  905. subMenuItemArr.append(subItem3Property)
  906. propertie_Menuitem.subPropertys = subMenuItemArr
  907. return propertie_Menuitem
  908. }
  909. class func editRotateLeftProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  910. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  911. text: KMLocalizedString("Rotate Left"),
  912. identifier: PDFViewMenuIdentifier_Edit_RotateLeft,representedObject: listView)
  913. return propertie_Menuitem
  914. }
  915. class func editRotateRightProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  916. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  917. text: KMLocalizedString("Rotate Right"),
  918. identifier: PDFViewMenuIdentifier_Edit_RotateRight,representedObject: listView)
  919. return propertie_Menuitem
  920. }
  921. class func editHorizontalMirrorProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  922. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  923. text: KMLocalizedString("Flip horizontal"),
  924. identifier: PDFViewMenuIdentifier_Edit_HorizontalMirror,representedObject: listView)
  925. return propertie_Menuitem
  926. }
  927. class func editVerticalMirrorProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  928. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  929. text: KMLocalizedString("Flip vertical"),
  930. identifier: PDFViewMenuIdentifier_Edit_VerticalMirror,representedObject: listView)
  931. return propertie_Menuitem
  932. }
  933. class func editCropProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  934. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  935. text: KMLocalizedString("Crop"),
  936. identifier: PDFViewMenuIdentifier_Edit_Crop,representedObject: listView)
  937. return propertie_Menuitem
  938. }
  939. class func editReplaceProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  940. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  941. text: KMLocalizedString("Replace"),
  942. identifier: PDFViewMenuIdentifier_Edit_Replace,representedObject: listView)
  943. return propertie_Menuitem
  944. }
  945. class func redactPropertiesProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
  946. let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
  947. text: KMLocalizedString("Properties..."),
  948. identifier: PDFViewMenuIdentifier_Normal_RedactProperties,representedObject: listView)
  949. return propertie_Menuitem
  950. }
  951. class func clickMenuUI(items:[String],theEvent:NSEvent?,listView:CPDFListView?)->KMNMenuStruct {
  952. var viewHeight: CGFloat = 8
  953. var menuItemArr: [ComponentMenuitemProperty] = []
  954. for item in items {
  955. if item == PDFViewMenuIdentifier_Normal_AITool {
  956. menuItemArr.append(KMPDFMenuConfig.aiMenuItemProperty(theEvent: theEvent))
  957. } else if item == PDFViewMenuIdentifier_Normal_Past {
  958. menuItemArr.append(KMPDFMenuConfig.pasteNumMenuItemProperty(theEvent: theEvent))
  959. } else if item == PDFViewMenuIdentifier_Normal_SelectAllText {
  960. menuItemArr.append(KMPDFMenuConfig.seletAllMenuItemProperty(theEvent: theEvent,listView: listView))
  961. } else if item == PDFViewMenuIdentifier_Normal_AddBook {
  962. menuItemArr.append(KMPDFMenuConfig.addBookMenuItemProperty(theEvent: theEvent,listView: listView))
  963. } else if item == PDFViewMenuIdentifier_Normal_ViewTools {
  964. menuItemArr.append(KMPDFMenuConfig.viewModeMenuItemProperty(theEvent: theEvent))
  965. } else if item == PDFViewMenuIdentifier_Normal_PageView {
  966. menuItemArr.append(KMPDFMenuConfig.pageViewMenuItemProperty(theEvent: theEvent,listView: listView))
  967. } else if item == PDFViewMenuIdentifier_Normal_ReadMode {
  968. menuItemArr.append(KMPDFMenuConfig.readerModeItemProperty(theEvent: theEvent))
  969. } else if item == PDFViewMenuIdentifier_Normal_Scale {
  970. menuItemArr.append(KMPDFMenuConfig.scaleViewMenuItemProperty(theEvent: theEvent,listView: listView))
  971. } else if item == PDFViewMenuIdentifier_Normal_PageRotate {
  972. menuItemArr.append(KMPDFMenuConfig.pageRotateMenuItemProperty(theEvent: theEvent,listView: listView))
  973. } else if item == PDFViewMenuIdentifier_Normal_PageNum {
  974. menuItemArr.append(KMPDFMenuConfig.pageNumMenuItemProperty(theEvent: theEvent,listView: listView))
  975. } else if item == PDFViewMenuIdentifier_Normal_AutoScroll {
  976. menuItemArr.append(KMPDFMenuConfig.scrollMenuItemProperty(theEvent: theEvent,listView: listView))
  977. } else if item == PDFViewMenuIdentifier_Normal_HightForm {
  978. menuItemArr.append(KMPDFMenuConfig.hightFormMenuItemProperty(theEvent: theEvent))
  979. } else if item == PDFViewMenuIdentifier_Normal_HightLink {
  980. menuItemArr.append(KMPDFMenuConfig.hightLinkMenuItemProperty(theEvent: theEvent))
  981. } else if item == PDFViewMenuIdentifier_Normal_RestForm {
  982. menuItemArr.append(KMPDFMenuConfig.resetFormItemProperty(theEvent: theEvent,listView: listView))
  983. } else if item == PDFViewMenuIdentifier_Normal_Search {
  984. menuItemArr.append(KMPDFMenuConfig.searchItemProperty(theEvent: theEvent))
  985. } else if item == PDFViewMenuIdentifier_Normal_Print {
  986. menuItemArr.append(KMPDFMenuConfig.printProperty(theEvent: theEvent,listView: listView))
  987. } else if item == PDFViewMenuIdentifier_Normal_Properties {
  988. menuItemArr.append(KMPDFMenuConfig.propertieItemProperty(theEvent: theEvent,listView: listView))
  989. } else if item == PDFViewMenuIdentifier_Space {
  990. menuItemArr.append(ComponentMenuitemProperty.divider())
  991. } else if item == PDFViewMenuIdentifier_Normal_Copy {
  992. menuItemArr.append(KMPDFMenuConfig.copyItemProperty(theEvent: theEvent))
  993. } else if item == PDFViewMenuIdentifier_Normal_Hight {
  994. menuItemArr.append(KMPDFMenuConfig.hightMarkItemProperty(theEvent: theEvent))
  995. } else if item == PDFViewMenuIdentifier_Normal_Underline {
  996. menuItemArr.append(KMPDFMenuConfig.underLineItemProperty(theEvent: theEvent))
  997. } else if item == PDFViewMenuIdentifier_Normal_Squiggly {
  998. menuItemArr.append(KMPDFMenuConfig.squigglyItemProperty(theEvent: theEvent))
  999. } else if item == PDFViewMenuIdentifier_Normal_StrikeOut {
  1000. menuItemArr.append(KMPDFMenuConfig.strikethroughItemProperty(theEvent: theEvent))
  1001. } else if item == PDFViewMenuIdentifier_Normal_Square {
  1002. menuItemArr.append(KMPDFMenuConfig.squareItemProperty(theEvent: theEvent))
  1003. } else if item == PDFViewMenuIdentifier_Normal_Circle {
  1004. menuItemArr.append(KMPDFMenuConfig.circleItemProperty(theEvent: theEvent))
  1005. } else if item == PDFViewMenuIdentifier_Normal_AddOutLine {
  1006. menuItemArr.append(KMPDFMenuConfig.addOutlineItemProperty(theEvent: theEvent))
  1007. } else if item == PDFViewMenuIdentifier_Normal_TTS {
  1008. menuItemArr.append(KMPDFMenuConfig.ttsItemProperty(theEvent: theEvent))
  1009. } else if item == PDFViewMenuIdentifier_Normal_SearchText {
  1010. menuItemArr.append(KMPDFMenuConfig.searchTextItemProperty(theEvent: theEvent, listView: listView))
  1011. } else if item == PDFViewMenuIdentifier_Normal_SelectAllForm {
  1012. menuItemArr.append(KMPDFMenuConfig.selectAllFormItemProperty(theEvent: theEvent,listView: listView))
  1013. } else if item == PDFViewMenuIdentifier_Normal_ShowFormName {
  1014. menuItemArr.append(KMPDFMenuConfig.showFormNameItemProperty(theEvent: theEvent, listView: listView))
  1015. } else if item == PDFViewMenuIdentifier_Normal_SelectAllAnnotation {
  1016. menuItemArr.append(KMPDFMenuConfig.selectAllAnnoationItemProperty(theEvent: theEvent,listView: listView))
  1017. } else if item == PDFViewMenuIdentifier_Normal_ShowAnnotation {
  1018. menuItemArr.append(KMPDFMenuConfig.showAnnoationItemProperty(theEvent: theEvent, listView: listView))
  1019. } else if item == PDFViewMenuIdentifier_Normal_CopyText {
  1020. menuItemArr.append(KMPDFMenuConfig.copyTextItemProperty(theEvent: theEvent))
  1021. } else if item == PDFViewMenuIdentifier_Normal_Cut {
  1022. menuItemArr.append(KMPDFMenuConfig.cutProperty(theEvent: theEvent))
  1023. } else if item == PDFViewMenuIdentifier_Normal_Delete {
  1024. menuItemArr.append(KMPDFMenuConfig.deleteProperty(theEvent: theEvent))
  1025. } else if item == PDFViewMenuIdentifier_Normal_ShowPopUI {
  1026. menuItemArr.append(KMPDFMenuConfig.showPopProperty(theEvent: theEvent))
  1027. } else if item == PDFViewMenuIdentifier_Normal_LinkReade {
  1028. menuItemArr.append(KMPDFMenuConfig.linkReadProperty(theEvent: theEvent, listView: listView))
  1029. } else if item == PDFViewMenuIdentifier_Normal_SortAnnotation {
  1030. menuItemArr.append(KMPDFMenuConfig.sortAnnotationMenuItemProperty(theEvent: theEvent, listView: listView))
  1031. } else if item == PDFViewMenuIdentifier_Normal_Content {
  1032. menuItemArr.append(KMPDFMenuConfig.editContentProperty(theEvent: theEvent, listView: listView))
  1033. } else if item == PDFViewMenuIdentifier_Normal_ShowAnnotation {
  1034. menuItemArr.append(KMPDFMenuConfig.showAnnoationItemProperty(theEvent: theEvent, listView: listView))
  1035. } else if item == PDFViewMenuIdentifier_Redact_Apply {
  1036. menuItemArr.append(KMPDFMenuConfig.redactApplyProperty(theEvent: theEvent, listView: listView))
  1037. } else if item == PDFViewMenuIdentifier_Redact_Multipage {
  1038. menuItemArr.append(KMPDFMenuConfig.redactMultiPageProperty(theEvent: theEvent, listView: listView))
  1039. } else if item == PDFViewMenuIdentifier_Redact_Default {
  1040. menuItemArr.append(KMPDFMenuConfig.redactDefaultProperty(theEvent: theEvent, listView: listView))
  1041. } else if item == PDFViewMenuIdentifier_Split_ViewMode {
  1042. menuItemArr.append(KMPDFMenuConfig.splitViewMenuItemProperty(theEvent: theEvent, listView: listView))
  1043. } else if item == PDFViewMenuIdentifier_Split_Sync {
  1044. menuItemArr.append(KMPDFMenuConfig.splitSyncProperty(theEvent: theEvent, listView: listView))
  1045. } else if item == PDFViewMenuIdentifier_Split_ShowBar {
  1046. menuItemArr.append(KMPDFMenuConfig.showBarProperty(theEvent: theEvent, listView: listView))
  1047. } else if item == PDFViewMenuIdentifier_Normal_Aligning {
  1048. menuItemArr.append(KMPDFMenuConfig.objectAlightProperty(theEvent: theEvent, listView: listView))
  1049. } else if item == PDFViewMenuIdentifier_Normal_Export {
  1050. menuItemArr.append(KMPDFMenuConfig.exportProperty(theEvent: theEvent, listView: listView))
  1051. } else if item == PDFViewMenuIdentifier_Edit_Paste {
  1052. menuItemArr.append(KMPDFMenuConfig.editPastProperty(theEvent: theEvent, listView: listView))
  1053. } else if item == PDFViewMenuIdentifier_Edit_NoStylePaste {
  1054. menuItemArr.append(KMPDFMenuConfig.editPastNoStyleProperty(theEvent: theEvent, listView: listView))
  1055. } else if item == PDFViewMenuIdentifier_Edit_SelectAll {
  1056. menuItemArr.append(KMPDFMenuConfig.editSelectAllProperty(theEvent: theEvent, listView: listView))
  1057. } else if item == PDFViewMenuIdentifier_Edit_AddLink {
  1058. menuItemArr.append(KMPDFMenuConfig.addLinkProperty(theEvent: theEvent, listView: listView))
  1059. } else if item == PDFViewMenuIdentifier_Edit_AddText {
  1060. menuItemArr.append(KMPDFMenuConfig.addTextProperty(theEvent: theEvent, listView: listView))
  1061. } else if item == PDFViewMenuIdentifier_Edit_AddImage {
  1062. menuItemArr.append(KMPDFMenuConfig.addImageProperty(theEvent: theEvent, listView: listView))
  1063. } else if item == PDFViewMenuIdentifier_Edit_Font {
  1064. menuItemArr.append(KMPDFMenuConfig.editFontProperty(theEvent: theEvent, listView: listView))
  1065. } else if item == PDFViewMenuIdentifier_Edit_FontName {
  1066. menuItemArr.append(KMPDFMenuConfig.editFontNameProperty(theEvent: theEvent, listView: listView))
  1067. } else if item == PDFViewMenuIdentifier_Edit_FontAlight {
  1068. menuItemArr.append(KMPDFMenuConfig.editFontAlighProperty(theEvent: theEvent, listView: listView))
  1069. } else if item == PDFViewMenuIdentifier_Edit_RotateLeft {
  1070. menuItemArr.append(KMPDFMenuConfig.editRotateLeftProperty(theEvent: theEvent, listView: listView))
  1071. } else if item == PDFViewMenuIdentifier_Edit_RotateRight {
  1072. menuItemArr.append(KMPDFMenuConfig.editRotateRightProperty(theEvent: theEvent, listView: listView))
  1073. } else if item == PDFViewMenuIdentifier_Edit_HorizontalMirror {
  1074. menuItemArr.append(KMPDFMenuConfig.editHorizontalMirrorProperty(theEvent: theEvent, listView: listView))
  1075. } else if item == PDFViewMenuIdentifier_Edit_VerticalMirror {
  1076. menuItemArr.append(KMPDFMenuConfig.editVerticalMirrorProperty(theEvent: theEvent, listView: listView))
  1077. } else if item == PDFViewMenuIdentifier_Edit_Crop {
  1078. menuItemArr.append(KMPDFMenuConfig.editCropProperty(theEvent: theEvent, listView: listView))
  1079. } else if item == PDFViewMenuIdentifier_Edit_Replace {
  1080. menuItemArr.append(KMPDFMenuConfig.editReplaceProperty(theEvent: theEvent, listView: listView))
  1081. } else if item == PDFViewMenuIdentifier_Normal_RedactProperties {
  1082. menuItemArr.append(KMPDFMenuConfig.redactPropertiesProperty(theEvent: theEvent, listView: listView))
  1083. }
  1084. if(item == PDFViewMenuIdentifier_Space) {
  1085. viewHeight += 8
  1086. } else {
  1087. viewHeight += 36
  1088. }
  1089. }
  1090. let menuStruct = KMNMenuStruct(menuitems: menuItemArr, viewHeight: viewHeight)
  1091. return menuStruct
  1092. }
  1093. }