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