// // KMWatermarkWindowController.swift // PDF Reader Pro // // Created by lizhe on 2023/11/14. // import Cocoa typealias KMWatermarkWindowControllerOperateCallBack = (_ controller: NSWindowController, _ watermark: KMWatermarkModel, _ countType: Int) -> () class KMWatermarkWindowController: KMBaseWindowController { var currentType: Int = 0 @IBOutlet weak var watermarkView: KMWatermarkView! var watermark: KMWatermarkModel = KMWatermarkModel() var operateCallBack:KMWatermarkWindowControllerOperateCallBack? var type: KMWatermarkManagerType = .use override func windowDidLoad() { super.windowDidLoad() // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. if type == .edit { watermarkView.watermark = watermark watermarkView.originalWatermark = watermark } watermarkView.isHiddenBatchBtn = isBatch watermarkView.type = type watermarkView.currentType = currentType watermarkView.pdfDocument = self.pdfDocument watermarkView.cancelAction = { [unowned self] view in cancelAction?(self) } watermarkView.operateCallBack = { [unowned self] watermark, countType in operateCallBack?(self, watermark, countType) } watermarkView.reloadData() } }