// // KMBatchOperateBaseWindowController.swift // PDF Reader Pro // // Created by kdanmobile on 2023/10/26. // import Cocoa @objcMembers class KMBatchOperateBaseWindowController: NSWindowController{ var files: [KMBatchOperateFile]? var operateType: KMBatchOperationType?{ willSet{ } didSet { switch operateType { case .Convert: self.window!.title = NSLocalizedString("Convert", comment: "") case .Merge: self.window!.title = NSLocalizedString("Merge", comment: "") case .Compress: self.window!.title = NSLocalizedString("Compress", comment: "") case .AddPassword: self.window!.title = NSLocalizedString("Set Passwords", comment: "") case .RemovePassword: self.window!.title = NSLocalizedString("Remove Security", comment: "") case .AddWatermark: self.window!.title = NSLocalizedString("Add Watermark", comment: "") case .RemoveWatermark: self.window!.title = NSLocalizedString("Remove Watermark", comment: "") case .AddBackground: self.window!.title = NSLocalizedString("Add Background", comment: "") case .RemoveBackground: self.window!.title = NSLocalizedString("Remove Background", comment: "") case .AddHeaderFooter: self.window!.title = NSLocalizedString("Add Header & Footer", comment: "") case .RemoveHeaderFooter: self.window!.title = NSLocalizedString("Remove Header & Footer", comment: "") case .AddBates: self.window!.title = NSLocalizedString("Add Bates Numbers", comment: "") case .RemoveBates: self.window!.title = NSLocalizedString("Remove Bates Numbers", comment: "") case .CreatePDF: self.window!.title = NSLocalizedString("Image To PDF", comment: "") case .OCR: self.window!.title = NSLocalizedString("OCR", comment: "") default : self.window!.title = NSLocalizedString("Convert", comment: "") } } } override func windowDidLoad() { super.windowDidLoad() self.configuUI() files = NSMutableArray() as? [KMBatchOperateFile] } func configuUI() { let splitViewController = KMBatchOperateSplitViewController(nibName: "KMBatchOperateSplitViewController", bundle: nil) contentViewController = splitViewController } func switchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) { self.files = files (self.contentViewController as? KMBatchOperateSplitViewController)?.switchToOperateType(operateType: operateType, files: files) self.operateType = operateType } func checkNeedPasswordSwitchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) { self.files = files (self.contentViewController as! KMBatchOperateSplitViewController).checkNeedPasswordSwitchToOperateType(operateType, files: files) self.operateType = operateType } func switchToConvertType(convertType: KMConvertWithPDFType) { (self.contentViewController as! KMBatchOperateSplitViewController).switchToConvertType(convertType) } func watermarkInterfaceSelectWatermark(watermark: KMWatermarkModel) { (self.contentViewController as! KMBatchOperateSplitViewController).watermarkInterfaceSelectWatermark(watermark) } func backgroundInterfaceSelectBackGround(background: KMBackgroundModel) { (self.contentViewController as! KMBatchOperateSplitViewController).backgroundInterfaceSelectBackground(background) } func headerFooterInterfaceSelectHeaderFooter(headerFooter: KMHeaderFooterObject) { (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter) } func batesInterfaceSelectBates(headerFooter: KMHeaderFooterObject) { (self.contentViewController as! KMBatchOperateSplitViewController).headerFooterInterfaceSelectHeaderFooter(headerFooter) } }