// // KMConvertPPTsWindowController.swift // PDF Reader Pro // // Created by tangchao on 2022/12/6. // import Cocoa // 转档 [PPT、RTF、Text、HTML] 窗口 class KMConvertPPTsWindowController: KMConvertBaseWindowController { override var fileExtension: String { if (self.subType == 1) { return KMPDFConvert.pathExtension(.ppt) } else if (self.subType == 2) { return KMPDFConvert.pathExtension(.rtf) } else if (self.subType == 3) { return KMPDFConvert.pathExtension(.html) } else if (self.subType == 4) { return KMPDFConvert.pathExtension(.text) } else if subType == 5 { return KMPDFConvert.pathExtension(.csv, true) } return super.fileExtension } override func initContentView() { super.initContentView() if (self.subType == 1) { self.titleLabel.stringValue = NSLocalizedString("PDF to PPT", comment: "") } else if (self.subType == 2) { self.titleLabel.stringValue = NSLocalizedString("PDF to RTF", comment: "") } else if (self.subType == 3) { self.titleLabel.stringValue = NSLocalizedString("PDF to HTML", comment: "") } else if (self.subType == 4) { self.titleLabel.stringValue = NSLocalizedString("PDF to Text", comment: "") } else if subType == 5 { self.titleLabel.stringValue = NSLocalizedString("PDF to CSV", comment: "") } } override func initSettingView() -> KMConvertSettingView? { return KMConvertPPTsSettingView.createFromNib() } override func initConvert() -> KMPDFConvert { if (self.subType == 1) { return KMPDFConvertPPT() } else if (self.subType == 2) { return KMPDFConvertRTF() } else if (self.subType == 3) { return KMPDFConvertHTML() } else if (self.subType == 4) { return KMPDFConvertText() } else if subType == 5 { return KMPDFConvertCSV() } return super.initConvert() } override func convertModelAppendParams(convert: KMPDFConvert) { super.convertModelAppendParams(convert: convert) if subType == 5 { convert.isExtractTable = true } } }