KMPreferenceCommon.swift 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // KMPreferenceCommon.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2024/1/16.
  6. //
  7. import Foundation
  8. func KMPreferenceKeyToCKey(pKey: KMPreferenceKey) -> String? {
  9. // freeText
  10. if pKey == KMPreference.freeTextNoteLineWidthKey {
  11. return CFreeTextNoteLineWidthKey
  12. } else if pKey == KMPreference.freeTextNoteLineStyleKey {
  13. return CFreeTextNoteLineStyleKey
  14. } else if pKey == KMPreference.freeTextNoteDashPatternKey {
  15. return CFreeTextNoteDashPatternKey
  16. }
  17. // Line
  18. else if pKey == KMPreference.lineNoteLineWidthKey {
  19. return CLineNoteLineWidthKey
  20. } else if pKey == KMPreference.lineNoteLineStyleKey {
  21. return CLineNoteLineStyleKey
  22. } else if pKey == KMPreference.lineNoteDashPatternKey {
  23. return CLineNoteDashPatternKey
  24. } else if pKey == KMPreference.lineNoteStartLineStyleKey {
  25. return CLineNoteStartLineStyleKey
  26. } else if pKey == KMPreference.lineNoteEndLineStyleKey {
  27. return CLineNoteEndLineStyleKey
  28. }
  29. // freehand
  30. else if pKey == KMPreference.inkNoteLineWidthKey {
  31. return CInkNoteLineWidthKey
  32. } else if pKey == KMPreference.inkNoteLineStyleKey {
  33. return CInkNoteLineStyleKey
  34. } else if pKey == KMPreference.inkNoteDashPatternKey {
  35. return CInkNoteDashPatternKey
  36. }
  37. // circle
  38. else if pKey == KMPreference.circleNoteLineWidthKey {
  39. return CCircleNoteLineWidthKey
  40. } else if pKey == KMPreference.circleNoteLineStyleKey {
  41. return CCircleNoteLineStyleKey
  42. } else if pKey == KMPreference.circleNoteDashPatternKey {
  43. return CCircleNoteDashPatternKey
  44. }
  45. // rect
  46. else if pKey == KMPreference.squareNoteLineWidthKey {
  47. return CSquareNoteLineWidthKey
  48. } else if pKey == KMPreference.squareNoteLineStyleKey {
  49. return CSquareNoteLineStyleKey
  50. } else if pKey == KMPreference.squareNoteDashPatternKey {
  51. return CSquareNoteDashPatternKey
  52. }
  53. return nil
  54. }