- 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
53 lines
1.2 KiB
Swift
53 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
final class RDEPUBRuntimeChapter {
|
|
|
|
let spineIndex: Int
|
|
|
|
let href: String
|
|
|
|
let title: String
|
|
|
|
var sourceAttributedString: NSAttributedString?
|
|
|
|
let typesetAttributedString: NSAttributedString
|
|
|
|
let layouter: RDEPUBTextLayouter
|
|
|
|
let pageRanges: [NSRange]
|
|
|
|
let pages: [RDEPUBTextPage]
|
|
|
|
let chapterOffsetMap: RDEPUBChapterOffsetMap
|
|
|
|
init(
|
|
spineIndex: Int,
|
|
href: String,
|
|
title: String,
|
|
sourceAttributedString: NSAttributedString?,
|
|
typesetAttributedString: NSAttributedString,
|
|
layouter: RDEPUBTextLayouter,
|
|
pageRanges: [NSRange],
|
|
pages: [RDEPUBTextPage],
|
|
chapterOffsetMap: RDEPUBChapterOffsetMap
|
|
) {
|
|
self.spineIndex = spineIndex
|
|
self.href = href
|
|
self.title = title
|
|
self.sourceAttributedString = sourceAttributedString
|
|
self.typesetAttributedString = typesetAttributedString
|
|
self.layouter = layouter
|
|
self.pageRanges = pageRanges
|
|
self.pages = pages
|
|
self.chapterOffsetMap = chapterOffsetMap
|
|
}
|
|
|
|
func releaseSourceText() {
|
|
sourceAttributedString = nil
|
|
}
|
|
|
|
func updateCFIMap(_ cfiMap: RDEPUBCFIMap) {
|
|
chapterOffsetMap.updateCFIMap(cfiMap)
|
|
}
|
|
}
|