123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- //
- // 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
- }
|