KMCommonEnum.swift 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 current // 奇数
  44. case odd // 偶数
  45. case even // 当前页
  46. case custom // 自定义
  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. @objc enum KMSortMode: Int {
  60. case none = 0 // 无
  61. case ascending // 升序
  62. case descending // 降序
  63. }
  64. @objc enum KMResult: Int {
  65. case cancel = 0 // 关闭
  66. case ok // 确认
  67. case success // 成功
  68. case failure // 失败
  69. }
  70. enum KMInsertPosition {
  71. case first
  72. case last
  73. case before
  74. case after
  75. }