12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // KMHeaderFooterWindowController.swift
- // PDF Reader Pro
- //
- // Created by lizhe on 2023/11/24.
- //
- import Cocoa
- typealias KMHeaderFooterWindowControllerOperateCallBack = (_ controller: NSWindowController, _ headerFooter: KMHeaderFooterObject) -> ()
- class KMHeaderFooterWindowController: KMBaseWindowController {
- @IBOutlet weak var headerFooterView: KMHeaderFooterView!
- var headerFooterObj: KMHeaderFooterObject = KMHeaderFooterObject()
- var type: KMBatchModifyTemplateType = .Use
- var operateCallBack: KMHeaderFooterWindowControllerOperateCallBack?
-
- 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 {
- headerFooterView.headerFooterObj = headerFooterObj
- headerFooterView.originalHeaderFooterObj = headerFooterObj
- }
- headerFooterView.isHiddenBatchBtn = isBatch
- headerFooterView.isBates = isBates
- headerFooterView.type = type
- headerFooterView.pdfDocument = pdfDocument
- headerFooterView.cancelAction = { [unowned self] view in
- cancelAction?(self)
- }
-
- headerFooterView.operateCallBack = { [unowned self] model in
- cancelAction?(self)
- operateCallBack?(self, model)
- }
- }
- }
|