KMToolbarConfig.swift 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // KMToolbarConfig.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 2024/8/5.
  6. //
  7. import Foundation
  8. @objc enum KMToolbarViewType : Int {
  9. case None
  10. case Main
  11. case Annatiton
  12. case Page
  13. case Conversion
  14. case ScanOCR
  15. case editPDF
  16. case Form
  17. case FillSign
  18. case Tool
  19. case redact
  20. case Move
  21. case Magnify
  22. case Select
  23. case SelectZoom
  24. case LeftPanel
  25. case RightPanel
  26. case viewSetting
  27. case sign
  28. case AITools
  29. func isToolMode() -> Bool {
  30. return (self == .Move || self == .Magnify || self == .Select || self == .SelectZoom)
  31. }
  32. func itemIdentifier() -> String {
  33. if (self == .Annatiton) {
  34. return KMDocumentAnnotationToolbarItemIdentifier
  35. } else if (self == .Page) {
  36. return KMDocumentPageToolbarItemIdentifier
  37. } else if (self == .Conversion) {
  38. return KMDocumentConversonToolbarItemIdentifier
  39. } else if (self == .ScanOCR) {
  40. return KMDocumentScanOCRToolbarItemIdentifier
  41. } else if (self == .editPDF) {
  42. return KMDocumentEditToolbarItemIdentifier
  43. } else if (self == .Form) {
  44. return KMDocumentFormToolbarItemIdentifier
  45. } else if (self == .FillSign) {
  46. return KMDocumentFillSginToolbarItemIdentifier
  47. } else if (self == .Tool) {
  48. return KMDocumentToolToolbarItemIdentifier
  49. } else if (self == .Move) {
  50. return KMToolbarMoveToolModeItemIdentifier
  51. } else if (self == .Magnify) {
  52. return KMToolbarMagnifyToolModeItemIdentifier
  53. } else if (self == .Select) {
  54. return KMToolbarSelectToolModeItemIdentifier
  55. } else if (self == .SelectZoom) {
  56. return KMToolbarZoomToSelectionItemIdentifier
  57. } else if (self == .LeftPanel) {
  58. return KMLeftControlToolbarItemIdentifier
  59. } else if (self == .RightPanel) {
  60. return KMRightControlToolbarItemIdentifier
  61. }
  62. return ""
  63. }
  64. }
  65. @objc enum KMToolbarType: Int {
  66. /// conversion
  67. case word = 3000
  68. case excel = 3001
  69. case ppt = 3002
  70. case rtf = 3003
  71. case csv = 3004
  72. case html = 3005
  73. case conversion_text = 3006
  74. case conversion_image = 3007
  75. case conversion_imageToPDF = 3008
  76. case conversion_other = 3009
  77. case json = 3010
  78. /// tool
  79. case compress = 8000
  80. case merge = 8001
  81. case fileCompare = 8002
  82. case secure = 8003
  83. case redact = 8004
  84. case watermark = 8005
  85. case background = 8006
  86. case headerAndFooter = 8007
  87. case bates = 8008
  88. case crop = 8009
  89. case comparison = 8010
  90. case aiTools = 8011
  91. case measure = 8012
  92. }