KMCommonEnum.swift 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 func string() -> String {
  32. guard let value = Unicode.Scalar(self.rawValue) else {
  33. return ""
  34. }
  35. return String(value)
  36. }
  37. }
  38. @objc enum KMPageRange: Int {
  39. case all = 0 // 全部
  40. case current // 奇数
  41. case odd // 偶数
  42. case even // 当前页
  43. case custom // 自定义
  44. case horizontal // 横向
  45. case vertical // 纵向
  46. }
  47. @objc enum KMItemKey: Int {
  48. case print = 0 // 打印
  49. case delete
  50. case leftRotate
  51. case rightRotate
  52. case cut
  53. case paste
  54. case pageEdit
  55. }
  56. @objc enum KMSortMode: Int {
  57. case none = 0 // 无
  58. case ascending // 升序
  59. case descending // 降序
  60. }
  61. @objc enum KMResult: Int {
  62. case cancel = 0 // 关闭
  63. case ok // 确认
  64. case success // 成功
  65. case failure // 失败
  66. }