KMConvertPPTsWindowController.swift 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // KMConvertPPTsWindowController.swift
  3. // PDF Reader Pro
  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. } else if subType == 5 {
  20. return KMPDFConvert.pathExtension(.csv, true)
  21. }
  22. return super.fileExtension
  23. }
  24. override func initContentView() {
  25. super.initContentView()
  26. if (self.subType == 1) {
  27. self.titleLabel.stringValue = NSLocalizedString("PDF to PPT", comment: "")
  28. } else if (self.subType == 2) {
  29. self.titleLabel.stringValue = NSLocalizedString("PDF to RTF", comment: "")
  30. } else if (self.subType == 3) {
  31. self.titleLabel.stringValue = NSLocalizedString("PDF to HTML", comment: "")
  32. } else if (self.subType == 4) {
  33. self.titleLabel.stringValue = NSLocalizedString("PDF to Text", comment: "")
  34. } else if subType == 5 {
  35. self.titleLabel.stringValue = NSLocalizedString("PDF to CSV", comment: "")
  36. }
  37. }
  38. override func initSettingView() -> KMConvertSettingView? {
  39. return KMConvertPPTsSettingView.createFromNib()
  40. }
  41. override func initConvert() -> KMPDFConvert {
  42. if (self.subType == 1) {
  43. return KMPDFConvertPPT()
  44. } else if (self.subType == 2) {
  45. return KMPDFConvertRTF()
  46. } else if (self.subType == 3) {
  47. return KMPDFConvertHTML()
  48. } else if (self.subType == 4) {
  49. return KMPDFConvertText()
  50. } else if subType == 5 {
  51. return KMPDFConvertCSV()
  52. }
  53. return super.initConvert()
  54. }
  55. override func convertModelAppendParams(convert: KMPDFConvert) {
  56. super.convertModelAppendParams(convert: convert)
  57. if subType == 5 {
  58. convert.isExtractTable = true
  59. }
  60. }
  61. }