// // KMEnumExtensions.swift // PDF Reader Pro // // Created by tangchao on 2023/7/14. // import Foundation @objc enum KMSubscribeWaterMarkType: Int { case none = 0 case stamp = 1 case link case sign case editText case editImage case insert case extract case replace case split case delete case rotate case copy case toWord case toExcel case toPPT case toRTF case toCSV case toHTML case toText case toImage case compress case merge case setPassword case removePassword case crop case aiTranslate case aiRewrite case aiCorrect case save } protocol KMSubscribeWaterMarkTypeConvertProtocol { func toSubscribeWaterMarkType() -> KMSubscribeWaterMarkType } extension KMToolbarType: KMSubscribeWaterMarkTypeConvertProtocol { func toSubscribeWaterMarkType() -> KMSubscribeWaterMarkType { switch self { case .word: return .toWord case .excel: return .toExcel case .ppt: return .toPPT case .rtf: return .toRTF case .csv: return .toCSV case .html: return .toHTML case .conversion_text: return .toText case .conversion_image: return .toImage case .compress: return .compress case .merge: return .merge default: return .none } } } extension KMPDFConvertType: KMSubscribeWaterMarkTypeConvertProtocol { func toSubscribeWaterMarkType() -> KMSubscribeWaterMarkType { switch self { case .word: return .toWord case .excel: return .toExcel case .ppt: return .toPPT case .rtf: return .toRTF case .csv: return .toCSV case .html: return .toHTML case .text: return .toText case .image: return .toImage default: return .none } } } extension KMItemKey: KMSubscribeWaterMarkTypeConvertProtocol { func toSubscribeWaterMarkType() -> KMSubscribeWaterMarkType { switch self { case .leftRotate: return .rotate case .rightRotate: return .rotate case .paste: return .copy case .delete: return .delete default: return .none } } } extension KMPageEditType: KMSubscribeWaterMarkTypeConvertProtocol { func toSubscribeWaterMarkType() -> KMSubscribeWaterMarkType { switch self { case .leftRotate: return .rotate case .rightRotate: return .rotate case .insert: return .insert case .extract: return .extract case .replace: return .replace case .split: return .split case .reverse: return .none case .delete: return .delete case .paste: return .copy default: return .none } } }