KMPDFFileInfoWindowController.swift 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // KMPDFFileInfoWindowController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 2024/12/23.
  6. //
  7. import Cocoa
  8. import KMComponentLibrary
  9. class KMPDFFileInfoWindowController: NSWindowController {
  10. @IBOutlet var titleLabel: NSTextField!
  11. @IBOutlet var typeTabs: ComponentTabs!
  12. @IBOutlet var infoContendView: NSView!
  13. @IBOutlet var cancelButton: ComponentButton!
  14. @IBOutlet var doneButton: ComponentButton!
  15. @IBOutlet var DescriptionBox: NSBox!
  16. @IBOutlet var advancedBox: NSBox!
  17. @IBOutlet var securityBox: NSBox!
  18. static let shared = KMPDFFileInfoWindowController(windowNibName: "KMPDFFileInfoWindowController")
  19. let descriptionProperty = ComponentTabsProperty(tabsType: .underline_Fill, state: .normal, showIcon: false, title: NSLocalizedString("Page", comment: ""))
  20. let advanceProperty = ComponentTabsProperty(tabsType: .underline_Fill, state: .normal, showIcon: false, title: NSLocalizedString("Web", comment: ""))
  21. let securityProperty = ComponentTabsProperty(tabsType: .underline_Fill, state: .normal, showIcon: false, title: NSLocalizedString("Email", comment: ""))
  22. var filePath: String = "" {
  23. didSet {
  24. }
  25. }
  26. override func windowDidLoad() {
  27. super.windowDidLoad()
  28. // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
  29. setupProperty()
  30. }
  31. func setupProperty() {
  32. typeTabs.updateItemProperty([descriptionProperty, advanceProperty, securityProperty])
  33. typeTabs.delegate = self
  34. }
  35. func reloadData() {
  36. }
  37. }
  38. //MARK: - ComponentTabsDelegate
  39. extension KMPDFFileInfoWindowController: ComponentTabsDelegate {
  40. func componentTabsDidSelected(_ view: ComponentTabs, _ property: ComponentTabsProperty) {
  41. if property == descriptionProperty {
  42. } else if property == advanceProperty {
  43. } else if property == securityProperty {
  44. }
  45. reloadData()
  46. }
  47. }