// // PublicKey.swift // PDF Master // // Created by lxy on 2022/12/1. // import Foundation /// Main Tool let KMLeftControlToolbarItemIdentifier = "KMLeftControlToolbarItemIdentifier" let KMDocumentZoomToolbarItemIdentifier = "KMDocumentZoomToolbarItemIdentifier" let KMDocumentZoomOutToolbarItemIdentifier = "KMDocumentZoomOutToolbarItemIdentifier" let KMDocumentZoomViewToolbarItemIdentifier = "KMDocumentZoomViewToolbarItemIdentifier" let KMDocumentPreviousPageToolbarItemIdentifier = "KMDocumentPreviousPageToolbarItemIdentifier" let KMDocumentNextPageToolbarItemIdentifier = "KMDocumentNextPageToolbarItemIdentifier" let KMDocumentAnnotationToolbarItemIdentifier = "KMDocumentAnnotationToolbarItemIdentifier" let KMDocumentPageToolbarItemIdentifier = "KMDocumentPageToolbarItemIdentifier" let KMDocumentConversonToolbarItemIdentifier = "KMDocumentConversonToolbarItemIdentifier" let KMDocumentScanOCRToolbarItemIdentifier = "KMDocumentScanOCRToolbarItemIdentifier" let KMDocumentFormToolbarItemIdentifier = "KMDocumentFormToolbarItemIdentifier" let KMDocumentEditToolbarItemIdentifier = "KMDocumentPageEditToolbarItemIdentifier" let KMDocumentFillSginToolbarItemIdentifier = "KMDocumentFillSginToolbarItemIdentifier" let KMDocumentToolToolbarItemIdentifier = "KMDocumentToolToolbarItemIdentifier" let KMDocumentPrintToolbarItemIdentifier = "KMDocumentPrintToolbarItemIdentifier" let KMDocumentAITranslationToolbarItemIdentifier = "KMDocumentAITranslationToolbarItemIdentifier" let KMDocumentShareToolbarItemIdentifier = "KMDocumentShareToolbarItemIdentifier" let KMRightControlToolbarItemIdentifier = "KMRightControlToolbarItemIdentifier" let mainToolIdentifiers = [KMLeftControlToolbarItemIdentifier, KMDocumentZoomToolbarItemIdentifier, KMDocumentZoomOutToolbarItemIdentifier, KMDocumentZoomViewToolbarItemIdentifier, KMDocumentPreviousPageToolbarItemIdentifier, KMDocumentNextPageToolbarItemIdentifier, KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier, KMDocumentScanOCRToolbarItemIdentifier, KMDocumentFormToolbarItemIdentifier, KMDocumentEditToolbarItemIdentifier, KMDocumentFillSginToolbarItemIdentifier, KMDocumentToolToolbarItemIdentifier, KMDocumentPrintToolbarItemIdentifier, KMDocumentShareToolbarItemIdentifier, KMRightControlToolbarItemIdentifier] /// annotation // let KMToolbarMoveToolModeItemIdentifier = "KMToolbarPreviousItemIdentifier" let KMToolbarMagnifyToolModeItemIdentifier = "KMToolbarMagnifyToolModeItemIdentifier" let KMToolbarSelectToolModeItemIdentifier = "KMToolbarSelectToolModeItemIdentifier" let KMToolbarZoomToSelectionItemIdentifier = "KMToolbarZoomToSelectionItemIdentifier" let KMToolbarHighlightAnnotationItemIdentifier = "KMToolbarHighlightAnnotationItemIdentifier" let KMToolbarUnderlineAnnotationItemIdentifier = "KMToolbarUnderlineAnnotationItemIdentifier" let KMToolbarStrikeOutAnnotationItemIdentifier = "KMToolbarStrikeOutAnnotationItemIdentifier" let KMToolbarInkAnnotationItemIdentifier = "KMToolbarInkAnnotationItemIdentifier" let KMToolbarFreeTextAnnotationItemIdentifier = "KMToolbarFreeTextAnnotationItemIdentifier" let KMToolbarAnchoredAnnotationItemIdentifier = "KMToolbarAnchoredAnnotationItemIdentifier" let KMToolbarSquareAnnotationItemIdentifier = "KMToolbarSquareAnnotationItemIdentifier" let KMToolbarCircleAnnotationItemIdentifier = "KMToolbarCircleAnnotationItemIdentifier" let KMToolbarLineAnnotationItemIdentifier = "KMToolbarLineAnnotationItemIdentifier" let KMToolbarArrowAnnotationItemIdentifier = "KMToolbarArrowAnnotationItemIdentifier" let KMToolbarLinkAnnotationItemIdentifier = "KMToolbarLinkAnnotationItemIdentifier" let KMToolbarSignSignatureAnnotationItemIdentifier = "KMToolbarSignSignatureAnnotationItemIdentifier" let KMAnnotationStampToolbarItemIdentifier = "KMAnnotationStampToolbarItemIdentifier" let KMToolbarShowToolbarItemIdentifier = "KMToolbarShowToolbarItemIdentifier" let annotationToolIdentifiers = [KMToolbarMoveToolModeItemIdentifier, KMToolbarMagnifyToolModeItemIdentifier, KMToolbarSelectToolModeItemIdentifier, KMToolbarZoomToSelectionItemIdentifier, KMToolbarHighlightAnnotationItemIdentifier, KMToolbarUnderlineAnnotationItemIdentifier, KMToolbarStrikeOutAnnotationItemIdentifier, KMToolbarInkAnnotationItemIdentifier, KMToolbarFreeTextAnnotationItemIdentifier, KMToolbarAnchoredAnnotationItemIdentifier, KMToolbarSquareAnnotationItemIdentifier, KMToolbarCircleAnnotationItemIdentifier, KMToolbarLineAnnotationItemIdentifier, KMToolbarArrowAnnotationItemIdentifier, KMToolbarLinkAnnotationItemIdentifier, KMToolbarSignSignatureAnnotationItemIdentifier, KMAnnotationStampToolbarItemIdentifier, KMToolbarShowToolbarItemIdentifier] // PageEdit let KMToolbarPageEditPageRangeItemIdentifier = "KMToolbarPageEditPageRangeItemIdentifier" let KMToolbarPageEditLeftRotateItemIdentifier = "KMToolbarPageEditLeftRotateItemIdentifier" let KMToolbarPageEditRightRotateItemIdentifier = "KMToolbarPageEditRightRotateItemIdentifier" let KMToolbarPageEditInsetItemIdentifier = "KMToolbarPageEditInsetItemIdentifier" let KMToolbarPageEditExtractItemIdentifier = "KMToolbarPageEditExtractItemIdentifier" let KMToolbarPageEditReplaceItemIdentifier = "KMToolbarPageEditReplaceItemIdentifier" let KMToolbarPageEditSplitItemIdentifier = "KMToolbarPageEditSplitItemIdentifier" let KMToolbarPageEditReverseItemIdentifier = "KMToolbarPageEditReverseItemIdentifier" let KMToolbarPageEditDeleteItemIdentifier = "KMToolbarPageEditDeleteItemIdentifier" let pageEditToolIdentifiers = [KMToolbarPageEditPageRangeItemIdentifier, KMToolbarPageEditLeftRotateItemIdentifier, KMToolbarPageEditRightRotateItemIdentifier, KMToolbarPageEditInsetItemIdentifier, KMToolbarPageEditExtractItemIdentifier, KMToolbarPageEditReplaceItemIdentifier, KMToolbarPageEditSplitItemIdentifier, KMToolbarPageEditReverseItemIdentifier, KMToolbarPageEditDeleteItemIdentifier] // conversion let KMToolbarConversionWordItemIdentifier = "KMToolbarConversionWordItemIdentifier" let KMToolbarConversionExcelItemIdentifier = "KMToolbarConversionExcelItemIdentifier" let KMToolbarConversionPPTItemIdentifier = "KMToolbarConversionPPTItemIdentifier" let KMToolbarConversionRTFItemIdentifier = "KMToolbarConversionRTFItemIdentifier" let KMToolbarConversionCSVItemIdentifier = "KMToolbarConversionCSVItemIdentifier" let KMToolbarConversionHTMLItemIdentifier = "KMToolbarConversionHTMLItemIdentifier" let KMToolbarConversionTextItemIdentifier = "KMToolbarConversionTextItemIdentifier" let KMToolbarConversionImageItemIdentifier = "KMToolbarConversionImageItemIdentifier" let conversionToolIdentifiers = [KMToolbarConversionWordItemIdentifier, KMToolbarConversionExcelItemIdentifier, KMToolbarConversionPPTItemIdentifier, KMToolbarConversionRTFItemIdentifier, KMToolbarConversionCSVItemIdentifier, KMToolbarConversionHTMLItemIdentifier, KMToolbarConversionTextItemIdentifier, KMToolbarConversionImageItemIdentifier] // EditPDF let KMToolbarAddTextEditPDFItemIdentifier = "KMToolbarAddTextEditPDFItemIdentifier" let KMToolbarAddImageEditPDFItemIdentifier = "KMToolbarAddImageEditPDFItemIdentifier" let editPDFItemIdentifier = [KMToolbarAddTextEditPDFItemIdentifier, KMToolbarAddImageEditPDFItemIdentifier] let KMToolbarDividerItemIdentifier = "KMToolbarDividerItemIdentifier" /// Tool let KMToolbarToolCropItemIdentifier = "KMToolbarToolCropItemIdentifier" let KMToolbarToolBatesItemIdentifier = "KMToolbarToolBatesItemIdentifier" let KMToolbarToolHeaderFooterItemIdentifier = "KMToolbarToolHeaderFooterItemIdentifier" let KMToolbarToolBackgroundItemIdentifier = "KMToolbarToolBackgroundItemIdentifier" let KMToolbarToolWatermarkItemIdentifier = "KMToolbarToolWatermarkItemIdentifier" let KMToolbarToolRedactItemIdentifier = "KMToolbarToolRedactItemIdentifier" let KMToolbarToolCompressItemIdentifier = "KMToolbarToolCompressItemIdentifier" let KMToolbarToolSecureItemIdentifier = "KMToolbarToolSecureItemIdentifier" let KMToolbarToolMergeItemIdentifier = "KMToolbarToolMergeItemIdentifier" let toolToolIdentifiers = [KMToolbarToolCropItemIdentifier, KMToolbarToolBatesItemIdentifier, KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBackgroundItemIdentifier, KMToolbarToolWatermarkItemIdentifier, KMToolbarToolRedactItemIdentifier, KMToolbarToolCompressItemIdentifier, KMToolbarToolSecureItemIdentifier, KMToolbarToolMergeItemIdentifier] /// Form let KMToolbarToolTextFieldItemIdentifier = "KMToolbarToolTextFieldItemIdentifier" let KMToolbarToolCheckBoxItemIdentifier = "KMToolbarToolCheckBoxItemIdentifier" let KMToolbarToolRadioButtonItemIdentifier = "KMToolbarToolRadioButtonItemIdentifier" let KMToolbarToolListBoxItemIdentifier = "KMToolbarToolListBoxItemIdentifier" let KMToolbarToolPullDownmenuItemIdentifier = "KMToolbarToolPullDownmenuItemIdentifier" let KMToolbarToolButtonIdentifier = "KMToolbarToolButtonIdentifier" let KMToolbarToolSignBoxIdentifier = "KMToolbarToolSignBoxIdentifier" let KMToolbarToolFormAlignIdentifier = "KMToolbarToolFormAlignIdentifier" let KMToolbarToolFormMoreIdentifier = "KMToolbarToolFormMoreIdentifier" let formToolIdentifiers = [KMToolbarToolTextFieldItemIdentifier, KMToolbarToolCheckBoxItemIdentifier, KMToolbarToolRadioButtonItemIdentifier, KMToolbarToolListBoxItemIdentifier, KMToolbarToolPullDownmenuItemIdentifier, KMToolbarToolButtonIdentifier, KMToolbarToolSignBoxIdentifier, KMToolbarToolFormAlignIdentifier, KMToolbarToolFormMoreIdentifier] /// FillSign let KMToolbarToolHookItemIdentifier = "KMToolbarToolHookItemIdentifier" let KMToolbarToolForkItemIdentifier = "KMToolbarToolForkItemIdentifier" let KMToolbarToolLineItemIdentifier = "KMToolbarToolLineItemIdentifier" let KMToolbarToolDotItemIdentifier = "KMToolbarToolDotItemIdentifier" let KMToolbarToolRectangleIdentifier = "KMToolbarToolRectangleIdentifier" let KMToolbarToolTextIdentifier = "KMToolbarToolTextIdentifier" let KMToolbarToolDateIdentifier = "KMToolbarToolDateIdentifier" let KMToolbarFillSignSignatureIdentifier = "KMToolbarFillSignSignatureIdentifier" let fillSignToolIdentifiers = [KMToolbarToolHookItemIdentifier, KMToolbarToolForkItemIdentifier, KMToolbarToolLineItemIdentifier, KMToolbarToolDotItemIdentifier, KMToolbarToolRectangleIdentifier, KMToolbarToolTextIdentifier, KMToolbarToolDateIdentifier, KMToolbarFillSignSignatureIdentifier] //Scan OCR let KMToolbarToolOCRTextIdentifier = "KMToolbarToolOCRTextIdentifier" let KMToolbarToolEnhancedScanIdentifier = "KMToolbarToolEnhancedScanIdentifier" let KMToolBarToolPDFShapeStyle = "KMToolBarToolPDFShapeStyle" public func parentIdentifier(_ identifier: String) -> String { if (isMainToolItem(identifier)) { return "" } if (editPDFItemIdentifier.contains(identifier)) { return KMDocumentEditToolbarItemIdentifier } if (annotationToolIdentifiers.contains(identifier)) { return KMDocumentAnnotationToolbarItemIdentifier } if (pageEditToolIdentifiers.contains(identifier)) { return KMDocumentPageToolbarItemIdentifier } if (conversionToolIdentifiers.contains(identifier)) { return KMDocumentConversonToolbarItemIdentifier } if (toolToolIdentifiers.contains(identifier)) { return KMDocumentToolToolbarItemIdentifier } if (formToolIdentifiers.contains(identifier)) { return KMDocumentFormToolbarItemIdentifier } if (fillSignToolIdentifiers.contains(identifier)) { return KMDocumentFillSginToolbarItemIdentifier } return "" } public func isMainToolItem(_ identifier: String) -> Bool { if (mainToolIdentifiers.contains(identifier)) { return true } return false }