// // KMEnumExtensions.swift // PDF Master // // Created by tangchao on 2023/7/14. // import Foundation 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 } } }