CPDFDisplayModel.swift 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // CPDFDisplayModel.swift
  3. // ComPDFKit_Tools
  4. //
  5. // Copyright © 2014-2024 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. import Foundation
  13. import UIKit
  14. class CPDFDisplayModel: NSObject {
  15. var image: UIImage?
  16. var titilName: String?
  17. var tag: CDisplayPDFType = .singlePage
  18. init(displayType: CDisplayPDFType) {
  19. super.init()
  20. switch displayType {
  21. case .singlePage:
  22. image = UIImage(named: "CDisplayImageNameSinglePage", in: Bundle(for: type(of: self)), compatibleWith: nil)
  23. titilName = NSLocalizedString("Single Page", comment: "")
  24. case .twoPages:
  25. image = UIImage(named: "CDisplayImageNameTwoPages", in: Bundle(for: type(of: self)), compatibleWith: nil)
  26. titilName = NSLocalizedString("Double Page", comment: "")
  27. case .bookMode:
  28. image = UIImage(named: "CDisplayImageNameBookMode", in: Bundle(for: type(of: self)), compatibleWith: nil)
  29. titilName = NSLocalizedString("Book Mode", comment: "")
  30. case .continuousScroll:
  31. image = UIImage(named: "CDisplayImageNameContinuousScroll", in: Bundle(for: type(of: self)), compatibleWith: nil)
  32. titilName = NSLocalizedString("Continuous Scrolling", comment: "")
  33. case .cropMode:
  34. image = UIImage(named: "CDisplayImageNameCropMode", in: Bundle(for: type(of: self)), compatibleWith: nil)
  35. titilName = NSLocalizedString("Crop Mode", comment: "")
  36. case .verticalScrolling:
  37. image = UIImage(named: "CDisplayImageNameVerticalScrolling", in: Bundle(for: type(of: self)), compatibleWith: nil)
  38. titilName = NSLocalizedString("Vertical Scrolling", comment: "")
  39. case .horizontalScrolling:
  40. image = UIImage(named: "CDisplayImageNameHorizontalScrolling", in: Bundle(for: type(of: self)), compatibleWith: nil)
  41. titilName = NSLocalizedString("Horizontal Scrolling", comment: "")
  42. case .themesLight:
  43. image = UIImage(named: "CDisplayImageNameThemesLight", in: Bundle(for: type(of: self)), compatibleWith: nil)
  44. titilName = NSLocalizedString("Light", comment: "")
  45. case .themesDark:
  46. image = UIImage(named: "CDisplayImageNameThemesDark", in: Bundle(for: type(of: self)), compatibleWith: nil)
  47. titilName = NSLocalizedString("Dark", comment: "")
  48. case .themesSepia:
  49. image = UIImage(named: "CDisplayImageNameThemesSepia", in: Bundle(for: type(of: self)), compatibleWith: nil)
  50. titilName = NSLocalizedString("Sepia", comment: "")
  51. case .themesReseda:
  52. image = UIImage(named: "CDisplayImageNameThemesReseda", in: Bundle(for: type(of: self)), compatibleWith: nil)
  53. titilName = NSLocalizedString("Reseda", comment: "")
  54. }
  55. tag = displayType
  56. }
  57. }