123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233 |
- //
- // PublicKey.swift
- // PDF Reader Pro
- //
- // Created by lxy on 2022/12/1.
- //
- import Foundation
- /// Main Tool
- let KMLeftControlToolbarItemIdentifier = "KMLeftControlToolbarItemIdentifier"
- let KMDocumentZoomViewToolbarItemIdentifier = "KMDocumentZoomViewToolbarItemIdentifier"
- let KMDocumentPreviousPageToolbarItemIdentifier = "KMDocumentPreviousPageToolbarItemIdentifier"
- let KMDocumentHomeToolbarItemIdentifier = "KMDocumentHomeToolbarItemIdentifier"
- 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 KMDocumentRedactToolbarItemIdentifier = "KMDocumentRedactToolbarItemIdentifier"
- let KMDocumentDigitalSignToolbarItemIdentifier = "KMDocumentDigitalSignToolbarItemIdentifier"
- let KMDocumentViewDisplayToolbarItemIdentifier = "KMDocumentViewDisplayToolbarItemIdentifier"
- let KMDocumentPrintToolbarItemIdentifier = "KMDocumentPrintToolbarItemIdentifier"
- let KMDocumentAITranslationToolbarItemIdentifier = "KMDocumentAITranslationToolbarItemIdentifier"
- let KMDocumentShareToolbarItemIdentifier = "KMDocumentShareToolbarItemIdentifier"
- let KMDocumentSearchToolbarItemIdentifier = "KMDocumentSearchToolbarItemIdentifier"
- let KMRightControlToolbarItemIdentifier = "KMRightControlToolbarItemIdentifier"
- let KMDocumentAIToolsToolbarItemIdentifier = "KMDocumentAIToolsToolbarItemIdentifier"
- let KMDocumentPreviousBackToolbarItemIdentifier = "previousBackItemIdentifier"
- let KMDocumentFirstLastToolbarItemIdentifier = "firstLastItemIdentifier"
- let KMDocumentPageIndicatorToolbarItemIdentifier = "pageIndicatorItemIdentifier"
- let KMDocumentPresentationToolbarItemIdentifier = "presentationItemIdentifier"
- let mainToolIdentifiers = [KMLeftControlToolbarItemIdentifier,
- KMDocumentZoomViewToolbarItemIdentifier, KMDocumentPreviousPageToolbarItemIdentifier,
- KMDocumentHomeToolbarItemIdentifier, KMDocumentAnnotationToolbarItemIdentifier, KMDocumentPageToolbarItemIdentifier, KMDocumentConversonToolbarItemIdentifier,KMDocumentRedactToolbarItemIdentifier,KMDocumentViewDisplayToolbarItemIdentifier,KMDocumentScanOCRToolbarItemIdentifier, KMDocumentFormToolbarItemIdentifier, KMDocumentEditToolbarItemIdentifier, KMDocumentDigitalSignToolbarItemIdentifier,
- KMDocumentFillSginToolbarItemIdentifier, KMDocumentToolToolbarItemIdentifier, KMDocumentPrintToolbarItemIdentifier,
- KMDocumentShareToolbarItemIdentifier, KMDocumentSearchToolbarItemIdentifier, KMRightControlToolbarItemIdentifier,
- KMDocumentPreviousBackToolbarItemIdentifier, KMDocumentFirstLastToolbarItemIdentifier,
- // KMDocumentPageIndicatorToolbarItemIdentifier,
- KMDocumentPresentationToolbarItemIdentifier]
- /// 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 = "KMToolbarSignatureAnnotationItemIdentifier"
- let KMAnnotationStampToolbarItemIdentifier = "KMToolbarStampAnnotationItemIdentifier"
- let KMAnnotationImageToolbarItemIdentifier = "KMToolbarImageAnnotationItemIdentifier"
- let KMAnnotationTableToolbarItemIdentifier = "KMToolbarTableAnnotationItemIdentifier"
- let KMToolbarShowToolbarItemIdentifier = "KMToolbarShowToolbarItemIdentifier"
- let KMToolbarAnnotationSettingItemIdentifier = "KMToolbarAnnotationSettingItemIdentifier"
- let annotationToolIdentifiers = [KMToolbarMoveToolModeItemIdentifier, KMToolbarMagnifyToolModeItemIdentifier, KMToolbarSelectToolModeItemIdentifier,
- KMToolbarZoomToSelectionItemIdentifier, KMToolbarHighlightAnnotationItemIdentifier, KMToolbarUnderlineAnnotationItemIdentifier,
- KMToolbarStrikeOutAnnotationItemIdentifier, KMToolbarInkAnnotationItemIdentifier, KMToolbarFreeTextAnnotationItemIdentifier,
- KMToolbarAnchoredAnnotationItemIdentifier, KMToolbarSquareAnnotationItemIdentifier, KMToolbarCircleAnnotationItemIdentifier,
- KMToolbarLineAnnotationItemIdentifier, KMToolbarArrowAnnotationItemIdentifier, KMToolbarLinkAnnotationItemIdentifier,
- KMToolbarSignSignatureAnnotationItemIdentifier, KMAnnotationStampToolbarItemIdentifier, KMAnnotationImageToolbarItemIdentifier, KMAnnotationTableToolbarItemIdentifier, KMToolbarAnnotationSettingItemIdentifier]
- // PageEdit
- let KMToolbarPageEditPageRangeItemIdentifier = "KMToolbarPageEditPageRangeItemIdentifier"
- let KMToolbarPageEditRotateItemIdentifier = "KMToolbarPageEditRotateItemIdentifier"
- let KMToolbarPageEditLeftRotateItemIdentifier = "KMToolbarPageEditLeftRotateItemIdentifier"
- let KMToolbarPageEditRightRotateItemIdentifier = "KMToolbarPageEditRightRotateItemIdentifier"
- let KMToolbarPageEditInsetItemIdentifier = "KMToolbarPageEditInsertItemIdentifier"
- let KMToolbarPageEditExtractItemIdentifier = "KMToolbarPageEditExtractItemIdentifier"
- let KMToolbarPageEditReplaceItemIdentifier = "KMToolbarPageEditReplaceItemIdentifier"
- let KMToolbarPageEditSplitItemIdentifier = "KMToolbarPageEditSplitItemIdentifier"
- let KMToolbarPageEditReverseItemIdentifier = "KMToolbarPageEditReverseItemIdentifier"
- let KMToolbarPageEditCopyItemIdentifier = "KMToolbarPageEditCopyItemIdentifier"
- let KMToolbarPageEditPasteItemIdentifier = "KMToolbarPageEditPasteItemIdentifier"
- let KMToolbarPageEditDeleteItemIdentifier = "KMToolbarPageEditDeleteItemIdentifier"
- let pageEditToolIdentifiers = [KMToolbarPageEditPageRangeItemIdentifier, KMToolbarPageEditRotateItemIdentifier,
- KMToolbarPageEditLeftRotateItemIdentifier,KMToolbarPageEditRightRotateItemIdentifier,
- KMToolbarPageEditInsetItemIdentifier, KMToolbarPageEditExtractItemIdentifier,
- KMToolbarPageEditReplaceItemIdentifier, KMToolbarPageEditSplitItemIdentifier,
- KMToolbarPageEditReverseItemIdentifier, KMToolbarPageEditCopyItemIdentifier,
- KMToolbarPageEditPasteItemIdentifier, KMToolbarPageEditDeleteItemIdentifier]
- // conversion
- let KMToolbarConversionCreatePDFItemIdentifier = "KMToolbarImageToPDFItemIdentifier"
- let KMToolbarConversionWordItemIdentifier = "KMToolbarPDFToWordItemIdentifier"
- let KMToolbarConversionExcelItemIdentifier = "KMToolbarPDFToExcelItemIdentifier"
- let KMToolbarConversionPPTItemIdentifier = "KMToolbarPDFToPPTItemIdentifier"
- let KMToolbarConversionRTFItemIdentifier = "KMToolbarPDFToRTFItemIdentifier"
- let KMToolbarConversionCSVItemIdentifier = "KMToolbarPDFToCSVItemIdentifier"
- let KMToolbarConversionHTMLItemIdentifier = "KMToolbarPDFToHtmlItemIdentifier"
- let KMToolbarConversionTextItemIdentifier = "KMToolbarPDFToTextItemIdentifier"
- let KMToolbarConversionImageItemIdentifier = "KMToolbarPDFToImageItemIdentifier"
- let KMToolbarConversionOCRIdentifier = "KMToolbarConversionOCRIdentifier"
- let KMToolbarConversionExportImageItemIdentifier = "KMToolbarExtractPDFImageItemIdentifier"
- let conversionToolIdentifiers = [KMToolbarConversionCreatePDFItemIdentifier,
- KMToolbarConversionWordItemIdentifier, KMToolbarConversionExcelItemIdentifier,
- KMToolbarConversionPPTItemIdentifier, KMToolbarConversionRTFItemIdentifier,
- KMToolbarConversionCSVItemIdentifier, KMToolbarConversionHTMLItemIdentifier,
- KMToolbarConversionTextItemIdentifier, KMToolbarConversionImageItemIdentifier,
- KMToolbarConversionOCRIdentifier, KMToolbarConversionExportImageItemIdentifier]
- // EditPDF
- let KMToolbarAddTextEditPDFItemIdentifier = "KMToolbarAddTextEditPDFItemIdentifier"
- let KMToolbarAddImageEditPDFItemIdentifier = "KMToolbarAddImageEditPDFItemIdentifier"
- let editPDFItemIdentifiers = [KMToolbarAddTextEditPDFItemIdentifier, KMToolbarAddImageEditPDFItemIdentifier]
- let KMToolbarDividerItemIdentifier = "KMToolbarDividerItemIdentifier"
- /// Tool
- let KMToolbarToolCropItemIdentifier = "KMToolbarToolCropItemIdentifier"
- let KMToolbarToolBatesItemIdentifier = "KMToolbarBatesItemIdentifier"
- let KMToolbarToolHeaderFooterItemIdentifier = "KMToolbarHeaderFooterItemIdentifier"
- let KMToolbarToolBackgroundItemIdentifier = "KMToolbarBackgroundItemIdentifier"
- let KMToolbarToolWatermarkItemIdentifier = "KMToolbarWatermarkItemIdentifier"
- let KMToolbarToolRedactItemIdentifier = "KMToolbarToolRedactItemIdentifier"
- let KMToolbarToolCompressItemIdentifier = "KMToolbarCompressionItemIdentifier"
- let KMToolbarToolSecureItemIdentifier = "KMToolbarSecurityItemIdentifier"
- let KMToolbarToolMergeItemIdentifier = "KMToolbarMergeItemIdentifier"
- let KMToolbarComparisonItemIdentifier = "KMToolbarComparisonItemIdentifier"
- let KMToolbarAIItemIdentifier = "KMToolbarAIItemIdentifier"
- let toolToolIdentifiers = [KMToolbarToolCropItemIdentifier, KMToolbarToolBatesItemIdentifier,
- KMToolbarToolHeaderFooterItemIdentifier, KMToolbarToolBackgroundItemIdentifier,
- KMToolbarToolWatermarkItemIdentifier, KMToolbarToolRedactItemIdentifier,
- KMToolbarToolCompressItemIdentifier, KMToolbarToolSecureItemIdentifier,
- KMToolbarToolMergeItemIdentifier,KMToolbarComparisonItemIdentifier]
- /// Form
- let KMToolbarToolTextFieldItemIdentifier = "KMToolbarFormTextFieldItemIdentifier"
- let KMToolbarToolCheckBoxItemIdentifier = "KMToolbarFormCheckBoxItemIdentifier"
- let KMToolbarToolRadioButtonItemIdentifier = "KMToolbarFormRadioButtonItemIdentifier"
- let KMToolbarToolListBoxItemIdentifier = "KMToolbarToolListBoxItemIdentifier"
- let KMToolbarToolPullDownmenuItemIdentifier = "KMToolbarFormComboBoxItemIdentifier"
- let KMToolbarToolButtonIdentifier = "KMToolbarFormActionButtonItemIdentifier"
- let KMToolbarToolSignBoxIdentifier = "KMToolbarFormSignatureButtonItemIdentifier"
- let KMToolbarToolFormAlignIdentifier = "KMToolbarFormAlignmentIdentifier"
- 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 KMToolbarToolProfileIdentifier = "KMToolbarToolProfileIdentifier"
- let KMToolbarFillSignSignatureIdentifier = "KMToolbarFillSignSignatureIdentifier"
- let fillSignToolIdentifiers = [KMToolbarToolHookItemIdentifier, KMToolbarToolForkItemIdentifier,
- KMToolbarToolLineItemIdentifier, KMToolbarToolDotItemIdentifier,
- KMToolbarToolRectangleIdentifier, KMToolbarToolTextIdentifier,
- KMToolbarToolDateIdentifier, KMToolbarToolProfileIdentifier,
- KMToolbarFillSignSignatureIdentifier]
- //Scan OCR
- let KMToolbarToolOCRTextIdentifier = "KMToolbarToolOCRTextIdentifier"
- let KMToolbarToolEnhancedScanIdentifier = "KMToolbarToolEnhancedScanIdentifier"
- let KMToolbarViewSettingIdentifier = "KMToolbarSplitScreenModeItemIdentifier"
- let KMToolbarCropIdentifier = "KMToolbarCropItemIdentifier"
- let KMToolbarSnapshotIdentifier = "KMToolbarTakeSnapshotItemIdentifier"
- let KMToolbarTTSIdentifier = "KMToolbarTTSViewItemIdentifier"
- let KMViewDisplayIdentifiers = [KMToolbarViewSettingIdentifier, KMToolbarCropIdentifier, KMToolbarSnapshotIdentifier, KMToolbarTTSIdentifier]
- let KMNewToolbarSpaceItemIdentifier = "KMNewToolbarSpaceItemIdentifier"
- //let KMToolbarDividerItemIdentifier = "KMToolbarDividerItemIdentifier"
- // 固定宽度
- let KMToolbarFixedSpaceItemIdentifier = "fixedSpaceItemIdentifier"
- // 可变宽度
- let KMToolbarFlexibleSpaceItemIdentifier = "flexibleSpaceItemIdentifier"
- let KMToolBarToolPDFShapeStyle = "KMToolBarToolPDFShapeStyle"
- public func parentIdentifier(_ identifier: String) -> String {
- if (isMainToolItem(identifier)) {
- return ""
- }
-
- if (editPDFItemIdentifiers.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
- }
- if KMViewDisplayIdentifiers.contains(identifier) {
- return KMDocumentViewDisplayToolbarItemIdentifier
- }
- return ""
- }
- public func isMainToolItem(_ identifier: String) -> Bool {
- if (mainToolIdentifiers.contains(identifier)) {
- return true
- }
- return false
- }
|