KMWatermarkAdjectivePropertyMainController.swift 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // KMWatermarkAdjectivePropertyMainController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/1/30.
  6. //
  7. import Cocoa
  8. typealias KMWatermarkAdjectiveModelDidChange = (_ model: KMWatermarkAdjectiveBaseModel?) -> ()
  9. /// 水印相关 属性主控制器(基类)
  10. class KMWatermarkAdjectivePropertyMainController: NSViewController {
  11. /// 当前页面控制器
  12. var currentController: NSViewController!
  13. /// 预览视图页面数量
  14. var pageCount: Int = 0
  15. /// 模型已改变回调
  16. var modelDidChange: KMWatermarkAdjectiveModelDidChange!
  17. var model: KMWatermarkAdjectiveBaseModel?
  18. override func viewDidLoad() {
  19. super.viewDidLoad()
  20. /// 显示主页面
  21. self.gotoHomeController("")
  22. }
  23. /// 显示主页面
  24. func gotoHomeController(_ selectedModelID: String) {
  25. /// no things.
  26. }
  27. /// 显示创建页面
  28. func gotoCreateController() {
  29. /// no things.
  30. }
  31. /// 显示编辑页面
  32. func gotoEditController(_ model: KMWatermarkAdjectiveBaseModel) {
  33. /// no things.
  34. }
  35. /// 显示页面
  36. func showController(_ controller: NSViewController) {
  37. for subview in self.view.subviews {
  38. subview.removeFromSuperview()
  39. }
  40. controller.view.frame = self.view.bounds
  41. controller.view.autoresizingMask = NSView.AutoresizingMask(rawValue: 18)
  42. self.view.addSubview(controller.view)
  43. self.currentController = controller
  44. }
  45. }