// // KMBatchOperateSplitViewController.swift // PDF Reader Pro // // Created by kdanmobile on 2023/10/26. // import Cocoa class KMBatchOperateSplitViewController: NSSplitViewController{ var leftFileListViewController: KMBatchOperateLeftViewController? var rightPropertiesViewController: KMBatchOperateRightViewController? override func viewDidLoad() { super.viewDidLoad() self.leftFileListViewController = KMBatchOperateLeftViewController() self.rightPropertiesViewController = KMBatchOperateRightViewController() let item1 = NSSplitViewItem(viewController: self.leftFileListViewController!) let item2 = NSSplitViewItem(viewController: self.rightPropertiesViewController!) item1.minimumThickness = 400 item2.minimumThickness = 270 item2.maximumThickness = 270 self.addSplitViewItem(item1) self.addSplitViewItem(item2) self.addNewTrackingArea() } func addNewTrackingArea() { let trackingArea = NSTrackingArea(rect: self.view.frame, options: [.mouseEnteredAndExited, .inVisibleRect, .activeAlways, .mouseMoved], owner: self, userInfo: nil) self.view.addTrackingArea(trackingArea) } func switchToOperateType(operateType: KMBatchOperationType, files: [KMBatchOperateFile]) { self.leftFileListViewController?.switchToOperateType(operateType, files: files) self.rightPropertiesViewController?.switchToOperateType(operateType: operateType, files: files ) } func checkNeedPasswordSwitchToOperateType(_ operateType: KMBatchOperationType, files: [KMBatchOperateFile]) { self.leftFileListViewController?.checkNeedPasswordSwitchToOperateType(operateType, files: files) self.rightPropertiesViewController?.switchToOperateType(operateType: operateType, files: files) } func switchToOperateType(_ operateType: KMBatchOperationType) { self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? [] self.leftFileListViewController!.switchToOperateType(operateType) self.rightPropertiesViewController!.switchToOperateType(operateType: operateType) } func switchToConvertType(_ convertType: KMConvertWithPDFType) { self.rightPropertiesViewController?.files = self.leftFileListViewController?.files ?? [] self.leftFileListViewController!.reloadConvertInterface(withType: convertType) self.rightPropertiesViewController!.switchToConvertType(convertType) } func watermarkInterfaceSelectWatermark(_ watermark: KMWatermarkModel) { self.rightPropertiesViewController?.watermarkInterfaceSelectWatermark(watermark) } func backgroundInterfaceSelectBackground(_ background: KMBackgroundModel) { self.rightPropertiesViewController?.backgroundInterfaceSelectBackground(background) } func headerFooterInterfaceSelectHeaderFooter(_ headerFooter: KMHeaderFooterObject) { self.rightPropertiesViewController?.headerFooterInterfaceSelectHeaderFooter(headerFooter) } func batesInterfaceSelectBates(_ headerFooter: KMHeaderFooterObject) { self.rightPropertiesViewController?.batesInterfaceSelectBates(headerFooter) } }