1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354 |
- //
- // KMPDFMenuConfig.swift
- // PDF Reader Pro
- //
- // Created by Niehaoyu on 2024/10/23.
- //
- import Foundation
- import KMComponentLibrary
- let PDFViewMenuIdentifier_Space = "PDFViewMenuIdentifier_Space"
- //MARK: -PageEdit
- let ThumbnailMenuIdentifier_Copy = "ThumbnailMenuIdentifier_Copy"
- let ThumbnailMenuIdentifier_Cut = "ThumbnailMenuIdentifier_Cut"
- let ThumbnailMenuIdentifier_Paste = "ThumbnailMenuIdentifier_Paste"
- let ThumbnailMenuIdentifier_Delete = "ThumbnailMenuIdentifier_Delete"
- let ThumbnailMenuIdentifier_RotateRight = "ThumbnailMenuIdentifier_RotateRight"
- let ThumbnailMenuIdentifier_RotateLeft = "ThumbnailMenuIdentifier_RotateLeft"
- let ThumbnailMenuIdentifier_InsertFile = "ThumbnailMenuIdentifier_InsertFile"
- let ThumbnailMenuIdentifier_InsertBlank = "ThumbnailMenuIdentifier_InsertBlank"
- let ThumbnailMenuIdentifier_Replace = "ThumbnailMenuIdentifier_Replace"
- let ThumbnailMenuIdentifier_Share = "ThumbnailMenuIdentifier_Share"
- let ThumbnailMenuIdentifier_Export = "ThumbnailMenuIdentifier_Export"
- let ThumbnailMenuIdentifier_PastNull = "ThumbnailMenuIdentifier_PastNull"
- let ThumbnailMenuIdentifier_FileShowSize = "ThumbnailMenuIdentifier_FileShowSize"
- //MARK: - 幻灯片
- let PDFViewMenuIdentifier_PageNext = "PDFViewMenuIdentifier_PageNext"
- let PDFViewMenuIdentifier_PagePrevious = "PDFViewMenuIdentifier_PagePrevious"
- let PDFViewMenuIdentifier_PageFirst = "PDFViewMenuIdentifier_PageFirst"
- let PDFViewMenuIdentifier_PageLast = "PDFViewMenuIdentifier_PageLast"
- let PDFViewMenuIdentifier_Presentation_LaserPoint = "PDFViewMenuIdentifier_Presentation_LaserPoint"
- let PDFViewMenuIdentifier_Presentation_Brush = "PDFViewMenuIdentifier_Presentation_Brush"
- let PDFViewMenuIdentifier_Presentation_Exit = "PDFViewMenuIdentifier_Presentation_Exit"
- //MARK: - 常规模式
- let PDFViewMenuIdentifier_Normal_AITool = "PDFViewMenuIdentifier_Normal_AITool"
- let PDFViewMenuIdentifier_Normal_AIRewrite = "PDFViewMenuIdentifier_Normal_AIRewrite"
- let PDFViewMenuIdentifier_Normal_AIProofread = "PDFViewMenuIdentifier_Normal_AIProofread"
- let PDFViewMenuIdentifier_Normal_AITranslate = "PDFViewMenuIdentifier_Normal_AITranslate"
- let PDFViewMenuIdentifier_Normal_Past = "PDFViewMenuIdentifier_Normal_Past"
- let PDFViewMenuIdentifier_Normal_SelectAllText = "PDFViewMenuIdentifier_Normal_SelectAllText"
- let PDFViewMenuIdentifier_Normal_AddBook = "PDFViewMenuIdentifier_Normal_AddBook"
- let PDFViewMenuIdentifier_Normal_ViewTools = "PDFViewMenuIdentifier_Normal_ViewTools"
- let PDFViewMenuIdentifier_Normal_TextTool = "PDFViewMenuIdentifier_Normal_TextTool"
- let PDFViewMenuIdentifier_Normal_MoveTool = "PDFViewMenuIdentifier_Normal_MoveTool"
- let PDFViewMenuIdentifier_Normal_SelectTool = "PDFViewMenuIdentifier_Normal_SelectTool"
- let PDFViewMenuIdentifier_Normal_MagnifyTool = "PDFViewMenuIdentifier_Normal_MagnifyTool"
- let PDFViewMenuIdentifier_Normal_SelectZoomTool = "PDFViewMenuIdentifier_Normal_SelectZoomTool"
- let PDFViewMenuIdentifier_Normal_PageView = "PDFViewMenuIdentifier_Normal_PageView"
- let PDFViewMenuIdentifier_Normal_Single = "PDFViewMenuIdentifier_Normal_Single"
- let PDFViewMenuIdentifier_Normal_SingleContinuous = "PDFViewMenuIdentifier_Normal_SingleContinuous"
- let PDFViewMenuIdentifier_Normal_TwoPages = "PDFViewMenuIdentifier_Normal_TwoPages"
- let PDFViewMenuIdentifier_Normal_TwoPagesContinuous = "PDFViewMenuIdentifier_Normal_TwoPagesContinuous"
- let PDFViewMenuIdentifier_Normal_BookMode = "PDFViewMenuIdentifier_Normal_BookMode"
- let PDFViewMenuIdentifier_Normal_ReadMode = "PDFViewMenuIdentifier_Normal_ReadMode"
- let PDFViewMenuIdentifier_Normal_Scale = "PDFViewMenuIdentifier_Normal_Scale"
- let PDFViewMenuIdentifier_Normal_ScaleWidth = "PDFViewMenuIdentifier_Normal_ScaleWidth"
- let PDFViewMenuIdentifier_Normal_ScalePage = "PDFViewMenuIdentifier_Normal_ScalePage"
- let PDFViewMenuIdentifier_Normal_ScaleOrg = "PDFViewMenuIdentifier_Normal_ScaleOrg"
- let PDFViewMenuIdentifier_Normal_ScaleZoomIn = "PDFViewMenuIdentifier_Normal_ScaleZoomIn"
- let PDFViewMenuIdentifier_Normal_ScaleZoomOut = "PDFViewMenuIdentifier_Normal_ScaleZoomOut"
- let PDFViewMenuIdentifier_Normal_PageRotate = "PDFViewMenuIdentifier_Normal_PageRotate"
- let PDFViewMenuIdentifier_Normal_RotateLeft = "PDFViewMenuIdentifier_Normal_RotateLeft"
- let PDFViewMenuIdentifier_Normal_RotateRight = "PDFViewMenuIdentifier_Normal_RotateRight"
- let PDFViewMenuIdentifier_Normal_PageNum = "PDFViewMenuIdentifier_Normal_PageNum"
- let PDFViewMenuIdentifier_Normal_EnterPageNum = "PDFViewMenuIdentifier_Normal_EnterPageNum"
- let PDFViewMenuIdentifier_Normal_PageBack = "PDFViewMenuIdentifier_Normal_PageBack"
- let PDFViewMenuIdentifier_Normal_PageForward = "PDFViewMenuIdentifier_Normal_PageForward"
- let PDFViewMenuIdentifier_Normal_AutoScroll = "PDFViewMenuIdentifier_Normal_AutoScroll"
- let PDFViewMenuIdentifier_Normal_HightForm = "PDFViewMenuIdentifier_Normal_HightForm"
- let PDFViewMenuIdentifier_Normal_HightLink = "PDFViewMenuIdentifier_Normal_HightLink"
- let PDFViewMenuIdentifier_Normal_RestForm = "PDFViewMenuIdentifier_Normal_RestForm"
- let PDFViewMenuIdentifier_Normal_Search = "PDFViewMenuIdentifier_Normal_Search"
- let PDFViewMenuIdentifier_Normal_Print = "PDFViewMenuIdentifier_Normal_Print"
- let PDFViewMenuIdentifier_Normal_Properties = "PDFViewMenuIdentifier_Normal_Properties"
- let PDFViewMenuIdentifier_Normal_Copy = "PDFViewMenuIdentifier_Normal_Copy"
- let PDFViewMenuIdentifier_Normal_Hight = "PDFViewMenuIdentifier_Normal_Hight"
- let PDFViewMenuIdentifier_Normal_Underline = "PDFViewMenuIdentifier_Normal_Underline"
- let PDFViewMenuIdentifier_Normal_Squiggly = "PDFViewMenuIdentifier_Normal_Squiggly"
- let PDFViewMenuIdentifier_Normal_StrikeOut = "PDFViewMenuIdentifier_Normal_StrikeOut"
- let PDFViewMenuIdentifier_Normal_Square = "PDFViewMenuIdentifier_Normal_Square"
- let PDFViewMenuIdentifier_Normal_Circle = "PDFViewMenuIdentifier_Normal_Circle"
- let PDFViewMenuIdentifier_Normal_AddOutLine = "PDFViewMenuIdentifier_Normal_AddOutLine"
- let PDFViewMenuIdentifier_Normal_TTS = "PDFViewMenuIdentifier_Normal_TTS"
- let PDFViewMenuIdentifier_Normal_SearchText = "PDFViewMenuIdentifier_Normal_SearchText"
- let PDFViewMenuIdentifier_Normal_SelectAllForm = "PDFViewMenuIdentifier_Normal_SelectAllForm"
- let PDFViewMenuIdentifier_Normal_ShowFormName = "PDFViewMenuIdentifier_Normal_ShowFormName"
- let PDFViewMenuIdentifier_Normal_SelectAllAnnotation = "PDFViewMenuIdentifier_Normal_SelectAllAnnotation"
- let PDFViewMenuIdentifier_Normal_ShowAnnotation = "PDFViewMenuIdentifier_Normal_ShowAnnotation"
- let PDFViewMenuIdentifier_Normal_CopyText = "PDFViewMenuIdentifier_Normal_CopyText"
- let PDFViewMenuIdentifier_Normal_Cut = "PDFViewMenuIdentifier_Normal_Cut"
- let PDFViewMenuIdentifier_Normal_Delete = "PDFViewMenuIdentifier_Normal_Delete"
- let PDFViewMenuIdentifier_Normal_ShowPopUI = "PDFViewMenuIdentifier_Normal_ShowPopUI"
- let PDFViewMenuIdentifier_Normal_LinkReade = "PDFViewMenuIdentifier_Normal_LinkReade"
- let PDFViewMenuIdentifier_Normal_SortAnnotation = "PDFViewMenuIdentifier_Normal_SortAnnotation"
- let PDFViewMenuIdentifier_Normal_SortFirstAnnotation = "PDFViewMenuIdentifier_Normal_SortFirstAnnotation"
- let PDFViewMenuIdentifier_Normal_SortTopAnnotation = "PDFViewMenuIdentifier_Normal_SortTopAnnotation"
- let PDFViewMenuIdentifier_Normal_SortBottomAnnotation = "PDFViewMenuIdentifier_Normal_SortBottomAnnotation"
- let PDFViewMenuIdentifier_Normal_SortLastAnnotation = "PDFViewMenuIdentifier_Normal_SortLastAnnotation"
- let PDFViewMenuIdentifier_Normal_Content = "PDFViewMenuIdentifier_Normal_Content"
- let PDFViewMenuIdentifier_Redact_Apply = "PDFViewMenuIdentifier_Redact_Apply"
- let PDFViewMenuIdentifier_Redact_Multipage = "PDFViewMenuIdentifier_Redact_Multipage"
- let PDFViewMenuIdentifier_Redact_Default = "PDFViewMenuIdentifier_Redact_Default"
- let PDFViewMenuIdentifier_Split_ViewMode = "PDFViewMenuIdentifier_Split_ViewMode"
- let PDFViewMenuIdentifier_Split_ViewSingleMode = "PDFViewMenuIdentifier_Split_ViewSingleMode"
- let PDFViewMenuIdentifier_Split_ViewVerticalMode = "PDFViewMenuIdentifier_Split_ViewVerticalMode"
- let PDFViewMenuIdentifier_Split_ViewHorizontalMode = "PDFViewMenuIdentifier_Split_ViewHorizontalMode"
- let PDFViewMenuIdentifier_Split_Sync = "PDFViewMenuIdentifier_Split_Sync"
- let PDFViewMenuIdentifier_Split_ShowBar = "PDFViewMenuIdentifier_Split_ShowBar"
- let PDFViewMenuIdentifier_Normal_Aligning = "PDFViewMenuIdentifier_Normal_Aligning"
- let PDFViewMenuIdentifier_Normal_LeftAlight = "PDFViewMenuIdentifier_Normal_LeftAlight"
- let PDFViewMenuIdentifier_Normal_VerticallyAlight = "PDFViewMenuIdentifier_Normal_VerticallyAlight"
- let PDFViewMenuIdentifier_Normal_RightAlight = "PDFViewMenuIdentifier_Normal_RightAlight"
- let PDFViewMenuIdentifier_Normal_TopAlight = "PDFViewMenuIdentifier_Normal_TopAlight"
- let PDFViewMenuIdentifier_Normal_HorizontallyAlight = "PDFViewMenuIdentifier_Normal_HorizontallyAlight"
- let PDFViewMenuIdentifier_Normal_BottomAlight = "PDFViewMenuIdentifier_Normal_BottomAlight"
- let PDFViewMenuIdentifier_Normal_DistributeHorizontally = "PDFViewMenuIdentifier_Normal_DistributeHorizontally"
- let PDFViewMenuIdentifier_Normal_DistributeVertically = "PDFViewMenuIdentifier_Normal_DistributeVertically"
- let PDFViewMenuIdentifier_Normal_Export = "PDFViewMenuIdentifier_Normal_Export"
- let PDFViewMenuIdentifier_Normal_ExportJPG = "PDFViewMenuIdentifier_Normal_ExportJPG"
- let PDFViewMenuIdentifier_Normal_ExportPNG = "PDFViewMenuIdentifier_Normal_ExportPNG"
- let PDFViewMenuIdentifier_Normal_ExportPDF = "PDFViewMenuIdentifier_Normal_ExportPDF"
- let PDFViewMenuIdentifier_Normal_RedactProperties = "PDFViewMenuIdentifier_Normal_RedactProperties"
- let PDFViewMenuIdentifier_Edit_Paste = "PDFViewMenuIdentifier_Edit_Paste"
- let PDFViewMenuIdentifier_Edit_NoStylePaste = "PDFViewMenuIdentifier_Edit_NoStylePaste"
- let PDFViewMenuIdentifier_Edit_SelectAll = "PDFViewMenuIdentifier_Edit_SelectAll"
- let PDFViewMenuIdentifier_Edit_AddLink = "PDFViewMenuIdentifier_Edit_AddLink"
- let PDFViewMenuIdentifier_Edit_AddText = "PDFViewMenuIdentifier_Edit_AddText"
- let PDFViewMenuIdentifier_Edit_AddImage = "PDFViewMenuIdentifier_Edit_AddImage"
- let PDFViewMenuIdentifier_Edit_Font = "PDFViewMenuIdentifier_Edit_Font"
- let PDFViewMenuIdentifier_Edit_FontBold = "PDFViewMenuIdentifier_Edit_FontBold"
- let PDFViewMenuIdentifier_Edit_FontItalic = "PDFViewMenuIdentifier_Edit_FontItalic"
- let PDFViewMenuIdentifier_Edit_FontUnderline = "PDFViewMenuIdentifier_Edit_FontUnderline"
- let PDFViewMenuIdentifier_Edit_FontStrikeout = "PDFViewMenuIdentifier_Edit_FontStrikeout"
- let PDFViewMenuIdentifier_Edit_FontZoomIn = "PDFViewMenuIdentifier_Edit_FontZoomIn"
- let PDFViewMenuIdentifier_Edit_FontZoomOut = "PDFViewMenuIdentifier_Edit_FontZoomOut"
- let PDFViewMenuIdentifier_Edit_FontColor = "PDFViewMenuIdentifier_Edit_FontColor"
- let PDFViewMenuIdentifier_Edit_FontName = "PDFViewMenuIdentifier_Edit_FontName"
- let PDFViewMenuIdentifier_Edit_FontH1Name = "PDFViewMenuIdentifier_Edit_FontH1Name"
- let PDFViewMenuIdentifier_Edit_FontH2Name = "PDFViewMenuIdentifier_Edit_FontH2Name"
- let PDFViewMenuIdentifier_Edit_FontH3Name = "PDFViewMenuIdentifier_Edit_FontH3Name"
- let PDFViewMenuIdentifier_Edit_FontB1Name = "PDFViewMenuIdentifier_Edit_FontB1Name"
- let PDFViewMenuIdentifier_Edit_FontB2Name = "PDFViewMenuIdentifier_Edit_FontB2Name"
- let PDFViewMenuIdentifier_Edit_FontB3Name = "PDFViewMenuIdentifier_Edit_FontB3Name"
- let PDFViewMenuIdentifier_Edit_FontAlight = "PDFViewMenuIdentifier_Edit_FontAlight"
- let PDFViewMenuIdentifier_Edit_FontLeftAlight = "PDFViewMenuIdentifier_Edit_FontLeftAlight"
- let PDFViewMenuIdentifier_Edit_FontCenterAlight = "PDFViewMenuIdentifier_Edit_FontCenterAlight"
- let PDFViewMenuIdentifier_Edit_FontRightAlight = "PDFViewMenuIdentifier_Edit_FontRightAlight"
- let PDFViewMenuIdentifier_Edit_FontJustAlight = "PDFViewMenuIdentifier_Edit_FontJustAlight"
- let PDFViewMenuIdentifier_Edit_RotateLeft = "PDFViewMenuIdentifier_Edit_RotateLeft"
- let PDFViewMenuIdentifier_Edit_RotateRight = "PDFViewMenuIdentifier_Edit_RotateRight"
- let PDFViewMenuIdentifier_Edit_HorizontalMirror = "PDFViewMenuIdentifier_Edit_HorizontalMirror"
- let PDFViewMenuIdentifier_Edit_VerticalMirror = "PDFViewMenuIdentifier_Edit_VerticalMirror"
- let PDFViewMenuIdentifier_Edit_Crop = "PDFViewMenuIdentifier_Edit_Crop"
- let PDFViewMenuIdentifier_Edit_Replace = "PDFViewMenuIdentifier_Edit_Replace"
- let BOTAMenuIdentifier_Annotation_Expand = "BOTAMenuIdentifier_Annotation_Expand"
- let BOTAMenuIdentifier_Annotation_Sort = "BOTAMenuIdentifier_Annotation_Sort"
- let BOTAMenuIdentifier_Annotation_SortPage = "BOTAMenuIdentifier_Annotation_SortPage"
- let BOTAMenuIdentifier_Annotation_SortAscTime = "BOTAMenuIdentifier_Annotation_SortAscTime"
- let BOTAMenuIdentifier_Annotation_SortDesTime = "BOTAMenuIdentifier_Annotation_SortDesTime"
- let BOTAMenuIdentifier_Annotation_Improt = "BOTAMenuIdentifier_Annotation_Improt"
- let BOTAMenuIdentifier_Annotation_Export = "BOTAMenuIdentifier_Annotation_Export"
- let BOTAMenuIdentifier_Annotation_RemoveAll = "BOTAMenuIdentifier_Annotation_RemoveAll"
- let BOTAMenuIdentifier_Annotation_DeleteRep = "BOTAMenuIdentifier_Annotation_DeleteRep"
- let BOTAMenuIdentifier_Annotation_EditNote = "BOTAMenuIdentifier_Annotation_EditNote"
- let BOTAMenuIdentifier_Annotation_AddMark = "BOTAMenuIdentifier_Annotation_AddMark"
- let BOTAMenuIdentifier_Annotation_AddRep = "BOTAMenuIdentifier_Annotation_AddRep"
- let BOTAMenuIdentifier_Annotation_RepState = "BOTAMenuIdentifier_Annotation_RepState"
- let BOTAMenuIdentifier_Annotation_RepStateNone = "BOTAMenuIdentifier_Annotation_RepStateNone"
- let BOTAMenuIdentifier_Annotation_RepStateAccepted = "BOTAMenuIdentifier_Annotation_RepStateAccepted"
- let BOTAMenuIdentifier_Annotation_RepStateRejected = "BOTAMenuIdentifier_Annotation_RepStateRejected"
- let BOTAMenuIdentifier_Annotation_RepStateCancelled = "BOTAMenuIdentifier_Annotation_RepStateCancelled"
- let BOTAMenuIdentifier_Annotation_RepStateCompleted = "BOTAMenuIdentifier_Annotation_RepStateCompleted"
- let BOTAMenuIdentifier_Annotation_DeleteSignRep = "BOTAMenuIdentifier_Annotation_DeleteSignRep"
- let BOTAMenuIdentifier_Annotation_DeleteMuteRep = "BOTAMenuIdentifier_Annotation_DeleteMuteRep"
- let PDFViewMenuIdentifier_Edit_Apply = "PDFViewMenuIdentifier_Edit_Apply"
- let PDFViewMenuIdentifier_Edit_Exit = "PDFViewMenuIdentifier_Edit_Exit"
- let PDFViewMenuIdentifier_Edit_Reset = "PDFViewMenuIdentifier_Edit_Reset"
- @objcMembers class KMPDFMenuConfig: NSString {
- class func aiMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("AI Tools"),
- identifier: PDFViewMenuIdentifier_Normal_AITool)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("AI Rewrite"),identifier: PDFViewMenuIdentifier_Normal_AIRewrite)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("AI Proofread"),identifier: PDFViewMenuIdentifier_Normal_AIProofread)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("AI Translate"),identifier: PDFViewMenuIdentifier_Normal_AITranslate)
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func viewModeMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Tool Mode"),
- identifier: PDFViewMenuIdentifier_Normal_ViewTools)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subSelectProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥1",
- text: KMLocalizedString("Select"),identifier: PDFViewMenuIdentifier_Normal_SelectTool)
- let subScrollProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥2",
- text: KMLocalizedString("Scroll"),identifier: PDFViewMenuIdentifier_Normal_MoveTool)
-
- let subTextProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥3",
- text: KMLocalizedString("Content Selection"),identifier: PDFViewMenuIdentifier_Normal_TextTool)
- let subMagnifyProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥4",
- text: KMLocalizedString("Magnify"),identifier: PDFViewMenuIdentifier_Normal_MagnifyTool)
-
-
- let subAreaZoomProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥5",
- text: KMLocalizedString("Area Zoom"),identifier: PDFViewMenuIdentifier_Normal_SelectZoomTool)
-
- subMenuItemArr.append(subSelectProperty)
- subMenuItemArr.append(subScrollProperty)
- subMenuItemArr.append(subTextProperty)
- subMenuItemArr.append(subMagnifyProperty)
- subMenuItemArr.append(subAreaZoomProperty)
- if(listView?.toolMode == .CNoteToolMode) {
- subSelectProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
- } else if (listView?.toolMode == .CMoveToolMode) {
- subScrollProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
- } else if (listView?.toolMode == .CMagnifyToolMode) {
- subMagnifyProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
- } else if (listView?.toolMode == .CSelectToolMode) {
- subTextProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
- } else if (listView?.toolMode == .CSelectZoomToolMode) {
- subAreaZoomProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
-
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func pageViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("PDF Display"),
- identifier: PDFViewMenuIdentifier_Normal_PageView)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subSingleProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌃⌘1",
- text: KMLocalizedString("Single Page"),
- identifier: PDFViewMenuIdentifier_Normal_Single,
- representedObject: listView)
- let subSingleContinuousProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌃⌘2",
- text: KMLocalizedString("Single Page Continuous"),
- identifier: PDFViewMenuIdentifier_Normal_SingleContinuous,
- representedObject: listView)
- let subTwoProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌃⌘3",
- text: KMLocalizedString("Two Pages"),
- identifier: PDFViewMenuIdentifier_Normal_TwoPages,
- representedObject: listView)
-
- let subTwoContinuousProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌃⌘4",
- text: KMLocalizedString("Two Pages Continuous"),
- identifier: PDFViewMenuIdentifier_Normal_TwoPagesContinuous,
- representedObject: listView)
-
- let subBookProperty: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Book Mode"),identifier: PDFViewMenuIdentifier_Normal_BookMode,
- representedObject: listView)
-
- subMenuItemArr.append(subSingleProperty)
- subMenuItemArr.append(subSingleContinuousProperty)
- subMenuItemArr.append(subTwoProperty)
- subMenuItemArr.append(subTwoContinuousProperty)
- subMenuItemArr.append(subBookProperty)
- var selctionProperty: ComponentMenuitemProperty = subSingleProperty
- if(listView?.displayTwoUp == true){
- if (listView?.displaysAsBook) == true {
- selctionProperty = subBookProperty
- } else {
- if listView?.displayDirection == .vertical {
- selctionProperty = subTwoContinuousProperty
- } else {
- selctionProperty = subTwoProperty
- }
- }
- } else {
- if listView?.displayDirection == .vertical {
- selctionProperty = subSingleContinuousProperty
- } else {
- selctionProperty = subSingleProperty
- }
- }
-
- selctionProperty.righticon = NSImage(named: "KMNImageNameMenuSelect")
-
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func scaleViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Zoom"),
- identifier: PDFViewMenuIdentifier_Normal_Scale)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘1",
- text: KMLocalizedString("Zoom To Width"),identifier: PDFViewMenuIdentifier_Normal_ScaleWidth,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘2",
- text: KMLocalizedString("Adapt to Page"),identifier: PDFViewMenuIdentifier_Normal_ScalePage,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘0",
- text: KMLocalizedString("Actual Size"),identifier: PDFViewMenuIdentifier_Normal_ScaleOrg,
- representedObject: listView)
-
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘+",
- text: KMLocalizedString("Zoom In"),identifier: PDFViewMenuIdentifier_Normal_ScaleZoomIn,
- representedObject: listView)
-
- let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘-",
- text: KMLocalizedString("Zoom Out"),identifier: PDFViewMenuIdentifier_Normal_ScaleZoomOut,
- representedObject: listView)
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- subMenuItemArr.append(subItem4Property)
-
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func pageRotateMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Rotate Page"),
- identifier: PDFViewMenuIdentifier_Normal_PageRotate)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘L",
- text: KMLocalizedString("Rotate Left"),identifier: PDFViewMenuIdentifier_Normal_RotateLeft,
- representedObject: ["Object": listView, "theEvent": theEvent])
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘R",
- text: KMLocalizedString("Rotate Right"),identifier: PDFViewMenuIdentifier_Normal_RotateRight,
- representedObject: ["Object": listView, "theEvent": theEvent])
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
-
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func pageNumMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Page"),
- identifier: PDFViewMenuIdentifier_Normal_PageNum)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘▶",
- text: KMLocalizedString("Next Page"),identifier: PDFViewMenuIdentifier_PageNext,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘◀",
- text: KMLocalizedString("Previous Page"),identifier: PDFViewMenuIdentifier_PagePrevious,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘▲",
- text: KMLocalizedString("First"),identifier: PDFViewMenuIdentifier_PageFirst,
- representedObject: listView)
-
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘▼",
- text: KMLocalizedString("Last"),identifier: PDFViewMenuIdentifier_PageLast,
- representedObject: listView)
-
- let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌥⌘G",
- text: KMLocalizedString("Go To Page…"),identifier: PDFViewMenuIdentifier_Normal_EnterPageNum,
- representedObject: listView)
-
- let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘[",
- text: KMLocalizedString("Forward"),identifier: PDFViewMenuIdentifier_Normal_PageForward,
- representedObject: listView)
-
- let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: "⌘]",
- text: KMLocalizedString("Back"),identifier: PDFViewMenuIdentifier_Normal_PageBack,
- representedObject: listView)
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem4Property)
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem5Property)
- subMenuItemArr.append(subItem6Property)
-
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func pasteNumMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let past_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘V",
- text: KMLocalizedString("Paste"),
- identifier: PDFViewMenuIdentifier_Normal_Past,representedObject: theEvent)
-
- return past_Menuitem
- }
-
- class func seletAllMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let selectAll_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
- text: KMLocalizedString("Select All"),
- identifier: PDFViewMenuIdentifier_Normal_SelectAllText,representedObject: ["Object": listView, "theEvent": theEvent])
- return selectAll_Menuitem
- }
-
- class func addBookMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var pagePoint = NSPoint.zero
- var isHoveBookMark = false
- if let page = listView?.pageAndPoint(&pagePoint, for: theEvent, nearest: true) {
- isHoveBookMark = listView?.document.bookmark(forPageIndex: UInt(page.pageIndex())) != nil
- }
-
- var text = KMLocalizedString("Add Bookmark")
- if isHoveBookMark == true {
- text = KMLocalizedString("Remove Bookmark")
- }
- let addBook_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: text,
- identifier: PDFViewMenuIdentifier_Normal_AddBook,representedObject: theEvent)
- return addBook_Menuitem
- }
-
- class func readerModeItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let readModel = UserDefaults.standard.bool(forKey: CPDFViewIsReadModeKey)
- var text = KMLocalizedString("Read Mode On")
- if readModel == true {
- text = KMLocalizedString("Read Mode Off")
- } else {
- text = KMLocalizedString("Read Mode On")
- }
- let readerMode_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: text,
- identifier: PDFViewMenuIdentifier_Normal_ReadMode,representedObject: theEvent)
-
- return readerMode_Menuitem
- }
-
- class func scrollMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let scroll_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Auto Scroll"),
- identifier: PDFViewMenuIdentifier_Normal_AutoScroll,representedObject: theEvent)
-
- if ((listView?.isAutoFlow()) == true) {
- scroll_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return scroll_Menuitem
- }
-
- class func hightLinkMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let hightLink_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Highlight Links"),
- identifier: PDFViewMenuIdentifier_Normal_HightLink,representedObject: theEvent)
- let highlightLinkFiled = CPDFKitConfig.sharedInstance().enableLinkFieldHighlight()
- if highlightLinkFiled {
- hightLink_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return hightLink_Menuitem
- }
-
- class func hightFormMenuItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let hightForm_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Highlight Form Fields"),
- identifier: PDFViewMenuIdentifier_Normal_HightForm,representedObject: theEvent)
-
- let highlightFormFiled = CPDFKitConfig.sharedInstance().enableFormFieldHighlight()
- if highlightFormFiled {
- hightForm_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return hightForm_Menuitem
- }
-
- class func resetFormItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let resetForm_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Reset Form"),
- identifier: PDFViewMenuIdentifier_Normal_RestForm,representedObject: listView)
-
- return resetForm_Menuitem
- }
-
- class func searchItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let search_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘F",
- text: KMLocalizedString("Search"),
- identifier: PDFViewMenuIdentifier_Normal_Search,representedObject: theEvent)
- return search_Menuitem
- }
-
- class func printProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let print_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘P",
- text: KMLocalizedString("Print"),
- identifier: PDFViewMenuIdentifier_Normal_Print,representedObject: listView)
- return print_Menuitem
- }
-
- class func propertieItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘D",
- text: KMLocalizedString("Properties..."),
- identifier: PDFViewMenuIdentifier_Normal_Properties,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func copyItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let copy_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘C",
- text: KMLocalizedString("Copy"),
- identifier: PDFViewMenuIdentifier_Normal_Copy,representedObject: theEvent)
- return copy_Menuitem
- }
-
- class func hightMarkItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let hightMark_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘H",
- text: KMLocalizedString("Highlight"),
- identifier: PDFViewMenuIdentifier_Normal_Hight,representedObject: theEvent)
- return hightMark_Menuitem
- }
-
- class func underLineItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let underLine_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘U",
- text: KMLocalizedString("Underline"),
- identifier: PDFViewMenuIdentifier_Normal_Underline,representedObject: theEvent)
- return underLine_Menuitem
- }
-
- class func strikethroughItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let strikethrough_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘D",
- text: KMLocalizedString("Strikethrough"),
- identifier: PDFViewMenuIdentifier_Normal_StrikeOut,representedObject: theEvent)
- return strikethrough_Menuitem
- }
-
- class func squigglyItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let squiggly_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘V",
- text: KMLocalizedString("Squiggly"),
- identifier: PDFViewMenuIdentifier_Normal_Squiggly,representedObject: theEvent)
- return squiggly_Menuitem
- }
-
- class func squareItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘R",
- text: KMLocalizedString("Rectangle"),
- identifier: PDFViewMenuIdentifier_Normal_Square,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func circleItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var isDisAble = false
- if listView?.hideNotes == true {
- isDisAble = true
- }
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled: isDisAble,keyEquivalent: "⌃⌘O",
- text: KMLocalizedString("Circle"),
- identifier: PDFViewMenuIdentifier_Normal_Circle,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func addOutlineItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Add Outline Item"),
- identifier: PDFViewMenuIdentifier_Normal_AddOutLine,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func ttsItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("TTS"),
- identifier: PDFViewMenuIdentifier_Normal_TTS,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func searchTextItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- var string = (listView?.currentSelection.string() ?? "")
- if string.count > 25 {
- string = string.substring(to: 25)
- string = string + "..."
- }
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Search") + " " + "\"" + string + "\"",
- identifier: PDFViewMenuIdentifier_Normal_SearchText,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func selectAllFormItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
- text: KMLocalizedString("Select All"),
- identifier: PDFViewMenuIdentifier_Normal_SelectAllForm,representedObject: ["Object": listView, "theEvent": theEvent])
- return propertie_Menuitem
- }
-
- class func showFormNameItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Display Field Name"),
- identifier: PDFViewMenuIdentifier_Normal_ShowFormName,representedObject: listView)
- if(listView?.showFormFieldName == true) {
- propertie_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return propertie_Menuitem
- }
-
- class func selectAllAnnoationItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌥⌘A",
- text: KMLocalizedString("Select All Annotations"),
- identifier: PDFViewMenuIdentifier_Normal_SelectAllAnnotation,representedObject: ["Object": listView, "theEvent": theEvent])
- return propertie_Menuitem
- }
-
- class func showAnnoationItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let hideNotes = listView?.hideNotes
- var text = KMLocalizedString("Show Note")
- if hideNotes == true {
- text = KMLocalizedString("Show Note")
- } else {
- text = KMLocalizedString("Hide Annotations")
- }
-
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: text,
- identifier: PDFViewMenuIdentifier_Normal_ShowAnnotation,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func copyTextItemProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘C",
- text: KMLocalizedString("Copy Text"),
- identifier: PDFViewMenuIdentifier_Normal_CopyText,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func cutProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘X",
- text: KMLocalizedString("Cut"),
- identifier: PDFViewMenuIdentifier_Normal_Cut,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func deleteProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌫",
- text: KMLocalizedString("Delete"),
- identifier: PDFViewMenuIdentifier_Normal_Delete,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func showPopProperty(theEvent:NSEvent?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Display Floating Toolbar"),
- identifier: PDFViewMenuIdentifier_Normal_ShowPopUI,representedObject: theEvent)
- return propertie_Menuitem
- }
-
-
- class func linkReadProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Preview"),
- identifier: PDFViewMenuIdentifier_Normal_LinkReade,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func sortAnnotationMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(multipleSelect: false,
- itemSelected: false,
- isDisabled: false,
- keyEquivalent: nil,
- text: KMLocalizedString("Sort"),
- identifier: PDFViewMenuIdentifier_Normal_SortAnnotation)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let activeAnnotations = listView?.activeAnnotations as? [CPDFAnnotation]
- let firstAnnotation = activeAnnotations?.first
-
- let pageAnnotationArray = firstAnnotation?.page.annotations
-
- var isFirstDisabled = false
- if(firstAnnotation == pageAnnotationArray?.last) {
- isFirstDisabled = true
- }
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:isFirstDisabled,text: KMLocalizedString("Bring to Front"),identifier: PDFViewMenuIdentifier_Normal_SortFirstAnnotation,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:isFirstDisabled,text: KMLocalizedString("Bring Forward"),identifier: PDFViewMenuIdentifier_Normal_SortTopAnnotation,
- representedObject: listView)
-
- var isLastDisabled = false
- if(firstAnnotation == pageAnnotationArray?.first) {
- isLastDisabled = true
- }
-
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- isDisabled:isLastDisabled,text: KMLocalizedString("Send Backward"),identifier: PDFViewMenuIdentifier_Normal_SortBottomAnnotation,
- representedObject: listView)
-
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(isDisabled:isLastDisabled,text: KMLocalizedString("Send to Back"),identifier: PDFViewMenuIdentifier_Normal_SortLastAnnotation,
- representedObject: listView)
-
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func editContentProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Edit"),
- identifier: PDFViewMenuIdentifier_Normal_Content,representedObject: theEvent)
- return propertie_Menuitem
- }
-
- class func redactApplyProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Apply Redactions"),
- identifier: PDFViewMenuIdentifier_Redact_Apply,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func redactMultiPageProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Repeat Mark Across Pages"),
- identifier: PDFViewMenuIdentifier_Redact_Multipage,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func redactDefaultProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Make Current Properties Default"),
- identifier: PDFViewMenuIdentifier_Redact_Default,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func splitViewMenuItemProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let properties_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Split View"),
- identifier: PDFViewMenuIdentifier_Split_ViewMode)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Single"),identifier: PDFViewMenuIdentifier_Split_ViewSingleMode,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Horizontal"),identifier: PDFViewMenuIdentifier_Split_ViewHorizontalMode,
-
- representedObject: listView)
-
-
- if(listView?.viewSplitMode == .horizontal) {
- subItem1Property.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Vertical"),identifier: PDFViewMenuIdentifier_Split_ViewVerticalMode,
- representedObject: listView)
- if(listView?.viewSplitMode == .vertical) {
- subItem2Property.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem0Property)
- properties_Menuitem.subPropertys = subMenuItemArr
-
- return properties_Menuitem
- }
-
- class func splitSyncProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Sync Scroll and Zoom (Split View)"),
- identifier: PDFViewMenuIdentifier_Split_Sync,representedObject: listView)
- if(listView?.isSyncSplitView == true) {
- propertie_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return propertie_Menuitem
- }
-
- class func showBarProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Show Status Bar"),
- identifier: PDFViewMenuIdentifier_Split_ShowBar,representedObject: listView)
- if(listView?.isShowSplitBar == true) {
- propertie_Menuitem.righticon = NSImage(named: "KMNImageNameMenuSelect")
- }
- return propertie_Menuitem
- }
-
- class func objectAlightProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Align"),
- identifier: PDFViewMenuIdentifier_Normal_Aligning,representedObject: listView)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Align Left"),identifier: PDFViewMenuIdentifier_Normal_LeftAlight,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("Align Vertically"),identifier: PDFViewMenuIdentifier_Normal_HorizontallyAlight,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Align Right"),identifier: PDFViewMenuIdentifier_Normal_RightAlight,
- representedObject: listView)
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Align Top"),identifier: PDFViewMenuIdentifier_Normal_TopAlight,
- representedObject: listView)
- let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Align Horizontally"),identifier: PDFViewMenuIdentifier_Normal_HorizontallyAlight,
- representedObject: listView)
- let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Align Bottom"),identifier: PDFViewMenuIdentifier_Normal_BottomAlight,
- representedObject: listView)
- let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Distribute Vertically"),identifier: PDFViewMenuIdentifier_Normal_DistributeVertically,
- representedObject: listView)
-
- let subItem7Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("Distribute Horizontally"),identifier: PDFViewMenuIdentifier_Normal_DistributeHorizontally,
- representedObject: listView)
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem3Property)
- subMenuItemArr.append(subItem4Property)
- subMenuItemArr.append(subItem5Property)
- if listView?.activeAnnotations.count ?? 0 > 3 || listView?.km_EditingAreas().count ?? 0 > 3 {
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem6Property)
- subMenuItemArr.append(subItem7Property)
- }
- propertie_Menuitem.subPropertys = subMenuItemArr
-
- return propertie_Menuitem
- }
-
- class func exportProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Export"),
- identifier: PDFViewMenuIdentifier_Normal_Export,representedObject: listView)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("JPG"),identifier: PDFViewMenuIdentifier_Normal_ExportJPG,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(text: KMLocalizedString("PNG"),identifier: PDFViewMenuIdentifier_Normal_ExportPNG,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- text: KMLocalizedString("PDF"),identifier: PDFViewMenuIdentifier_Normal_ExportPDF,
- representedObject: listView)
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- propertie_Menuitem.subPropertys = subMenuItemArr
-
- return propertie_Menuitem
- }
-
- class func editPastProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let past_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌥⌘V",
- text: KMLocalizedString("Paste and Match Style"),
- identifier: PDFViewMenuIdentifier_Edit_Paste,representedObject: theEvent)
-
- return past_Menuitem
- }
-
- class func editPastNoStyleProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⇧⌘V",
- text: KMLocalizedString("Paste"),
- identifier: PDFViewMenuIdentifier_Edit_NoStylePaste,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editSelectAllProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘A",
- text: KMLocalizedString("Select All"),
- identifier: PDFViewMenuIdentifier_Edit_SelectAll,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func addLinkProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⇧⌘L",
- text: KMLocalizedString("Link"),
- identifier: PDFViewMenuIdentifier_Edit_AddLink,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func addTextProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Add Text"),
- identifier: PDFViewMenuIdentifier_Edit_AddText,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func addImageProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Add Image"),
- identifier: PDFViewMenuIdentifier_Edit_AddImage,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editFontProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Font"),
- identifier: PDFViewMenuIdentifier_Edit_Font,
- representedObject: listView)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘B",text: KMLocalizedString("Bold"),identifier: PDFViewMenuIdentifier_Edit_FontBold,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘I",text: KMLocalizedString("Italic"),identifier: PDFViewMenuIdentifier_Edit_FontItalic,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: "⌘U",text: KMLocalizedString("Underline"),identifier: PDFViewMenuIdentifier_Edit_FontUnderline,
- representedObject: listView)
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("Strikethrough"),identifier: PDFViewMenuIdentifier_Edit_FontStrikeout,
- representedObject: listView)
- let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: "⌥⌘+",text: KMLocalizedString("Bigger"),identifier: PDFViewMenuIdentifier_Edit_FontZoomIn,
- representedObject: listView)
- let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: "⌥⌘-",text: KMLocalizedString("Smaller"),identifier: PDFViewMenuIdentifier_Edit_FontZoomOut,
- representedObject: listView)
- let subItem6Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: "⇧⌘C",text: KMLocalizedString("Font Color"),identifier: PDFViewMenuIdentifier_Edit_FontColor,
- representedObject: listView)
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem4Property)
- subMenuItemArr.append(subItem5Property)
- subMenuItemArr.append(ComponentMenuitemProperty.divider())
- subMenuItemArr.append(subItem6Property)
- propertie_Menuitem.subPropertys = subMenuItemArr
- return propertie_Menuitem
- }
-
- class func editFontNameProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Default Style"),
- identifier: PDFViewMenuIdentifier_Edit_FontName,
- representedObject: listView)
-
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,text: KMLocalizedString("H1 Headline"),identifier: PDFViewMenuIdentifier_Edit_FontH1Name,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,text: KMLocalizedString("H2 Title"),identifier: PDFViewMenuIdentifier_Edit_FontH2Name,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("H3 Subtitle"),identifier: PDFViewMenuIdentifier_Edit_FontH3Name,
- representedObject: listView)
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("B1 Text"),identifier: PDFViewMenuIdentifier_Edit_FontB1Name,
- representedObject: listView)
- let subItem4Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("B2 Small Text"),identifier: PDFViewMenuIdentifier_Edit_FontB2Name,
- representedObject: listView)
- let subItem5Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("B3 Describtion"),identifier: PDFViewMenuIdentifier_Edit_FontB3Name, representedObject: listView)
-
-
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- subMenuItemArr.append(subItem4Property)
- subMenuItemArr.append(subItem5Property)
- propertie_Menuitem.subPropertys = subMenuItemArr
- return propertie_Menuitem
- }
-
- class func editFontAlighProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Text Alignment"),
- identifier: PDFViewMenuIdentifier_Edit_FontAlight,representedObject: listView)
- var subMenuItemArr: [ComponentMenuitemProperty] = []
- let subItem0Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘{",text: KMLocalizedString("Align Left"),identifier: PDFViewMenuIdentifier_Edit_FontLeftAlight,
- representedObject: listView)
- let subItem1Property: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: "⌘|",text: KMLocalizedString("Center"),identifier: PDFViewMenuIdentifier_Edit_FontCenterAlight,
- representedObject: listView)
- let subItem2Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: "⌘}",text: KMLocalizedString("Align Right"),identifier: PDFViewMenuIdentifier_Edit_FontRightAlight,
- representedObject: listView)
- let subItem3Property: ComponentMenuitemProperty = ComponentMenuitemProperty(
- keyEquivalent: nil,text: KMLocalizedString("Align both ends"),identifier: PDFViewMenuIdentifier_Edit_FontJustAlight,
- representedObject: listView)
- subMenuItemArr.append(subItem0Property)
- subMenuItemArr.append(subItem1Property)
- subMenuItemArr.append(subItem2Property)
- subMenuItemArr.append(subItem3Property)
- propertie_Menuitem.subPropertys = subMenuItemArr
- return propertie_Menuitem
- }
-
- class func editRotateLeftProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Rotate Left"),
- identifier: PDFViewMenuIdentifier_Edit_RotateLeft,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editRotateRightProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Rotate Right"),
- identifier: PDFViewMenuIdentifier_Edit_RotateRight,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editHorizontalMirrorProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Flip horizontal"),
- identifier: PDFViewMenuIdentifier_Edit_HorizontalMirror,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editVerticalMirrorProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Flip vertical"),
- identifier: PDFViewMenuIdentifier_Edit_VerticalMirror,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editCropProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Crop"),
- identifier: PDFViewMenuIdentifier_Edit_Crop,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func editReplaceProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Replace"),
- identifier: PDFViewMenuIdentifier_Edit_Replace,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func redactPropertiesProperty(theEvent:NSEvent?,listView:CPDFListView?)->ComponentMenuitemProperty {
- let propertie_Menuitem: ComponentMenuitemProperty = ComponentMenuitemProperty(keyEquivalent: nil,
- text: KMLocalizedString("Properties..."),
- identifier: PDFViewMenuIdentifier_Normal_RedactProperties,representedObject: listView)
- return propertie_Menuitem
- }
-
- class func clickMenuUI(items:[String],theEvent:NSEvent?,listView:CPDFListView?)->KMNMenuStruct {
- var viewHeight: CGFloat = 8
- var menuItemArr: [ComponentMenuitemProperty] = []
- for item in items {
- if item == PDFViewMenuIdentifier_Normal_AITool {
- menuItemArr.append(KMPDFMenuConfig.aiMenuItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Past {
- menuItemArr.append(KMPDFMenuConfig.pasteNumMenuItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_SelectAllText {
- menuItemArr.append(KMPDFMenuConfig.seletAllMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_AddBook {
- menuItemArr.append(KMPDFMenuConfig.addBookMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_ViewTools {
- menuItemArr.append(KMPDFMenuConfig.viewModeMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_PageView {
- menuItemArr.append(KMPDFMenuConfig.pageViewMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_ReadMode {
- menuItemArr.append(KMPDFMenuConfig.readerModeItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Scale {
- menuItemArr.append(KMPDFMenuConfig.scaleViewMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_PageRotate {
- menuItemArr.append(KMPDFMenuConfig.pageRotateMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_PageNum {
- menuItemArr.append(KMPDFMenuConfig.pageNumMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_AutoScroll {
- menuItemArr.append(KMPDFMenuConfig.scrollMenuItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_HightForm {
- menuItemArr.append(KMPDFMenuConfig.hightFormMenuItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_HightLink {
- menuItemArr.append(KMPDFMenuConfig.hightLinkMenuItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_RestForm {
- menuItemArr.append(KMPDFMenuConfig.resetFormItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Search {
- menuItemArr.append(KMPDFMenuConfig.searchItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Print {
- menuItemArr.append(KMPDFMenuConfig.printProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Properties {
- menuItemArr.append(KMPDFMenuConfig.propertieItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Space {
- menuItemArr.append(ComponentMenuitemProperty.divider())
- } else if item == PDFViewMenuIdentifier_Normal_Copy {
- menuItemArr.append(KMPDFMenuConfig.copyItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Hight {
- menuItemArr.append(KMPDFMenuConfig.hightMarkItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Underline {
- menuItemArr.append(KMPDFMenuConfig.underLineItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Squiggly {
- menuItemArr.append(KMPDFMenuConfig.squigglyItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_StrikeOut {
- menuItemArr.append(KMPDFMenuConfig.strikethroughItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Square {
- menuItemArr.append(KMPDFMenuConfig.squareItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Circle {
- menuItemArr.append(KMPDFMenuConfig.circleItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_AddOutLine {
- menuItemArr.append(KMPDFMenuConfig.addOutlineItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_TTS {
- menuItemArr.append(KMPDFMenuConfig.ttsItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_SearchText {
- menuItemArr.append(KMPDFMenuConfig.searchTextItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_SelectAllForm {
- menuItemArr.append(KMPDFMenuConfig.selectAllFormItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_ShowFormName {
- menuItemArr.append(KMPDFMenuConfig.showFormNameItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_SelectAllAnnotation {
- menuItemArr.append(KMPDFMenuConfig.selectAllAnnoationItemProperty(theEvent: theEvent,listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_ShowAnnotation {
- menuItemArr.append(KMPDFMenuConfig.showAnnoationItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_CopyText {
- menuItemArr.append(KMPDFMenuConfig.copyTextItemProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Cut {
- menuItemArr.append(KMPDFMenuConfig.cutProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_Delete {
- menuItemArr.append(KMPDFMenuConfig.deleteProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_ShowPopUI {
- menuItemArr.append(KMPDFMenuConfig.showPopProperty(theEvent: theEvent))
- } else if item == PDFViewMenuIdentifier_Normal_LinkReade {
- menuItemArr.append(KMPDFMenuConfig.linkReadProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_SortAnnotation {
- menuItemArr.append(KMPDFMenuConfig.sortAnnotationMenuItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Content {
- menuItemArr.append(KMPDFMenuConfig.editContentProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_ShowAnnotation {
- menuItemArr.append(KMPDFMenuConfig.showAnnoationItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Redact_Apply {
- menuItemArr.append(KMPDFMenuConfig.redactApplyProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Redact_Multipage {
- menuItemArr.append(KMPDFMenuConfig.redactMultiPageProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Redact_Default {
- menuItemArr.append(KMPDFMenuConfig.redactDefaultProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Split_ViewMode {
- menuItemArr.append(KMPDFMenuConfig.splitViewMenuItemProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Split_Sync {
- menuItemArr.append(KMPDFMenuConfig.splitSyncProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Split_ShowBar {
- menuItemArr.append(KMPDFMenuConfig.showBarProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Aligning {
- menuItemArr.append(KMPDFMenuConfig.objectAlightProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_Export {
- menuItemArr.append(KMPDFMenuConfig.exportProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_Paste {
- menuItemArr.append(KMPDFMenuConfig.editPastProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_NoStylePaste {
- menuItemArr.append(KMPDFMenuConfig.editPastNoStyleProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_SelectAll {
- menuItemArr.append(KMPDFMenuConfig.editSelectAllProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_AddLink {
- menuItemArr.append(KMPDFMenuConfig.addLinkProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_AddText {
- menuItemArr.append(KMPDFMenuConfig.addTextProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_AddImage {
- menuItemArr.append(KMPDFMenuConfig.addImageProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_Font {
- menuItemArr.append(KMPDFMenuConfig.editFontProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_FontName {
- menuItemArr.append(KMPDFMenuConfig.editFontNameProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_FontAlight {
- menuItemArr.append(KMPDFMenuConfig.editFontAlighProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_RotateLeft {
- menuItemArr.append(KMPDFMenuConfig.editRotateLeftProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_RotateRight {
- menuItemArr.append(KMPDFMenuConfig.editRotateRightProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_HorizontalMirror {
- menuItemArr.append(KMPDFMenuConfig.editHorizontalMirrorProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_VerticalMirror {
- menuItemArr.append(KMPDFMenuConfig.editVerticalMirrorProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_Crop {
- menuItemArr.append(KMPDFMenuConfig.editCropProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Edit_Replace {
- menuItemArr.append(KMPDFMenuConfig.editReplaceProperty(theEvent: theEvent, listView: listView))
- } else if item == PDFViewMenuIdentifier_Normal_RedactProperties {
- menuItemArr.append(KMPDFMenuConfig.redactPropertiesProperty(theEvent: theEvent, listView: listView))
- }
-
- if(item == PDFViewMenuIdentifier_Space) {
- viewHeight += 8
- } else {
- viewHeight += 36
- }
- }
-
- let menuStruct = KMNMenuStruct(menuitems: menuItemArr, viewHeight: viewHeight)
- return menuStruct
- }
-
- }
|