KMCommonEnum.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //
  2. // KMCommonEnum.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/3/14.
  6. //
  7. import Foundation
  8. @objc enum KMPDFDisplayType: Int {
  9. case singlePage = 0, singlePageContinuous
  10. case twoUp, twoUpContinuous
  11. case bookMode, bookContinuous
  12. case readModel, readContinuous
  13. }
  14. @objc enum KMRotateType: Int {
  15. case clockwise = 0 // 顺时针
  16. case anticlockwise // 逆时针
  17. }
  18. @objc enum KMZoomType: Int {
  19. case z_in = 0 // 缩小
  20. case out // 放大
  21. }
  22. @objc enum KMPDFZoomType: Int {
  23. case width = 0
  24. case fit
  25. case actualSize // 实际大小
  26. }
  27. @objc enum KMKeyEquivalent: UInt32 {
  28. case esc = 27
  29. // case enter = UInt32("r")
  30. public static let enter = "\r"
  31. public static let copy = "c"
  32. public static let cut = "x"
  33. public static let paste = "v"
  34. public func string() -> String {
  35. guard let value = Unicode.Scalar(self.rawValue) else {
  36. return ""
  37. }
  38. return String(value)
  39. }
  40. }
  41. @objc enum KMPageRange: Int {
  42. case all = 0 // 全部// 奇数
  43. case odd // 奇数
  44. case even // 偶数
  45. case custom // 自定义
  46. case current // 当前页
  47. case horizontal // 横向
  48. case vertical // 纵向
  49. }
  50. @objc enum KMItemKey: Int {
  51. case print = 0 // 打印
  52. case delete
  53. case leftRotate
  54. case rightRotate
  55. case cut
  56. case paste
  57. case pageEdit
  58. // 降级
  59. case demote
  60. // 升级
  61. case promote
  62. case tts
  63. }
  64. @objc enum KMSortMode: Int {
  65. case none = 0 // 无
  66. case ascending // 升序
  67. case descending // 降序
  68. }
  69. @objc enum KMResult: Int {
  70. case cancel = 0 // 关闭
  71. case ok // 确认
  72. case success // 成功
  73. case failure // 失败
  74. }
  75. enum KMInsertPosition {
  76. case first
  77. case last
  78. case before
  79. case after
  80. }