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