KMBackgroundWindowController.swift 1.1 KB

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