├── .DS_Store ├── .gitignore ├── DUAReader.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcuserdata │ ├── mengminduan.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── nothot.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── DUAReader ├── AppDelegate.swift ├── Assets.xcassets │ ├── A+.imageset │ │ ├── A+@2x.png │ │ ├── A+@3x.png │ │ └── Contents.json │ ├── A-.imageset │ │ ├── A-@2x.png │ │ ├── A-@3x.png │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── backImg.imageset │ │ ├── Contents.json │ │ └── backImg.jpg │ ├── backImg1.imageset │ │ ├── Contents.json │ │ └── backImg1.jpg │ ├── backImg2.imageset │ │ ├── Contents.json │ │ └── backImg2.jpg │ ├── bookDir.imageset │ │ ├── Contents.json │ │ └── bookDir.png │ ├── bookMark.imageset │ │ ├── Contents.json │ │ ├── bookMark@2x.png │ │ └── bookMark@3x.png │ ├── bookMarked.imageset │ │ ├── Contents.json │ │ ├── bookMarked@2x.png │ │ └── bookMarked@3x.png │ ├── mback.imageset │ │ ├── Contents.json │ │ ├── mback@2x.png │ │ └── mback@3x.png │ └── whitePot.imageset │ │ ├── Contents.json │ │ ├── whitePot@2x.png │ │ └── whitePot@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── BookMarkButton.swift ├── Info.plist ├── Resources │ ├── 每天懂一点好玩心理学.epub │ └── 郭黄之恋.txt ├── SourceCore │ ├── Controller │ │ ├── DUABackViewController.swift │ │ ├── DUAPageViewController.swift │ │ ├── DUAReader.swift │ │ └── DUAtranslationController.swift │ ├── DataModel │ │ ├── config │ │ │ └── DUAConfiguration.swift │ │ ├── parser │ │ │ ├── DUADataParser.swift │ │ │ ├── DUAEpubDataParser.swift │ │ │ └── DUATextDataParser.swift │ │ └── storage │ │ │ ├── DUAChapterModel.swift │ │ │ └── DUAPageModel.swift │ ├── Utils │ │ ├── DUAUtils.swift │ │ └── UIView+subScript.swift │ └── Views │ │ ├── DUAAttributedView.swift │ │ ├── DUAConVexLensView.swift │ │ ├── DUAStatusBar.swift │ │ ├── DUATableView.swift │ │ └── DUATableViewCell.swift ├── SwiftLibXML2 │ └── module.modulemap ├── ThirdKit │ ├── DTCoreText.framework │ │ ├── DTCoreText │ │ ├── Headers │ │ │ ├── CTLineUtils.h │ │ │ ├── DT-Prefix.pch │ │ │ ├── DTAccessibilityElement.h │ │ │ ├── DTAccessibilityViewProxy.h │ │ │ ├── DTActivityTitleView.h │ │ │ ├── DTAnchorHTMLElement.h │ │ │ ├── DTAnimatedGIF.h │ │ │ ├── DTAttributedLabel.h │ │ │ ├── DTAttributedTextCell.h │ │ │ ├── DTAttributedTextContentView.h │ │ │ ├── DTAttributedTextView.h │ │ │ ├── DTBase64Coding.h │ │ │ ├── DTBlockFunctions.h │ │ │ ├── DTBreakHTMLElement.h │ │ │ ├── DTCSSListStyle.h │ │ │ ├── DTCSSStylesheet.h │ │ │ ├── DTColor+Compatibility.h │ │ │ ├── DTColorFunctions.h │ │ │ ├── DTCompatibility.h │ │ │ ├── DTCoreGraphicsUtils.h │ │ │ ├── DTCoreText.h │ │ │ ├── DTCoreTextConstants.h │ │ │ ├── DTCoreTextFontCollection.h │ │ │ ├── DTCoreTextFontDescriptor.h │ │ │ ├── DTCoreTextFunctions.h │ │ │ ├── DTCoreTextGlyphRun.h │ │ │ ├── DTCoreTextLayoutFrame+Cursor.h │ │ │ ├── DTCoreTextLayoutFrame.h │ │ │ ├── DTCoreTextLayoutFrameAccessibilityElementGenerator.h │ │ │ ├── DTCoreTextLayoutLine.h │ │ │ ├── DTCoreTextLayouter.h │ │ │ ├── DTCoreTextMacros.h │ │ │ ├── DTCoreTextParagraphStyle.h │ │ │ ├── DTCustomColoredAccessory.h │ │ │ ├── DTDictationPlaceholderTextAttachment.h │ │ │ ├── DTDictationPlaceholderView.h │ │ │ ├── DTExtendedFileAttributes.h │ │ │ ├── DTFolderMonitor.h │ │ │ ├── DTFoundationConstants.h │ │ │ ├── DTHTMLAttributedStringBuilder.h │ │ │ ├── DTHTMLElement.h │ │ │ ├── DTHTMLParser.h │ │ │ ├── DTHTMLParserNode.h │ │ │ ├── DTHTMLParserTextNode.h │ │ │ ├── DTHTMLWriter.h │ │ │ ├── DTHorizontalRuleHTMLElement.h │ │ │ ├── DTIframeTextAttachment.h │ │ │ ├── DTImage+HTML.h │ │ │ ├── DTImageTextAttachment.h │ │ │ ├── DTLazyImageView.h │ │ │ ├── DTLinkButton.h │ │ │ ├── DTListItemHTMLElement.h │ │ │ ├── DTLog.h │ │ │ ├── DTObjectTextAttachment.h │ │ │ ├── DTPieProgressIndicator.h │ │ │ ├── DTSmartPagingScrollView.h │ │ │ ├── DTStylesheetHTMLElement.h │ │ │ ├── DTTextAttachment.h │ │ │ ├── DTTextAttachmentHTMLElement.h │ │ │ ├── DTTextBlock.h │ │ │ ├── DTTextHTMLElement.h │ │ │ ├── DTTiledLayerWithoutFade.h │ │ │ ├── DTVersion.h │ │ │ ├── DTVideoTextAttachment.h │ │ │ ├── DTWeakSupport.h │ │ │ ├── DTWebVideoView.h │ │ │ ├── NSArray+DTError.h │ │ │ ├── NSAttributedString+DTCoreText.h │ │ │ ├── NSAttributedString+DTDebug.h │ │ │ ├── NSAttributedString+HTML.h │ │ │ ├── NSAttributedString+SmallCaps.h │ │ │ ├── NSAttributedStringRunDelegates.h │ │ │ ├── NSCharacterSet+HTML.h │ │ │ ├── NSCoder+DTCompatibility.h │ │ │ ├── NSData+DTCrypto.h │ │ │ ├── NSDictionary+DTCoreText.h │ │ │ ├── NSDictionary+DTError.h │ │ │ ├── NSFileWrapper+DTCopying.h │ │ │ ├── NSMutableArray+DTMoving.h │ │ │ ├── NSMutableAttributedString+HTML.h │ │ │ ├── NSMutableString+HTML.h │ │ │ ├── NSNumber+RomanNumerals.h │ │ │ ├── NSScanner+HTML.h │ │ │ ├── NSString+CSS.h │ │ │ ├── NSString+DTFormatNumbers.h │ │ │ ├── NSString+DTPaths.h │ │ │ ├── NSString+DTURLEncoding.h │ │ │ ├── NSString+DTUtilities.h │ │ │ ├── NSString+HTML.h │ │ │ ├── NSString+Paragraphs.h │ │ │ ├── NSURL+DTAppLinks.h │ │ │ ├── NSURL+DTComparing.h │ │ │ ├── NSURL+DTUnshorten.h │ │ │ ├── UIApplication+DTNetworkActivity.h │ │ │ ├── UIFont+DTCoreText.h │ │ │ ├── UIImage+DTFoundation.h │ │ │ ├── UIView+DTFoundation.h │ │ │ └── UIWebView+DTFoundation.h │ │ ├── Info.plist │ │ ├── Modules │ │ │ └── module.modulemap │ │ ├── _CodeSignature │ │ │ ├── CodeDirectory │ │ │ ├── CodeRequirements │ │ │ ├── CodeRequirements-1 │ │ │ ├── CodeResources │ │ │ └── CodeSignature │ │ └── default.css │ ├── TouchXML.framework │ │ ├── Headers │ │ │ ├── CTidy.h │ │ │ ├── CXHTMLDocument.h │ │ │ ├── CXMLDocument.h │ │ │ ├── CXMLDocument_CreationExtensions.h │ │ │ ├── CXMLDocument_PrivateExtensions.h │ │ │ ├── CXMLElement.h │ │ │ ├── CXMLElement_CreationExtensions.h │ │ │ ├── CXMLElement_ElementTreeExtensions.h │ │ │ ├── CXMLNamespaceNode.h │ │ │ ├── CXMLNode.h │ │ │ ├── CXMLNode_CreationExtensions.h │ │ │ ├── CXMLNode_PrivateExtensions.h │ │ │ ├── CXMLNode_XPathExtensions.h │ │ │ ├── CXMLUnsupportedNode.h │ │ │ └── TouchXML.h │ │ ├── Info.plist │ │ ├── Modules │ │ │ └── module.modulemap │ │ └── TouchXML │ └── ZipArchive.framework │ │ ├── Headers │ │ └── ZipArchive.h │ │ ├── Info.plist │ │ ├── Modules │ │ └── module.modulemap │ │ └── ZipArchive ├── ViewController.swift ├── bottomMenu.xib └── topMenu.xib ├── README.md └── reader.gif /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | DUAReader.xcodeproj/project.xcworkspace/xcuserdata/ 2 | DUAReader/DUAReader.xcodeproj/xcuserdata/ -------------------------------------------------------------------------------- /DUAReader.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DUAReader.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DUAReader.xcodeproj/xcuserdata/mengminduan.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DUAReader.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DUAReader.xcodeproj/xcuserdata/nothot.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /DUAReader.xcodeproj/xcuserdata/nothot.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DUAReader.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DUAReader/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A+.imageset/A+@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/A+.imageset/A+@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A+.imageset/A+@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/A+.imageset/A+@3x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A+.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "A+@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "A+@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A-.imageset/A-@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/A-.imageset/A-@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A-.imageset/A-@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/A-.imageset/A-@3x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/A-.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "A-@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "A-@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "backImg.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg.imageset/backImg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/backImg.imageset/backImg.jpg -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "backImg1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg1.imageset/backImg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/backImg1.imageset/backImg1.jpg -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "backImg2.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/backImg2.imageset/backImg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/backImg2.imageset/backImg2.jpg -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookDir.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bookDir.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookDir.imageset/bookDir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/bookDir.imageset/bookDir.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMark.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bookMark@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "bookMark@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMark.imageset/bookMark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/bookMark.imageset/bookMark@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMark.imageset/bookMark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/bookMark.imageset/bookMark@3x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMarked.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bookMarked@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "bookMarked@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMarked.imageset/bookMarked@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/bookMarked.imageset/bookMarked@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/bookMarked.imageset/bookMarked@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/bookMarked.imageset/bookMarked@3x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/mback.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mback@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mback@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/mback.imageset/mback@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/mback.imageset/mback@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/mback.imageset/mback@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/mback.imageset/mback@3x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/whitePot.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "whitePot@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "whitePot@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/whitePot.imageset/whitePot@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/whitePot.imageset/whitePot@2x.png -------------------------------------------------------------------------------- /DUAReader/Assets.xcassets/whitePot.imageset/whitePot@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Assets.xcassets/whitePot.imageset/whitePot@3x.png -------------------------------------------------------------------------------- /DUAReader/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /DUAReader/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 32 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /DUAReader/BookMarkButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BookMarkButton.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2018/1/12. 6 | // Copyright © 2018年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class BookMarkButton: UIButton { 12 | 13 | 14 | var isClicked = false { 15 | didSet { 16 | if isClicked { 17 | self.setImage(UIImage.init(named: "bookMarked"), for: .normal) 18 | }else { 19 | setImage(UIImage.init(named: "bookMark"), for: .normal) 20 | } 21 | } 22 | } 23 | 24 | /* 25 | // Only override draw() if you perform custom drawing. 26 | // An empty implementation adversely affects performance during animation. 27 | override func draw(_ rect: CGRect) { 28 | // Drawing code 29 | } 30 | */ 31 | 32 | } 33 | -------------------------------------------------------------------------------- /DUAReader/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DUAReader/Resources/每天懂一点好玩心理学.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/Resources/每天懂一点好玩心理学.epub -------------------------------------------------------------------------------- /DUAReader/SourceCore/Controller/DUABackViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUABackViewController.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUABackViewController: UIViewController { 12 | 13 | var index: Int = 1 14 | var chapterBelong: Int = 1 15 | var backImage: UIImage? 16 | 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | 21 | let imageView = UIImageView.init(frame: CGRect(x: 0, y: 0, width: self.view.width, height: self.view.height)) 22 | imageView.image = self.backImage 23 | self.view.addSubview(imageView) 24 | } 25 | 26 | func grabViewController(viewController: DUAPageViewController) -> Void { 27 | self.index = viewController.index 28 | self.chapterBelong = viewController.chapterBelong 29 | let rect = viewController.view.bounds 30 | UIGraphicsBeginImageContextWithOptions(rect.size, true, 0.0) 31 | let context = UIGraphicsGetCurrentContext() 32 | let transform = CGAffineTransform(a: -1.0, b: 0.0, c: 0.0, d: 1.0, tx: rect.size.width, ty: 0.0) 33 | context?.concatenate(transform) 34 | viewController.view.layer.render(in: context!) 35 | self.backImage = UIGraphicsGetImageFromCurrentImageContext() 36 | UIGraphicsEndImageContext() 37 | } 38 | 39 | override func didReceiveMemoryWarning() { 40 | super.didReceiveMemoryWarning() 41 | // Dispose of any resources that can be recreated. 42 | } 43 | 44 | 45 | /* 46 | // MARK: - Navigation 47 | 48 | // In a storyboard-based application, you will often want to do a little preparation before navigation 49 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 50 | // Get the new view controller using segue.destinationViewController. 51 | // Pass the selected object to the new view controller. 52 | } 53 | */ 54 | 55 | } 56 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Controller/DUAPageViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAPageViewController.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUAContainerPageViewController: UIPageViewController { 12 | var willStepIntoNextChapter = false 13 | var willStepIntoLastChapter = false 14 | 15 | } 16 | 17 | class DUAtranslationControllerExt: DUAtranslationController { 18 | var willStepIntoNextChapter = false 19 | var willStepIntoLastChapter = false 20 | } 21 | 22 | class DUAPageViewController: UIViewController { 23 | 24 | var index: Int = 1 25 | var chapterBelong: Int = 1 26 | var backgroundImage: UIImage? 27 | 28 | 29 | 30 | override func viewDidLoad() { 31 | super.viewDidLoad() 32 | self.view.backgroundColor = UIColor.white 33 | 34 | if backgroundImage != nil { 35 | let imageView = UIImageView.init(frame: self.view.frame) 36 | imageView.image = backgroundImage 37 | self.view.insertSubview(imageView, at: 0) 38 | } 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/DataModel/config/DUAConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAConfig.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum DUAReaderScrollType: Int { 12 | case curl 13 | case horizontal 14 | case vertical 15 | case none 16 | } 17 | 18 | enum DUAReaderBookType { 19 | case txt 20 | case epub 21 | } 22 | 23 | class DUAConfiguration: NSObject { 24 | 25 | var contentFrame = CGRect() 26 | var lineHeightMutiplier: CGFloat = 2 { 27 | didSet { 28 | self.didLineHeightChanged(lineHeightMutiplier) 29 | } 30 | } 31 | var fontSize: CGFloat = 15 { 32 | didSet { 33 | self.didFontSizeChanged(fontSize) 34 | } 35 | } 36 | var fontName:String! { 37 | didSet { 38 | self.didFontNameChanged(fontName) 39 | } 40 | } 41 | var backgroundImage:UIImage! { 42 | didSet { 43 | self.didBackgroundImageChanged(backgroundImage) 44 | } 45 | } 46 | 47 | var scrollType = DUAReaderScrollType.curl { 48 | didSet { 49 | self.didScrollTypeChanged(scrollType) 50 | } 51 | } 52 | 53 | var bookType = DUAReaderBookType.txt 54 | 55 | 56 | var didFontSizeChanged: (CGFloat) -> Void = {_ in } 57 | var didFontNameChanged: (String) -> Void = {_ in } 58 | var didBackgroundImageChanged: (UIImage) -> Void = {_ in } 59 | var didLineHeightChanged: (CGFloat) -> Void = {_ in } 60 | var didScrollTypeChanged: (DUAReaderScrollType) -> Void = {_ in } 61 | 62 | 63 | override init() { 64 | super.init() 65 | let font = UIFont.systemFont(ofSize: self.fontSize) 66 | self.fontName = font.fontName 67 | let safeAreaTopHeight: CGFloat = UIScreen.main.bounds.size.height == 812.0 ? 24 : 0 68 | let safeAreaBottomHeight: CGFloat = UIScreen.main.bounds.size.height == 812.0 ? 34 : 0 69 | self.contentFrame = CGRect(x: 30, y: 30 + safeAreaTopHeight, width: UIScreen.main.bounds.size.width - 60, height: UIScreen.main.bounds.size.height - 60.0 - safeAreaTopHeight - safeAreaBottomHeight) 70 | 71 | 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/DataModel/parser/DUADataParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUADataParser.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import DTCoreText 11 | 12 | class DUADataParser: NSObject { 13 | 14 | func parseChapterFromBook(path: String, completeHandler: @escaping (Array, Array) -> Void) { 15 | 16 | } 17 | 18 | func attributedStringFromChapterModel(chapter: DUAChapterModel, config: DUAConfiguration) -> NSAttributedString? { 19 | return nil 20 | } 21 | 22 | func cutPageWith(attrString: NSAttributedString, config: DUAConfiguration, completeHandler: (Int, DUAPageModel, Bool) -> Void) -> Void { 23 | let layouter = DTCoreTextLayouter.init(attributedString: attrString) 24 | let rect = CGRect(x: config.contentFrame.origin.x, y: config.contentFrame.origin.y, width: config.contentFrame.size.width, height: config.contentFrame.size.height - 5) 25 | var frame = layouter?.layoutFrame(with: rect, range: NSRange(location: 0, length: attrString.length)) 26 | 27 | var pageVisibleRange = frame?.visibleStringRange() 28 | var rangeOffset = pageVisibleRange!.location + pageVisibleRange!.length 29 | var count = 1 30 | 31 | while rangeOffset <= attrString.length && rangeOffset != 0 { 32 | let pageModel = DUAPageModel.init() 33 | pageModel.attributedString = attrString.attributedSubstring(from: pageVisibleRange!) 34 | pageModel.range = pageVisibleRange 35 | pageModel.pageIndex = count - 1 36 | 37 | frame = layouter?.layoutFrame(with: rect, range: NSRange(location: rangeOffset, length: attrString.length - rangeOffset)) 38 | pageVisibleRange = frame?.visibleStringRange() 39 | if pageVisibleRange == nil { 40 | rangeOffset = 0 41 | }else { 42 | rangeOffset = pageVisibleRange!.location + pageVisibleRange!.length 43 | } 44 | 45 | let completed = (rangeOffset <= attrString.length && rangeOffset != 0) ? false : true 46 | completeHandler(count, pageModel, completed) 47 | count += 1 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/DataModel/parser/DUAEpubDataParser.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAEpubDataParser.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/27. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import DTCoreText 11 | 12 | class DUAEpubDataParser: DUADataParser { 13 | 14 | override func parseChapterFromBook(path: String, completeHandler: @escaping (Array, Array) -> Void) { 15 | let epubZippedPath = DUAUtils.unzipWith(filePath: path) 16 | let opfPath = DUAUtils.OPFPathFrom(epubPath: epubZippedPath) 17 | let chapterInfoArray = DUAUtils.parseOPF(opfPath: opfPath) 18 | var titleArray: [String] = [] 19 | var models: [DUAChapterModel] = [] 20 | 21 | var chapterIndexOffset = false 22 | if Int(chapterInfoArray.first!["chapterIndex"]!)! == 0 { 23 | chapterIndexOffset = true 24 | } 25 | 26 | for item in chapterInfoArray { 27 | titleArray.append(item["chapterTitle"]!) 28 | let chapter = DUAChapterModel() 29 | chapter.chapterIndex = chapterIndexOffset ? Int(item["chapterIndex"]!)! + 1 : Int(item["chapterIndex"]!)! 30 | chapter.path = item["chapterPath"] 31 | chapter.title = item["chapterIndex"] 32 | models.append(chapter) 33 | } 34 | completeHandler(titleArray, models) 35 | } 36 | 37 | override func attributedStringFromChapterModel(chapter: DUAChapterModel, config: DUAConfiguration) -> NSAttributedString? { 38 | let htmlData = try? Data.init(contentsOf: URL.init(fileURLWithPath: chapter.path!)) 39 | if htmlData == nil { 40 | return nil 41 | } 42 | 43 | let options = [ 44 | DTDefaultFontFamily : "Times New Roman", 45 | DTDefaultLinkColor : "purple", 46 | NSTextSizeMultiplierDocumentOption : 1.0, 47 | DTDefaultFontSize : config.fontSize, 48 | DTDefaultLineHeightMultiplier : config.lineHeightMutiplier, 49 | DTDefaultTextAlignment : "0", 50 | DTDefaultHeadIndent : "0.0", 51 | NSBaseURLDocumentOption : URL.init(fileURLWithPath: chapter.path!), 52 | DTMaxImageSize : config.contentFrame.size, 53 | ] as [String : Any] 54 | let attrString: NSAttributedString? = NSAttributedString.init(htmlData: htmlData, options: options, documentAttributes: nil) 55 | 56 | return attrString 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/DataModel/storage/DUAChapterModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAChapterModel.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUAChapterModel: NSObject { 12 | 13 | var title: String? 14 | var path: String? 15 | var chapterIndex: Int = 1 16 | } 17 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/DataModel/storage/DUAPageModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAPageModel.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUAPageModel: NSObject { 12 | 13 | var attributedString: NSAttributedString? 14 | var range: NSRange? 15 | var pageIndex: Int = 1 16 | 17 | } 18 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Utils/UIView+subScript.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+subScript.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/27. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIView { 12 | 13 | public var x: CGFloat{ 14 | get{ 15 | return self.frame.origin.x 16 | } 17 | set{ 18 | var r = self.frame 19 | r.origin.x = newValue 20 | self.frame = r 21 | } 22 | } 23 | 24 | public var y: CGFloat{ 25 | get{ 26 | return self.frame.origin.y 27 | } 28 | set{ 29 | var r = self.frame 30 | r.origin.y = newValue 31 | self.frame = r 32 | } 33 | } 34 | 35 | public var width: CGFloat{ 36 | get{ 37 | return self.frame.size.width 38 | } 39 | set{ 40 | var r = self.frame 41 | r.size.width = newValue 42 | self.frame = r 43 | } 44 | } 45 | public var height: CGFloat{ 46 | get{ 47 | return self.frame.size.height 48 | } 49 | set{ 50 | var r = self.frame 51 | r.size.height = newValue 52 | self.frame = r 53 | } 54 | } 55 | 56 | 57 | public var origin: CGPoint{ 58 | get{ 59 | return self.frame.origin 60 | } 61 | set{ 62 | self.x = newValue.x 63 | self.y = newValue.y 64 | } 65 | } 66 | 67 | public var size: CGSize{ 68 | get{ 69 | return self.frame.size 70 | } 71 | set{ 72 | self.width = newValue.width 73 | self.height = newValue.height 74 | } 75 | } 76 | 77 | public var centerX : CGFloat{ 78 | get{ 79 | return self.center.x 80 | } 81 | set{ 82 | self.center = CGPoint(x: newValue, y: self.center.y) 83 | } 84 | } 85 | 86 | public var centerY : CGFloat{ 87 | get{ 88 | return self.center.y 89 | } 90 | set{ 91 | self.center = CGPoint(x: self.center.x, y: newValue) 92 | } 93 | } 94 | 95 | public var rightX: CGFloat{ 96 | get{ 97 | return self.x + self.width 98 | } 99 | set{ 100 | var r = self.frame 101 | r.origin.x = newValue - frame.size.width 102 | self.frame = r 103 | } 104 | } 105 | 106 | public var bottomY: CGFloat{ 107 | get{ 108 | return self.y + self.height 109 | } 110 | set{ 111 | var r = self.frame 112 | r.origin.y = newValue - frame.size.height 113 | self.frame = r 114 | } 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Views/DUAConVexLensView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAConVexLensView.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2018/1/18. 6 | // Copyright © 2018年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUAConVexLensView: UIView { 12 | 13 | var locatePoint: CGPoint = CGPoint() { 14 | didSet { 15 | self.center = CGPoint(x: locatePoint.x, y: locatePoint.y - 80) 16 | self.setNeedsDisplay() 17 | } 18 | } 19 | 20 | 21 | override init(frame: CGRect) { 22 | super.init(frame: frame) 23 | 24 | self.layer.borderWidth = 3 25 | self.layer.borderColor = UIColor.lightGray.cgColor 26 | self.layer.cornerRadius = 60 27 | self.layer.masksToBounds = true 28 | } 29 | 30 | init() { 31 | 32 | super.init(frame: CGRect(x: 0, y: 0, width: 120, height: 120)) 33 | 34 | self.layer.borderWidth = 3 35 | self.layer.borderColor = UIColor.lightGray.cgColor 36 | self.layer.cornerRadius = 60 37 | self.layer.masksToBounds = true 38 | } 39 | 40 | required init?(coder aDecoder: NSCoder) { 41 | fatalError("init(coder:) has not been implemented") 42 | } 43 | 44 | override func draw(_ rect: CGRect) { 45 | 46 | let ctx = UIGraphicsGetCurrentContext() 47 | 48 | ctx?.translateBy(x: self.frame.width/2, y: self.frame.height/2) 49 | ctx?.scaleBy(x: 1.5, y: 1.5) 50 | ctx?.translateBy(x: -1 * locatePoint.x, y: -1 * (locatePoint.y + 20)) 51 | UIApplication.shared.keyWindow?.layer.render(in: ctx!) 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Views/DUAStatusBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUAStatusBar.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/26. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class DUAStatusBar: UIView { 12 | 13 | var totalPageCounts = 1 14 | { 15 | didSet { 16 | let text = "第" + String(curPageIndex) + "/" + String(totalPageCounts) + "页" 17 | label.textAlignment = .center 18 | label.text = text 19 | label.textColor = UIColor.gray 20 | label.font = UIFont.systemFont(ofSize: 11) 21 | label.sizeToFit() 22 | } 23 | } 24 | var curPageIndex = 1 25 | { 26 | didSet { 27 | let text = "第" + String(curPageIndex + 1) + "/" + String(totalPageCounts) + "页" 28 | label.textAlignment = .center 29 | label.text = text 30 | label.textColor = UIColor.gray 31 | label.font = UIFont.systemFont(ofSize: 11) 32 | label.sizeToFit() 33 | } 34 | } 35 | 36 | var label = UILabel() 37 | 38 | 39 | override init(frame: CGRect) { 40 | super.init(frame: frame) 41 | 42 | self.addSubview(label) 43 | } 44 | 45 | required public init?(coder aDecoder: NSCoder) { 46 | super.init(coder: aDecoder) 47 | } 48 | 49 | 50 | override func layoutSubviews() { 51 | super.layoutSubviews() 52 | label.origin = CGPoint(x: self.width - label.bounds.size.width, y: 3) 53 | 54 | } 55 | /* 56 | // Only override draw() if you perform custom drawing. 57 | // An empty implementation adversely affects performance during animation. 58 | override func draw(_ rect: CGRect) { 59 | // Drawing code 60 | } 61 | */ 62 | 63 | } 64 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Views/DUATableView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUATableView.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/28. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | enum tableViewScrollDirecton { 12 | case up 13 | case down 14 | case unknown 15 | } 16 | 17 | class DUATableView: UITableView { 18 | 19 | var dataArray: [DUAPageModel] = [] 20 | var cellIndex: Int = 0 21 | var isReloading = false 22 | var arrivedZeroOffset = false 23 | var scrollDirection = tableViewScrollDirecton.unknown 24 | 25 | /* 26 | // Only override draw() if you perform custom drawing. 27 | // An empty implementation adversely affects performance during animation. 28 | override func draw(_ rect: CGRect) { 29 | // Drawing code 30 | } 31 | */ 32 | 33 | } 34 | -------------------------------------------------------------------------------- /DUAReader/SourceCore/Views/DUATableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DUATableViewCell.swift 3 | // DUAReader 4 | // 5 | // Created by mengminduan on 2017/12/29. 6 | // Copyright © 2017年 nothot. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import DTCoreText 11 | 12 | class DUATableViewCell: UITableViewCell { 13 | 14 | var dtLabel: DTAttributedLabel! 15 | 16 | 17 | override func awakeFromNib() { 18 | super.awakeFromNib() 19 | // Initialization code 20 | } 21 | 22 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 23 | super.init(style: style, reuseIdentifier: reuseIdentifier) 24 | self.selectionStyle = .none 25 | self.backgroundColor = UIColor.clear 26 | 27 | // self.layer.borderColor = UIColor.gray.cgColor 28 | // self.layer.borderWidth = 1 29 | } 30 | 31 | required init?(coder aDecoder: NSCoder) { 32 | super.init(coder: aDecoder) 33 | } 34 | 35 | func configCellWith(pageModel: DUAPageModel, config: DUAConfiguration) -> Void { 36 | dtLabel = DTAttributedLabel.init(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: config.contentFrame.height)) 37 | dtLabel.backgroundColor = UIColor.clear 38 | dtLabel.edgeInsets = UIEdgeInsetsMake(0, config.contentFrame.origin.x, 0, config.contentFrame.origin.x) 39 | self.contentView.addSubview(dtLabel) 40 | dtLabel.attributedString = pageModel.attributedString 41 | 42 | } 43 | 44 | 45 | override func setSelected(_ selected: Bool, animated: Bool) { 46 | super.setSelected(selected, animated: animated) 47 | 48 | // Configure the view for the selected state 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /DUAReader/SwiftLibXML2/module.modulemap: -------------------------------------------------------------------------------- 1 | //module SwiftLibXML2 [system] { 2 | // header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h" 3 | // export * 4 | //} 5 | 6 | //module libxmlModuleDevice { 7 | // header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h" 8 | // export * 9 | //} 10 | 11 | module SwiftLibXML2 { 12 | header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/libxml2/libxml/tree.h" 13 | header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h" 14 | export * 15 | } 16 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/DTCoreText: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/DTCoreText -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/CTLineUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTLineUtils.h 3 | // DTCoreText 4 | // 5 | // Created by Oleksandr Deundiak on 7/15/15. 6 | // Copyright 2015. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | BOOL areLinesEqual(CTLineRef line1, CTLineRef line2); 12 | CFIndex getTruncationIndex(CTLineRef line, CTLineRef trunc); 13 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DT-Prefix.pch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #ifdef __OBJC__ 6 | 7 | #import 8 | #import 9 | #import "DTCoreTextConstants.h" 10 | 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAccessibilityElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTAccessibilityElement.h 3 | // DTCoreText 4 | // 5 | // Created by Austen Green on 3/13/13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | A UIAccessibilityElement subclass that automatically converts its local accessibilityFrame to screen coordinates. 13 | */ 14 | @interface DTAccessibilityElement : UIAccessibilityElement 15 | /** 16 | The frame for the accessibility element in terms of the receiver's superview. 17 | */ 18 | @property (nonatomic, assign) CGRect localCoordinateAccessibilityFrame; 19 | 20 | /** 21 | The point for activating accessibility events in terms of the receiver's superview. 22 | */ 23 | @property (nonatomic, assign) CGPoint localCoordinateAccessibilityActivationPoint; 24 | 25 | /** 26 | The designated initializer. This class should be initialized with a UIView as its accessibility container. 27 | @param parentView The logical superview for the onscreen element the receiver represents. 28 | @returns Returns an initialized DTAccessibilityElement */ 29 | 30 | - (id)initWithParentView:(UIView *)parentView; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAccessibilityViewProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTAccessibilityViewProxy.h 3 | // DTCoreText 4 | // 5 | // Created by Austen Green on 5/6/13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DTTextAttachment.h" 11 | 12 | @protocol DTAccessibilityViewProxyDelegate; 13 | 14 | /** 15 | UIView proxy for DTAttributedTextContentView custom subviews for text attachments. 16 | */ 17 | 18 | @interface DTAccessibilityViewProxy : NSProxy 19 | /** 20 | The delegate for the proxy 21 | */ 22 | @property (nonatomic, unsafe_unretained, readonly) id delegate; 23 | 24 | /** 25 | The text attachment represented by the proxy 26 | */ 27 | @property (nonatomic, strong, readonly) DTTextAttachment *textAttachment; 28 | 29 | /** 30 | Creates a text attachment proxy for use with the VoiceOver system. 31 | @param textAttachment The that will be represented by a view. 32 | @param delegate An object conforming to that will provide a view when needed by the proxy. 33 | @returns A new proxy object 34 | */ 35 | 36 | - (id)initWithTextAttachment:(DTTextAttachment *)textAttachment delegate:(id)delegate; 37 | 38 | @end 39 | 40 | /** 41 | Protocol to provide custom views for accessibility elements representing a DTTextAttachment. 42 | */ 43 | @protocol DTAccessibilityViewProxyDelegate 44 | @required 45 | /** 46 | Provides a view for an attachment, e.g. an imageView for images 47 | 48 | @param attachment The that the requested view should represent 49 | @param proxy The frame that the view should use to fit on top of the space reserved for the attachment. 50 | @returns The sender requesting the view. 51 | */ 52 | 53 | - (UIView *)viewForTextAttachment:(DTTextAttachment *)attachment proxy:(DTAccessibilityViewProxy *)proxy; 54 | @end -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTActivityTitleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTActivityTitleView.h 3 | // DTFoundation 4 | // 5 | // Created by Rene Pirringer on 12.09.12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Alternative view for showing titles with a configurable activity indicator 11 | instead of default title view in navigationItem. 12 | */ 13 | @interface DTActivityTitleView : UIView 14 | 15 | /** 16 | Title that is shown 17 | */ 18 | @property (nonatomic, copy) NSString *title; 19 | 20 | /** 21 | When busy is set to YES the activity indicator starts spinning 22 | When set to NO the activity indicator stops spinning 23 | */ 24 | @property (nonatomic, assign) BOOL busy; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAnchorHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementA.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 21.03.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of that represents a hyperlink. 13 | */ 14 | @interface DTAnchorHTMLElement : DTHTMLElement 15 | 16 | /** 17 | Foreground text color of the receiver when highlighted 18 | */ 19 | @property (nonatomic, strong) DTColor *highlightedTextColor; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAnimatedGIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTAnimatedGIF.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 7/2/14. 6 | // Copyright (c) 2014 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | Loads an animated GIF from file, compatible with UIImageView 12 | */ 13 | UIImage *DTAnimatedGIFFromFile(NSString *path); 14 | 15 | /** 16 | Loads an animated GIF from data, compatible with UIImageView 17 | */ 18 | UIImage *DTAnimatedGIFFromData(NSData *data); 19 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAttributedLabel.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTAttributedLabel.h 3 | // DTCoreText 4 | // 5 | // Created by Brian Kenny on 1/17/13. 6 | // Copyright (c) 2013 Cocoanetics.com. All rights reserved. 7 | // 8 | 9 | #import "DTAttributedTextContentView.h" 10 | 11 | /** 12 | A Rich Text replacement for `UILabel`. It inherits from and as such you can also set the delegate to provide custom subviews i.e. for images or hyperlinks. 13 | 14 | Contrary to DTAttributedTextContentView the intrinsicContentSize is only as wide as the text content. To shrink the DTAttributedLabel to that call -sizeToFit. 15 | */ 16 | 17 | @interface DTAttributedLabel : DTAttributedTextContentView 18 | 19 | /** 20 | @name Setting Attributes 21 | */ 22 | 23 | /** 24 | The number of lines to display in the receiver 25 | */ 26 | @property(nonatomic, assign) NSInteger numberOfLines; 27 | 28 | /** 29 | The line break mode of the receiver 30 | */ 31 | @property(nonatomic, assign) NSLineBreakMode lineBreakMode; 32 | 33 | /** 34 | The string to append to the visible string in case a truncation occurs 35 | */ 36 | @property(nonatomic, strong) NSAttributedString *truncationString; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTAttributedTextCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTAttributedTextCell.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 8/4/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTAttributedTextContentView.h" 10 | //#import 11 | #import "DTWeakSupport.h" 12 | 13 | /** 14 | This class represents a tableview cell that contains an attributed text as its content. 15 | */ 16 | @interface DTAttributedTextCell : UITableViewCell 17 | 18 | /** 19 | @name Creating Cells 20 | */ 21 | 22 | /** 23 | Creates a tableview cell with a given reuse identifier. 24 | @param reuseIdentifier The reuse identifier to use for the cell 25 | @returns A prepared cell 26 | */ 27 | - (id)initWithReuseIdentifier:(NSString *)reuseIdentifier; 28 | 29 | /** 30 | @name Setting Attributed Content 31 | */ 32 | 33 | /** 34 | The attributed string content of the receiver 35 | */ 36 | @property (nonatomic, strong) NSAttributedString *attributedString; 37 | 38 | /** 39 | A delegate implementing DTAttributedTextContentViewDelegate to provide custom subviews for images and links. 40 | */ 41 | @property (nonatomic, DT_WEAK_PROPERTY) IBOutlet id textDelegate; 42 | 43 | /** 44 | This method allows to set HTML text directly as content of the receiver. 45 | 46 | This will be converted to an attributed string. 47 | @param html The HTML string to set as the receiver's text content 48 | */ 49 | - (void)setHTMLString:(NSString *)html; 50 | 51 | /** 52 | This method allows to set HTML text directly as content of the receiver. 53 | 54 | This will be converted to an attributed string. 55 | @param html The HTML string to set as the receiver's text content 56 | @param options The options used for rendering the HTML 57 | */ 58 | - (void) setHTMLString:(NSString *)html options:(NSDictionary*) options; 59 | 60 | 61 | /** 62 | @name Getting Information 63 | */ 64 | 65 | /** 66 | Determines the row height that is needed in a specific table view to show the entire text content. 67 | 68 | The table view is necessary because from this the method can know the style. Also the accessory type needs to be set before calling this method because this reduces the available space. 69 | @note This value is only useful for table views with variable row height. 70 | @param tableView The table view to determine the height for. 71 | */ 72 | - (CGFloat)requiredRowHeightInTableView:(UITableView *)tableView; 73 | 74 | /** 75 | Determines whether the cells built-in contentView is allowed to dictate the size available for text. If active then attributedTextContextView's height always matches the cell height. 76 | 77 | Set this to `YES` for use in fixed row height table views, leave it `NO` for flexible row height table views. 78 | */ 79 | @property (nonatomic, assign) BOOL hasFixedRowHeight; 80 | 81 | /** 82 | The attributed text content view that the receiver uses to display the attributed text content. 83 | */ 84 | @property (nonatomic, readonly) DTAttributedTextContentView *attributedTextContextView; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTBase64Coding.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTBase64Coding.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 04.03.13. 6 | // Copyright (c) 2013 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Utility class for encoding and decoding data in base64 format. 11 | 12 | This was formerly a category on `NSData` but since Matt Gallagher's category has become so enormously popular people where reporting more and more conflicts. Thus we decided to move it into a properly named class. 13 | 14 | Since all methods are class methods you never need to actually initialize it, doing so will raises a `DTAbstractClassException`. 15 | */ 16 | 17 | @interface DTBase64Coding : NSObject 18 | 19 | /** 20 | Encoding and Decoding 21 | */ 22 | 23 | /** 24 | Encodes data as base64 string. 25 | @param data The data to encode 26 | @returns The encoded string 27 | */ 28 | + (NSString *)stringByEncodingData:(NSData *)data; 29 | 30 | /** 31 | Encodes data as base64 string. 32 | @param string The string with data encoded in base64 format 33 | @returns data The decoded data 34 | */ 35 | + (NSData *)dataByDecodingString:(NSString *)string; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTBlockFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTBlockFunctions.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 02.10.13. 6 | // Copyright (c) 2013 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Block Utility Methods 11 | */ 12 | 13 | /** 14 | Performs a block synchronous if execution is currently on the main thread or dispatches it asynchronously if not 15 | @param block The block to execute 16 | */ 17 | void DTBlockPerformSyncIfOnMainThreadElseAsync(void (^block)(void)); 18 | 19 | /** 20 | Performs a block synchronous on the main thread regardless of the current thread 21 | @param block The block to execute 22 | */ 23 | void DTBlockPerformSyncOnMainThread(void (^block)(void)); 24 | 25 | 26 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTBreakHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementBR.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of that represents a line break. 13 | */ 14 | 15 | @interface DTBreakHTMLElement : DTHTMLElement 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCSSStylesheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCSSStylesheet.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 9/5/11. 6 | // Copyright (c) 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class DTHTMLElement; 12 | 13 | /** 14 | This class represents a CSS style sheet used for specifying formatting for certain CSS selectors. 15 | 16 | It supports matching styles by class, by id or by tag name. Hierarchy matching is not supported yet. 17 | */ 18 | @interface DTCSSStylesheet : NSObject 19 | 20 | 21 | /** 22 | @name Creating Stylesheets 23 | */ 24 | 25 | /** 26 | Creates the default stylesheet. 27 | 28 | This stylesheet is based on the standard styles that Webkit provides for these tags. This stylesheet is loaded from an embedded copy of default.css. 29 | */ 30 | + (DTCSSStylesheet *)defaultStyleSheet; 31 | 32 | 33 | /** 34 | Creates a stylesheet with a given style block 35 | 36 | @param css The CSS string for the style block 37 | */ 38 | - (id)initWithStyleBlock:(NSString *)css; 39 | 40 | 41 | /** 42 | @name Working with CSS Style Blocks 43 | */ 44 | 45 | 46 | /** 47 | Parses a style block string and adds the found style rules to the receiver. 48 | 49 | @param css The CSS string for the style block 50 | */ 51 | - (void)parseStyleBlock:(NSString *)css; 52 | 53 | 54 | /** 55 | Merges styles from given stylesheet into the receiver 56 | 57 | @param stylesheet the stylesheet to merge 58 | */ 59 | - (void)mergeStylesheet:(DTCSSStylesheet *)stylesheet; 60 | 61 | 62 | /** 63 | @name Accessing Style Information 64 | */ 65 | 66 | /** 67 | Returns a dictionary that contains the merged style for a given element and the applicable style rules from the receiver. 68 | 69 | @param element The HTML element. 70 | @param matchedSelectors The CSS selectors that caused a match 71 | @param ignoreInlineStyle If `YES` then the inline styles of the element will be ignored and only the receiver's styles used 72 | @returns The merged style dictionary containing only styles which selector matches the element 73 | */ 74 | - (NSDictionary *)mergedStyleDictionaryForElement:(DTHTMLElement *)element matchedSelectors:(NSSet * __autoreleasing*)matchedSelectors ignoreInlineStyle:(BOOL)ignoreInlineStyle; 75 | 76 | /** 77 | Returns a dictionary of the styles of the receiver 78 | */ 79 | - (NSDictionary *)styles; 80 | 81 | /** 82 | Returns an ordered (by declaration) set of the selectors for all of the styles. 83 | */ 84 | - (NSArray *)orderedSelectors; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTColor+Compatibility.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTColor+Compatibility.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/9/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #if TARGET_OS_IPHONE 12 | 13 | #import 14 | 15 | /** 16 | Implementations of methods on NSColor/UIColor which are missing on the other platform. 17 | */ 18 | @interface UIColor (HTML) 19 | 20 | 21 | /** 22 | A quick method to return the alpha component of this UIColor by using the CGColorGetAlpha method. 23 | @returns The floating point alpha value of this UIColor. 24 | */ 25 | - (CGFloat)alphaComponent; 26 | 27 | @end 28 | 29 | #else 30 | 31 | /** 32 | Methods used to work with HTML representations of colors. 33 | */ 34 | @interface NSColor (HTML) 35 | 36 | 37 | /** 38 | Return a string hexadecimal representation of this NSColor. Splits the color into components with CGColor methods, re-maps them from percentages in the range 0-255, and returns the RGB color (alpha is stripped) in a six character string. 39 | @returns A CSS hexadecimal NSString specifying this NSColor. 40 | */ 41 | //- (NSString *)htmlHexString; 42 | 43 | #if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_7 44 | /** 45 | Converts a CGColorRef into an NSColor by placing each component into an NSColor and pending on the component count to return a grayscale or rgb color. If there are not 2 (grayscale) or 4 (rgba) components the color is from an unsupported color space and nil is returned. 46 | @param cgColor The CGColorRef to convert 47 | @returns An NSColor of this CGColorRef 48 | */ 49 | + (NSColor *)colorWithCGColor:(CGColorRef)cgColor; 50 | 51 | /** 52 | Converts an NSColor into a CGColorRef. 53 | @returns A CGColorRef of this NSColor 54 | */ 55 | - (CGColorRef)CGColor DT_RETURNS_INNER_POINTER; 56 | #endif 57 | 58 | @end 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTColorFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTColorFunctions.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 9/9/13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | @class DTColor; 10 | 11 | /** 12 | Takes a CSS color string ('333', 'F9FFF9'), determines the RGB values used, and returns a UIColor object of that color. 13 | For each part of the RGB color those numbers for that color are converted to a number using a category on NSString. Then that number is divided by the maximum value, 15 for 3 character strings and 255 for 6 character strings, making the color a percentage and within the range 0.0 and 1.0 that UIColor uses. 14 | @param hexString A CSS hexadecimal color string of length 6 or 3. 15 | @returns A UIColor object generated from the hexadecimal color string with alpha 1.0. 16 | */ 17 | DTColor *DTColorCreateWithHexString(NSString *hexString); 18 | 19 | 20 | /** 21 | Takes an English string representing a color and maps it to a numeric RGB value as declared by the HTML and CSS specifications (see http://www.w3schools.com/html/html_colornames.asp). Also accepts CSS `#` hexadecimal colors, `rgba`, and `rgb` and does the right thing returning a corresponding UIColor. 22 | If a color begins with a `#` we know that it is a hexadecimal color and send it to colorWithHexString:. If the string is an `rgba()` color declaration the comma delimited r, g, b, and a values are made into percentages and then made into a UIColor which is returned. If the string is an `rgb()` color declaration the same process happens except with an alpha of 1.0. 23 | The last case is that the color string is not a numeric declaration `#`, nor a `rgba` or `rgb` declaration so the CSS color value matching the English string is found in a lookup dictionary and then passed to colorWithHexString: which will make a UIColor out of the hexadecimal string. 24 | @param name The CSS color string that we want to map from a name into an RGB color. 25 | @returns A UIColor object representing the name parameter as numeric values declared by the HTML and CSS specifications, a `rgba()` color, or a `rgb()` color. 26 | */ 27 | DTColor *DTColorCreateWithHTMLName(NSString *name); 28 | 29 | 30 | /** 31 | Return a string hexadecimal representation of this UIColor. Splits the color into components with CGColor methods, re-maps them from percentages to the range 0-255, and depending on the number of components returns a grayscale (repeating string of two characters) or color RGB (alpha is stripped) six character string. In the event of a non-2 or non-4 component color nil is returned as it is from an unsupported color space. 32 | @returns A CSS hexadecimal NSString specifying this UIColor. 33 | */ 34 | NSString *DTHexStringFromDTColor(DTColor *color); 35 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreGraphicsUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreGraphicsUtils.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 7/18/10. 6 | // Copyright 2010 Cocoanetics. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Various CoreGraphics-related utility functions 13 | */ 14 | 15 | /** 16 | Promotes value to CGFloat type. 17 | */ 18 | #define CGFloat_(__x) ((CGFloat) (__x)) 19 | 20 | /** 21 | Calculates a size that fits an original size into a different size preserving the aspect ratio. 22 | */ 23 | CGSize DTCGSizeThatFitsKeepingAspectRatio(CGSize originalSize, CGSize sizeToFit); 24 | 25 | /** 26 | Calculates a size that fits an original size into a different size preserving the aspect ratio and filling the target size. 27 | */ 28 | CGSize DTCGSizeThatFillsKeepingAspectRatio(CGSize originalSize, CGSize sizeToFit); 29 | 30 | /** 31 | Replacement for buggy CGSizeMakeWithDictionaryRepresentation 32 | @param dict The dictionary containing an encoded `CGSize` 33 | @param size The `CGSize` to decode from the dictionary 34 | @see http://www.cocoanetics.com/2012/09/radar-cgrectmakewithdictionaryrepresentation/ 35 | */ 36 | BOOL DTCGSizeMakeWithDictionaryRepresentation(NSDictionary *dict, CGSize *size); 37 | 38 | /** 39 | Replacement for buggy CGSizeCreateDictionaryRepresentation 40 | @param size The `CGSize` to encode in the returned dictionary 41 | @see http://www.cocoanetics.com/2012/09/radar-cgrectmakewithdictionaryrepresentation/ 42 | */ 43 | NSDictionary *DTCGSizeCreateDictionaryRepresentation(CGSize size); 44 | 45 | /** 46 | Replacement for buggy CGRectMakeWithDictionaryRepresentation 47 | @param dict The dictionary containing an encoded `CGRect` 48 | @param rect The `CGRect` to decode from the dictionary 49 | @see http://www.cocoanetics.com/2012/09/radar-cgrectmakewithdictionaryrepresentation/ 50 | */ 51 | BOOL DTCGRectMakeWithDictionaryRepresentation(NSDictionary *dict, CGRect *rect); 52 | 53 | /** 54 | Replacement for buggy CGRectCreateDictionaryRepresentation 55 | @param rect The `CGRect` to encode in the returned dictionary 56 | @see http://www.cocoanetics.com/2012/09/radar-cgrectmakewithdictionaryrepresentation/ 57 | */ 58 | NSDictionary *DTCGRectCreateDictionaryRepresentation(CGRect rect); 59 | 60 | /** 61 | Convenience method to find the center of a CGRect. Uses CGRectGetMidX and CGRectGetMidY. 62 | @returns The point which is the center of rect. 63 | */ 64 | CGPoint DTCGRectCenter(CGRect rect); 65 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreText.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #if TARGET_OS_IPHONE 4 | #import 5 | #elif TARGET_OS_MAC 6 | #import 7 | #endif 8 | 9 | // global constants 10 | #import "DTCoreTextMacros.h" 11 | #import "DTCoreTextConstants.h" 12 | #import "DTCompatibility.h" 13 | 14 | #import "DTColor+Compatibility.h" 15 | #import "DTImage+HTML.h" 16 | 17 | // common utilities 18 | #if TARGET_OS_IPHONE 19 | #import "DTCoreTextFunctions.h" 20 | #endif 21 | 22 | #import "DTColorFunctions.h" 23 | 24 | // common classes 25 | #import "DTCSSListStyle.h" 26 | #import "DTTextBlock.h" 27 | #import "DTCSSStylesheet.h" 28 | #import "DTCoreTextFontDescriptor.h" 29 | #import "DTCoreTextParagraphStyle.h" 30 | #import "DTHTMLAttributedStringBuilder.h" 31 | #import "DTHTMLElement.h" 32 | #import "DTAnchorHTMLElement.h" 33 | #import "DTBreakHTMLElement.h" 34 | #import "DTListItemHTMLElement.h" 35 | #import "DTHorizontalRuleHTMLElement.h" 36 | #import "DTStylesheetHTMLElement.h" 37 | #import "DTTextAttachmentHTMLElement.h" 38 | #import "DTTextHTMLElement.h" 39 | #import "DTHTMLWriter.h" 40 | #import "NSCharacterSet+HTML.h" 41 | #import "NSCoder+DTCompatibility.h" 42 | #import "NSDictionary+DTCoreText.h" 43 | #import "NSAttributedString+HTML.h" 44 | #import "NSAttributedString+SmallCaps.h" 45 | #import "NSAttributedString+DTCoreText.h" 46 | #import "NSMutableAttributedString+HTML.h" 47 | #import "NSMutableString+HTML.h" 48 | #import "NSScanner+HTML.h" 49 | #import "NSString+CSS.h" 50 | #import "NSString+HTML.h" 51 | #import "NSString+Paragraphs.h" 52 | 53 | // parsing classes 54 | #import "DTHTMLParserNode.h" 55 | #import "DTHTMLParserTextNode.h" 56 | 57 | // text attachment cluster 58 | #import "DTTextAttachment.h" 59 | #import "DTDictationPlaceholderTextAttachment.h" 60 | #import "DTIframeTextAttachment.h" 61 | #import "DTImageTextAttachment.h" 62 | #import "DTObjectTextAttachment.h" 63 | #import "DTVideoTextAttachment.h" 64 | 65 | // TARGET_OS_IPHONE is both tvOS and iOS 66 | #if TARGET_OS_IPHONE 67 | 68 | #import "DTLazyImageView.h" 69 | #import "DTLinkButton.h" 70 | 71 | #import "NSAttributedStringRunDelegates.h" 72 | 73 | #import "DTAttributedLabel.h" 74 | #import "DTAttributedTextCell.h" 75 | #import "DTAttributedTextContentView.h" 76 | #import "DTAttributedTextView.h" 77 | #import "DTCoreTextFontCollection.h" 78 | #import "DTCoreTextGlyphRun.h" 79 | #import "DTCoreTextLayoutFrame.h" 80 | #import "DTCoreTextLayoutFrame+Cursor.h" 81 | #import "DTCoreTextLayoutLine.h" 82 | #import "DTCoreTextLayouter.h" 83 | 84 | #import "DTDictationPlaceholderView.h" 85 | 86 | #import "UIFont+DTCoreText.h" 87 | 88 | #import "DTAccessibilityElement.h" 89 | #import "DTAccessibilityViewProxy.h" 90 | #import "DTCoreTextLayoutFrameAccessibilityElementGenerator.h" 91 | 92 | #endif 93 | 94 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextFontCollection.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextFontCollection.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 5/23/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | 10 | 11 | @class DTCoreTextFontDescriptor; 12 | 13 | /** 14 | Class representing a collection of fonts 15 | */ 16 | 17 | @interface DTCoreTextFontCollection : NSObject 18 | 19 | /** 20 | @name Creating Font Collections 21 | */ 22 | 23 | /** 24 | Creates a font collection with all available fonts on the system 25 | */ 26 | + (DTCoreTextFontCollection *)availableFontsCollection; 27 | 28 | /** 29 | @name Getting Information about Font Collections 30 | */ 31 | 32 | /** 33 | The font family names that occur in the receiver's list of fonts 34 | */ 35 | - (NSArray *)fontFamilyNames; 36 | 37 | /** 38 | The font descriptors describing all fonts in the receiver's font collection 39 | */ 40 | - (NSArray *)fontDescriptors; 41 | 42 | /** 43 | @name Searching for Fonts 44 | */ 45 | 46 | /** 47 | The font descriptor describing a font in the receiver's collection that matches a given descriptor 48 | @param descriptor The font descriptor to search for 49 | @returns The first found font descriptor in the font collection 50 | */ 51 | - (DTCoreTextFontDescriptor *)matchingFontDescriptorForFontDescriptor:(DTCoreTextFontDescriptor *)descriptor; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextFunctions.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextFunctions.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 21.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTCompatibility.h" 10 | 11 | #if TARGET_OS_IPHONE 12 | 13 | #import 14 | 15 | /** 16 | Creates a CTFont from a UIFont 17 | @param font The `UIFont` 18 | @returns The matching CTFont 19 | */ 20 | CTFontRef DTCTFontCreateWithUIFont(UIFont *font); 21 | #endif 22 | 23 | /** 24 | Converts an NSLineBreakMode into CoreText line truncation type 25 | */ 26 | CTLineTruncationType DTCTLineTruncationTypeFromNSLineBreakMode(NSLineBreakMode lineBreakMode); 27 | 28 | /** 29 | Rounds the passed value according to the specified content scale. 30 | 31 | With contentScale 1 the results are identical to roundf, with Retina content scale 2 the results are multiples of 0.5. 32 | */ 33 | CGFloat DTRoundWithContentScale(CGFloat value, CGFloat contentScale); 34 | 35 | /** 36 | Rounds up the passed value according to the specified content scale. 37 | 38 | With contentScale 1 the results are identical to roundf, with Retina content scale 2 the results are multiples of 0.5. 39 | */ 40 | CGFloat DTCeilWithContentScale(CGFloat value, CGFloat contentScale); 41 | 42 | /** 43 | Rounds down the passed value according to the sspecifiedcontent scale. 44 | 45 | With contentScale 1 the results are identical to roundf, with Retina content scale 2 the results are multiples of 0.5. 46 | */ 47 | CGFloat DTFloorWithContentScale(CGFloat value, CGFloat contentScale); 48 | 49 | #pragma mark - Alignment Conversion 50 | 51 | #if DTCORETEXT_SUPPORT_NS_ATTRIBUTES 52 | /** 53 | Converts from NSTextAlignment to CTTextAligment 54 | */ 55 | CTTextAlignment DTNSTextAlignmentToCTTextAlignment(NSTextAlignment nsTextAlignment); 56 | 57 | /** 58 | Converts from CTTextAlignment to NSTextAligment 59 | */ 60 | NSTextAlignment DTNSTextAlignmentFromCTTextAlignment(CTTextAlignment ctTextAlignment); 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextLayoutFrame+Cursor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextLayoutFrame+Cursor.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 10.07.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTCoreTextLayoutFrame.h" 10 | 11 | /** 12 | The **Cursor** category extends DTCoreTextLayoutFrame for working with a caret and determine the string index of touch coordinates. 13 | */ 14 | 15 | @interface DTCoreTextLayoutFrame (Cursor) 16 | 17 | /** 18 | Determines the closest string index to a point in the receiver's frame. 19 | 20 | This can be used to find the cursor position to position an input caret at. 21 | @param point The point 22 | @returns The resulting string index 23 | */ 24 | - (NSInteger)closestCursorIndexToPoint:(CGPoint)point; 25 | 26 | /** 27 | The rectangle to draw a caret for a given index 28 | @param index The string index for which to determine a cursor frame 29 | @returns The cursor rectangle 30 | */ 31 | - (CGRect)cursorRectAtIndex:(NSInteger)index; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextLayoutFrameAccessibilityElementGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextLayoutFrameAccessibilityElementGenerator.h 3 | // DTCoreText 4 | // 5 | // Created by Austen Green on 3/13/13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DTAccessibilityElement.h" 11 | 12 | @class DTCoreTextLayoutFrame, DTTextAttachment; 13 | 14 | /** 15 | A block that provides accessibility information for the passed text attachments 16 | */ 17 | typedef id(^DTAttachmentViewProvider)(DTTextAttachment *textAttachment); 18 | 19 | /** 20 | Generates an array of objects conforming to the UIAccessibility informal protocol based on a . 21 | */ 22 | @interface DTCoreTextLayoutFrameAccessibilityElementGenerator : NSObject 23 | 24 | /** 25 | The designated initializer. The DTAttachmentViewProvider block may be used to provide custom subviews in place of a static accessibility element. 26 | @param frame The to generate accessibility elements for. 27 | @param view The logical superview of the elements - the view that owns the local coordinate system for drawing the frame. 28 | @param block A callback block which takes a object and returns an object that conforms to the UIAccessibility informal protocol. 29 | @returns Returns an array of objects conforming to the UIAccessibility informal protocol, suitable for presentation for the VoiceOver system. 30 | */ 31 | 32 | - (NSArray *)accessibilityElementsForLayoutFrame:(DTCoreTextLayoutFrame *)frame view:(UIView *)view attachmentViewProvider:(DTAttachmentViewProvider)block; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextLayouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextLayouter.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/24/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | 10 | 11 | #if TARGET_OS_IPHONE 12 | #import 13 | #elif TARGET_OS_MAC 14 | #import 15 | #endif 16 | 17 | #import "DTCoreTextLayoutFrame.h" 18 | #import "DTCoreTextLayoutLine.h" 19 | #import "DTCoreTextGlyphRun.h" 20 | 21 | /** 22 | This class owns an attributed string and is able to create layoutFrames for certain ranges in this string. Optionally it caches these layout frames. 23 | */ 24 | @interface DTCoreTextLayouter : NSObject 25 | 26 | /** 27 | @name Creating a Layouter 28 | */ 29 | 30 | /** 31 | Designated Initializer. Creates a new Layouter with an attributed string 32 | @param attributedString The `NSAttributedString` to layout for 33 | @returns An initialized layouter 34 | */ 35 | - (id)initWithAttributedString:(NSAttributedString *)attributedString; 36 | 37 | 38 | /** 39 | @name Creating Layout Frames 40 | */ 41 | 42 | /** 43 | Creates a layout frame with a given rectangle and string range. The layouter fills the layout frame with as many lines as fit. You can query [DTCoreTextLayoutFrame visibleStringRange] for the range the fits and create another layout frame that continues the text from there to create multiple pages, for example for an e-book. 44 | @param frame The rectangle to fill with text 45 | @param range The string range to fill, pass {0,0} for the entire string (as much as fits) 46 | */ 47 | - (DTCoreTextLayoutFrame *)layoutFrameWithRect:(CGRect)frame range:(NSRange)range; 48 | 49 | /** 50 | If set to `YES` then the receiver will cache layout frames generated with layoutFrameWithRect:range: for a given rect 51 | */ 52 | @property (nonatomic, assign) BOOL shouldCacheLayoutFrames; 53 | 54 | 55 | /** 56 | @name Getting Information 57 | */ 58 | 59 | /** 60 | The attributed string that the layouter currently owns 61 | */ 62 | @property (nonatomic, strong) NSAttributedString *attributedString; 63 | 64 | /** 65 | The internal framesetter of the receiver 66 | */ 67 | @property (nonatomic, readonly) CTFramesetterRef framesetter; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCoreTextMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCoreTextMacros.h 3 | // DTCoreText 4 | // 5 | // Created by Jean-Charles BERTIN on 5/28/14. 6 | // Copyright (c) 2014 Axinoe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef DT_RETURNS_INNER_POINTER 12 | #if __has_attribute(objc_returns_inner_pointer) 13 | #define DT_RETURNS_INNER_POINTER __attribute__((objc_returns_inner_pointer)) 14 | #else 15 | #define DT_RETURNS_INNER_POINTER 16 | #endif 17 | #endif 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTCustomColoredAccessory.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTCustomColoredAccessory.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 2/10/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Constant used by DTCustomColoredAccessory to specify the type of accessory. 11 | */ 12 | typedef NS_ENUM(NSUInteger, DTCustomColoredAccessoryType) 13 | { 14 | /** 15 | An accessoring pointing to the right side 16 | */ 17 | DTCustomColoredAccessoryTypeRight = 0, 18 | 19 | /** 20 | An accessoring pointing to the left side 21 | */ 22 | DTCustomColoredAccessoryTypeLeft, 23 | 24 | /** 25 | An accessoring pointing upwards 26 | */ 27 | DTCustomColoredAccessoryTypeUp, 28 | 29 | /** 30 | An accessoring pointing downwards 31 | */ 32 | DTCustomColoredAccessoryTypeDown, 33 | 34 | /** 35 | A front square drawn on top of a back square with the back square offset up and to the right 36 | */ 37 | DTCustomColoredAccessoryTypeSquare 38 | 39 | }; 40 | 41 | /** 42 | An accessory control that can be used instead of the standard disclosure indicator in a `UITableView`. See the DTCustomColoredAccessoryType for supported styles. 43 | */ 44 | 45 | @interface DTCustomColoredAccessory : UIControl 46 | 47 | /**------------------------------------------------------------------------------------- 48 | @name Creating A Custom-Colored Accessory 49 | --------------------------------------------------------------------------------------- 50 | */ 51 | 52 | /** 53 | Creates a custom-colored right disclosure indicator accessory with a given color 54 | @param color The color to use 55 | */ 56 | + (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color; 57 | 58 | /** 59 | Creates a custom-colored accessory with a given color and type 60 | @param color The color to use 61 | @param type The DTCustomColoredAccessoryType to use 62 | */ 63 | + (DTCustomColoredAccessory *)accessoryWithColor:(UIColor *)color type:(DTCustomColoredAccessoryType)type; 64 | 65 | /** 66 | Creates a custom-colored square on top of a square with offset 67 | @param color The color to use 68 | @param backgroundColor The backgroundColor to use 69 | */ 70 | + (DTCustomColoredAccessory *)squareAccessoryWithColor:(UIColor *)color backgroundColor:(UIColor *)backgroundColor; 71 | 72 | /**------------------------------------------------------------------------------------- 73 | @name Properties 74 | --------------------------------------------------------------------------------------- 75 | */ 76 | 77 | /** 78 | The color to draw the accessory in 79 | */ 80 | @property (nonatomic, retain) UIColor *accessoryColor; 81 | 82 | /** 83 | The color to draw the accessory in while highlighted 84 | */ 85 | @property (nonatomic, retain) UIColor *highlightedColor; 86 | /** 87 | The color to draw the front square of the square accessory in while not highlighted 88 | */ 89 | @property (nonatomic, retain) UIColor *frontSquareAccessoryColor; 90 | /** 91 | The color to draw the back square of the square accessory in while not highlighted 92 | */ 93 | @property (nonatomic, retain) UIColor *backSquareAccessoryColor; 94 | 95 | /** 96 | The DTCustomColoredAccessoryType of the accessory. 97 | */ 98 | @property (nonatomic, assign) DTCustomColoredAccessoryType type; 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTDictationPlaceholderTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTDictationPlaceholderTextAttachment.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 06.02.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTTextAttachment.h" 10 | 11 | /** 12 | This is a special subclass of DTTextAttachment used to represent the dictation placeholder. 13 | 14 | When encountering such an element DTAttributedTextContentView does not call the delegate to provide a subclass but automatically creates and adds a DTDictationPlaceholderView. 15 | */ 16 | 17 | @interface DTDictationPlaceholderTextAttachment : DTTextAttachment 18 | 19 | /** 20 | The string that inserting the dictation placeholder replaced, used for Undoing 21 | */ 22 | @property (nonatomic, retain) NSAttributedString *replacedAttributedString; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTDictationPlaceholderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTDictationPlaceholderView.h 3 | // DTRichTextEditor 4 | // 5 | // Created by Oliver Drobnik on 05.02.13. 6 | // Copyright (c) 2013 Cocoanetics. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | A dictation placeholder to display in editors between the time the recording is complete until a recognized response is received. 13 | */ 14 | 15 | @interface DTDictationPlaceholderView : UIView 16 | 17 | /** 18 | Creates an appropriately sized DTDictationPlaceholderView with 3 animated purple dots 19 | */ 20 | + (DTDictationPlaceholderView *)placeholderView; 21 | 22 | /** 23 | The context of the receiver. This can be any object, for example the selection range to replace with the dictation result text 24 | */ 25 | @property (nonatomic, strong) id context; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTExtendedFileAttributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTExtendedFileAttributes.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 3/6/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | This class provides read/write access to extended file attributes of a file or folder. It wraps the standard xattr Posix functions to do that. 11 | 12 | Because the file system does not keep track of the data types saved in extended attributes this API so far reads and writes strings. 13 | */ 14 | @interface DTExtendedFileAttributes : NSObject 15 | 16 | 17 | /** 18 | @name Creating an Extended File Attribute Manager 19 | */ 20 | 21 | 22 | /** 23 | Creates an Extended File Attribute Manager. 24 | 25 | @param path The file path 26 | */ 27 | - (id)initWithPath:(NSString *)path; 28 | 29 | 30 | /** 31 | @name Reading/Writing Extended Attributes 32 | */ 33 | 34 | /** 35 | Removes an extended file attribute from the receiver. 36 | 37 | @param attribute The name of the attribute. 38 | @returns `YES` if successful. 39 | */ 40 | - (BOOL)removeAttribute:(NSString *)attribute; 41 | 42 | 43 | /** 44 | Sets the value of an extended file attribute for the receiver. 45 | 46 | If the value is `nil` then this is the same as calling . 47 | 48 | @param value The string to save for this attribute. 49 | @param attribute The name of the attribute. 50 | @returns `YES` if successful. 51 | */ 52 | - (BOOL)setValue:(NSString *)value forAttribute:(NSString *)attribute; 53 | 54 | 55 | /** 56 | Gets the value of an extended file attribute from the receiver. 57 | 58 | @param attribute The name of the attribute. 59 | @returns The string for the value or `nil` if the value is not set. 60 | */ 61 | - (NSString *)valueForAttribute:(NSString *)attribute; 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTFolderMonitor.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTFolderMonitor.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 05.08.13. 6 | // Copyright (c) 2013 Cocoanetics. All rights reserved. 7 | // 8 | 9 | // The block to execute if a monitored folder changes 10 | typedef void (^DTFolderMonitorBlock) (void); 11 | 12 | /** 13 | Class for monitoring changes on a folder. This can be used to monitor the application documents folder for changes in the files there if the user adds or removes files via iTunes file sharing. 14 | */ 15 | 16 | @interface DTFolderMonitor : NSObject 17 | 18 | /** 19 | @name Creating a Folder Monitor 20 | */ 21 | 22 | /** 23 | Creates a new DTFolderMonitor to watch the folder at the given URL. Whenever there is a change on this folder the block is executed. 24 | 25 | The URL must be a file URL. Both the URL and the block parameter are mandatory. The block is being dispatched on a background queue. 26 | 27 | @param URL The monitored folder URL 28 | @param block The block to execute if the folder is being modified 29 | @returns The instantiated monitor in suspended mode. Call -startMonitoring to start monitoring. 30 | */ 31 | + (DTFolderMonitor * _Nonnull)folderMonitorForURL:(NSURL * _Nonnull)URL block: (DTFolderMonitorBlock _Nullable)block; 32 | 33 | 34 | /** 35 | @name Starting/Stopping Monitoring 36 | */ 37 | 38 | /** 39 | Start monitoring the folder. A monitor can be started and stopped multiple times. 40 | */ 41 | - (void)startMonitoring; 42 | 43 | /** 44 | Stop monitoring the folder. A monitor can be started and stopped multiple times. 45 | */ 46 | - (void)stopMonitoring; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTFoundationConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTFoundationConstants.h 3 | // DTFoundation 4 | // 5 | // Created by Stefan Gugarel on 10/18/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | // string constant for NSError domain 11 | extern NSString * const DTFoundationErrorDomain; -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTHTMLAttributedStringBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLAttributedStringBuilder.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 21.01.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | //#import 10 | #import "DTHTMLParser.h" 11 | 12 | @class DTHTMLElement; 13 | 14 | /** 15 | The block that gets executed whenever an element is flushed to the output string 16 | */ 17 | typedef void(^DTHTMLAttributedStringBuilderWillFlushCallback)(DTHTMLElement *); 18 | 19 | 20 | /** 21 | Class for building an `NSAttributedString` from an HTML document. 22 | */ 23 | @interface DTHTMLAttributedStringBuilder : NSObject 24 | 25 | /** 26 | @name Creating an Attributed String Builder 27 | */ 28 | 29 | /** 30 | Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL. 31 | 32 | Options can be: 33 | 34 | - DTMaxImageSize: the maximum CGSize that a text attachment can fill 35 | - DTDefaultFontFamily: the default font family to use instead of Times New Roman 36 | - DTDefaultFontName: the default font face to use instead of Times New Roman 37 | - DTDefaultFontSize: the default font size to use instead of 12 38 | - DTDefaultTextColor: the default text color 39 | - DTDefaultLinkColor: the default color for hyperlink text 40 | - DTDefaultLinkDecoration: the default decoration for hyperlinks 41 | - DTDefaultLinkHighlightColor: the color to show while the hyperlink is highlighted 42 | - DTDefaultTextAlignment: the default text alignment for paragraphs 43 | - DTDefaultLineHeightMultiplier: The multiplier for line heights 44 | - DTDefaultFirstLineHeadIndent: The default indent for left margin on first line 45 | - DTDefaultHeadIndent: The default indent for left margin except first line 46 | - DTDefaultListIndent: The amount by which lists are indented 47 | - DTDefaultStyleSheet: The default style sheet to use 48 | - DTUseiOS6Attributes: use iOS 6 attributes for building (UITextView compatible) 49 | - DTWillFlushBlockCallBack: a block to be executed whenever content is flushed to the output string 50 | - DTIgnoreInlineStylesOption: All inline style information is being ignored and only style blocks used 51 | 52 | @param data The data in HTML format from which to create the attributed string. 53 | @param options Specifies how the document should be loaded. Contains values described in NSAttributedString(HTML). 54 | @param docAttributes Currently not in use. 55 | @returns Returns an initialized object, or `nil` if the data can’t be decoded. 56 | */ 57 | - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary * __autoreleasing*)docAttributes; 58 | 59 | 60 | /** 61 | @name Generating Attributed Strings 62 | */ 63 | 64 | /** 65 | Creates the attributed string when called the first time. 66 | @returns An `NSAttributedString` representing the HTML document passed in the initializer. 67 | */ 68 | - (NSAttributedString *)generatedAttributedString; 69 | 70 | 71 | /** 72 | This block is called before the element is written to the output attributed string 73 | */ 74 | @property (nonatomic, copy) DTHTMLAttributedStringBuilderWillFlushCallback willFlushCallback; 75 | 76 | /** 77 | Setting this property to `YES` causes the tree of parse nodes to be preserved until the end of the generation process. This allows to output the HTML structure of the document for debugging. 78 | */ 79 | @property (nonatomic, assign) BOOL shouldKeepDocumentNodeTree; 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTHTMLParserNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLParserNode.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | //#import 10 | #import "DTWeakSupport.h" 11 | @class DTHTMLParserTextNode; 12 | 13 | /** 14 | This class represents one node in an HTML DOM tree. 15 | */ 16 | @interface DTHTMLParserNode : NSObject 17 | { 18 | NSDictionary *_attributes; 19 | } 20 | 21 | /** 22 | Designated initializer 23 | @param name The element name 24 | @param attributes The attributes dictionary 25 | @returns An initialized parser node. 26 | */ 27 | - (id)initWithName:(NSString *)name attributes:(NSDictionary *)attributes; 28 | 29 | /** 30 | The name of the receiver 31 | */ 32 | @property (nonatomic, copy) NSString *name; 33 | 34 | /** 35 | The attributes of the receiver. 36 | */ 37 | @property (nonatomic, copy) NSDictionary *attributes; 38 | 39 | /** 40 | A weak link to the parent node of the receiver 41 | */ 42 | @property (nonatomic, DT_WEAK_PROPERTY) DTHTMLParserNode *parentNode; 43 | 44 | /** 45 | The child nodes of the receiver 46 | */ 47 | @property (nonatomic, readonly) NSArray *childNodes; 48 | 49 | /** 50 | Adds a child node to the receiver. 51 | @param childNode The child node to be appended to the list of children 52 | */ 53 | - (void)addChildNode:(DTHTMLParserNode *)childNode; 54 | 55 | /** 56 | Removes a child node from the receiver 57 | @param childNode The child node to remove 58 | */ 59 | - (void)removeChildNode:(DTHTMLParserNode *)childNode; 60 | 61 | /** 62 | Removes all child nodes from the receiver 63 | */ 64 | - (void)removeAllChildNodes; 65 | 66 | /** 67 | Hierarchy representation of the receiver including all attributes and children 68 | */ 69 | - (NSString *)debugDescription; 70 | 71 | /** 72 | Concatenated contents of all text nodes 73 | */ 74 | - (NSString *)text; 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTHTMLParserTextNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLParserTextNode.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLParserNode.h" 10 | 11 | /** 12 | Specialized sub class of that represents text inside a node 13 | */ 14 | @interface DTHTMLParserTextNode : DTHTMLParserNode 15 | 16 | /** 17 | Designated initializer with the characters that make up the text. 18 | @param characters The characters of the string 19 | @returns The initialized text node 20 | */ 21 | - (id)initWithCharacters:(NSString *)characters; 22 | 23 | /** 24 | Returns the receivers character contents 25 | */ 26 | @property (nonatomic, readonly) NSString *characters; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTHTMLWriter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLWriter.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 23.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | /** 10 | Class to generate HTML from `NSAttributedString` instances. 11 | */ 12 | @interface DTHTMLWriter : NSObject 13 | 14 | /** 15 | @name Creating an HTML Writer 16 | */ 17 | 18 | /** 19 | Creates a writer with a given `NSAttributedString` as input 20 | @param attributedString An attributed string 21 | */ 22 | - (id)initWithAttributedString:(NSAttributedString *)attributedString; 23 | 24 | /** 25 | @name Generating HTML 26 | */ 27 | 28 | /** 29 | Generates a HTML representation of the attributed string 30 | @returns The generated string 31 | */ 32 | - (NSString *)HTMLString; 33 | 34 | 35 | /** 36 | Generates a HTML fragment representation of the attributed string including inlined styles and no html or head elements 37 | @returns The generated string 38 | */ 39 | - (NSString *)HTMLFragment; 40 | 41 | /** 42 | @name Properties 43 | */ 44 | 45 | /** 46 | If specified then all absolute font sizes (px) will be divided by this value. This is useful if you specified a text size multiplier when converting HTML to the attributed string you are processing. 47 | */ 48 | @property (nonatomic, assign) CGFloat textScale; 49 | 50 | /** 51 | If YES, preserve whitespaces in HTML by using "Apple-converted-space". Default YES. 52 | */ 53 | @property (nonatomic, assign) BOOL useAppleConvertedSpace; 54 | 55 | /** 56 | The attributed string that the writer is processing. 57 | */ 58 | @property (nonatomic, readonly) NSAttributedString *attributedString; 59 | 60 | 61 | /** 62 | The HTML element tag name to use for paragraphs. Defaults to @"p". 63 | */ 64 | @property (nonatomic, strong) NSString *paragraphTagName; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTHorizontalRuleHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementHR.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of that deals with list items. 13 | */ 14 | 15 | @interface DTHorizontalRuleHTMLElement : DTHTMLElement 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTIframeTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTTextAttachmentIframe.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 22.04.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTTextAttachment.h" 10 | 11 | /** 12 | A specialized subclass in the DTTextAttachment class cluster to represent an IFRAME 13 | */ 14 | 15 | @interface DTIframeTextAttachment : DTTextAttachment 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTImage+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTImage+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/9/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE 10 | 11 | #import 12 | 13 | /** 14 | Category used to have the same method available for unit testing on Mac on iOS. 15 | */ 16 | @interface UIImage (HTML) 17 | 18 | /** 19 | Retrieve the NSData representation of a UIImage. Used to encode UIImages in DTTextAttachments. 20 | 21 | @returns The NSData representation of the UIImage instance receiving this message. Convenience method for UIImagePNGRepresentation(). 22 | */ 23 | - (NSData *)dataForPNGRepresentation; 24 | 25 | @end 26 | 27 | #else 28 | 29 | /** 30 | Category used to have the same method available for unit testing on Mac on iOS. 31 | */ 32 | @interface NSImage (HTML) 33 | 34 | 35 | /** 36 | Retrieve the NSData representation of a NSImage. 37 | 38 | @returns The NSData representation of the NSImage instance receiving this message. 39 | */ 40 | - (NSData *)dataForPNGRepresentation; 41 | 42 | @end 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTImageTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTTextAttachmentImage.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 22.04.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTTextAttachment.h" 10 | 11 | @class DTImage; 12 | 13 | /** 14 | A specialized subclass in the DTTextAttachment class cluster to represent an embedded image 15 | */ 16 | 17 | @interface DTImageTextAttachment : DTTextAttachment 18 | 19 | /** 20 | The designated initializer which will be called by [DTTextAttachment textAttachmentWithElement:options:] for image attachments. 21 | @param element A DTHTMLElement that must have a valid tag name and should have a size. Any element attributes are copied to the text attachment's elements. 22 | @param options An NSDictionary of options. Used to specify the max image size with the key DTMaxImageSize. 23 | */ 24 | - (id)initWithElement:(DTHTMLElement *)element options:(NSDictionary *)options; 25 | 26 | /** 27 | @name Alternate Representations 28 | */ 29 | 30 | /** 31 | Retrieves a string which is in the format "data:image/png;base64,%@" with this DTTextAttachment's content's data representation encoded in Base64 string encoding. For image contents only. 32 | @returns A Base64 encoded string of the png data representation of this text attachment's image contents. 33 | */ 34 | - (NSString *)dataURLRepresentation; 35 | 36 | /** 37 | The image represented by the receiver 38 | */ 39 | @property (nonatomic, strong) DTImage *image; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTLazyImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTLazyImageView.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 5/20/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | //#import 10 | #import "DTWeakSupport.h" 11 | #import "DTAttributedTextContentView.h" 12 | 13 | @class DTLazyImageView; 14 | 15 | // Notifications 16 | extern NSString * const DTLazyImageViewWillStartDownloadNotification; 17 | extern NSString * const DTLazyImageViewDidFinishDownloadNotification; 18 | 19 | /** 20 | Protocol for delegates of to inform them about the downloaded image dimensions. 21 | */ 22 | @protocol DTLazyImageViewDelegate 23 | @optional 24 | 25 | /** 26 | Method that informs the delegate about the image size so that it can re-layout text. 27 | @param lazyImageView The image view 28 | @param size The image size that is now known 29 | */ 30 | - (void)lazyImageView:(DTLazyImageView *)lazyImageView didChangeImageSize:(CGSize)size; 31 | @end 32 | 33 | /** 34 | This `UIImageView` subclass lazily loads an image from a URL and informs a delegate once the size of the image is known. 35 | */ 36 | 37 | @interface DTLazyImageView : UIImageView 38 | 39 | /** 40 | @name Providing Content 41 | */ 42 | 43 | /** 44 | The URL of the remote image 45 | */ 46 | @property (nonatomic, strong) NSURL *url; 47 | 48 | /** 49 | The URL Request that is to be used for downloading the image. If this is left `nil` the a new URL Request will be created 50 | */ 51 | @property (nonatomic, strong) NSMutableURLRequest *urlRequest; 52 | 53 | /** 54 | The DTAttributedTextContentView used to display remote images with DTAttributedTextCell 55 | */ 56 | @property (nonatomic, DT_WEAK_PROPERTY) DTAttributedTextContentView *contentView; 57 | 58 | /** 59 | @name Getting Information 60 | */ 61 | 62 | /** 63 | Set to `YES` to support progressive display of progressive downloads 64 | */ 65 | @property (nonatomic, assign) BOOL shouldShowProgressiveDownload; 66 | 67 | /** 68 | The delegate, conforming to , to inform when the image dimensions were determined 69 | */ 70 | @property (nonatomic, DT_WEAK_PROPERTY) id delegate; 71 | 72 | 73 | /** 74 | @name Cancelling Download 75 | */ 76 | 77 | /** 78 | Cancels the image downloading 79 | */ 80 | - (void)cancelLoading; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTLinkButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTLinkButton.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/16/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | /** 10 | Constant for highlighting notification 11 | */ 12 | 13 | extern NSString *DTLinkButtonDidHighlightNotification; 14 | 15 | /** 16 | A button that corresponds to a hyperlink. 17 | 18 | Multiple parts of the same hyperlink synchronize their looks through the guid. You can show link text in a different color for normal and highlighted mode by setting the button images for these states. 19 | */ 20 | @interface DTLinkButton : UIButton 21 | 22 | 23 | /** 24 | The URL that this button corresponds to. 25 | */ 26 | @property (nonatomic, copy) NSURL *URL; 27 | 28 | 29 | /** 30 | The unique identifier (GUID) that all parts of the same hyperlink have in common. 31 | */ 32 | @property (nonatomic, copy) NSString *GUID; 33 | 34 | 35 | /** 36 | The minimum size that the receiver should respond on hits with. Adjusts the bounds if they are smaller than the passed size. 37 | */ 38 | @property (nonatomic, assign) CGSize minimumHitSize; 39 | 40 | 41 | /** 42 | A Boolean value that determines whether tapping the button causes it to show a gray rounded rectangle. Default is YES. 43 | */ 44 | @property(nonatomic) BOOL showsTouchWhenHighlighted; 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTListItemHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementLI.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 27.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of that deals with list items. 13 | */ 14 | @interface DTListItemHTMLElement : DTHTMLElement 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTObjectTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTObjectTextAttachment.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 22.04.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTTextAttachment.h" 10 | 11 | /** 12 | A specialized subclass in the DTTextAttachment class cluster to represent an generic object 13 | */ 14 | 15 | @interface DTObjectTextAttachment : DTTextAttachment 16 | 17 | /** 18 | The DTHTMLElement child nodes of the receiver. This array is only used for object tags at the moment. 19 | */ 20 | @property (nonatomic, strong) NSArray *childNodes; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTPieProgressIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTPieProgressIndicator.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 16.05.12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | A Progress indicator shaped like a pie chart. If you don't specify a color then the current tintColor is used. This is useful when using it as a subview of a UIVisualEffectsView with vibrancy effect. Then all subviews using tintColor have the vibrancy applied. 11 | */ 12 | 13 | @interface DTPieProgressIndicator : UIView 14 | 15 | /** 16 | The progress in percent 17 | */ 18 | @property (nonatomic, assign) float progressPercent; 19 | 20 | /** 21 | The color of the pie 22 | */ 23 | @property (nonatomic, strong) UIColor *color; 24 | 25 | /** 26 | Creates a pie progress indicator of the correct size 27 | */ 28 | + (DTPieProgressIndicator *)pieProgressIndicator; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTSmartPagingScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTSmartPagingScrollView.h 3 | // DTSmartPhotoView 4 | // 5 | // Created by Stefan Gugarel on 5/11/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | //#import 10 | #import "DTWeakSupport.h" 11 | 12 | @class DTSmartPagingScrollView; 13 | 14 | 15 | /** 16 | Protocol for providing pages to 17 | */ 18 | @protocol DTSmartPagingScrollViewDatasource 19 | 20 | /** 21 | The number of pages for the 22 | @param smartPagingScrollView The scroll view asking 23 | @returns The number of pages 24 | */ 25 | - (NSUInteger)numberOfPagesInSmartPagingScrollView:(DTSmartPagingScrollView *)smartPagingScrollView; 26 | 27 | /** 28 | Method to provide UIViews to be used for the pages 29 | 30 | The frame of the passed view will be adjusted to the page size of the scroll view 31 | @param smartPagingScrollView The scroll view asking 32 | @param index The index of the page to provide 33 | @returns The view to use for the given page index. 34 | */ 35 | - (UIView *)smartPagingScrollView:(DTSmartPagingScrollView *)smartPagingScrollView viewForPageAtIndex:(NSUInteger)index; 36 | 37 | @optional 38 | /** 39 | The number of pages for the 40 | @param smartPagingScrollView The scroll view asking 41 | @param index The index of the page 42 | */ 43 | - (void)smartPagingScrollView:(DTSmartPagingScrollView *)smartPagingScrollView didScrollToPageAtIndex:(NSUInteger)index; 44 | 45 | @end 46 | 47 | /** 48 | A scroll view that automatically manages a set of pages 49 | */ 50 | @interface DTSmartPagingScrollView : UIScrollView 51 | 52 | /** 53 | The page data source for the receiver 54 | */ 55 | @property (nonatomic, DT_WEAK_PROPERTY) IBOutlet id pageDatasource; 56 | 57 | /** 58 | The current page index visible on the receiver 59 | */ 60 | @property (nonatomic, assign) NSUInteger currentPageIndex; 61 | 62 | /** 63 | Reloads the pages from the datasource 64 | */ 65 | - (void)reloadData; 66 | 67 | /** 68 | The range of indexes of the currently visible pages 69 | */ 70 | - (NSRange)rangeOfVisiblePages; 71 | 72 | /** 73 | Scroll the receiver to the given page index 74 | @param page The index of the page to move to 75 | @param animated Whether the move should be animated 76 | */ 77 | - (void)scrollToPage:(NSInteger)page animated:(BOOL)animated; 78 | 79 | /** 80 | Get a view for a specified index 81 | @param index The index of the view to retrieve 82 | */ 83 | - (UIView *)viewForIndex:(NSUInteger)index; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTStylesheetHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementStylesheet.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 29.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | @class DTCSSStylesheet; 12 | 13 | /** 14 | This is a specialized subclass of representing a style block. 15 | */ 16 | @interface DTStylesheetHTMLElement : DTHTMLElement 17 | 18 | /** 19 | Parses the text children and assembles the resulting stylesheet. 20 | */ 21 | - (DTCSSStylesheet *)stylesheet; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTTextAttachmentHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementAttachment.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of for dealing with instances, e.g. images. 13 | */ 14 | 15 | @interface DTTextAttachmentHTMLElement : DTHTMLElement 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTTextBlock.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTTextBlock.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 04.03.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTCompatibility.h" 10 | 11 | /** 12 | Class that represents a block of text with attributes like padding or a background color. 13 | */ 14 | @interface DTTextBlock : NSObject 15 | 16 | /** 17 | The space to be applied between the layouted text and the edges of the receiver 18 | */ 19 | @property (nonatomic, assign) DTEdgeInsets padding; 20 | 21 | 22 | /** 23 | The background color to paint behind the text in the receiver 24 | */ 25 | @property (nonatomic, strong) DTColor *backgroundColor; 26 | 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTTextHTMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTHTMLElementText.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 26.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTHTMLElement.h" 10 | 11 | /** 12 | Specialized subclass of that deals with text. It represents a text node. The text inside a DTHTMLElement can consist of any number of such text nodes. 13 | */ 14 | 15 | @interface DTTextHTMLElement : DTHTMLElement 16 | 17 | /** 18 | The text content of the element. 19 | */ 20 | @property (nonatomic, strong) NSString *text; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTTiledLayerWithoutFade.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTTiledLayerWithoutFade.h 3 | // DTRichTextEditor 4 | // 5 | // Created by Oliver Drobnik on 8/24/11. 6 | // Copyright 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Simple subclass of `CATiledLayer` that does not fade in drawn tiles. 13 | */ 14 | 15 | @interface DTTiledLayerWithoutFade : CATiledLayer 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTVideoTextAttachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTTextAttachmentVideo.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 22.04.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTTextAttachment.h" 10 | 11 | /** 12 | A specialized subclass in the DTTextAttachment class cluster to represent an embedded video 13 | */ 14 | 15 | @interface DTVideoTextAttachment : DTTextAttachment 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTWeakSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTWeakSupport.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 6/3/13. 6 | // Copyright (c) 2013 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Useful defines for building code the compiles with zeroing weak references if the deployment target allows it. This is possible from minimum supported iOS 5.0 and OS X 10.7 and above. Note that on OS X 10.7 some AppKit classes do not support having a weak ref, e.g. NSWindowController or NSViewController. 11 | */ 12 | 13 | #import 14 | 15 | #if __has_feature(objc_arc_weak) 16 | 17 | // zeroing weak refs are supported for ivars and properties 18 | #define DT_WEAK_VARIABLE __weak 19 | #define DT_WEAK_PROPERTY weak 20 | 21 | #elif __has_feature(objc_arc) 22 | 23 | /// zeroing weak refs not supported, fall back to unsafe unretained and assigning 24 | #define DT_WEAK_VARIABLE __unsafe_unretained 25 | #define DT_WEAK_PROPERTY assign 26 | 27 | #else 28 | 29 | // define something, as this header might be included in a non-ARC project for using compiled code from an ARC static lib 30 | #define DT_WEAK_VARIABLE 31 | #define DT_WEAK_PROPERTY assign 32 | 33 | #endif -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/DTWebVideoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DTWebVideoView.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 8/5/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | //#import 10 | #import "DTWeakSupport.h" 11 | 12 | @class DTWebVideoView; 13 | @class DTTextAttachment; 14 | 15 | /** 16 | Protocol for delegates of 17 | */ 18 | @protocol DTWebVideoViewDelegate 19 | 20 | @optional 21 | 22 | /** 23 | Asks the delegate if an external URL may be opened 24 | @param videoView The web video view 25 | @param url The external URL that is asked to be opened 26 | @returns `YES` if the app may be left to open the external URL 27 | */ 28 | 29 | - (BOOL)videoView:(DTWebVideoView *)videoView shouldOpenExternalURL:(NSURL *)url; 30 | 31 | @end 32 | 33 | 34 | /** 35 | The class represents a custom subview for use in to represent an embedded video. 36 | 37 | Embedded videos work by loading the video URL in a UIWebView which iOS then replaces with the built-in media player view. The URL of the embed script depends on the service and needs to be added to the webView:shouldStartLoadWithRequest:navigationType:. You want to allow the URL for the embed script, but disallow all other requests which for example occur if a user taps on the YouTube logo. If you were to allow this type of navigation then the YouTube website would be loaded in the video view. For these scenarios there is the videoView:shouldOpenExternalURL: method in DTWebVideoViewDelegate. If you respond with `YES` (which is default if the method is not implemented) then the URL will be opened in Safari. 38 | 39 | To add additional video services please add them in the mentioned location and submit a pull request for the addition. 40 | */ 41 | @interface DTWebVideoView : UIView 42 | 43 | /** 44 | The delegate of the video view 45 | */ 46 | @property (nonatomic, DT_WEAK_PROPERTY) id delegate; 47 | 48 | /** 49 | The text attachment representing an embedded video. 50 | */ 51 | @property (nonatomic, strong) DTTextAttachment *attachment; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSArray+DTError.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+error.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 6/15/10. 6 | // Copyright 2010 Drobnik.com. All rights reserved. 7 | // 8 | 9 | /** 10 | A collection of useful additions for `NSArray` to deal with Property Lists and also to get error handling for malformed data. 11 | */ 12 | 13 | @interface NSArray (DTError) 14 | 15 | 16 | /**------------------------------------------------------------------------------------- 17 | @name Property List Error Handling 18 | --------------------------------------------------------------------------------------- 19 | */ 20 | 21 | /** 22 | Creates and returns an array found in a file specified by a given URL. 23 | 24 | @param URL An `NSURL`. The file identified by URL must contain a string representation of a property list whose root object is an array. 25 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 26 | @return A new array that contains the array at path, or `nil` if there is a file error or if the contents of the file are an invalid representation of a array. 27 | */ 28 | + (NSArray *)arrayWithContentsOfURL:(NSURL *)URL error:(NSError **)error; 29 | 30 | 31 | /** 32 | Creates and returns an array found in a file specified by a given path. 33 | 34 | @param path A full or relative pathname. The file identified by path must contain a string representation of a property list whose root object is a dictionary. 35 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 36 | @return A new dictionary that contains the dictionary at path, or `nil` if there is a file error or if the contents of the file are an invalid representation of a dictionary. 37 | */ 38 | + (NSArray *)arrayWithContentsOfFile:(NSString *)path error:(NSError **)error; 39 | 40 | 41 | /** 42 | Creates and returns an array encoded in the given blob of data. 43 | 44 | @param data The data object identified by data must contain a string representation of a property list whose root object is an array. 45 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 46 | @return A new array that contains the decoded array, or `nil` if there is an error or if the contents of the file are an invalid representation of an array. 47 | */ 48 | + (NSArray *)arrayWithContentsOfData:(NSData *)data error:(NSError **)error; 49 | @end 50 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSAttributedString+DTCoreText.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedString+DTCoreText.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 2/1/12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | @class DTCSSListStyle; 10 | @class DTTextBlock; 11 | 12 | /** 13 | Convenience Methods that mimics similar methods available on Mac 14 | */ 15 | @interface NSAttributedString (DTCoreText) 16 | 17 | /** 18 | @name Working with Text Attachments 19 | */ 20 | 21 | /** 22 | Retrieves the DTTextAttachment objects that match the given predicate. 23 | 24 | With this method you can for example find all images that have a certain URL. 25 | 26 | @param predicate The predicate to apply for filtering or `nil` to not filter by attachment 27 | @param theClass The class that attachments need to have, or `nil` for all attachments regardless of class 28 | @returns The filtered array of attachments 29 | */ 30 | - (NSArray *)textAttachmentsWithPredicate:(NSPredicate *)predicate class:(Class)theClass; 31 | 32 | /** 33 | @name Calculating Ranges 34 | */ 35 | 36 | 37 | /** 38 | Returns the index of the item at the given location within the list. 39 | 40 | @param list The text list. 41 | @param location The location of the item. 42 | @returns Returns the index within the list. 43 | */ 44 | - (NSInteger)itemNumberInTextList:(DTCSSListStyle *)list atIndex:(NSUInteger)location; 45 | 46 | 47 | /** 48 | Returns the range of the given text list that contains the given location. 49 | 50 | @param list The text list. 51 | @param location The location in the text. 52 | @returns The range of the given text list containing the location. 53 | */ 54 | - (NSRange)rangeOfTextList:(DTCSSListStyle *)list atIndex:(NSUInteger)location; 55 | 56 | /** 57 | Returns the range of the given text block that contains the given location. 58 | 59 | @param textBlock The text block. 60 | @param location The location in the text. 61 | @returns The range of the given text block containing the location. 62 | */ 63 | - (NSRange)rangeOfTextBlock:(DTTextBlock *)textBlock atIndex:(NSUInteger)location; 64 | 65 | /** 66 | Returns the range of the given href anchor. 67 | 68 | @param anchorName The name of the anchor. 69 | @returns The range of the given anchor. 70 | */ 71 | - (NSRange)rangeOfAnchorNamed:(NSString *)anchorName; 72 | 73 | /** 74 | Returns the range of the hyperlink at the given index. 75 | 76 | @param location The location to query 77 | @param URL The URL that is found at this location or `NULL` if this is not needed 78 | @returns The range of the given hyperlink. 79 | */ 80 | - (NSRange)rangeOfLinkAtIndex:(NSUInteger)location URL:(NSURL * __autoreleasing*)URL; 81 | 82 | /** 83 | Returns the range of a field at the given index. 84 | 85 | @param location The location of the field 86 | @returns The range of the field. If there is no field at this location it returns {NSNotFound, 0}. 87 | */ 88 | - (NSRange)rangeOfFieldAtIndex:(NSUInteger)location; 89 | 90 | #ifndef COVERAGE 91 | // exclude method from coverage testing, those are just convenience methods 92 | 93 | /** 94 | @name Converting to Other Representations 95 | */ 96 | 97 | /** 98 | Encodes the receiver into a generic HTML representation. 99 | 100 | @returns An HTML string. 101 | */ 102 | - (NSString *)htmlString; 103 | 104 | 105 | /** 106 | Encodes the receiver into a generic HTML fragment representation. Styles are inlined and no html or head tags are included. 107 | 108 | @returns An HTML string. 109 | */ 110 | - (NSString *)htmlFragment; 111 | 112 | /** 113 | Converts the receiver into plain text. 114 | 115 | This is different from the `string` method of `NSAttributedString` by also erasing placeholders for text attachments. 116 | 117 | @returns The receiver converted to plain text. 118 | */ 119 | - (NSString *)plainTextString; 120 | 121 | #endif 122 | 123 | /** 124 | @name Creating Special Attributed Strings 125 | */ 126 | 127 | 128 | /** 129 | Create a prefix for a paragraph in a list 130 | 131 | @param listCounter The value for the list item. 132 | @param listStyle The list style 133 | @param listIndent The amount in px to indent the list 134 | @param attributes The attribute dictionary for the text to be prefixed 135 | @returns An attributed string with the list prefix 136 | */ 137 | + (NSAttributedString *)prefixForListItemWithCounter:(NSUInteger)listCounter listStyle:(DTCSSListStyle *)listStyle listIndent:(CGFloat)listIndent attributes:(NSDictionary *)attributes; 138 | 139 | @end 140 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSAttributedString+DTDebug.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedString+DTDebug.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 29.04.13. 6 | // Copyright (c) 2013 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | The *DTDebug* category contains methods for debugging and dumping attributed strings 13 | */ 14 | @interface NSAttributedString (DTDebug) 15 | 16 | - (void)dumpRangesOfAttribute:(id)attribute; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSAttributedString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedString+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/9/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | @class NSAttributedString; 10 | 11 | /** 12 | Methods for generating an `NSAttributedString` from HTML data. Those methods exist on Mac but have not been ported (publicly) to iOS. This project aims to remedy this. 13 | 14 | For a list of available options to pass to any of these methods please refer to [DTHTMLAttributedStringBuilder initWithHTML:options:documentAttributes:]. 15 | */ 16 | 17 | @interface NSAttributedString (HTML) 18 | 19 | /** 20 | @name Creating an NSAttributedString 21 | */ 22 | 23 | /** 24 | Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL. 25 | @param data The data in HTML format from which to create the attributed string. 26 | @param docAttributes Currently not in used. 27 | @returns Returns an initialized object, or `nil` if the data can’t be decoded. 28 | @see [DTHTMLAttributedStringBuilder initWithHTML:options:documentAttributes:] for a list of available options 29 | */ 30 | - (id)initWithHTMLData:(NSData *)data documentAttributes:(NSDictionary * __autoreleasing*)docAttributes; 31 | 32 | /** 33 | Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL. 34 | @param data The data in HTML format from which to create the attributed string. 35 | @param baseURL An `NSURL` that represents the base URL for all links within the HTML. 36 | @param docAttributes Currently not in used. 37 | @returns Returns an initialized object, or `nil` if the data can’t be decoded. 38 | @see [DTHTMLAttributedStringBuilder initWithHTML:options:documentAttributes:] for a list of available options 39 | */ 40 | - (id)initWithHTMLData:(NSData *)data baseURL:(NSURL *)baseURL documentAttributes:(NSDictionary * __autoreleasing*)docAttributes; 41 | 42 | /** 43 | Initializes and returns a new `NSAttributedString` object from the HTML contained in the given object and base URL. 44 | 45 | @param data The data in HTML format from which to create the attributed string. 46 | @param options Specifies how the document should be loaded. 47 | @param docAttributes Currently not in used. 48 | @returns Returns an initialized object, or `nil` if the data can’t be decoded. 49 | @see [DTHTMLAttributedStringBuilder initWithHTML:options:documentAttributes:] for a list of available options 50 | */ 51 | - (id)initWithHTMLData:(NSData *)data options:(NSDictionary *)options documentAttributes:(NSDictionary * __autoreleasing*)docAttributes; 52 | 53 | 54 | /** 55 | @name Working with Custom HTML Attributes 56 | */ 57 | 58 | /** 59 | Retrieves the dictionary of custom HTML attributes active at the given string index 60 | @param index The string index to query 61 | @returns The custom HTML attributes dictionary or `nil` if there aren't any at this index 62 | */ 63 | - (NSDictionary *)HTMLAttributesAtIndex:(NSUInteger)index; 64 | 65 | /** 66 | Retrieves the range that an attribute with a given name is active for, beginning with the passed index 67 | 68 | Since a custom HTML attribute can occur in multiple individual attribute dictionaries this extends the range from the passed index outwards until the full range of the custom HTML attribute has been found. Those range extensions have to have an identical value, as established by comparing them to the value of the custom attribute at the index with isEqual: 69 | @param name The name of the custom attribute to remove 70 | @param index The string index to query 71 | @returns The custom HTML attributes dictionary or `nil` if there aren't any at this index 72 | */ 73 | - (NSRange)rangeOfHTMLAttribute:(NSString *)name atIndex:(NSUInteger)index; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSAttributedString+SmallCaps.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedString+SmallCaps.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 31.01.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | /** 10 | Methods that generated an attributed string with Small Caps, even if the used fonts don't support them natively. 11 | 12 | This category works equally for Mac and iOS attributed strings. 13 | */ 14 | 15 | @interface NSAttributedString (SmallCaps) 16 | 17 | /** 18 | Creates an `NSAttributedString` from the given text and attributes and synthesizes small caps. On iPad there is only one font that has native small caps, for all other fonts the small caps are synthesized by reducing the font size for all lowercase characters. 19 | 20 | @param text The string to convert into an attributed string 21 | @param attributes A dictionary with attributes for the attributed string 22 | @returns An attributed string with synthesized small caps. 23 | */ 24 | + (NSAttributedString *)synthesizedSmallCapsAttributedStringWithText:(NSString *)text attributes:(NSDictionary *)attributes; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSAttributedStringRunDelegates.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSAttributedStringRunDelegates.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver on 14.01.11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #if TARGET_OS_IPHONE 10 | #import 11 | #elif TARGET_OS_MAC 12 | #import 13 | #endif 14 | 15 | void embeddedObjectDeallocCallback(void *context); 16 | CGFloat embeddedObjectGetAscentCallback(void *context); 17 | CGFloat embeddedObjectGetDescentCallback(void *context); 18 | CGFloat embeddedObjectGetWidthCallback(void *context); 19 | CTRunDelegateRef createEmbeddedObjectRunDelegate(id obj); 20 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSCharacterSet+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSCharacterSet+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/15/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Category on NSCharacterSet to create character sets frequently used and relevant to HTML and CSS string manipulations. Each character set is only initialized once. 13 | */ 14 | @interface NSCharacterSet (HTML) 15 | 16 | /** 17 | @name HTML Character Sets 18 | */ 19 | 20 | 21 | /** 22 | Creates an alpha-numeric character set, appropriate for tag names. 23 | @returns An NSCharacterSet with alpha-numeric characters. a-Z, 0-9. 24 | */ 25 | + (NSCharacterSet *)tagNameCharacterSet; 26 | 27 | 28 | /** 29 | Creates an alpha-numeric character set just as tagNameCharacterSet does but also with colon, dash, and underscore characters, appropriate for tag attribute names. 30 | @returns An NSCharacterSet with alpha-numeric characters and colon :, dash -, and underscore _'. 31 | */ 32 | + (NSCharacterSet *)tagAttributeNameCharacterSet; 33 | 34 | 35 | /** 36 | Creates a characterset of all whitespace and newline characters that can be ignored between HTML tags 37 | @returns An NSCharacterSet of ignorable characters 38 | */ 39 | + (NSCharacterSet *)ignorableWhitespaceCharacterSet; 40 | 41 | /** 42 | Creates a character set with the apostrophe character ' (used as single quote agnostic of direction) and double quote character " (agnostic of direction). 43 | @returns An NSCharacterSet with the single quote and double quote characters: ', ". 44 | */ 45 | + (NSCharacterSet *)quoteCharacterSet; 46 | 47 | 48 | /** 49 | Creates a character set with the characters forward slash / and closing angle bracket aka greater than sign >, then forms the union of this character set with the [whitespace character set](https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSCharacterSet_Class/Reference/Reference.html) which includes space, tab, newline, and nextline characters. Useful to find the end of an attribute. 50 | @returns An NSCharacterSet with the forward slash, closing angle bracket characters, tab, space, newline, and nextline characters. 51 | */ 52 | + (NSCharacterSet *)nonQuotedAttributeEndCharacterSet; 53 | 54 | 55 | /** 56 | @name CSS Character Sets 57 | */ 58 | 59 | /** 60 | Creates an alpha-numeric character set just as tagNameCharacterSet does but also with the dash and underscore characters. Does not contain the colon character because it will mess up parsing of CSS style attributes. Useful for CSS attribute names. 61 | @returns An NSCharacterSet with alpha-numeric characters, dash, and underscore characters. 62 | */ 63 | + (NSCharacterSet *)cssStyleAttributeNameCharacterSet; 64 | 65 | 66 | /** 67 | Characterset of characters that make up units in CSS values 68 | @returns An NSCharacterSet 69 | */ 70 | + (NSCharacterSet *)cssLengthValueCharacterSet; 71 | 72 | 73 | /** 74 | Characterset of characters that make up units in CSS lengths 75 | @returns An NSCharacterSet 76 | */ 77 | + (NSCharacterSet *)cssLengthUnitCharacterSet; 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSCoder+DTCompatibility.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSCoder+DTCompatibility.h 3 | // DTCoreText 4 | // 5 | // Created by Ryan Johnson on 14/02/19. 6 | // Copyright (c) 2014 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTCompatibility.h" 10 | 11 | @interface NSCoder (DTCompatibility) 12 | 13 | #if !TARGET_OS_IPHONE 14 | - (void)encodeCGSize:(CGSize)size forKey:(NSString *)key; 15 | - (CGSize)decodeCGSizeForKey:(NSString *)key; 16 | #endif 17 | 18 | - (void)encodeDTEdgeInsets:(DTEdgeInsets)insets forKey:(NSString *)key; 19 | - (DTEdgeInsets)decodeDTEdgeInsetsForKey:(NSString *)key; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSData+DTCrypto.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+DTCrypto.h 3 | // DTFoundation 4 | // 5 | // Created by Stefan Gugarel on 10/3/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Useful cryptography methods. 11 | */ 12 | 13 | @interface NSData (DTCrypto) 14 | 15 | /**------------------------------------------------------------------------------------- 16 | @name Generating HMAC Hashes 17 | --------------------------------------------------------------------------------------- 18 | */ 19 | 20 | /** 21 | Generates a HMAC from the receiver using the SHA1 algorithm 22 | @param key The encryption key 23 | @returns The encrypted hash 24 | */ 25 | - (NSData *)encryptedDataUsingSHA1WithKey:(NSData *)key; 26 | 27 | 28 | /**------------------------------------------------------------------------------------- 29 | @name Digest Hashes 30 | --------------------------------------------------------------------------------------- 31 | */ 32 | 33 | /** 34 | Generate an MD5 checksum from the receiver 35 | @returns An `NSData` containing the md5 digest. 36 | */ 37 | -(NSData *)dataWithMD5Hash; 38 | 39 | /** 40 | Generate an SHA1 checksum from the receiver 41 | @returns An `NSData` containing the SHA digest. 42 | */ 43 | - (NSData *)dataWithSHA1Hash; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSDictionary+DTCoreText.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+DTRichText.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 7/21/11. 6 | // Copyright 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | #import "DTCompatibility.h" 10 | 11 | @class DTCoreTextParagraphStyle; 12 | @class DTCoreTextFontDescriptor; 13 | 14 | /** 15 | Convenience methods for editors dealing with Core Text attribute dictionaries. 16 | */ 17 | @interface NSDictionary (DTCoreText) 18 | 19 | /** 20 | @name Getting State information 21 | */ 22 | 23 | /** 24 | Whether the font in the receiver's attributes is bold. 25 | @returns `YES` if the text has a bold trait 26 | */ 27 | - (BOOL)isBold; 28 | 29 | /** 30 | Whether the font in the receiver's attributes is italic. 31 | @returns `YES` if the text has an italic trait 32 | */ 33 | - (BOOL)isItalic; 34 | 35 | /** 36 | Whether the receiver's attributes contains underlining. 37 | @returns `YES` if the text is underlined 38 | */ 39 | - (BOOL)isUnderline; 40 | 41 | /** 42 | Whether the receiver's attributes contains strike-through. 43 | @returns `YES` if the text is strike-through 44 | */ 45 | - (BOOL)isStrikethrough; 46 | 47 | /** 48 | Whether the receiver's attributes contain a DTTextAttachment 49 | @returns `YES` if there is an attachment 50 | */ 51 | - (BOOL)hasAttachment; 52 | 53 | /** 54 | The header level of the receiver 55 | @returns The header level (1-6) or 0 if no header level is set 56 | */ 57 | - (NSUInteger)headerLevel; 58 | 59 | /** 60 | @name Getting Style Information 61 | */ 62 | 63 | /** 64 | Retrieves the DTCoreTextParagraphStyle from the receiver's attributes. This supports both `CTParagraphStyle` as well as `NSParagraphStyle` as a possible representation of the text's paragraph style. 65 | @returns The paragraph style 66 | */ 67 | - (DTCoreTextParagraphStyle *)paragraphStyle; 68 | 69 | /** 70 | Retrieves the DTCoreTextFontDescriptor from the receiver's attributes. This supports both `CTFont` as well as `UIFont` as a possible representation of the text's font. 71 | @returns The font descriptor 72 | */ 73 | - (DTCoreTextFontDescriptor *)fontDescriptor; 74 | 75 | /** 76 | Retrieves the foreground color. On iOS as UIColor, on Mac as NSColor. This supports both the CT as well as the NS/UIKit method of specifying the color. If no foreground color is defined in the receiver then black is assumed. 77 | @returns The platform-specific color defined for the foreground 78 | */ 79 | - (DTColor *)foregroundColor; 80 | 81 | /** 82 | Retrieves the background color. On iOS as UIColor, on Mac as NSColor. This supports both the DT as well as the NS/UIKit method of specifying the color. If no background color is defined in the receiver then `nil` is returned 83 | @returns The platform-specific color defined for the background, or `nil` if none is defined 84 | */ 85 | - (DTColor *)backgroundColor; 86 | 87 | /** 88 | The text kerning value 89 | @returns the kerning value 90 | */ 91 | - (CGFloat)kerning; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSDictionary+DTError.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+DTError.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 4/16/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | A collection of useful additions for `NSDictionary` to deal with Property Lists and also to get error handling for malformed data. 11 | */ 12 | 13 | @interface NSDictionary (DTError) 14 | 15 | /**------------------------------------------------------------------------------------- 16 | @name Property List Error Handling 17 | --------------------------------------------------------------------------------------- 18 | */ 19 | 20 | /** 21 | Creates and returns a dictionary using the keys and values found in a file specified by a given URL. 22 | 23 | @param URL An URL. The file identified by URL must contain a string representation of a property list whose root object is a dictionary. 24 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 25 | @return A new dictionary that contains the dictionary at path, or `nil` if there is a file error or if the contents of the file are an invalid representation of a dictionary. 26 | */ 27 | + (NSDictionary *)dictionaryWithContentsOfURL:(NSURL *)URL error:(NSError **)error; 28 | 29 | /** 30 | Creates and returns a dictionary using the keys and values found in a file specified by a given path. 31 | 32 | @param path A full or relative pathname. The file identified by path must contain a string representation of a property list whose root object is a dictionary. 33 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 34 | @return A new dictionary that contains the dictionary at path, or `nil` if there is a file error or if the contents of the file are an invalid representation of a dictionary. 35 | */ 36 | + (NSDictionary *)dictionaryWithContentsOfFile:(NSString *)path error:(NSError **)error; 37 | 38 | /** 39 | Creates and returns a dictionary using the keys and values found in the given data. 40 | 41 | @param data The data object identified by data must contain a string representation of a property list whose root object is a dictionary. 42 | @param error If an error occurs, upon returns contains an NSError object that describes the problem. If you are not interested in possible errors, pass in `NULL`. 43 | @return A new dictionary that contains the dictionary at path, or `nil` if there is a file error or if the contents of the file are an invalid representation of a dictionary. 44 | */ 45 | + (NSDictionary *)dictionaryWithContentsOfData:(NSData *)data error:(NSError **)error; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSFileWrapper+DTCopying.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSFileWrapper+DTCopying.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 10/19/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Methods for copying file wrappers. 11 | */ 12 | @interface NSFileWrapper (DTCopying) 13 | 14 | /** 15 | Creates a copy of the receiver by deep copying all contained sub filewrappers. 16 | */ 17 | - (NSFileWrapper *)fileWrapperByDeepCopying; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSMutableArray+DTMoving.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableArray+DTMoving.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 9/27/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Methods that add convenient moving methods to `NSMutableArray`. 11 | */ 12 | 13 | @interface NSMutableArray (DTMoving) 14 | 15 | /** 16 | Moves the object at the specified indexes to the new location. 17 | 18 | @param indexes The indexes of the objects to move. 19 | @param idx The index in the mutable array at which to insert the objects. 20 | */ 21 | - (void)moveObjectsAtIndexes:(NSIndexSet *)indexes toIndex:(NSUInteger)idx; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSMutableAttributedString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableAttributedString+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 4/14/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import "DTCoreTextConstants.h" 10 | 11 | @class DTCoreTextParagraphStyle, DTCoreTextFontDescriptor; 12 | 13 | /** 14 | Methods for appending `NSString` instances to mutable attributed strings 15 | */ 16 | @interface NSMutableAttributedString (HTML) 17 | 18 | /** 19 | Appends a string with the same attributes as this string to this string. 20 | 21 | If the last character of the receiver contains a placeholder for a it is removed from the appended string. Also fields (e.g. list prefixes) are not extended 22 | @param string The string to be appended to this string. */ 23 | - (void)appendString:(NSString *)string; 24 | 25 | /** 26 | Appends a string with a given paragraph style and font to this string. 27 | @param string The string to be appended to this string. 28 | @param paragraphStyle Paragraph style to be attributed to the appended string. 29 | @param fontDescriptor Font descriptor to be attributed to the appended string. */ 30 | - (void)appendString:(NSString *)string withParagraphStyle:(DTCoreTextParagraphStyle *)paragraphStyle fontDescriptor:(DTCoreTextFontDescriptor *)fontDescriptor; 31 | 32 | /** 33 | Adds the paragraph terminator `\n` and makes sure that the previous font and paragraph styles extend to include it 34 | */ 35 | - (void)appendEndOfParagraph; 36 | 37 | /** 38 | @name Working with Custom HTML Attributes 39 | */ 40 | 41 | /** 42 | Adds the custom HTML attributes with the given value on the given range, optionally replacing occurrences of an attribute with the same name. 43 | @param name The name of the custom HTML attribute 44 | @param value The value to set for the custom attribute 45 | @param range The range to add the custom attribute for 46 | @param replaceExisting `YES` if ranges that have an attribute with the same name should be replaced. With `NO` the attribute is only added for ranges where there is no attribute with the given name 47 | */ 48 | - (void)addHTMLAttribute:(NSString *)name value:(id)value range:(NSRange)range replaceExisting:(BOOL)replaceExisting; 49 | 50 | /** 51 | Adds the custom HTML attributes with the given value from the given range. 52 | @param name The name of the custom HTML attribute 53 | @param range The range to add the custom attribute for 54 | */ 55 | - (void)removeHTMLAttribute:(NSString *)name range:(NSRange)range; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSMutableString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableString+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 01.02.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | Categories needed for modifying mutable strings, as needed for DTCoreText. 12 | */ 13 | @interface NSMutableString (HTML) 14 | 15 | /** 16 | Removes the trailing whitespace from the receiver. 17 | */ 18 | - (void)removeTrailingWhitespace; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSNumber+RomanNumerals.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSNumber+RomanNumerals.h 3 | // DTCoreText 4 | // 5 | // Created by Kai Maschke on 26.07.16. 6 | // Copyright © 2016 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSNumber (RomanNumerals) 12 | 13 | - (NSString *)romanNumeral; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSScanner+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSScanner+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/12/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | @class DTColor; 10 | 11 | /** 12 | Extensions for NSScanner to deal with HTML-specific parsing, primarily CSS-related things 13 | */ 14 | @interface NSScanner (HTML) 15 | 16 | /** 17 | @name Working with CSS 18 | */ 19 | 20 | /** 21 | Scans for a CSS attribute used in CSS style sheets 22 | @param name An optional output parameter that will contain the name of the scanned attribute if successful 23 | @param value An optional output parameter that will contain the value of the scanned attribute if successful. This value may be a string or an array. 24 | @returns `YES` if an URL String could be scanned 25 | */ 26 | - (BOOL)scanCSSAttribute:(NSString * __autoreleasing*)name value:(id __autoreleasing*)value; 27 | 28 | 29 | /** 30 | Scans for URLs used in CSS style sheets 31 | @param urlString An optional output parameter that will contain the scanned URL string if successful 32 | @returns `YES` if an URL String could be scanned 33 | */ 34 | - (BOOL)scanCSSURL:(NSString * __autoreleasing*)urlString; 35 | 36 | 37 | /** 38 | Scans for a typical HTML color, typically either #FFFFFF, rgb(255,255,255) or a HTML color name. 39 | @param color An optional output parameter that will contain the scanned color if successful 40 | @returns `YES` if a color could be scanned 41 | */ 42 | - (BOOL)scanHTMLColor:(DTColor * __autoreleasing*)color; 43 | 44 | /** 45 | Scans for a typical HTML color, typically either #FFFFFF, rgb(255,255,255) or a HTML color name. 46 | @param color An optional output parameter that will contain the scanned color if successful 47 | @param name An optional output parameter that will contain the HTML color string 48 | @returns `YES` if a color could be scanned 49 | */ 50 | - (BOOL)scanHTMLColor:(DTColor * __autoreleasing*)color HTMLName:(NSString * __autoreleasing*)name; 51 | 52 | @end 53 | 54 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+CSS.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+CSS.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 31.01.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | @class DTColor; 10 | 11 | /** 12 | Methods to make dealing with CSS strings easier. Extract shadows from this string, extract CSS styles found in this string, extract the pixel size of a CSS measurement relative to the current text size, and extract the CSS pixel measurement of this string. 13 | */ 14 | @interface NSString (CSS) 15 | 16 | /** 17 | Examine a string for all CSS styles that are applied to it and return a dictionary of those styles. Implemented using scanCSSAttribute: which is defined in NSScanner+HTML.h. 18 | @returns A dictionary of strings containing the CSS styles which are applied to this string. 19 | */ 20 | - (NSDictionary *)dictionaryOfCSSStyles; 21 | 22 | /** 23 | Determines if the receiver contains a CSS length value, that is a number with optional period and unit (em, pt, px). 24 | @returns `YES` if this is a CSS length value 25 | */ 26 | - (BOOL)isCSSLengthValue; 27 | 28 | /** 29 | Calculates a pixel-based length from the receiver based on the current text size in pixels. Used in DTHTMLElement. 30 | @param textSize The current size which the CSS size is relative to. 31 | @param textScale The factor by which absolute sizes are scaled. Set to 1.0f to keep the original value. 32 | @returns A float that is the textSize 33 | */ 34 | - (CGFloat)pixelSizeOfCSSMeasureRelativeToCurrentTextSize:(CGFloat)textSize textScale:(CGFloat)textScale; 35 | 36 | /** 37 | Decodes edge inset values from the CSS attribute string. This is used for margin and padding which might have varying number of elements. 38 | @param textSize The current size which the CSS size is relative to. 39 | @param textScale The factor by which absolute sizes are scaled. Set to 1.0f to keep the original value. 40 | @returns The edge insets that this describes 41 | */ 42 | - (DTEdgeInsets)DTEdgeInsetsRelativeToCurrentTextSize:(CGFloat)textSize textScale:(CGFloat)textScale; 43 | 44 | /** 45 | Parse CSS shadow styles, consisting of color, blur, and offset, out of this string. The input string must be comma delimited in the format: ? ? where the third length and the color are not required per CSS shadows. To calculate the sizes of the blur and offset pixelSizeOfCSSMeasureRelativeToCurrentTextSize is used. Used in DTHTMLElement. 46 | @param textSize In order to determine the shadow offset we need what text size it will be displayed at. 47 | @param color Used if no shadow attribute color is found. 48 | @returns An array of dictionaries, each of which is a shadow consisting of color, blur, and offset keys value pairs. 49 | */ 50 | - (NSArray *)arrayOfCSSShadowsWithCurrentTextSize:(CGFloat)textSize currentColor:(DTColor *)color; 51 | 52 | /** 53 | Decodes a content attribute which might contained unicode sequences. 54 | */ 55 | - (NSString *)stringByDecodingCSSContentAttribute; 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+DTFormatNumbers.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+DTFormatNumbers.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 11/25/11. 6 | // Copyright (c) 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | A collection of category extensions for `NSString` dealing with the formatting of numbers in special contexts. 12 | */ 13 | 14 | @interface NSString (DTFormatNumbers) 15 | 16 | /**------------------------------------------------------------------------------------- 17 | @name Formatting File Sizes 18 | --------------------------------------------------------------------------------------- 19 | */ 20 | 21 | 22 | /** Formats the passed number as a byte value in a form that is pleasing to the user when displayed next to a progress bar. 23 | 24 | Output numbers are rounded to one decimal place. Bytes are not abbreviated because most users might not be used to B for that. Higher units are kB, MB, GB and TB. 25 | 26 | @param bytes The value of the bytes to be formatted 27 | @return Returns the formatted string. 28 | 29 | */ 30 | + (NSString *)stringByFormattingBytes:(long long)bytes; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+DTPaths.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+DTPaths.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 2/15/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | A collection of useful additions for `NSString` to deal with paths. 12 | */ 13 | 14 | @interface NSString (DTPaths) 15 | 16 | /**------------------------------------------------------------------------------------- 17 | @name Getting Standard Paths 18 | --------------------------------------------------------------------------------------- 19 | */ 20 | 21 | /** Determines the path to the Library/Caches folder in the current application's sandbox. 22 | 23 | The return value is cached on the first call. 24 | 25 | @return The path to the app's Caches folder. 26 | */ 27 | + (NSString *)cachesPath; 28 | 29 | 30 | /** Determines the path to the Documents folder in the current application's sandbox. 31 | 32 | The return value is cached on the first call. 33 | 34 | @return The path to the app's Documents folder. 35 | */ 36 | + (NSString *)documentsPath; 37 | 38 | /**------------------------------------------------------------------------------------- 39 | @name Getting Temporary Paths 40 | --------------------------------------------------------------------------------------- 41 | */ 42 | 43 | /** Determines the path for temporary files in the current application's sandbox. 44 | 45 | The return value is cached on the first call. This value is different in Simulator than on the actual device. In Simulator you get a reference to /tmp wheras on iOS devices it is a special folder inside the application folder. 46 | 47 | @return The path to the app's folder for temporary files. 48 | */ 49 | + (NSString *)temporaryPath; 50 | 51 | 52 | /** Creates a unique filename that can be used for one temporary file or folder. 53 | 54 | The returned string is different on every call. It is created by combining the result from temporaryPath with a unique UUID. 55 | 56 | @return The generated temporary path. 57 | */ 58 | + (NSString *)pathForTemporaryFile; 59 | 60 | 61 | /**------------------------------------------------------------------------------------- 62 | @name Working with Paths 63 | --------------------------------------------------------------------------------------- 64 | */ 65 | 66 | /** Appends or Increments a sequence number in brackets 67 | 68 | If the receiver already has a number suffix then it is incremented. If not then (1) is added. 69 | 70 | @return The incremented path 71 | */ 72 | - (NSString *)pathByIncrementingSequenceNumber; 73 | 74 | 75 | /** Removes a sequence number in brackets 76 | 77 | If the receiver number suffix then it is removed. If not the receiver is returned. 78 | 79 | @return The modified path 80 | */ 81 | - (NSString *)pathByDeletingSequenceNumber; 82 | 83 | 84 | 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+DTURLEncoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+DTURLEncoding.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 4/16/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | A collection of useful additions for `NSString` to deal with URL encoding. 11 | */ 12 | 13 | @interface NSString (DTURLEncoding) 14 | 15 | /**------------------------------------------------------------------------------------- 16 | @name Encoding Strings for URLs 17 | --------------------------------------------------------------------------------------- 18 | */ 19 | 20 | 21 | /** Encoding suitable for use in URLs. 22 | 23 | stringByAddingPercentEscapes does not replace serveral characters which are problematics in URLs. 24 | 25 | @return The encoded version of the receiver. 26 | */ 27 | - (NSString *)stringByURLEncoding; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+DTUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+DTUtilities.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 4/16/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | A collection of utility additions for `NSString`. 12 | */ 13 | 14 | @interface NSString (DTUtilities) 15 | 16 | /**------------------------------------------------------------------------------------- 17 | @name Working with Identifiers 18 | --------------------------------------------------------------------------------------- 19 | */ 20 | 21 | /** Creates a new string that contains a generated UUID. 22 | 23 | @return The path to the app's Caches folder. 24 | */ 25 | + (NSString *)stringWithUUID; 26 | 27 | 28 | /**------------------------------------------------------------------------------------- 29 | @name Working with Checksums 30 | --------------------------------------------------------------------------------------- 31 | */ 32 | 33 | /** creates an MD5 checksum 34 | 35 | @return returns an MD5 hash for the receiver. 36 | */ 37 | - (NSString *)md5Checksum; 38 | 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+HTML.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 1/9/11. 6 | // Copyright 2011 Drobnik.com. All rights reserved. 7 | // 8 | 9 | /** 10 | Methods for making HTML strings easier and quicker to handle. 11 | */ 12 | @interface NSString (HTML) 13 | 14 | /** 15 | Extract the numbers from this string and return them as an NSUInteger. 16 | @returns An NSUInteger of the number characters in this string. 17 | */ 18 | - (NSUInteger)integerValueFromHex; 19 | 20 | 21 | /** 22 | Test whether or not this string is numeric only. 23 | @returns If this string consists only of numeric characters 0-9. 24 | */ 25 | - (BOOL)isNumeric; 26 | 27 | /** 28 | Test whether the entire receiver consists of only whitespace characters. 29 | @returns `YES` if the receiver only has whitespace and newline characters 30 | */ 31 | - (BOOL)isIgnorableWhitespace; 32 | 33 | /** 34 | Read through this string and store the numbers included, then divide them by 100 giving a percentage. 35 | @returns The numbers contained in this string, as a percentage. 36 | */ 37 | - (float)percentValue; 38 | 39 | 40 | /** 41 | Return a copy of this string with all whitespace characters replaced by space characters. 42 | @returns A copy of this string with only space characters for whitespace. 43 | */ 44 | - (NSString *)stringByNormalizingWhitespace; 45 | 46 | 47 | /** 48 | Determines if the first character of this string is in the parameter characterSet. 49 | @param characterSet The character set to compare the first character of this string against. 50 | @returns If the first character of this string is in character set. 51 | */ 52 | - (BOOL)hasPrefixCharacterFromSet:(NSCharacterSet *)characterSet; 53 | 54 | 55 | /** 56 | Determines if the last character of this string is in the parameter characterSet. 57 | @param characterSet The character set to compare the last character of this string against. 58 | @returns If the last character of this string is in the character set. 59 | */ 60 | - (BOOL)hasSuffixCharacterFromSet:(NSCharacterSet *)characterSet; 61 | 62 | 63 | /** 64 | Convert a string into a proper HTML string by converting special characters into HTML entities. For example: an ellipsis `…` is represented by the entity `…` in order to display it correctly across text encodings. 65 | @returns A string containing HTML that now uses proper HTML entities. 66 | */ 67 | - (NSString *)stringByAddingHTMLEntities; 68 | 69 | 70 | /** 71 | Convert a string from HTML entities into correct character representations using UTF8 encoding. For example: an ellipsis entity represented by `…` is converted into `…`. 72 | @returns A string without HTML entities, instead having the actual characters formerly represented by HTML entities. 73 | */ 74 | - (NSString *)stringByReplacingHTMLEntities; 75 | 76 | 77 | /** 78 | Replaces occurrences of more two or more spaces with a range of alternating non-breaking space and regular space. It also encloses these parts with a span of class 'Apple-converted-space' 79 | */ 80 | - (NSString *)stringByAddingAppleConvertedSpace; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSString+Paragraphs.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Paragraphs.h 3 | // DTRichTextEditor 4 | // 5 | // Created by Oliver Drobnik on 11/11/11. 6 | // Copyright (c) 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | Methods simplifying dealing with text that is in paragraphs. 12 | 13 | The character used to separate paragraphs from each other is '\n'. 14 | */ 15 | @interface NSString (Paragraphs) 16 | 17 | /** 18 | Extends the given range such that it contains only full paragraphs. 19 | 20 | @param range The string range 21 | @param parBegIndex An optional output parameter that is filled with the beginning index of the extended range 22 | @param parEndIndex An optional output parameter that is filled with the ending index of the extended range 23 | @returns The extended string range 24 | */ 25 | - (NSRange)rangeOfParagraphsContainingRange:(NSRange)range parBegIndex:(NSUInteger *)parBegIndex parEndIndex:(NSUInteger *)parEndIndex; 26 | 27 | 28 | /** 29 | Determines if the given index is the first character of a new paragraph. 30 | 31 | This is done by examining the string, index 0 or characters following a newline are considered to be a first character of a new paragraph. 32 | @param index The index to examine 33 | @returns `YES` if the given index is the first character of a new paragraph, `NO` otherwise 34 | */ 35 | - (BOOL)indexIsAtBeginningOfParagraph:(NSUInteger)index; 36 | 37 | /** 38 | Returns the string range of the paragraph with the given index. 39 | 40 | @param index The paragraph index to inspect 41 | @returns The string range of the paragraph 42 | */ 43 | - (NSRange)rangeOfParagraphAtIndex:(NSUInteger)index; 44 | 45 | 46 | /** 47 | Counts the number of paragraphs in the receiver 48 | @returns The number of paragraph characters (\n) in the receiver 49 | */ 50 | - (NSUInteger)numberOfParagraphs; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSURL+DTAppLinks.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+DTAppLinks.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 11/25/11. 6 | // Copyright (c) 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | 10 | /** A collection of category extensions for `NSURL` that provide direct access to built-in app capabilities. 11 | 12 | For example: Open the app store on the page for the app 13 | 14 | NSURL *appURL = [NSURL appStoreURLforApplicationIdentifier:@"463623298"]; 15 | [[UIApplication sharedApplication] openURL:appURL]; 16 | */ 17 | 18 | @interface NSURL (DTAppLinks) 19 | 20 | /**------------------------------------------------------------------------------------- 21 | @name Mobile App Store Pages 22 | --------------------------------------------------------------------------------------- 23 | */ 24 | 25 | /** Returns the URL to open the mobile app store on the app's page. 26 | 27 | URL construction as described in [QA1629](https://developer.apple.com/library/ios/#qa/qa2008/qa1629.html). Test and found to be opening the app store app directly even without the itms: or itms-apps: scheme. This kind of URL can also be used to forward a link to the app to non-iOS devices. 28 | 29 | @param identifier The application identifier that gets assigned to a new app when you add it to iTunes Connect. 30 | @return Returns the URL to the direct app store link 31 | */ 32 | + (NSURL *)appStoreURLforApplicationIdentifier:(NSString *)identifier; 33 | 34 | 35 | /** Returns the URL to open the mobile app store on the app's review page. 36 | 37 | The reviews page is a sub-page of the normal app landing page you get with appStoreURLforApplicationIdentifier: 38 | 39 | @param identifier The application identifier that gets assigned to a new app when you add it to iTunes Connect. 40 | @return Returns the URL to the direct app store link 41 | */ 42 | + (NSURL *)appStoreReviewURLForApplicationIdentifier:(NSString *)identifier; 43 | 44 | @end 45 | 46 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSURL+DTComparing.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+DTComparing.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 13.11.12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Category for comparing URLs. 11 | 12 | Contrary to what you might think isEqual: does not work properly in many cases. 13 | */ 14 | 15 | @interface NSURL (DTComparing) 16 | 17 | /** 18 | Compares the receiver with another URL 19 | @param URL another URL 20 | @returns `YES` if the receiver is equivalent with the passed URL 21 | */ 22 | - (BOOL)isEqualToURL:(NSURL *)URL; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/NSURL+DTUnshorten.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+DTUnshorten.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 6/2/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** Method for getting the full length URL for a shortened one. 10 | 11 | For example: 12 | 13 | NSURL *url = [NSURL URLWithString:@"buff.ly/L4uGoza"]; 14 | 15 | [url unshortenWithCompletion:^(NSURL *url) { 16 | NSLog(@"Unshortened: %@", url); 17 | }]; 18 | 19 | */ 20 | 21 | typedef void (^NSURLUnshortenCompletionHandler)(NSURL *); 22 | 23 | @interface NSURL (DTUnshorten) 24 | 25 | /** 26 | Unshortens the receiver and returns the long URL via the completion handler. 27 | 28 | Results are cached and therefore a subsequent call for the same receiver will return instantly if the result is still present in the cache. 29 | @param completion The completion handler 30 | */ 31 | - (void)unshortenWithCompletion:(NSURLUnshortenCompletionHandler)completion; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/UIApplication+DTNetworkActivity.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+DTNetworkActivity.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 5/21/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Enhancement for `UIApplication` to properly count active network sessions and show the network activity indicator whenever there are more than 0 active sessions. 11 | */ 12 | @interface UIApplication (DTNetworkActivity) 13 | 14 | /** 15 | Increments the number of active network operations 16 | */ 17 | - (void)pushActiveNetworkOperation; 18 | 19 | /** 20 | Decrements the number of active network operations 21 | */ 22 | - (void)popActiveNetworkOperation; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/UIFont+DTCoreText.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+DTCoreText.h 3 | // DTCoreText 4 | // 5 | // Created by Oliver Drobnik on 11.12.12. 6 | // Copyright (c) 2012 Drobnik.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | Methods to translate from `CTFont` to `UIFont` 13 | */ 14 | 15 | @interface UIFont (DTCoreText) 16 | 17 | /** 18 | Creates a UIFont that matches the provided CTFont. 19 | @param ctFont a `CTFontRef` 20 | @returns The matching UIFont 21 | */ 22 | + (UIFont *)fontWithCTFont:(CTFontRef)ctFont; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/UIImage+DTFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+DTFoundation.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 3/8/12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Methods to help with working with images. 11 | */ 12 | @interface UIImage (DTFoundation) 13 | 14 | /** 15 | @name Generating Images 16 | */ 17 | 18 | /** 19 | Creates an image filled with a solid color 20 | @param color The solid color that fills the image 21 | @param size The size of the image 22 | @returns The image filled with given color and given size 23 | */ 24 | + (UIImage *)imageWithSolidColor:(UIColor *)color size:(CGSize)size; 25 | 26 | 27 | /** 28 | Creates an image filled with a tint color using the receiver as image mask. The resulting image ignores the receiver's color values and instead uses the alpha values combined with the passed color. 29 | @param color The color to use for tinting 30 | @returns A new image 31 | */ 32 | - (UIImage *)imageMaskedAndTintedWithColor:(UIColor *)color; 33 | 34 | /** 35 | @name Loading from RemoteURLs 36 | */ 37 | 38 | 39 | /** 40 | Creates and returns an image object synchronously by loading the image data from the specified URL and optionally caching it. 41 | 42 | Useful values for cachePolicy are: 43 | 44 | - NSURLRequestUseProtocolCachePolicy (default) 45 | - NSURLRequestReloadIgnoringLocalCacheData 46 | - NSURLRequestReturnCacheDataElseLoad 47 | - NSURLRequestReturnCacheDataDontLoad 48 | 49 | @param URL The URL to load the image from 50 | @param cachePolicy The cache policy to apply. 51 | @param error An optional output parameter to return an error if the loading fails 52 | @returns The image object for the specified URL, or nil if the method could not load the specified image. 53 | */ 54 | + (UIImage *)imageWithContentsOfURL:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy error:(NSError **)error; 55 | 56 | 57 | /** 58 | @name Drawing 59 | */ 60 | 61 | /** 62 | Mimicks the way images are drawn differently by UIImageView based on the set content mode. 63 | @param rect The rectangle to drawn in 64 | @param contentMode The content mode. Note that UIViewContentModeRedraw is treated the same as UIViewContentModeScaleToFill. 65 | */ 66 | - (void)drawInRect:(CGRect)rect withContentMode:(UIViewContentMode)contentMode; 67 | 68 | /** 69 | @name Working with Tiles 70 | */ 71 | 72 | /** 73 | Cuts out a tile at the given row and column 74 | 75 | @param column The index of the column 76 | @param columns The total number of columns 77 | @param row The index of the row 78 | @param rows The total number of rows 79 | @returns The resulting image 80 | */ 81 | - (UIImage *)tileImageAtColumn:(NSUInteger)column ofColumns:(NSUInteger)columns row:(NSUInteger)row ofRows:(NSUInteger)rows; 82 | 83 | /** 84 | Cuts out a tile at the given clip rect relative to the bounds 85 | 86 | @param clipRect The clipping rect to extract 87 | @param bounds The bounds to which the clipRect is relative to 88 | @param scale The image scale 89 | @returns The resulting image 90 | */ 91 | - (UIImage *)tileImageInClipRect:(CGRect)clipRect inBounds:(CGRect)bounds scale:(CGFloat)scale; 92 | 93 | 94 | /** 95 | @name Modifying Images 96 | */ 97 | 98 | /** 99 | Resizes the receiver to the given size. 100 | 101 | @param newSize The target image size 102 | @returns The resulting image 103 | */ 104 | - (UIImage *)imageScaledToSize:(CGSize)newSize; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/UIView+DTFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DTFoundation.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 12/23/11. 6 | // Copyright (c) 2011 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** DTFoundation enhancements for `UIView` */ 10 | 11 | @interface UIView (DTFoundation) 12 | 13 | /**--------------------------------------------------------------------------------------- 14 | * @name Getting Snapshot Images 15 | * --------------------------------------------------------------------------------------- 16 | */ 17 | 18 | /** Creates a snapshot of the receiver. 19 | 20 | @return Returns a bitmap image with the same contents and dimensions as the receiver. 21 | */ 22 | - (UIImage *)snapshotImage; 23 | 24 | 25 | /**--------------------------------------------------------------------------------------- 26 | * @name Rounded Corners 27 | * --------------------------------------------------------------------------------------- 28 | */ 29 | 30 | /** Sets the corner attributes of the receiver's layer. 31 | 32 | The advantage of using this method is that you do not need to import the QuartzCore headers just for setting the corners. 33 | @param radius The corner radius. 34 | @param width The width of the border line. 35 | @param color The color to be used for the border line. Can be `nil` to leave it unchanged. 36 | */ 37 | - (void)setRoundedCornersWithRadius:(CGFloat)radius width:(CGFloat)width color:(UIColor *)color; 38 | 39 | 40 | /**--------------------------------------------------------------------------------------- 41 | * @name Shadows 42 | * --------------------------------------------------------------------------------------- 43 | */ 44 | 45 | /** Adds a layer-based shadow to the receiver. 46 | 47 | The advantage of using this method is that you do not need to import the QuartzCore headers just for adding the shadow. 48 | Layer-based shadows are properly combined for views that are on the same superview. This does not add a shadow path, 49 | you should call updateShadowPathToBounds whenever the receiver's bounds change and also after setting the initial frame. 50 | @warn Disables clipping to bounds because this would also clip off the shadow. 51 | @param color The shadow color. Can be `nil` for default black. 52 | @param alpha The alpha value of the shadow. 53 | @param radius The amount that the shadow is blurred. 54 | @param offset The offset of the shadow 55 | @see updateShadowPathToBounds:withDuration: 56 | */ 57 | - (void)addShadowWithColor:(UIColor *)color alpha:(CGFloat)alpha radius:(CGFloat)radius offset:(CGSize)offset; 58 | 59 | 60 | /** sets the shadow path to fit the receiver's bounds. 61 | 62 | This should be called whenever the receiver's bounds change, or else the shadow detaches. 63 | @warn Since this a CALayer property it needs to be explicitly animated, for example in the willRotate ... method of a `UIViewController`. 64 | @param bounds The new bounds of the shadow path 65 | @param duration The animation duration. Specify a duration of 0 to not do an animation 66 | */ 67 | - (void)updateShadowPathToBounds:(CGRect)bounds withDuration:(NSTimeInterval)duration; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Headers/UIWebView+DTFoundation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+DTFoundation.h 3 | // DTFoundation 4 | // 5 | // Created by Oliver Drobnik on 25.05.12. 6 | // Copyright (c) 2012 Cocoanetics. All rights reserved. 7 | // 8 | 9 | /** 10 | Some convenient functions that can be also achieved if you know JavaScript, but are way more easy to remember like this. 11 | */ 12 | 13 | @interface UIWebView (DTFoundation) 14 | 15 | /** 16 | Getting the current document's title 17 | @returns A string with the document title 18 | */ 19 | - (NSString *)documentTitle; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/Info.plist -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module DTCoreText { 2 | umbrella header "DTCoreText.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/DTCoreText.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CTidy.h: -------------------------------------------------------------------------------- 1 | // 2 | // CTidy.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #ifdef TOUCHXMLUSETIDY 33 | 34 | #import 35 | 36 | #include "tidy.h" 37 | #include "buffio.h" 38 | 39 | typedef enum { 40 | TidyFormat_HTML, 41 | TidyFormat_XML, 42 | TidyFormat_XHTML, 43 | } CTidyFormat; 44 | 45 | @interface CTidy : NSObject 46 | + (NSString *)tidyEncodingFromStringEncoding:(NSStringEncoding)encoding; 47 | 48 | - (NSData *)tidyData:(NSData *)inData inputFormat:(CTidyFormat)inInputFormat outputFormat:(CTidyFormat)inOutputFormat encoding:(const char *)encoding diagnostics:(NSString **)outDiagnostics error:(NSError **)outError; 49 | 50 | - (NSString *)tidyString:(NSString *)inString inputFormat:(CTidyFormat)inInputFormat outputFormat:(CTidyFormat)inOutputFormat encoding:(const char *)encoding diagnostics:(NSString **)outDiagnostics error:(NSError **)outError; 51 | @end 52 | 53 | #endif /* TOUCHXMLUSETIDY */ 54 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXHTMLDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXHTMLDocument.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLDocument.h" 33 | 34 | 35 | @interface CXHTMLDocument : CXMLDocument { 36 | 37 | } 38 | 39 | - (id)initWithXHTMLData:(NSData *)inData encoding:(NSStringEncoding)encoding options:(NSUInteger)inOptions error:(NSError **)outError; 40 | - (id)initWithXHTMLString:(NSString *)inString options:(NSUInteger)inOptions error:(NSError **)outError; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLDocument_CreationExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLDocument_CreationExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 11/11/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLDocument.h" 33 | 34 | @interface CXMLDocument (CXMLDocument_CreationExtensions) 35 | 36 | //- (void)setVersion:(NSString *)version; //primitive 37 | //- (void)setStandalone:(BOOL)standalone; //primitive 38 | //- (void)setDocumentContentKind:(CXMLDocumentContentKind)kind; //primitive 39 | //- (void)setMIMEType:(NSString *)MIMEType; //primitive 40 | //- (void)setDTD:(CXMLDTD *)documentTypeDeclaration; //primitive 41 | //- (void)setRootElement:(CXMLNode *)root; 42 | - (void)insertChild:(CXMLNode *)child atIndex:(NSUInteger)index; 43 | //- (void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index; 44 | //- (void)removeChildAtIndex:(NSUInteger)index; //primitive 45 | //- (void)setChildren:(NSArray *)children; //primitive 46 | - (void)addChild:(CXMLNode *)child; 47 | //- (void)replaceChildAtIndex:(NSUInteger)index withNode:(CXMLNode *)node; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLDocument_PrivateExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLDocument_PrivateExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLDocument.h" 33 | 34 | #include 35 | 36 | @interface CXMLDocument (CXMLDocument_PrivateExtensions) 37 | 38 | //- (id)initWithLibXmlParserContext:(xmlParserCtxtPtr)inContext options:(NSUInteger)inOptions error:(NSError **)outError; 39 | 40 | - (NSMutableSet *)nodePool; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLElement.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLElement.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLNode.h" 33 | 34 | // NSXMLElement 35 | @interface CXMLElement : CXMLNode { 36 | 37 | } 38 | 39 | - (NSArray *)elementsForName:(NSString *)name; 40 | - (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)URI; 41 | 42 | - (NSArray *)attributes; 43 | - (CXMLNode *)attributeForName:(NSString *)name; 44 | - (CXMLNode *)attributeForLocalName:(NSString *)localName URI:(NSString *)URI; 45 | 46 | - (NSArray *)namespaces; 47 | - (CXMLNode *)namespaceForPrefix:(NSString *)name; 48 | - (CXMLNode *)resolveNamespaceForName:(NSString *)name; 49 | - (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI; 50 | 51 | //- (NSString*)_XMLStringWithOptions:(NSUInteger)options appendingToString:(NSMutableString*)str; 52 | @end 53 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLElement_CreationExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLElement_CreationExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 04/01/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLElement.h" 33 | 34 | @interface CXMLElement (CXMLElement_CreationExtensions) 35 | 36 | - (void)addChild:(CXMLNode *)inNode; 37 | 38 | - (void)addNamespace:(CXMLNode *)inNamespace; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLElement_ElementTreeExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLElement_ElementTreeExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 11/14/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLElement.h" 33 | 34 | 35 | @interface CXMLElement (CXMLElement_ElementTreeExtensions) 36 | 37 | - (CXMLElement *)subelement:(NSString *)inName; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLNamespaceNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLNamespaceNode.h 3 | // TouchXML 4 | // 5 | // Created by Jonathan Wight on 1/1/2000. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import 33 | #import "CXMLNode.h" 34 | #import "CXMLElement.h" 35 | 36 | @interface CXMLNamespaceNode : CXMLNode { 37 | 38 | NSString *_prefix; 39 | NSString *_uri; 40 | CXMLElement *_parent; 41 | } 42 | 43 | - (id) initWithPrefix:(NSString *)prefix URI:(NSString *)uri parentElement:(CXMLElement *)parent; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLNode.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import 33 | 34 | #include 35 | 36 | typedef enum { 37 | CXMLInvalidKind = 0, 38 | CXMLElementKind = XML_ELEMENT_NODE, 39 | CXMLAttributeKind = XML_ATTRIBUTE_NODE, 40 | CXMLTextKind = XML_TEXT_NODE, 41 | CXMLProcessingInstructionKind = XML_PI_NODE, 42 | CXMLCommentKind = XML_COMMENT_NODE, 43 | CXMLNotationDeclarationKind = XML_NOTATION_NODE, 44 | CXMLDTDKind = XML_DTD_NODE, 45 | CXMLElementDeclarationKind = XML_ELEMENT_DECL, 46 | CXMLAttributeDeclarationKind = XML_ATTRIBUTE_DECL, 47 | CXMLEntityDeclarationKind = XML_ENTITY_DECL, 48 | CXMLNamespaceKind = XML_NAMESPACE_DECL, 49 | CXMLEntityReferenceKind = XML_ENTITY_REF_NODE 50 | } CXMLNodeKind; 51 | 52 | @class CXMLDocument; 53 | 54 | // NSXMLNode 55 | @interface CXMLNode : NSObject { 56 | xmlNodePtr _node; 57 | BOOL _freeNodeOnRelease; 58 | } 59 | 60 | - (CXMLNodeKind)kind; 61 | - (NSString *)name; 62 | - (NSString *)stringValue; 63 | - (NSUInteger)index; 64 | - (NSUInteger)level; 65 | - (CXMLDocument *)rootDocument; 66 | - (CXMLNode *)parent; 67 | - (NSUInteger)childCount; 68 | - (NSArray *)children; 69 | - (CXMLNode *)childAtIndex:(NSUInteger)index; 70 | - (CXMLNode *)previousSibling; 71 | - (CXMLNode *)nextSibling; 72 | //- (CXMLNode *)previousNode; 73 | //- (CXMLNode *)nextNode; 74 | //- (NSString *)XPath; 75 | - (NSString *)localName; 76 | - (NSString *)prefix; 77 | - (NSString *)URI; 78 | + (NSString *)localNameForName:(NSString *)name; 79 | + (NSString *)prefixForName:(NSString *)name; 80 | + (CXMLNode *)predefinedNamespaceForPrefix:(NSString *)name; 81 | - (NSString *)description; 82 | - (NSString *)XMLString; 83 | - (NSString *)XMLStringWithOptions:(NSUInteger)options; 84 | //- (NSString *)canonicalXMLStringPreservingComments:(BOOL)comments; 85 | - (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error; 86 | @end 87 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLNode_CreationExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLNode_CreationExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 04/01/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLNode.h" 33 | 34 | @class CXMLElement; 35 | 36 | @interface CXMLNode (CXMLNode_CreationExtensions) 37 | 38 | //- (id)initWithKind:(NSXMLNodeKind)kind; 39 | //- (id)initWithKind:(NSXMLNodeKind)kind options:(NSUInteger)options; //primitive 40 | + (id)document; 41 | + (id)documentWithRootElement:(CXMLElement *)element; 42 | + (id)elementWithName:(NSString *)name; 43 | + (id)elementWithName:(NSString *)name URI:(NSString *)URI; 44 | + (id)elementWithName:(NSString *)name stringValue:(NSString *)string; 45 | //+ (id)elementWithName:(NSString *)name children:(NSArray *)children attributes:(NSArray *)attributes; 46 | //+ (id)attributeWithName:(NSString *)name stringValue:(NSString *)stringValue; 47 | //+ (id)attributeWithName:(NSString *)name URI:(NSString *)URI stringValue:(NSString *)stringValue; 48 | + (id)namespaceWithName:(NSString *)name stringValue:(NSString *)stringValue; 49 | + (id)processingInstructionWithName:(NSString *)name stringValue:(NSString *)stringValue; 50 | //+ (id)commentWithStringValue:(NSString *)stringValue; 51 | //+ (id)textWithStringValue:(NSString *)stringValue; 52 | //+ (id)DTDNodeWithXMLString:(NSString *)string; 53 | 54 | - (void)setStringValue:(NSString *)inStringValue; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLNode_PrivateExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLNode_PrivateExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 03/07/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLNode.h" 33 | 34 | @interface CXMLNode (CXMLNode_PrivateExtensions) 35 | 36 | @property (readonly, nonatomic, assign) xmlNodePtr node; 37 | 38 | - (id)initWithLibXMLNode:(xmlNodePtr)inLibXMLNode freeOnDealloc:(BOOL)infreeOnDealloc; 39 | 40 | + (id)nodeWithLibXMLNode:(xmlNodePtr)inLibXMLNode freeOnDealloc:(BOOL)infreeOnDealloc; 41 | 42 | + (Class)nodeClassForLibXMLNode:(xmlNodePtr)inLibXMLNode; 43 | 44 | - (void)invalidate; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLNode_XPathExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // CXMLNode_XPathExtensions.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 04/01/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLNode.h" 33 | 34 | @interface CXMLNode (CXMLNode_XPathExtensions) 35 | 36 | - (NSArray *)nodesForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error; 37 | - (CXMLNode *)nodeForXPath:(NSString *)xpath namespaceMappings:(NSDictionary *)inNamespaceMappings error:(NSError **)error; 38 | - (CXMLNode *)nodeForXPath:(NSString *)xpath error:(NSError **)outError; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/CXMLUnsupportedNode.h: -------------------------------------------------------------------------------- 1 | /** 2 | This is a "special" class which marks nodes types not supported by TouchXML. 3 | They could work... or not... becareful when you encounter them. 4 | */ 5 | 6 | #import "CXMLNode.h" 7 | 8 | @interface CXMLUnsupportedNode : CXMLNode 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Headers/TouchXML.h: -------------------------------------------------------------------------------- 1 | // 2 | // TouchXML.h 3 | // TouchCode 4 | // 5 | // Created by Jonathan Wight on 07/11/08. 6 | // Copyright 2011 toxicsoftware.com. All rights reserved. 7 | // 8 | // Redistribution and use in source and binary forms, with or without modification, are 9 | // permitted provided that the following conditions are met: 10 | // 11 | // 1. Redistributions of source code must retain the above copyright notice, this list of 12 | // conditions and the following disclaimer. 13 | // 14 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 15 | // of conditions and the following disclaimer in the documentation and/or other materials 16 | // provided with the distribution. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY TOXICSOFTWARE.COM ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 20 | // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL TOXICSOFTWARE.COM OR 21 | // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 24 | // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | // 28 | // The views and conclusions contained in the software and documentation are those of the 29 | // authors and should not be interpreted as representing official policies, either expressed 30 | // or implied, of toxicsoftware.com. 31 | 32 | #import "CXMLDocument.h" 33 | #import "CXMLDocument_CreationExtensions.h" 34 | #import "CXMLElement.h" 35 | #import "CXMLElement_CreationExtensions.h" 36 | #import "CXMLElement_ElementTreeExtensions.h" 37 | #import "CXMLNode.h" 38 | #import "CXMLNode_CreationExtensions.h" 39 | #import "CXMLNode_XPathExtensions.h" 40 | #import "CXMLUnsupportedNode.h" 41 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/TouchXML.framework/Info.plist -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TouchXML { 2 | umbrella header "TouchXML.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/TouchXML.framework/TouchXML: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/TouchXML.framework/TouchXML -------------------------------------------------------------------------------- /DUAReader/ThirdKit/ZipArchive.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/ZipArchive.framework/Info.plist -------------------------------------------------------------------------------- /DUAReader/ThirdKit/ZipArchive.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module ZipArchive { 2 | umbrella header "ZipArchive.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DUAReader/ThirdKit/ZipArchive.framework/ZipArchive: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/DUAReader/ThirdKit/ZipArchive.framework/ZipArchive -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DUAReader 2 | 电子书阅读器,支持txt,epub(图文混排),纯swift编写,自动提取章节,支持翻页模式切换,更改背景,字体字号,章节跳转等各种常用功能 3 | 4 | An e-book reader, supporting txt, epub, written in swift, has a variety of commonly used features, including automatic extraction of chapters, page turning mode switching, changing the background, font size, chapter jump, etc. 5 | 6 | ![image](https://github.com/nothot/DUAReader/blob/master/reader.gif) 7 | 8 | # 20180721 Updated 9 | DUAReader现全面支持Objective-C,兼容Objective-C的版本将在fitOC分支单独维护,获取方式: 10 | 11 | DUAReader now fully supports Objective-C, and the Objective-C compatible version will be maintained separately in the fitOC branch 12 | 13 | - 克隆代码到本地 14 | 15 | git clone https://github.com/nothot/DUAReader.git 16 | 17 | - 切换到fitOC分支 18 | 19 | git checkout -b fitOC origin/fitOC 20 | 21 | # Example 22 | ``` 23 |        // txt示例 24 |        mreader = DUAReader() 25 | let configuration = DUAConfiguration.init() 26 | configuration.backgroundImage = UIImage.init(named: "backImg.jpg") 27 | mreader.config = configuration 28 | mreader.delegate = self 29 | self.present(mreader, animated: true, completion: nil) 30 | let bookPath = Bundle.main.path(forResource: "郭黄之恋", ofType: "txt") 31 | mreader.readWith(filePath: bookPath!, pageIndex: 1) 32 | ``` 33 | ``` 34 |        // epub示例 35 |        mreader = DUAReader() 36 | let configuration = DUAConfiguration.init() 37 | configuration.backgroundImage = UIImage.init(named: "backImg.jpg") 38 |        configuration.bookType = .epub // 默认TXT类型 39 |        mreader.config = configuration 40 | mreader.delegate = self 41 | self.present(mreader, animated: true, completion: nil) 42 | let epubPath = Bundle.main.path(forResource: "每天懂一点好玩心理学", ofType: "epub") 43 | mreader.readWith(filePath: epubPath!, pageIndex: 1) 44 | ``` 45 | 更多细节可参考demo 46 | 47 | See demo for more details 48 | 49 | 可以引入源码或编译为framework进行使用,注意工程需要添加libxml2动态库依赖,可参看demo工程(epub解析需要) 50 | 51 | **说明** 52 | 项目中引入了三个第三方framework是由objective-C编写,项目本身为swift编写 53 | -------------------------------------------------------------------------------- /reader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nothot/DUAReader/b7d53cf62070f2563887a331ee8fb4cfa416d63c/reader.gif --------------------------------------------------------------------------------