KMConvertPPTsWindowController.swift 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // KMConvertPPTsWindowController.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2022/12/6.
  6. //
  7. import Cocoa
  8. // 转档 [PPT、RTF、Text、HTML] 窗口
  9. class KMConvertPPTsWindowController: KMConvertBaseWindowController {
  10. override var fileExtension: String {
  11. if (self.subType == 1) {
  12. return KMPDFConvert.pathExtension(.ppt)
  13. } else if (self.subType == 2) {
  14. return KMPDFConvert.pathExtension(.rtf)
  15. } else if (self.subType == 3) {
  16. return KMPDFConvert.pathExtension(.html)
  17. } else if (self.subType == 4) {
  18. return KMPDFConvert.pathExtension(.text)
  19. }
  20. return super.fileExtension
  21. }
  22. override func initDefaultValue() {
  23. super.initDefaultValue()
  24. if (self.subType == 1) {
  25. self.titleLabel.stringValue = NSLocalizedString("PDF to PPT", comment: "")
  26. } else if (self.subType == 2) {
  27. self.titleLabel.stringValue = NSLocalizedString("PDF to RTF", comment: "")
  28. } else if (self.subType == 3) {
  29. self.titleLabel.stringValue = NSLocalizedString("PDF to HTML", comment: "")
  30. } else if (self.subType == 4) {
  31. self.titleLabel.stringValue = NSLocalizedString("PDF to Text", comment: "")
  32. }
  33. }
  34. override func initSettingView() -> KMConvertSettingView? {
  35. return KMConvertPPTsSettingView.createFromNib()
  36. }
  37. override func initConvert() -> KMPDFConvert {
  38. if (self.subType == 1) {
  39. return KMPDFConvertPPT()
  40. } else if (self.subType == 2) {
  41. return KMPDFConvertRTF()
  42. } else if (self.subType == 3) {
  43. return KMPDFConvertHTML()
  44. } else if (self.subType == 4) {
  45. return KMPDFConvertText()
  46. }
  47. return super.initConvert()
  48. }
  49. }