KMWatermarkWindowController.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // KMWatermarkWindowController.swift
  3. // PDF Master
  4. //
  5. // Created by lizhe on 2023/11/14.
  6. //
  7. import Cocoa
  8. typealias KMWatermarkWindowControllerOperateCallBack = (_ controller: NSWindowController, _ watermark: KMWatermarkModel, _ countType: Int) -> ()
  9. class KMWatermarkWindowController: KMBaseWindowController {
  10. var currentType: Int = 0
  11. @IBOutlet weak var watermarkView: KMWatermarkView!
  12. var operateCallBack:KMWatermarkWindowControllerOperateCallBack?
  13. var type: KMWatermarkManagerType = .use
  14. override func windowDidLoad() {
  15. super.windowDidLoad()
  16. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
  17. watermarkView.isHiddenBatchBtn = isBatch
  18. watermarkView.type = type
  19. watermarkView.currentType = currentType
  20. watermarkView.pdfDocument = self.pdfDocument
  21. watermarkView.cancelAction = { [unowned self] view in
  22. cancelAction?(self)
  23. }
  24. watermarkView.operateCallBack = { [unowned self] watermark, countType in
  25. operateCallBack?(self, watermark, countType)
  26. }
  27. }
  28. }