KMBatchRemoveView.swift 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // KMBatchRemoveView.swift
  3. // PDF Master
  4. //
  5. // Created by lizhe on 2023/1/16.
  6. //
  7. import Cocoa
  8. import KMComponentLibrary
  9. class KMBatchRemoveView: KMBatchSettingItemView {
  10. @IBOutlet weak var titleLabel: NSTextField!
  11. @IBOutlet weak var titleContentView: NSView!
  12. @IBOutlet weak var watermarkButton: ComponentCheckBox!
  13. @IBOutlet weak var backgroundButton: ComponentCheckBox!
  14. @IBOutlet weak var headerAndFooterButton: ComponentCheckBox!
  15. @IBOutlet weak var batesButton: ComponentCheckBox!
  16. var data = KMBatchRemoveViewModel()
  17. override func draw(_ dirtyRect: NSRect) {
  18. super.draw(dirtyRect)
  19. // Drawing code here.
  20. }
  21. override func setup() {
  22. super.setup()
  23. self.titleContentView.border(ComponentLibrary.shared.getComponentColorFromKey("colorBorder/divider"), 0.5, 0)
  24. watermarkButton.properties = ComponentCheckBoxProperty(size: .s,
  25. state: .normal,
  26. isDisabled: false,
  27. showhelp: false,
  28. text: KMLocalizedString("Watermark", comment: ""),
  29. checkboxType: .normal)
  30. backgroundButton.properties = ComponentCheckBoxProperty(size: .s,
  31. state: .normal,
  32. isDisabled: false,
  33. showhelp: false,
  34. text: KMLocalizedString("Background", comment: ""),
  35. checkboxType: .normal)
  36. headerAndFooterButton.properties = ComponentCheckBoxProperty(size: .s,
  37. state: .normal,
  38. isDisabled: false,
  39. showhelp: false,
  40. text: KMLocalizedString("Header & Footer", comment: ""),
  41. checkboxType: .normal)
  42. batesButton.properties = ComponentCheckBoxProperty(size: .s,
  43. state: .normal,
  44. isDisabled: false,
  45. showhelp: false,
  46. text: KMLocalizedString("Bates", comment: ""),
  47. checkboxType: .normal)
  48. }
  49. override func reloadData() {
  50. }
  51. }
  52. protocol KMBatchRemoveViewAction: KMBatchRemoveView {}
  53. extension KMBatchRemoveView: KMBatchRemoveViewAction {
  54. @IBAction func removeButtonAction(_ sender: NSButton) {
  55. guard self.data != nil else {
  56. return
  57. }
  58. if self.batchExport != nil {
  59. self.batchExport!(self, self.data)
  60. }
  61. }
  62. }