KMBackgroundWindowController.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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 currentType: Int = 0
  13. var operateCallBack: KMBackgroundWindowControllerOperateCallBack?
  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. addBackgroundView.isHiddenBatchBtn = isBatch
  18. addBackgroundView.type = type
  19. addBackgroundView.currentType = currentType
  20. addBackgroundView.pdfDocument = self.pdfDocument
  21. addBackgroundView.cancelAction = { [unowned self] view in
  22. cancelAction?(self)
  23. }
  24. addBackgroundView.operateCallBack = { [unowned self] background, countType in
  25. operateCallBack?(self, background, countType)
  26. }
  27. }
  28. }