- Rename source module from RDReaderView to RDEpubReaderView - Move all source files from Sources/RDReaderView/ to Sources/RDEpubReaderView/ - Update podspec: RDReaderView.podspec -> RDEpubReaderView.podspec - Update Podfile, demo project, and CocoaPods config for new pod name - Delete old RDReaderView pod support files from ReadViewDemo/Pods - Add new RDEpubReaderView pod support files - Update documentation (API ref, architecture, UML, conventions, etc.) - Add FixedLayoutRotationTests - Update .gitignore: exclude .DS_Store, manual unpack backups, _ssoft-output
79 lines
1.7 KiB
Swift
79 lines
1.7 KiB
Swift
import Foundation
|
|
|
|
public enum RDEPUBNoteKind: String, Codable, Equatable {
|
|
|
|
case footnote
|
|
|
|
case endnote
|
|
|
|
case rearnote
|
|
|
|
case unknown
|
|
}
|
|
|
|
public struct RDEPUBNoteReference: Codable, Equatable {
|
|
|
|
public var sourceHref: String
|
|
|
|
public var sourceCFI: String?
|
|
|
|
public var targetHref: String
|
|
|
|
public var targetFragment: String?
|
|
|
|
public var targetCFI: String?
|
|
|
|
public var label: String?
|
|
|
|
public var kind: RDEPUBNoteKind
|
|
|
|
public init(
|
|
sourceHref: String,
|
|
sourceCFI: String? = nil,
|
|
targetHref: String,
|
|
targetFragment: String? = nil,
|
|
targetCFI: String? = nil,
|
|
label: String? = nil,
|
|
kind: RDEPUBNoteKind = .unknown
|
|
) {
|
|
self.sourceHref = sourceHref
|
|
self.sourceCFI = sourceCFI
|
|
self.targetHref = targetHref
|
|
self.targetFragment = targetFragment
|
|
self.targetCFI = targetCFI
|
|
self.label = label?.rd_nilIfEmpty
|
|
self.kind = kind
|
|
}
|
|
}
|
|
|
|
public struct RDEPUBResolvedNote: Equatable {
|
|
|
|
public var reference: RDEPUBNoteReference
|
|
|
|
public var sourceLocation: RDEPUBLocation?
|
|
|
|
public var targetLocation: RDEPUBLocation
|
|
|
|
public var title: String?
|
|
|
|
public var html: String
|
|
|
|
public var plainText: String
|
|
|
|
public init(
|
|
reference: RDEPUBNoteReference,
|
|
sourceLocation: RDEPUBLocation? = nil,
|
|
targetLocation: RDEPUBLocation,
|
|
title: String? = nil,
|
|
html: String,
|
|
plainText: String
|
|
) {
|
|
self.reference = reference
|
|
self.sourceLocation = sourceLocation
|
|
self.targetLocation = targetLocation
|
|
self.title = title?.rd_nilIfEmpty
|
|
self.html = html
|
|
self.plainText = plainText
|
|
}
|
|
}
|