KMCommonEnum.swift 1.7 KB

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