marinofaggiana 5 éve
szülő
commit
5988826a08
74 módosított fájl, 164 hozzáadás és 7609 törlés
  1. 20 260
      Nextcloud.xcodeproj/project.pbxproj
  2. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-076.png
  3. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-120.png
  4. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-152.png
  5. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-167.png
  6. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-180.png
  7. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H.png
  8. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H@2x.png
  9. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H@3x.png
  10. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N.png
  11. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N@2x.png
  12. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N@3x.png
  13. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email.png
  14. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email@2x.png
  15. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email@3x.png
  16. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export.png
  17. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export@2x.png
  18. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export@3x.png
  19. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N.png
  20. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N@2x.png
  21. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N@3x.png
  22. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y.png
  23. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y@2x.png
  24. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y@3x.png
  25. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print.png
  26. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print@2x.png
  27. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print@3x.png
  28. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs.png
  29. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs@2x.png
  30. BIN
      iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs@3x.png
  31. 0 39
      iOSClient/Library/VFR Pdf Reader/Sources/CGPDFDocument.h
  32. 0 242
      iOSClient/Library/VFR Pdf Reader/Sources/CGPDFDocument.m
  33. 0 39
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderConstants.h
  34. 0 28
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderConstants.m
  35. 0 50
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentPage.h
  36. 0 595
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentPage.m
  37. 0 31
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentTile.h
  38. 0 71
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentTile.m
  39. 0 66
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentView.h
  40. 0 402
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentView.m
  41. 0 55
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocument.h
  42. 0 354
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocument.m
  43. 0 45
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocumentOutline.h
  44. 0 467
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocumentOutline.m
  45. 0 88
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainPagebar.h
  46. 0 642
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainPagebar.m
  47. 0 57
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainToolbar.h
  48. 0 356
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainToolbar.m
  49. 0 54
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbCache.h
  50. 0 228
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbCache.m
  51. 0 36
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbFetch.h
  52. 0 128
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbFetch.m
  53. 0 54
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbQueue.h
  54. 0 141
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbQueue.m
  55. 0 36
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRender.h
  56. 0 204
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRender.m
  57. 0 45
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRequest.h
  58. 0 96
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRequest.m
  59. 0 45
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbView.h
  60. 0 93
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbView.m
  61. 0 68
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbsView.h
  62. 0 545
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbsView.m
  63. 0 53
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.h
  64. 0 928
      iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.m
  65. 0 47
      iOSClient/Library/VFR Pdf Reader/Sources/ThumbsMainToolbar.h
  66. 0 169
      iOSClient/Library/VFR Pdf Reader/Sources/ThumbsMainToolbar.m
  67. 0 66
      iOSClient/Library/VFR Pdf Reader/Sources/ThumbsViewController.h
  68. 0 514
      iOSClient/Library/VFR Pdf Reader/Sources/ThumbsViewController.m
  69. 0 40
      iOSClient/Library/VFR Pdf Reader/Sources/UIXToolbarView.h
  70. 0 131
      iOSClient/Library/VFR Pdf Reader/Sources/UIXToolbarView.m
  71. 60 0
      iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeader.swift
  72. 32 0
      iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeaderView.swift
  73. 51 0
      iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeaderView.xib
  74. 1 1
      iOSClient/Main/NCDetailNavigationController.swift

+ 20 - 260
Nextcloud.xcodeproj/project.pbxproj

@@ -93,6 +93,9 @@
 		F710D1F52405770F00A6033D /* NCViewerPDF.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F42405770F00A6033D /* NCViewerPDF.swift */; };
 		F710D1F724057C9400A6033D /* NCDetailNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */; };
 		F710D1F924057C9D00A6033D /* NCDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1F824057C9D00A6033D /* NCDetailViewController.swift */; };
+		F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1FB24057E5E00A6033D /* NCActionSheetHeader.swift */; };
+		F710D1FF24057E5E00A6033D /* NCActionSheetHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F710D1FC24057E5E00A6033D /* NCActionSheetHeaderView.swift */; };
+		F710D20024057E5E00A6033D /* NCActionSheetHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F710D1FD24057E5E00A6033D /* NCActionSheetHeaderView.xib */; };
 		F710E8111EF95C9C00DC2427 /* ImagesIntro.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F710E80F1EF95C9C00DC2427 /* ImagesIntro.xcassets */; };
 		F71459B81D12E3B700CAFEEC /* CCError.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B881C638A4C00DC4301 /* CCError.m */; };
 		F71459BA1D12E3B700CAFEEC /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
@@ -492,55 +495,6 @@
 		F7D2D127230804E000FD3ED7 /* NCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */; };
 		F7D2D128230804E000FD3ED7 /* NCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */; };
 		F7D2D129230804E000FD3ED7 /* NCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */; };
-		F7D423331F0596AC009C9782 /* AppIcon-076.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423161F0596AC009C9782 /* AppIcon-076.png */; };
-		F7D423341F0596AC009C9782 /* AppIcon-120.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423171F0596AC009C9782 /* AppIcon-120.png */; };
-		F7D423351F0596AC009C9782 /* AppIcon-152.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423181F0596AC009C9782 /* AppIcon-152.png */; };
-		F7D423361F0596AC009C9782 /* AppIcon-167.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423191F0596AC009C9782 /* AppIcon-167.png */; };
-		F7D423371F0596AC009C9782 /* AppIcon-180.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231A1F0596AC009C9782 /* AppIcon-180.png */; };
-		F7D423381F0596AC009C9782 /* Reader-Button-H.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231B1F0596AC009C9782 /* Reader-Button-H.png */; };
-		F7D423391F0596AC009C9782 /* Reader-Button-H@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231C1F0596AC009C9782 /* Reader-Button-H@2x.png */; };
-		F7D4233A1F0596AC009C9782 /* Reader-Button-H@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231D1F0596AC009C9782 /* Reader-Button-H@3x.png */; };
-		F7D4233B1F0596AC009C9782 /* Reader-Button-N.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231E1F0596AC009C9782 /* Reader-Button-N.png */; };
-		F7D4233C1F0596AC009C9782 /* Reader-Button-N@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4231F1F0596AC009C9782 /* Reader-Button-N@2x.png */; };
-		F7D4233D1F0596AC009C9782 /* Reader-Button-N@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423201F0596AC009C9782 /* Reader-Button-N@3x.png */; };
-		F7D4233E1F0596AC009C9782 /* Reader-Email.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423211F0596AC009C9782 /* Reader-Email.png */; };
-		F7D4233F1F0596AC009C9782 /* Reader-Email@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423221F0596AC009C9782 /* Reader-Email@2x.png */; };
-		F7D423401F0596AC009C9782 /* Reader-Email@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423231F0596AC009C9782 /* Reader-Email@3x.png */; };
-		F7D423411F0596AC009C9782 /* Reader-Export.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423241F0596AC009C9782 /* Reader-Export.png */; };
-		F7D423421F0596AC009C9782 /* Reader-Export@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423251F0596AC009C9782 /* Reader-Export@2x.png */; };
-		F7D423431F0596AC009C9782 /* Reader-Export@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423261F0596AC009C9782 /* Reader-Export@3x.png */; };
-		F7D423441F0596AC009C9782 /* Reader-Mark-N.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423271F0596AC009C9782 /* Reader-Mark-N.png */; };
-		F7D423451F0596AC009C9782 /* Reader-Mark-N@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423281F0596AC009C9782 /* Reader-Mark-N@2x.png */; };
-		F7D423461F0596AC009C9782 /* Reader-Mark-N@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423291F0596AC009C9782 /* Reader-Mark-N@3x.png */; };
-		F7D423471F0596AC009C9782 /* Reader-Mark-Y.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232A1F0596AC009C9782 /* Reader-Mark-Y.png */; };
-		F7D423481F0596AC009C9782 /* Reader-Mark-Y@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232B1F0596AC009C9782 /* Reader-Mark-Y@2x.png */; };
-		F7D423491F0596AC009C9782 /* Reader-Mark-Y@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232C1F0596AC009C9782 /* Reader-Mark-Y@3x.png */; };
-		F7D4234A1F0596AC009C9782 /* Reader-Print.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232D1F0596AC009C9782 /* Reader-Print.png */; };
-		F7D4234B1F0596AC009C9782 /* Reader-Print@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232E1F0596AC009C9782 /* Reader-Print@2x.png */; };
-		F7D4234C1F0596AC009C9782 /* Reader-Print@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D4232F1F0596AC009C9782 /* Reader-Print@3x.png */; };
-		F7D4234D1F0596AC009C9782 /* Reader-Thumbs.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423301F0596AC009C9782 /* Reader-Thumbs.png */; };
-		F7D4234E1F0596AC009C9782 /* Reader-Thumbs@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423311F0596AC009C9782 /* Reader-Thumbs@2x.png */; };
-		F7D4234F1F0596AC009C9782 /* Reader-Thumbs@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = F7D423321F0596AC009C9782 /* Reader-Thumbs@3x.png */; };
-		F7D423791F0596C6009C9782 /* CGPDFDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423521F0596C6009C9782 /* CGPDFDocument.m */; };
-		F7D4237A1F0596C6009C9782 /* ReaderConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423541F0596C6009C9782 /* ReaderConstants.m */; };
-		F7D4237B1F0596C6009C9782 /* ReaderContentPage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423561F0596C6009C9782 /* ReaderContentPage.m */; };
-		F7D4237C1F0596C6009C9782 /* ReaderContentTile.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423581F0596C6009C9782 /* ReaderContentTile.m */; };
-		F7D4237D1F0596C6009C9782 /* ReaderContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4235A1F0596C6009C9782 /* ReaderContentView.m */; };
-		F7D4237E1F0596C6009C9782 /* ReaderDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4235C1F0596C6009C9782 /* ReaderDocument.m */; };
-		F7D4237F1F0596C6009C9782 /* ReaderDocumentOutline.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4235E1F0596C6009C9782 /* ReaderDocumentOutline.m */; };
-		F7D423801F0596C6009C9782 /* ReaderMainPagebar.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423601F0596C6009C9782 /* ReaderMainPagebar.m */; };
-		F7D423811F0596C6009C9782 /* ReaderMainToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423621F0596C6009C9782 /* ReaderMainToolbar.m */; };
-		F7D423821F0596C6009C9782 /* ReaderThumbCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423641F0596C6009C9782 /* ReaderThumbCache.m */; };
-		F7D423831F0596C6009C9782 /* ReaderThumbFetch.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423661F0596C6009C9782 /* ReaderThumbFetch.m */; };
-		F7D423841F0596C6009C9782 /* ReaderThumbQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423681F0596C6009C9782 /* ReaderThumbQueue.m */; };
-		F7D423851F0596C6009C9782 /* ReaderThumbRender.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4236A1F0596C6009C9782 /* ReaderThumbRender.m */; };
-		F7D423861F0596C6009C9782 /* ReaderThumbRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4236C1F0596C6009C9782 /* ReaderThumbRequest.m */; };
-		F7D423871F0596C6009C9782 /* ReaderThumbsView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4236E1F0596C6009C9782 /* ReaderThumbsView.m */; };
-		F7D423881F0596C6009C9782 /* ReaderThumbView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423701F0596C6009C9782 /* ReaderThumbView.m */; };
-		F7D423891F0596C6009C9782 /* ReaderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423721F0596C6009C9782 /* ReaderViewController.m */; };
-		F7D4238A1F0596C6009C9782 /* ThumbsMainToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423741F0596C6009C9782 /* ThumbsMainToolbar.m */; };
-		F7D4238B1F0596C6009C9782 /* ThumbsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423761F0596C6009C9782 /* ThumbsViewController.m */; };
-		F7D4238C1F0596C6009C9782 /* UIXToolbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D423781F0596C6009C9782 /* UIXToolbarView.m */; };
 		F7D4B6852295663D000C2C86 /* GoogleAppMeasurement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D4B67D2295663D000C2C86 /* GoogleAppMeasurement.framework */; };
 		F7D4B6862295663D000C2C86 /* FirebaseCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D4B67E2295663D000C2C86 /* FirebaseCore.framework */; };
 		F7D4B6872295663D000C2C86 /* FirebaseAnalytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7D4B67F2295663D000C2C86 /* FirebaseAnalytics.framework */; };
@@ -782,6 +736,9 @@
 		F710D1F42405770F00A6033D /* NCViewerPDF.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerPDF.swift; sourceTree = "<group>"; };
 		F710D1F624057C9400A6033D /* NCDetailNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDetailNavigationController.swift; sourceTree = "<group>"; };
 		F710D1F824057C9D00A6033D /* NCDetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCDetailViewController.swift; sourceTree = "<group>"; };
+		F710D1FB24057E5E00A6033D /* NCActionSheetHeader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCActionSheetHeader.swift; sourceTree = "<group>"; };
+		F710D1FC24057E5E00A6033D /* NCActionSheetHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCActionSheetHeaderView.swift; sourceTree = "<group>"; };
+		F710D1FD24057E5E00A6033D /* NCActionSheetHeaderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCActionSheetHeaderView.xib; sourceTree = "<group>"; };
 		F710E80F1EF95C9C00DC2427 /* ImagesIntro.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ImagesIntro.xcassets; sourceTree = "<group>"; };
 		F7151A811D477A4B00E6AF45 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
 		F7169A171EE590930086BD69 /* NCShares.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCShares.h; sourceTree = "<group>"; };
@@ -1277,75 +1234,6 @@
 		F7D1611F23CF19E30039EBBF /* NCViewerRichWorkspace.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerRichWorkspace.storyboard; sourceTree = "<group>"; };
 		F7D2D125230804DF00FD3ED7 /* NCXMLListParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCXMLListParser.h; sourceTree = "<group>"; };
 		F7D2D126230804E000FD3ED7 /* NCXMLListParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCXMLListParser.m; sourceTree = "<group>"; };
-		F7D423161F0596AC009C9782 /* AppIcon-076.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon-076.png"; sourceTree = "<group>"; };
-		F7D423171F0596AC009C9782 /* AppIcon-120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon-120.png"; sourceTree = "<group>"; };
-		F7D423181F0596AC009C9782 /* AppIcon-152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon-152.png"; sourceTree = "<group>"; };
-		F7D423191F0596AC009C9782 /* AppIcon-167.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon-167.png"; sourceTree = "<group>"; };
-		F7D4231A1F0596AC009C9782 /* AppIcon-180.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "AppIcon-180.png"; sourceTree = "<group>"; };
-		F7D4231B1F0596AC009C9782 /* Reader-Button-H.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-H.png"; sourceTree = "<group>"; };
-		F7D4231C1F0596AC009C9782 /* Reader-Button-H@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-H@2x.png"; sourceTree = "<group>"; };
-		F7D4231D1F0596AC009C9782 /* Reader-Button-H@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-H@3x.png"; sourceTree = "<group>"; };
-		F7D4231E1F0596AC009C9782 /* Reader-Button-N.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-N.png"; sourceTree = "<group>"; };
-		F7D4231F1F0596AC009C9782 /* Reader-Button-N@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-N@2x.png"; sourceTree = "<group>"; };
-		F7D423201F0596AC009C9782 /* Reader-Button-N@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Button-N@3x.png"; sourceTree = "<group>"; };
-		F7D423211F0596AC009C9782 /* Reader-Email.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Email.png"; sourceTree = "<group>"; };
-		F7D423221F0596AC009C9782 /* Reader-Email@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Email@2x.png"; sourceTree = "<group>"; };
-		F7D423231F0596AC009C9782 /* Reader-Email@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Email@3x.png"; sourceTree = "<group>"; };
-		F7D423241F0596AC009C9782 /* Reader-Export.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Export.png"; sourceTree = "<group>"; };
-		F7D423251F0596AC009C9782 /* Reader-Export@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Export@2x.png"; sourceTree = "<group>"; };
-		F7D423261F0596AC009C9782 /* Reader-Export@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Export@3x.png"; sourceTree = "<group>"; };
-		F7D423271F0596AC009C9782 /* Reader-Mark-N.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-N.png"; sourceTree = "<group>"; };
-		F7D423281F0596AC009C9782 /* Reader-Mark-N@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-N@2x.png"; sourceTree = "<group>"; };
-		F7D423291F0596AC009C9782 /* Reader-Mark-N@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-N@3x.png"; sourceTree = "<group>"; };
-		F7D4232A1F0596AC009C9782 /* Reader-Mark-Y.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-Y.png"; sourceTree = "<group>"; };
-		F7D4232B1F0596AC009C9782 /* Reader-Mark-Y@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-Y@2x.png"; sourceTree = "<group>"; };
-		F7D4232C1F0596AC009C9782 /* Reader-Mark-Y@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Mark-Y@3x.png"; sourceTree = "<group>"; };
-		F7D4232D1F0596AC009C9782 /* Reader-Print.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Print.png"; sourceTree = "<group>"; };
-		F7D4232E1F0596AC009C9782 /* Reader-Print@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Print@2x.png"; sourceTree = "<group>"; };
-		F7D4232F1F0596AC009C9782 /* Reader-Print@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Print@3x.png"; sourceTree = "<group>"; };
-		F7D423301F0596AC009C9782 /* Reader-Thumbs.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Thumbs.png"; sourceTree = "<group>"; };
-		F7D423311F0596AC009C9782 /* Reader-Thumbs@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Thumbs@2x.png"; sourceTree = "<group>"; };
-		F7D423321F0596AC009C9782 /* Reader-Thumbs@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Reader-Thumbs@3x.png"; sourceTree = "<group>"; };
-		F7D423511F0596C6009C9782 /* CGPDFDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGPDFDocument.h; sourceTree = "<group>"; };
-		F7D423521F0596C6009C9782 /* CGPDFDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGPDFDocument.m; sourceTree = "<group>"; };
-		F7D423531F0596C6009C9782 /* ReaderConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderConstants.h; sourceTree = "<group>"; };
-		F7D423541F0596C6009C9782 /* ReaderConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderConstants.m; sourceTree = "<group>"; };
-		F7D423551F0596C6009C9782 /* ReaderContentPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderContentPage.h; sourceTree = "<group>"; };
-		F7D423561F0596C6009C9782 /* ReaderContentPage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderContentPage.m; sourceTree = "<group>"; };
-		F7D423571F0596C6009C9782 /* ReaderContentTile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderContentTile.h; sourceTree = "<group>"; };
-		F7D423581F0596C6009C9782 /* ReaderContentTile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderContentTile.m; sourceTree = "<group>"; };
-		F7D423591F0596C6009C9782 /* ReaderContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderContentView.h; sourceTree = "<group>"; };
-		F7D4235A1F0596C6009C9782 /* ReaderContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderContentView.m; sourceTree = "<group>"; };
-		F7D4235B1F0596C6009C9782 /* ReaderDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderDocument.h; sourceTree = "<group>"; };
-		F7D4235C1F0596C6009C9782 /* ReaderDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderDocument.m; sourceTree = "<group>"; };
-		F7D4235D1F0596C6009C9782 /* ReaderDocumentOutline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderDocumentOutline.h; sourceTree = "<group>"; };
-		F7D4235E1F0596C6009C9782 /* ReaderDocumentOutline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderDocumentOutline.m; sourceTree = "<group>"; };
-		F7D4235F1F0596C6009C9782 /* ReaderMainPagebar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderMainPagebar.h; sourceTree = "<group>"; };
-		F7D423601F0596C6009C9782 /* ReaderMainPagebar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderMainPagebar.m; sourceTree = "<group>"; };
-		F7D423611F0596C6009C9782 /* ReaderMainToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderMainToolbar.h; sourceTree = "<group>"; };
-		F7D423621F0596C6009C9782 /* ReaderMainToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderMainToolbar.m; sourceTree = "<group>"; };
-		F7D423631F0596C6009C9782 /* ReaderThumbCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbCache.h; sourceTree = "<group>"; };
-		F7D423641F0596C6009C9782 /* ReaderThumbCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbCache.m; sourceTree = "<group>"; };
-		F7D423651F0596C6009C9782 /* ReaderThumbFetch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbFetch.h; sourceTree = "<group>"; };
-		F7D423661F0596C6009C9782 /* ReaderThumbFetch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbFetch.m; sourceTree = "<group>"; };
-		F7D423671F0596C6009C9782 /* ReaderThumbQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbQueue.h; sourceTree = "<group>"; };
-		F7D423681F0596C6009C9782 /* ReaderThumbQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbQueue.m; sourceTree = "<group>"; };
-		F7D423691F0596C6009C9782 /* ReaderThumbRender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbRender.h; sourceTree = "<group>"; };
-		F7D4236A1F0596C6009C9782 /* ReaderThumbRender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbRender.m; sourceTree = "<group>"; };
-		F7D4236B1F0596C6009C9782 /* ReaderThumbRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbRequest.h; sourceTree = "<group>"; };
-		F7D4236C1F0596C6009C9782 /* ReaderThumbRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbRequest.m; sourceTree = "<group>"; };
-		F7D4236D1F0596C6009C9782 /* ReaderThumbsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbsView.h; sourceTree = "<group>"; };
-		F7D4236E1F0596C6009C9782 /* ReaderThumbsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbsView.m; sourceTree = "<group>"; };
-		F7D4236F1F0596C6009C9782 /* ReaderThumbView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderThumbView.h; sourceTree = "<group>"; };
-		F7D423701F0596C6009C9782 /* ReaderThumbView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderThumbView.m; sourceTree = "<group>"; };
-		F7D423711F0596C6009C9782 /* ReaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReaderViewController.h; sourceTree = "<group>"; };
-		F7D423721F0596C6009C9782 /* ReaderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReaderViewController.m; sourceTree = "<group>"; };
-		F7D423731F0596C6009C9782 /* ThumbsMainToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThumbsMainToolbar.h; sourceTree = "<group>"; };
-		F7D423741F0596C6009C9782 /* ThumbsMainToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThumbsMainToolbar.m; sourceTree = "<group>"; };
-		F7D423751F0596C6009C9782 /* ThumbsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThumbsViewController.h; sourceTree = "<group>"; };
-		F7D423761F0596C6009C9782 /* ThumbsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThumbsViewController.m; sourceTree = "<group>"; };
-		F7D423771F0596C6009C9782 /* UIXToolbarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIXToolbarView.h; sourceTree = "<group>"; };
-		F7D423781F0596C6009C9782 /* UIXToolbarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIXToolbarView.m; sourceTree = "<group>"; };
 		F7D4B67B22956610000C2C86 /* Firebase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Firebase.h; sourceTree = "<group>"; };
 		F7D4B67D2295663D000C2C86 /* GoogleAppMeasurement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleAppMeasurement.framework; sourceTree = "<group>"; };
 		F7D4B67E2295663D000C2C86 /* FirebaseCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseCore.framework; sourceTree = "<group>"; };
@@ -1652,6 +1540,7 @@
 		F70211F31BAC56E9003FC03E /* Main */ = {
 			isa = PBXGroup;
 			children = (
+				F710D1FA24057E5E00A6033D /* ActionSheetHeaderView */,
 				F70211FA1BAC56E9003FC03E /* CCMain.h */,
 				F70211FB1BAC56E9003FC03E /* CCMain.m */,
 				F73F537E1E929C8500F8678D /* CCMore.swift */,
@@ -1736,6 +1625,16 @@
 			path = "UIImage+animatedGIF";
 			sourceTree = "<group>";
 		};
+		F710D1FA24057E5E00A6033D /* ActionSheetHeaderView */ = {
+			isa = PBXGroup;
+			children = (
+				F710D1FB24057E5E00A6033D /* NCActionSheetHeader.swift */,
+				F710D1FC24057E5E00A6033D /* NCActionSheetHeaderView.swift */,
+				F710D1FD24057E5E00A6033D /* NCActionSheetHeaderView.xib */,
+			);
+			path = ActionSheetHeaderView;
+			sourceTree = "<group>";
+		};
 		F710E80C1EF95C9C00DC2427 /* Intro */ = {
 			isa = PBXGroup;
 			children = (
@@ -2177,15 +2076,6 @@
 			path = Validation;
 			sourceTree = "<group>";
 		};
-		F762CB1C1EACB7D400B38484 /* VFR Pdf Reader */ = {
-			isa = PBXGroup;
-			children = (
-				F7D423501F0596C6009C9782 /* Sources */,
-				F7D423151F0596AC009C9782 /* Graphics */,
-			);
-			path = "VFR Pdf Reader";
-			sourceTree = "<group>";
-		};
 		F7632FC32183667400721B71 /* Section */ = {
 			isa = PBXGroup;
 			children = (
@@ -2561,89 +2451,6 @@
 			path = RichWorkspace;
 			sourceTree = "<group>";
 		};
-		F7D423151F0596AC009C9782 /* Graphics */ = {
-			isa = PBXGroup;
-			children = (
-				F7D423161F0596AC009C9782 /* AppIcon-076.png */,
-				F7D423171F0596AC009C9782 /* AppIcon-120.png */,
-				F7D423181F0596AC009C9782 /* AppIcon-152.png */,
-				F7D423191F0596AC009C9782 /* AppIcon-167.png */,
-				F7D4231A1F0596AC009C9782 /* AppIcon-180.png */,
-				F7D4231B1F0596AC009C9782 /* Reader-Button-H.png */,
-				F7D4231C1F0596AC009C9782 /* Reader-Button-H@2x.png */,
-				F7D4231D1F0596AC009C9782 /* Reader-Button-H@3x.png */,
-				F7D4231E1F0596AC009C9782 /* Reader-Button-N.png */,
-				F7D4231F1F0596AC009C9782 /* Reader-Button-N@2x.png */,
-				F7D423201F0596AC009C9782 /* Reader-Button-N@3x.png */,
-				F7D423211F0596AC009C9782 /* Reader-Email.png */,
-				F7D423221F0596AC009C9782 /* Reader-Email@2x.png */,
-				F7D423231F0596AC009C9782 /* Reader-Email@3x.png */,
-				F7D423241F0596AC009C9782 /* Reader-Export.png */,
-				F7D423251F0596AC009C9782 /* Reader-Export@2x.png */,
-				F7D423261F0596AC009C9782 /* Reader-Export@3x.png */,
-				F7D423271F0596AC009C9782 /* Reader-Mark-N.png */,
-				F7D423281F0596AC009C9782 /* Reader-Mark-N@2x.png */,
-				F7D423291F0596AC009C9782 /* Reader-Mark-N@3x.png */,
-				F7D4232A1F0596AC009C9782 /* Reader-Mark-Y.png */,
-				F7D4232B1F0596AC009C9782 /* Reader-Mark-Y@2x.png */,
-				F7D4232C1F0596AC009C9782 /* Reader-Mark-Y@3x.png */,
-				F7D4232D1F0596AC009C9782 /* Reader-Print.png */,
-				F7D4232E1F0596AC009C9782 /* Reader-Print@2x.png */,
-				F7D4232F1F0596AC009C9782 /* Reader-Print@3x.png */,
-				F7D423301F0596AC009C9782 /* Reader-Thumbs.png */,
-				F7D423311F0596AC009C9782 /* Reader-Thumbs@2x.png */,
-				F7D423321F0596AC009C9782 /* Reader-Thumbs@3x.png */,
-			);
-			path = Graphics;
-			sourceTree = "<group>";
-		};
-		F7D423501F0596C6009C9782 /* Sources */ = {
-			isa = PBXGroup;
-			children = (
-				F7D423511F0596C6009C9782 /* CGPDFDocument.h */,
-				F7D423521F0596C6009C9782 /* CGPDFDocument.m */,
-				F7D423531F0596C6009C9782 /* ReaderConstants.h */,
-				F7D423541F0596C6009C9782 /* ReaderConstants.m */,
-				F7D423551F0596C6009C9782 /* ReaderContentPage.h */,
-				F7D423561F0596C6009C9782 /* ReaderContentPage.m */,
-				F7D423571F0596C6009C9782 /* ReaderContentTile.h */,
-				F7D423581F0596C6009C9782 /* ReaderContentTile.m */,
-				F7D423591F0596C6009C9782 /* ReaderContentView.h */,
-				F7D4235A1F0596C6009C9782 /* ReaderContentView.m */,
-				F7D4235B1F0596C6009C9782 /* ReaderDocument.h */,
-				F7D4235C1F0596C6009C9782 /* ReaderDocument.m */,
-				F7D4235D1F0596C6009C9782 /* ReaderDocumentOutline.h */,
-				F7D4235E1F0596C6009C9782 /* ReaderDocumentOutline.m */,
-				F7D4235F1F0596C6009C9782 /* ReaderMainPagebar.h */,
-				F7D423601F0596C6009C9782 /* ReaderMainPagebar.m */,
-				F7D423611F0596C6009C9782 /* ReaderMainToolbar.h */,
-				F7D423621F0596C6009C9782 /* ReaderMainToolbar.m */,
-				F7D423631F0596C6009C9782 /* ReaderThumbCache.h */,
-				F7D423641F0596C6009C9782 /* ReaderThumbCache.m */,
-				F7D423651F0596C6009C9782 /* ReaderThumbFetch.h */,
-				F7D423661F0596C6009C9782 /* ReaderThumbFetch.m */,
-				F7D423671F0596C6009C9782 /* ReaderThumbQueue.h */,
-				F7D423681F0596C6009C9782 /* ReaderThumbQueue.m */,
-				F7D423691F0596C6009C9782 /* ReaderThumbRender.h */,
-				F7D4236A1F0596C6009C9782 /* ReaderThumbRender.m */,
-				F7D4236B1F0596C6009C9782 /* ReaderThumbRequest.h */,
-				F7D4236C1F0596C6009C9782 /* ReaderThumbRequest.m */,
-				F7D4236D1F0596C6009C9782 /* ReaderThumbsView.h */,
-				F7D4236E1F0596C6009C9782 /* ReaderThumbsView.m */,
-				F7D4236F1F0596C6009C9782 /* ReaderThumbView.h */,
-				F7D423701F0596C6009C9782 /* ReaderThumbView.m */,
-				F7D423711F0596C6009C9782 /* ReaderViewController.h */,
-				F7D423721F0596C6009C9782 /* ReaderViewController.m */,
-				F7D423731F0596C6009C9782 /* ThumbsMainToolbar.h */,
-				F7D423741F0596C6009C9782 /* ThumbsMainToolbar.m */,
-				F7D423751F0596C6009C9782 /* ThumbsViewController.h */,
-				F7D423761F0596C6009C9782 /* ThumbsViewController.m */,
-				F7D423771F0596C6009C9782 /* UIXToolbarView.h */,
-				F7D423781F0596C6009C9782 /* UIXToolbarView.m */,
-			);
-			path = Sources;
-			sourceTree = "<group>";
-		};
 		F7D4B67A22956610000C2C86 /* Firebase */ = {
 			isa = PBXGroup;
 			children = (
@@ -2734,7 +2541,6 @@
 				F7F54CAD1E5B14C700E19C62 /* MWPhotoBrowser */,
 				F7B4F1C51F44356F00B53B42 /* NCUchardet */,
 				F760F75621F21F61006B1A73 /* PhotoEditor */,
-				F762CB1C1EACB7D400B38484 /* VFR Pdf Reader */,
 				F762CA9F1EACB66200B38484 /* XLForm */,
 			);
 			path = Library;
@@ -3196,7 +3002,6 @@
 				F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */,
 				F75ADF451DC75FFE008A7347 /* CCLogin.storyboard in Resources */,
 				F7F54CED1E5B14C700E19C62 /* ImageSelectedOn@3x.png in Resources */,
-				F7D4234D1F0596AC009C9782 /* Reader-Thumbs.png in Resources */,
 				F7F54CF41E5B14C700E19C62 /* PlayButtonOverlayLarge.png in Resources */,
 				F7F54D041E5B14C800E19C62 /* VideoOverlay@2x.png in Resources */,
 				F7F54CF51E5B14C700E19C62 /* PlayButtonOverlayLarge@2x.png in Resources */,
@@ -3205,46 +3010,32 @@
 				F78ACD4421903CF20088454D /* NCListCell.xib in Resources */,
 				F78ACD4621903D010088454D /* NCGridCell.xib in Resources */,
 				F7F54CF91E5B14C700E19C62 /* PlayButtonOverlayLargeTap@3x.png in Resources */,
-				F7D4233D1F0596AC009C9782 /* Reader-Button-N@3x.png in Resources */,
 				F73B4EF21F470D9100BBEE4B /* EUCTWFreq.tab in Resources */,
 				F769453C22E9CFFF000A798A /* NCShareUserCell.xib in Resources */,
 				F700222C1EC479840080073F /* Custom.xcassets in Resources */,
+				F710D20024057E5E00A6033D /* NCActionSheetHeaderView.xib in Resources */,
 				F758B45A212C564000515F55 /* Scan.storyboard in Resources */,
 				F77B0EFE1D118A16002130FE /* CCUploadFromOtherUpp.storyboard in Resources */,
 				F7F54CF81E5B14C700E19C62 /* PlayButtonOverlayLargeTap@2x.png in Resources */,
 				F73B4EEE1F470D9100BBEE4B /* Big5Freq.tab in Resources */,
-				F7D4233B1F0596AC009C9782 /* Reader-Button-N.png in Resources */,
 				F760F78821F21F61006B1A73 /* PhotoCropEditorBorder@2x.png in Resources */,
 				F7F54CF31E5B14C700E19C62 /* ImageSelectedSmallOn@3x.png in Resources */,
-				F7D423441F0596AC009C9782 /* Reader-Mark-N.png in Resources */,
 				F7F54CFA1E5B14C700E19C62 /* UIBarButtonItemArrowLeft.png in Resources */,
 				F7FCFFD81D70798C000E6E29 /* CCPeekPop.storyboard in Resources */,
 				F7F54CF61E5B14C700E19C62 /* PlayButtonOverlayLarge@3x.png in Resources */,
-				F7D423371F0596AC009C9782 /* AppIcon-180.png in Resources */,
-				F7D423401F0596AC009C9782 /* Reader-Email@3x.png in Resources */,
-				F7D423391F0596AC009C9782 /* Reader-Button-H@2x.png in Resources */,
-				F7D423351F0596AC009C9782 /* AppIcon-152.png in Resources */,
 				F78F74342163757000C2ADAD /* NCTrash.storyboard in Resources */,
-				F7D4234E1F0596AC009C9782 /* Reader-Thumbs@2x.png in Resources */,
 				F760F78521F21F61006B1A73 /* EmojiCollectionViewCell.xib in Resources */,
 				F79A65C32191D90F00FF6DCC /* NCSelect.storyboard in Resources */,
 				F7F54D001E5B14C700E19C62 /* UIBarButtonItemGrid.png in Resources */,
 				F7F54CFE1E5B14C700E19C62 /* UIBarButtonItemArrowRight@2x.png in Resources */,
 				F7F54D031E5B14C800E19C62 /* VideoOverlay.png in Resources */,
 				F7F54CE81E5B14C700E19C62 /* ImageSelectedOff.png in Resources */,
-				F7D4234B1F0596AC009C9782 /* Reader-Print@2x.png in Resources */,
 				F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */,
 				F73D71641F2674A400E233EB /* NCText.storyboard in Resources */,
 				F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */,
-				F7D423471F0596AC009C9782 /* Reader-Mark-Y.png in Resources */,
 				F7632FBF21832F8700721B71 /* NCTrashSectionHeaderMenu.xib in Resources */,
-				F7D423431F0596AC009C9782 /* Reader-Export@3x.png in Resources */,
-				F7D4233C1F0596AC009C9782 /* Reader-Button-N@2x.png in Resources */,
-				F7D423411F0596AC009C9782 /* Reader-Export.png in Resources */,
 				F739513A221B127F00D986C8 /* NCSectionMediaHeader.xib in Resources */,
 				F77B0F481D118A16002130FE /* synchronized.gif in Resources */,
-				F7D4233E1F0596AC009C9782 /* Reader-Email.png in Resources */,
-				F7D423361F0596AC009C9782 /* AppIcon-167.png in Resources */,
 				F7F54CF71E5B14C700E19C62 /* PlayButtonOverlayLargeTap.png in Resources */,
 				3704EB2A23D5A58400455C5B /* NCMenu.storyboard in Resources */,
 				F7E0E1DE22327DBA006B0911 /* NCAudioRecorderViewController.storyboard in Resources */,
@@ -3278,7 +3069,6 @@
 				F7C9555321F0C4CA0024296E /* NCActivity.storyboard in Resources */,
 				F7F54CE71E5B14C700E19C62 /* ImageError@3x.png in Resources */,
 				F760F78F21F21F61006B1A73 /* PhotoCropEditorBorder@3x.png in Resources */,
-				F7D423461F0596AC009C9782 /* Reader-Mark-N@3x.png in Resources */,
 				F7F54CE61E5B14C700E19C62 /* ImageError@2x.png in Resources */,
 				F7F54CEF1E5B14C700E19C62 /* ImageSelectedSmallOff@2x.png in Resources */,
 				F7F54CFF1E5B14C700E19C62 /* UIBarButtonItemArrowRight@3x.png in Resources */,
@@ -3288,7 +3078,6 @@
 				F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */,
 				F77B0F631D118A16002130FE /* Localizable.strings in Resources */,
 				F7632FC1218353AA00721B71 /* NCTrashSectionFooter.xib in Resources */,
-				F7D4234C1F0596AC009C9782 /* Reader-Print@3x.png in Resources */,
 				F7F54CFB1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@2x.png in Resources */,
 				F7C525A21E3B6DA800FFE02C /* CCNotification.storyboard in Resources */,
 				F7F54CEB1E5B14C700E19C62 /* ImageSelectedOn.png in Resources */,
@@ -3298,18 +3087,12 @@
 				F73B4F151F470D9100BBEE4B /* symbols.cmake in Resources */,
 				F7F54CF21E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png in Resources */,
 				F774264A22EB4D0000B23912 /* NCShareUserDropDownCell.xib in Resources */,
-				F7D4233A1F0596AC009C9782 /* Reader-Button-H@3x.png in Resources */,
-				F7D423341F0596AC009C9782 /* AppIcon-120.png in Resources */,
-				F7D4234F1F0596AC009C9782 /* Reader-Thumbs@3x.png in Resources */,
 				F722814323C8C34500C41898 /* NCRichWorkspace.xib in Resources */,
 				F7F54CE51E5B14C700E19C62 /* ImageError.png in Resources */,
-				F7D423381F0596AC009C9782 /* Reader-Button-H.png in Resources */,
 				F7F54CFC1E5B14C700E19C62 /* UIBarButtonItemArrowLeft@3x.png in Resources */,
 				F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
 				F760F79021F21F61006B1A73 /* PhotoCropEditorBorder.png in Resources */,
 				F78ACD56219047E90088454D /* NCSectionHeader.xib in Resources */,
-				F7D423491F0596AC009C9782 /* Reader-Mark-Y@3x.png in Resources */,
-				F7D423421F0596AC009C9782 /* Reader-Export@2x.png in Resources */,
 				F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
 				F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
 				F7F54CE91E5B14C700E19C62 /* ImageSelectedOff@2x.png in Resources */,
@@ -3318,16 +3101,11 @@
 				F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */,
 				F73B4EF41F470D9100BBEE4B /* JISFreq.tab in Resources */,
 				F760F77B21F21F61006B1A73 /* icomoon.ttf in Resources */,
-				F7D423451F0596AC009C9782 /* Reader-Mark-N@2x.png in Resources */,
 				F760F78021F21F61006B1A73 /* PhotoEditorViewController.xib in Resources */,
 				F774DF101FCC26BE002AF9FC /* iTunesArtwork@2x.png in Resources */,
-				F7D423481F0596AC009C9782 /* Reader-Mark-Y@2x.png in Resources */,
-				F7D4233F1F0596AC009C9782 /* Reader-Email@2x.png in Resources */,
 				F73B4EF11F470D9100BBEE4B /* EUCKRFreq.tab in Resources */,
 				F7501C322212E57500FB1415 /* NCMedia.storyboard in Resources */,
 				F774DF111FCC26BE002AF9FC /* iTunesArtwork@3x.png in Resources */,
-				F7D4234A1F0596AC009C9782 /* Reader-Print.png in Resources */,
-				F7D423331F0596AC009C9782 /* AppIcon-076.png in Resources */,
 				F7F54CFD1E5B14C700E19C62 /* UIBarButtonItemArrowRight.png in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -3585,6 +3363,7 @@
 				F760F78321F21F61006B1A73 /* UIImageView+Alpha.swift in Sources */,
 				F73B4EEF1F470D9100BBEE4B /* CharDistribution.cpp in Sources */,
 				F7B0C0CD1EE7E7750033AC24 /* CCSynchronize.m in Sources */,
+				F710D1FE24057E5E00A6033D /* NCActionSheetHeader.swift in Sources */,
 				F754EEC921772B6100BB1CDF /* DropdownItem.swift in Sources */,
 				F77B0DFF1D118A16002130FE /* OCNetworking.m in Sources */,
 				F73B4F081F470D9100BBEE4B /* nsEUCJPProber.cpp in Sources */,
@@ -3595,22 +3374,18 @@
 				F73B4F0F1F470D9100BBEE4B /* nsMBCSSM.cpp in Sources */,
 				F754EECA21772B6100BB1CDF /* DropUpMenu.swift in Sources */,
 				F77B0E041D118A16002130FE /* UIImage+animatedGIF.m in Sources */,
-				F7D423881F0596C6009C9782 /* ReaderThumbView.m in Sources */,
 				37ECC83B23D0C7410082EFA2 /* NCMenuAction.swift in Sources */,
 				F73B4EFE1F470D9100BBEE4B /* LangHungarianModel.cpp in Sources */,
-				F7D4238A1F0596C6009C9782 /* ThumbsMainToolbar.m in Sources */,
 				F769454022E9F077000A798A /* NCSharePaging.swift in Sources */,
 				F760F79921F21F61006B1A73 /* CropViewController.swift in Sources */,
 				F70022EC1EC4C9100080073F /* OCXMLSharedParser.m in Sources */,
 				F7F54D061E5B14C800E19C62 /* MWCaptionView.m in Sources */,
 				F762CB001EACB66200B38484 /* XLFormSegmentedCell.m in Sources */,
 				F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */,
-				F7D423801F0596C6009C9782 /* ReaderMainPagebar.m in Sources */,
 				F762CB061EACB66200B38484 /* XLFormTextViewCell.m in Sources */,
 				F78ACD4221903CE00088454D /* NCListCell.swift in Sources */,
 				F78ACD4F2190440D0088454D /* NCLayout.swift in Sources */,
 				F760F79C21F21F61006B1A73 /* GradientView.swift in Sources */,
-				F7D4237F1F0596C6009C9782 /* ReaderDocumentOutline.m in Sources */,
 				F73F537F1E929C8500F8678D /* CCMore.swift in Sources */,
 				F73B4EF71F470D9100BBEE4B /* LangBulgarianModel.cpp in Sources */,
 				F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */,
@@ -3649,7 +3424,6 @@
 				3757A35523D9D76300EC369E /* NCMenuPanelController.swift in Sources */,
 				F7CA1ED320E7E3FE002CC65E /* PKStopDownloadButton.m in Sources */,
 				F762CB111EACB66200B38484 /* NSString+XLFormAdditions.m in Sources */,
-				F7D423871F0596C6009C9782 /* ReaderThumbsView.m in Sources */,
 				F7F54D0A1E5B14C800E19C62 /* MWPhotoBrowser.m in Sources */,
 				F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */,
 				F72D404923D2082500A97FD0 /* NCViewerNextcloudText.swift in Sources */,
@@ -3675,13 +3449,10 @@
 				F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */,
 				F77B0E301D118A16002130FE /* CCHud.m in Sources */,
 				F76673ED22C901F6007ED366 /* FileProviderDomain.swift in Sources */,
-				F7D423891F0596C6009C9782 /* ReaderViewController.m in Sources */,
 				F70022E91EC4C9100080073F /* OCXMLShareByLinkParser.m in Sources */,
 				F77B0E311D118A16002130FE /* CCExifGeo.m in Sources */,
 				F73B4F0E1F470D9100BBEE4B /* nsMBCSGroupProber.cpp in Sources */,
-				F7D423831F0596C6009C9782 /* ReaderThumbFetch.m in Sources */,
 				F73B4F171F470D9100BBEE4B /* uchardet.cpp in Sources */,
-				F7D4237A1F0596C6009C9782 /* ReaderConstants.m in Sources */,
 				F7B6ACDB22FC2D15008AB646 /* NCComments.m in Sources */,
 				F73B4F121F470D9100BBEE4B /* nsSJISProber.cpp in Sources */,
 				F760F78121F21F61006B1A73 /* PhotoEditor+StickersViewController.swift in Sources */,
@@ -3709,13 +3480,10 @@
 				F78ACD4A21903F850088454D /* NCTrashListCell.swift in Sources */,
 				F73B4EFB1F470D9100BBEE4B /* LangGermanModel.cpp in Sources */,
 				F73B4F061F470D9100BBEE4B /* nsEscCharsetProber.cpp in Sources */,
-				F7D4237D1F0596C6009C9782 /* ReaderContentView.m in Sources */,
 				F73B4EFA1F470D9100BBEE4B /* LangFrenchModel.cpp in Sources */,
 				F7682FE023C36B0500983A04 /* NCMainTabBar.swift in Sources */,
 				F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */,
 				F762CB101EACB66200B38484 /* NSPredicate+XLFormAdditions.m in Sources */,
-				F7D4237E1F0596C6009C9782 /* ReaderDocument.m in Sources */,
-				F7D4237C1F0596C6009C9782 /* ReaderContentTile.m in Sources */,
 				F73CC07E1E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */,
 				F77B0E5F1D118A16002130FE /* CCSettings.m in Sources */,
 				F78F74362163781100C2ADAD /* NCTrash.swift in Sources */,
@@ -3742,7 +3510,6 @@
 				F7DBC37F23325E2E001A85BA /* NCXMLGetAppPasswordParser.m in Sources */,
 				F750374D1DBFA91A008FB480 /* ALView+PureLayout.m in Sources */,
 				F7381EE1218218C9000B1560 /* NCOffline.swift in Sources */,
-				F7D423861F0596C6009C9782 /* ReaderThumbRequest.m in Sources */,
 				F73B4EF51F470D9100BBEE4B /* JpCntx.cpp in Sources */,
 				F78071091EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m in Sources */,
 				F76B3CCE1EAE01BD00921AC9 /* NCBrand.swift in Sources */,
@@ -3782,12 +3549,12 @@
 				F760F79321F21F61006B1A73 /* CropView.swift in Sources */,
 				F762CAF71EACB66200B38484 /* XLFormBaseCell.m in Sources */,
 				F760F78A21F21F61006B1A73 /* UIImage+Size.swift in Sources */,
+				F710D1FF24057E5E00A6033D /* NCActionSheetHeaderView.swift in Sources */,
 				F70022B31EC4C9100080073F /* OCActivity.m in Sources */,
 				F7E09CE723E308AD00FB3E9E /* NCMasterNavigationController.swift in Sources */,
 				F70022D41EC4C9100080073F /* NSDate+ISO8601.m in Sources */,
 				F762CB151EACB66200B38484 /* XLFormRowNavigationAccessoryView.m in Sources */,
 				F762CB0A1EACB66200B38484 /* XLFormDescriptor.m in Sources */,
-				F7D4238C1F0596C6009C9782 /* UIXToolbarView.m in Sources */,
 				F7020FCE2233D7F700B7297D /* NCCreateFormUploadVoiceNote.swift in Sources */,
 				F7F4B1D823C74B3E00D82A6E /* NCRichWorkspace.swift in Sources */,
 				F726EEEC1FED1C820030B9C8 /* NCEndToEndInitialize.swift in Sources */,
@@ -3802,7 +3569,6 @@
 				F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */,
 				F7B2DEF01F976854007CF4D2 /* NYMnemonic.m in Sources */,
 				F707C26521A2DC5200F6181E /* NCStoreReview.swift in Sources */,
-				F7D423791F0596C6009C9782 /* CGPDFDocument.m in Sources */,
 				F73B4EFF1F470D9100BBEE4B /* LangRussianModel.cpp in Sources */,
 				F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,
 				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
@@ -3810,7 +3576,6 @@
 				F73B4F031F470D9100BBEE4B /* LangVietnameseModel.cpp in Sources */,
 				F73B4F021F470D9100BBEE4B /* LangTurkishModel.cpp in Sources */,
 				F7F54D0B1E5B14C800E19C62 /* MWTapDetectingImageView.m in Sources */,
-				F7D423821F0596C6009C9782 /* ReaderThumbCache.m in Sources */,
 				F760F79A21F21F61006B1A73 /* PhotoEditor+Crop.swift in Sources */,
 				F7CA1ED220E7E3FE002CC65E /* PKCircleView.m in Sources */,
 				F7F54D0D1E5B14C800E19C62 /* MWZoomingScrollView.m in Sources */,
@@ -3823,12 +3588,9 @@
 				F769454822E9F20D000A798A /* NCShareNetworking.swift in Sources */,
 				F77B0EC61D118A16002130FE /* CCCellMain.m in Sources */,
 				F7C9555521F0C5470024296E /* NCActivity.swift in Sources */,
-				F7D4238B1F0596C6009C9782 /* ThumbsViewController.m in Sources */,
 				F70022B61EC4C9100080073F /* OCCapabilities.m in Sources */,
-				F7D423811F0596C6009C9782 /* ReaderMainToolbar.m in Sources */,
 				F762CB131EACB66200B38484 /* XLFormRightDetailCell.m in Sources */,
 				F7CA1ED820E7E3FE002CC65E /* PKBorderedButton.m in Sources */,
-				F7D4237B1F0596C6009C9782 /* ReaderContentPage.m in Sources */,
 				F73B4F0A1F470D9100BBEE4B /* nsEUCTWProber.cpp in Sources */,
 				F765608F23BF813600765969 /* NCContentPresenter.swift in Sources */,
 				F762CB091EACB66200B38484 /* XLFormViewController.m in Sources */,
@@ -3841,13 +3603,11 @@
 				F758B45E212C569D00515F55 /* ScanCell.swift in Sources */,
 				F781996922636BFA00EBDF6A /* HCFeatures.m in Sources */,
 				F70022FE1EC4C9100080073F /* UtilsFramework.m in Sources */,
-				F7D423851F0596C6009C9782 /* ReaderThumbRender.m in Sources */,
 				F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */,
 				F7CA1ED920E7E3FE002CC65E /* NSLayoutConstraint+PKDownloadButton.m in Sources */,
 				F74E432620B5547700C2E54C /* NCNetworkingEndToEnd.m in Sources */,
 				F73B4F141F470D9100BBEE4B /* nsUTF8Prober.cpp in Sources */,
 				F70022C81EC4C9100080073F /* OCRichObjectStrings.m in Sources */,
-				F7D423841F0596C6009C9782 /* ReaderThumbQueue.m in Sources */,
 				F77B0ED11D118A16002130FE /* Acknowledgements.m in Sources */,
 				F7E4D9C422ED929B003675FD /* NCShareComments.swift in Sources */,
 				F73CC06C1E813DFF006E3047 /* BKPasscodeField.m in Sources */,

BIN
iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-076.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-120.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-152.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-167.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/AppIcon-180.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-H@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Button-N@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Email@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Export@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-N@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Mark-Y@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Print@3x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs@2x.png


BIN
iOSClient/Library/VFR Pdf Reader/Graphics/Reader-Thumbs@3x.png


+ 0 - 39
iOSClient/Library/VFR Pdf Reader/Sources/CGPDFDocument.h

@@ -1,39 +0,0 @@
-//
-//	CGPDFDocument.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-#import <QuartzCore/QuartzCore.h>
-
-//
-//	Custom CGPDFDocument[...] functions
-//
-
-CGPDFDocumentRef CGPDFDocumentCreateUsingUrl(CFURLRef theURL, NSString *password);
-
-CGPDFDocumentRef CGPDFDocumentCreateUsingData(CGDataProviderRef dataProvider, NSString *password);
-
-BOOL CGPDFDocumentUrlNeedsPassword(CFURLRef theURL, NSString *password);
-
-BOOL CGPDFDocumentDataNeedsPassword(CGDataProviderRef dataProvider, NSString *password);

+ 0 - 242
iOSClient/Library/VFR Pdf Reader/Sources/CGPDFDocument.m

@@ -1,242 +0,0 @@
-//
-//	CGPDFDocument.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "CGPDFDocument.h"
-
-//
-//	CGPDFDocumentRef CGPDFDocumentCreateUsingUrl(CFURLRef, NSString *) function
-//
-
-CGPDFDocumentRef CGPDFDocumentCreateUsingUrl(CFURLRef theURL, NSString *password)
-{
-	CGPDFDocumentRef thePDFDocRef = NULL; // CGPDFDocument
-
-	if (theURL != NULL) // Check for non-NULL CFURLRef
-	{
-		thePDFDocRef = CGPDFDocumentCreateWithURL(theURL);
-
-		if (thePDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			if (CGPDFDocumentIsEncrypted(thePDFDocRef) == TRUE) // Encrypted
-			{
-				// Try a blank password first, per Apple's Quartz PDF example
-
-				if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, "") == FALSE)
-				{
-					// Nope, now let's try the provided password to unlock the PDF
-
-					if ((password != nil) && (password.length > 0)) // Not blank?
-					{
-						char text[128]; // char array buffer for the string conversion
-
-						[password getCString:text maxLength:126 encoding:NSUTF8StringEncoding];
-
-						if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, text) == FALSE) // Log failure
-						{
-							#ifdef DEBUG
-								NSLog(@"CGPDFDocumentCreateUsingUrl: Unable to unlock [%@] with [%@]", theURL, password);
-							#endif
-						}
-					}
-				}
-
-				if (CGPDFDocumentIsUnlocked(thePDFDocRef) == FALSE) // Cleanup unlock failure
-				{
-                    (void)(CGPDFDocumentRelease(thePDFDocRef)), thePDFDocRef = NULL;
-				}
-			}
-		}
-	}
-	else // Log an error diagnostic
-	{
-		#ifdef DEBUG
-			NSLog(@"CGPDFDocumentCreateUsingUrl: theURL == NULL");
-		#endif
-	}
-
-	return thePDFDocRef;
-}
-
-//
-//	CGPDFDocumentRef CGPDFDocumentCreateUsingData(CGDataProviderRef, NSString *) function
-//
-
-CGPDFDocumentRef CGPDFDocumentCreateUsingData(CGDataProviderRef dataProvider, NSString *password)
-{
-	CGPDFDocumentRef thePDFDocRef = NULL; // CGPDFDocument
-
-	if (dataProvider != NULL) // Check for non-NULL CGDataProviderRef
-	{
-		thePDFDocRef = CGPDFDocumentCreateWithProvider(dataProvider);
-
-		if (thePDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			if (CGPDFDocumentIsEncrypted(thePDFDocRef) == TRUE) // Encrypted
-			{
-				// Try a blank password first, per Apple's Quartz PDF example
-
-				if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, "") == FALSE)
-				{
-					// Nope, now let's try the provided password to unlock the PDF
-
-					if ((password != nil) && (password.length > 0)) // Not blank?
-					{
-						char text[128]; // char array buffer for the string conversion
-
-						[password getCString:text maxLength:126 encoding:NSUTF8StringEncoding];
-
-						if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, text) == FALSE) // Log failure
-						{
-							#ifdef DEBUG
-								NSLog(@"CGPDFDocumentCreateUsingData: Unable to unlock data with '%@'", password);
-							#endif
-						}
-					}
-				}
-
-				if (CGPDFDocumentIsUnlocked(thePDFDocRef) == FALSE) // Cleanup unlock failure
-				{
-                    (void)(CGPDFDocumentRelease(thePDFDocRef)), thePDFDocRef = NULL;
-				}
-			}
-		}
-	}
-	else // Log an error diagnostic
-	{
-		#ifdef DEBUG
-			NSLog(@"CGPDFDocumentCreateUsingData: theURL == NULL");
-		#endif
-	}
-
-	return thePDFDocRef;
-}
-
-//
-//	BOOL CGPDFDocumentUrlNeedsPassword(CFURLRef, NSString *) function
-//
-
-BOOL CGPDFDocumentUrlNeedsPassword(CFURLRef theURL, NSString *password)
-{
-	BOOL needPassword = NO; // Default flag
-
-	if (theURL != NULL) // Check for non-NULL CFURLRef
-	{
-		CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateWithURL(theURL);
-
-		if (thePDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			if (CGPDFDocumentIsEncrypted(thePDFDocRef) == TRUE) // Encrypted
-			{
-				// Try a blank password first, per Apple's Quartz PDF example
-
-				if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, "") == FALSE)
-				{
-					// Nope, now let's try the provided password to unlock the PDF
-
-					if ((password != nil) && (password.length > 0)) // Not blank?
-					{
-						char text[128]; // char array buffer for the string conversion
-
-						[password getCString:text maxLength:126 encoding:NSUTF8StringEncoding];
-
-						if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, text) == FALSE)
-						{
-							needPassword = YES;
-						}
-					}
-					else
-					{
-						needPassword = YES;
-					}
-				}
-			}
-
-			CGPDFDocumentRelease(thePDFDocRef); // Cleanup CGPDFDocumentRef
-		}
-	}
-	else // Log an error diagnostic
-	{
-		#ifdef DEBUG
-			NSLog(@"CGPDFDocumentUrlNeedsPassword: theURL == NULL");
-		#endif
-	}
-
-	return needPassword;
-}
-
-//
-//	BOOL CGPDFDocumentUrlNeedsPassword(CGDataProviderRef, NSString *) function
-//
-
-BOOL CGPDFDocumentDataNeedsPassword(CGDataProviderRef dataProvider, NSString *password)
-{
-	BOOL needPassword = NO; // Default flag
-
-	if (dataProvider != NULL) // Check for non-NULL CGDataProviderRef
-	{
-		CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateWithProvider(dataProvider);
-
-		if (thePDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			if (CGPDFDocumentIsEncrypted(thePDFDocRef) == TRUE) // Encrypted
-			{
-				// Try a blank password first, per Apple's Quartz PDF example
-
-				if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, "") == FALSE)
-				{
-					// Nope, now let's try the provided password to unlock the PDF
-
-					if ((password != nil) && (password.length > 0)) // Not blank?
-					{
-						char text[128]; // char array buffer for the string conversion
-
-						[password getCString:text maxLength:126 encoding:NSUTF8StringEncoding];
-
-						if (CGPDFDocumentUnlockWithPassword(thePDFDocRef, text) == FALSE)
-						{
-							needPassword = YES;
-						}
-					}
-					else
-					{
-						needPassword = YES;
-					}
-				}
-			}
-
-			CGPDFDocumentRelease(thePDFDocRef); // Cleanup CGPDFDocumentRef
-		}
-	}
-	else // Log an error diagnostic
-	{
-		#ifdef DEBUG
-			NSLog(@"CGPDFDocumentUrlNeedsPassword: theURL == NULL");
-		#endif
-	}
-
-	return needPassword;
-}
-
-// EOF

+ 0 - 39
iOSClient/Library/VFR Pdf Reader/Sources/ReaderConstants.h

@@ -1,39 +0,0 @@
-//
-//	ReaderConstants.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if !__has_feature(objc_arc)
-	#error ARC (-fobjc-arc) is required to build this code.
-#endif
-
-#import <Foundation/Foundation.h>
-
-#define READER_FLAT_UI TRUE
-#define READER_SHOW_SHADOWS TRUE
-#define READER_ENABLE_THUMBS TRUE
-#define READER_DISABLE_RETINA FALSE
-#define READER_ENABLE_PREVIEW TRUE
-#define READER_DISABLE_IDLE FALSE
-#define READER_STANDALONE FALSE
-#define READER_BOOKMARKS TRUE

+ 0 - 28
iOSClient/Library/VFR Pdf Reader/Sources/ReaderConstants.m

@@ -1,28 +0,0 @@
-//
-//	ReaderConstants.m
-//	Reader v2.8.7
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2016 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-
-static NSString *const kReaderCopyrightNotice = @"Reader v2.x.y • Copyright © 2011-2016 Julius Oklamcak. All rights reserved.";

+ 0 - 50
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentPage.h

@@ -1,50 +0,0 @@
-//
-//	ReaderContentPage.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface ReaderContentPage : UIView
-
-- (instancetype)initWithURL:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase;
-
-- (id)processSingleTap:(UITapGestureRecognizer *)recognizer;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderDocumentLink class interface
-//
-
-@interface ReaderDocumentLink : NSObject <NSObject>
-
-@property (nonatomic, assign, readonly) CGRect rect;
-
-@property (nonatomic, assign, readonly) CGPDFDictionaryRef dictionary;
-
-+ (instancetype)newWithRect:(CGRect)linkRect dictionary:(CGPDFDictionaryRef)linkDictionary;
-
-@end

+ 0 - 595
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentPage.m

@@ -1,595 +0,0 @@
-//
-//	ReaderContentPage.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ReaderContentPage.h"
-#import "ReaderContentTile.h"
-#import "CGPDFDocument.h"
-
-@implementation ReaderContentPage
-{
-	NSMutableArray *_links;
-
-	CGPDFDocumentRef _PDFDocRef;
-
-	CGPDFPageRef _PDFPageRef;
-
-	NSInteger _pageAngle;
-
-	CGFloat _pageWidth;
-	CGFloat _pageHeight;
-
-	CGFloat _pageOffsetX;
-	CGFloat _pageOffsetY;
-}
-
-#pragma mark - ReaderContentPage class methods
-
-+ (Class)layerClass
-{
-	return [ReaderContentTile class];
-}
-
-#pragma mark - ReaderContentPage PDF link methods
-
-- (void)highlightPageLinks
-{
-	if (_links.count > 0) // Add highlight views over all links
-	{
-		UIColor *hilite = [UIColor colorWithRed:0.0f green:0.0f blue:1.0f alpha:0.15f];
-
-		for (ReaderDocumentLink *link in _links) // Enumerate the links array
-		{
-			UIView *highlight = [[UIView alloc] initWithFrame:link.rect];
-
-			highlight.autoresizesSubviews = NO;
-			highlight.userInteractionEnabled = NO;
-			highlight.contentMode = UIViewContentModeRedraw;
-			highlight.autoresizingMask = UIViewAutoresizingNone;
-			highlight.backgroundColor = hilite; // Color
-
-			[self addSubview:highlight];
-		}
-	}
-}
-
-- (ReaderDocumentLink *)linkFromAnnotation:(CGPDFDictionaryRef)annotationDictionary
-{
-	ReaderDocumentLink *documentLink = nil; // Document link object
-
-	CGPDFArrayRef annotationRectArray = NULL; // Annotation co-ordinates array
-
-	if (CGPDFDictionaryGetArray(annotationDictionary, "Rect", &annotationRectArray))
-	{
-		CGPDFReal ll_x = 0.0f; CGPDFReal ll_y = 0.0f; // PDFRect lower-left X and Y
-		CGPDFReal ur_x = 0.0f; CGPDFReal ur_y = 0.0f; // PDFRect upper-right X and Y
-
-		CGPDFArrayGetNumber(annotationRectArray, 0, &ll_x); // Lower-left X co-ordinate
-		CGPDFArrayGetNumber(annotationRectArray, 1, &ll_y); // Lower-left Y co-ordinate
-
-		CGPDFArrayGetNumber(annotationRectArray, 2, &ur_x); // Upper-right X co-ordinate
-		CGPDFArrayGetNumber(annotationRectArray, 3, &ur_y); // Upper-right Y co-ordinate
-
-		if (ll_x > ur_x) { CGPDFReal t = ll_x; ll_x = ur_x; ur_x = t; } // Normalize Xs
-		if (ll_y > ur_y) { CGPDFReal t = ll_y; ll_y = ur_y; ur_y = t; } // Normalize Ys
-
-		ll_x -= _pageOffsetX; ll_y -= _pageOffsetY; // Offset lower-left co-ordinate
-		ur_x -= _pageOffsetX; ur_y -= _pageOffsetY; // Offset upper-right co-ordinate
-
-		switch (_pageAngle) // Page rotation angle (in degrees)
-		{
-			case 90: // 90 degree page rotation
-			{
-				CGPDFReal swap;
-				swap = ll_y; ll_y = ll_x; ll_x = swap;
-				swap = ur_y; ur_y = ur_x; ur_x = swap;
-				break;
-			}
-
-			case 270: // 270 degree page rotation
-			{
-				CGPDFReal swap;
-				swap = ll_y; ll_y = ll_x; ll_x = swap;
-				swap = ur_y; ur_y = ur_x; ur_x = swap;
-				ll_x = ((0.0f - ll_x) + _pageWidth);
-				ur_x = ((0.0f - ur_x) + _pageWidth);
-				break;
-			}
-
-			case 0: // 0 degree page rotation
-			{
-				ll_y = ((0.0f - ll_y) + _pageHeight);
-				ur_y = ((0.0f - ur_y) + _pageHeight);
-				break;
-			}
-		}
-
-		NSInteger vr_x = ll_x; NSInteger vr_w = (ur_x - ll_x); // Integer X and width
-		NSInteger vr_y = ll_y; NSInteger vr_h = (ur_y - ll_y); // Integer Y and height
-
-		CGRect viewRect = CGRectMake(vr_x, vr_y, vr_w, vr_h); // View CGRect from PDFRect
-
-		documentLink = [ReaderDocumentLink newWithRect:viewRect dictionary:annotationDictionary];
-	}
-
-	return documentLink;
-}
-
-- (void)buildAnnotationLinksList
-{
-	_links = [NSMutableArray new]; // Links list array
-
-	CGPDFArrayRef pageAnnotations = NULL; // Page annotations array
-
-	CGPDFDictionaryRef pageDictionary = CGPDFPageGetDictionary(_PDFPageRef);
-
-	if (CGPDFDictionaryGetArray(pageDictionary, "Annots", &pageAnnotations) == true)
-	{
-		NSInteger count = CGPDFArrayGetCount(pageAnnotations); // Number of annotations
-
-		for (NSInteger index = 0; index < count; index++) // Iterate through all annotations
-		{
-			CGPDFDictionaryRef annotationDictionary = NULL; // PDF annotation dictionary
-
-			if (CGPDFArrayGetDictionary(pageAnnotations, index, &annotationDictionary) == true)
-			{
-				const char *annotationSubtype = NULL; // PDF annotation subtype string
-
-				if (CGPDFDictionaryGetName(annotationDictionary, "Subtype", &annotationSubtype) == true)
-				{
-					if (strcmp(annotationSubtype, "Link") == 0) // Found annotation subtype of 'Link'
-					{
-						ReaderDocumentLink *documentLink = [self linkFromAnnotation:annotationDictionary];
-
-						if (documentLink != nil) [_links insertObject:documentLink atIndex:0]; // Add link
-					}
-				}
-			}
-		}
-
-		//[self highlightPageLinks]; // Link support debugging
-	}
-}
-
-- (CGPDFArrayRef)destinationWithName:(const char *)destinationName inDestsTree:(CGPDFDictionaryRef)node
-{
-	CGPDFArrayRef destinationArray = NULL;
-
-	CGPDFArrayRef limitsArray = NULL; // Limits array
-
-	if (CGPDFDictionaryGetArray(node, "Limits", &limitsArray) == true)
-	{
-		CGPDFStringRef lowerLimit = NULL; CGPDFStringRef upperLimit = NULL;
-
-		if (CGPDFArrayGetString(limitsArray, 0, &lowerLimit) == true) // Lower limit
-		{
-			if (CGPDFArrayGetString(limitsArray, 1, &upperLimit) == true) // Upper limit
-			{
-				const char *ll = (const char *)CGPDFStringGetBytePtr(lowerLimit); // Lower string
-				const char *ul = (const char *)CGPDFStringGetBytePtr(upperLimit); // Upper string
-
-				if ((strcmp(destinationName, ll) < 0) || (strcmp(destinationName, ul) > 0))
-				{
-					return NULL; // Destination name is outside this node's limits
-				}
-			}
-		}
-	}
-
-	CGPDFArrayRef namesArray = NULL; // Names array
-
-	if (CGPDFDictionaryGetArray(node, "Names", &namesArray) == true)
-	{
-		NSInteger namesCount = CGPDFArrayGetCount(namesArray);
-
-		for (NSInteger index = 0; index < namesCount; index += 2)
-		{
-			CGPDFStringRef destName; // Destination name string
-
-			if (CGPDFArrayGetString(namesArray, index, &destName) == true)
-			{
-				const char *dn = (const char *)CGPDFStringGetBytePtr(destName);
-
-				if (strcmp(dn, destinationName) == 0) // Found the destination name
-				{
-					if (CGPDFArrayGetArray(namesArray, (index + 1), &destinationArray) == false)
-					{
-						CGPDFDictionaryRef destinationDictionary = NULL; // Destination dictionary
-
-						if (CGPDFArrayGetDictionary(namesArray, (index + 1), &destinationDictionary) == true)
-						{
-							CGPDFDictionaryGetArray(destinationDictionary, "D", &destinationArray);
-						}
-					}
-
-					return destinationArray; // Return the destination array
-				}
-			}
-		}
-	}
-
-	CGPDFArrayRef kidsArray = NULL; // Kids array
-
-	if (CGPDFDictionaryGetArray(node, "Kids", &kidsArray) == true)
-	{
-		NSInteger kidsCount = CGPDFArrayGetCount(kidsArray);
-
-		for (NSInteger index = 0; index < kidsCount; index++)
-		{
-			CGPDFDictionaryRef kidNode = NULL; // Kid node dictionary
-
-			if (CGPDFArrayGetDictionary(kidsArray, index, &kidNode) == true) // Recurse into node
-			{
-				destinationArray = [self destinationWithName:destinationName inDestsTree:kidNode];
-
-				if (destinationArray != NULL) return destinationArray; // Return destination array
-			}
-		}
-	}
-
-	return NULL;
-}
-
-- (id)annotationLinkTarget:(CGPDFDictionaryRef)annotationDictionary
-{
-	id linkTarget = nil; // Link target object
-
-	CGPDFStringRef destName = NULL; const char *destString = NULL;
-
-	CGPDFDictionaryRef actionDictionary = NULL; CGPDFArrayRef destArray = NULL;
-
-	if (CGPDFDictionaryGetDictionary(annotationDictionary, "A", &actionDictionary) == true)
-	{
-		const char *actionType = NULL; // Annotation action type string
-
-		if (CGPDFDictionaryGetName(actionDictionary, "S", &actionType) == true)
-		{
-			if (strcmp(actionType, "GoTo") == 0) // GoTo action type
-			{
-				if (CGPDFDictionaryGetArray(actionDictionary, "D", &destArray) == false)
-				{
-					CGPDFDictionaryGetString(actionDictionary, "D", &destName);
-				}
-			}
-			else // Handle other link action type possibility
-			{
-				if (strcmp(actionType, "URI") == 0) // URI action type
-				{
-					CGPDFStringRef uriString = NULL; // Action's URI string
-
-					if (CGPDFDictionaryGetString(actionDictionary, "URI", &uriString) == true)
-					{
-						const char *uri = (const char *)CGPDFStringGetBytePtr(uriString); // Destination URI string
-
-						NSString *target = [NSString stringWithCString:uri encoding:NSUTF8StringEncoding]; // NSString - UTF8
-
-						//linkTarget = [NSURL URLWithString:[target stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; DEPRECATED iOS0
-
-                        linkTarget = [NSURL URLWithString:[target stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]]];
-                        
-						if (linkTarget == nil) NSLog(@"%s Bad URI '%@'", __FUNCTION__, target);
-					}
-				}
-			}
-		}
-	}
-	else // Handle other link target possibilities
-	{
-		if (CGPDFDictionaryGetArray(annotationDictionary, "Dest", &destArray) == false)
-		{
-			if (CGPDFDictionaryGetString(annotationDictionary, "Dest", &destName) == false)
-			{
-				CGPDFDictionaryGetName(annotationDictionary, "Dest", &destString);
-			}
-		}
-	}
-
-	if (destName != NULL) // Handle a destination name
-	{
-		CGPDFDictionaryRef catalogDictionary = CGPDFDocumentGetCatalog(_PDFDocRef);
-
-		CGPDFDictionaryRef namesDictionary = NULL; // Destination names in the document
-
-		if (CGPDFDictionaryGetDictionary(catalogDictionary, "Names", &namesDictionary) == true)
-		{
-			CGPDFDictionaryRef destsDictionary = NULL; // Document destinations dictionary
-
-			if (CGPDFDictionaryGetDictionary(namesDictionary, "Dests", &destsDictionary) == true)
-			{
-				const char *destinationName = (const char *)CGPDFStringGetBytePtr(destName); // Name
-
-				destArray = [self destinationWithName:destinationName inDestsTree:destsDictionary];
-			}
-		}
-	}
-
-	if (destString != NULL) // Handle a destination string
-	{
-		CGPDFDictionaryRef catalogDictionary = CGPDFDocumentGetCatalog(_PDFDocRef);
-
-		CGPDFDictionaryRef destsDictionary = NULL; // Document destinations dictionary
-
-		if (CGPDFDictionaryGetDictionary(catalogDictionary, "Dests", &destsDictionary) == true)
-		{
-			CGPDFDictionaryRef targetDictionary = NULL; // Destination target dictionary
-
-			if (CGPDFDictionaryGetDictionary(destsDictionary, destString, &targetDictionary) == true)
-			{
-				CGPDFDictionaryGetArray(targetDictionary, "D", &destArray);
-			}
-		}
-	}
-
-	if (destArray != NULL) // Handle a destination array
-	{
-		NSInteger targetPageNumber = 0; // The target page number
-
-		CGPDFDictionaryRef pageDictionaryFromDestArray = NULL; // Target reference
-
-		if (CGPDFArrayGetDictionary(destArray, 0, &pageDictionaryFromDestArray) == true)
-		{
-			NSInteger pageCount = CGPDFDocumentGetNumberOfPages(_PDFDocRef); // Pages
-
-			for (NSInteger pageNumber = 1; pageNumber <= pageCount; pageNumber++)
-			{
-				CGPDFPageRef pageRef = CGPDFDocumentGetPage(_PDFDocRef, pageNumber);
-
-				CGPDFDictionaryRef pageDictionaryFromPage = CGPDFPageGetDictionary(pageRef);
-
-				if (pageDictionaryFromPage == pageDictionaryFromDestArray) // Found it
-				{
-					targetPageNumber = pageNumber; break;
-				}
-			}
-		}
-		else // Try page number from array possibility
-		{
-			CGPDFInteger pageNumber = 0; // Page number in array
-
-			if (CGPDFArrayGetInteger(destArray, 0, &pageNumber) == true)
-			{
-				targetPageNumber = (pageNumber + 1); // 1-based
-			}
-		}
-
-		if (targetPageNumber > 0) // We have a target page number
-		{
-			linkTarget = [NSNumber numberWithInteger:targetPageNumber];
-		}
-	}
-
-	return linkTarget;
-}
-
-- (id)processSingleTap:(UITapGestureRecognizer *)recognizer
-{
-	id result = nil; // Tap result object
-
-	if (recognizer.state == UIGestureRecognizerStateRecognized)
-	{
-		if (_links.count > 0) // Process the single tap
-		{
-			CGPoint point = [recognizer locationInView:self];
-
-			for (ReaderDocumentLink *link in _links) // Enumerate links
-			{
-				if (CGRectContainsPoint(link.rect, point) == true) // Found it
-				{
-					result = [self annotationLinkTarget:link.dictionary]; break;
-				}
-			}
-		}
-	}
-
-	return result;
-}
-
-#pragma mark - ReaderContentPage instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = NO;
-		self.userInteractionEnabled = NO;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingNone;
-		self.backgroundColor = [UIColor clearColor];
-	}
-
-	return self;
-}
-
-- (instancetype)initWithURL:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase
-{
-	CGRect viewRect = CGRectZero; // View rect
-
-	if (fileURL != nil) // Check for non-nil file URL
-	{
-		_PDFDocRef = CGPDFDocumentCreateUsingUrl((__bridge CFURLRef)fileURL, phrase);
-
-		if (_PDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			if (page < 1) page = 1; // Check the lower page bounds
-
-			NSInteger pages = CGPDFDocumentGetNumberOfPages(_PDFDocRef);
-
-			if (page > pages) page = pages; // Check the upper page bounds
-
-			_PDFPageRef = CGPDFDocumentGetPage(_PDFDocRef, page); // Get page
-
-			if (_PDFPageRef != NULL) // Check for non-NULL CGPDFPageRef
-			{
-				CGPDFPageRetain(_PDFPageRef); // Retain the PDF page
-
-				CGRect cropBoxRect = CGPDFPageGetBoxRect(_PDFPageRef, kCGPDFCropBox);
-				CGRect mediaBoxRect = CGPDFPageGetBoxRect(_PDFPageRef, kCGPDFMediaBox);
-				CGRect effectiveRect = CGRectIntersection(cropBoxRect, mediaBoxRect);
-
-				_pageAngle = CGPDFPageGetRotationAngle(_PDFPageRef); // Angle
-
-				switch (_pageAngle) // Page rotation angle (in degrees)
-				{
-					default: // Default case
-					case 0: case 180: // 0 and 180 degrees
-					{
-						_pageWidth = effectiveRect.size.width;
-						_pageHeight = effectiveRect.size.height;
-						_pageOffsetX = effectiveRect.origin.x;
-						_pageOffsetY = effectiveRect.origin.y;
-						break;
-					}
-
-					case 90: case 270: // 90 and 270 degrees
-					{
-						_pageWidth = effectiveRect.size.height;
-						_pageHeight = effectiveRect.size.width;
-						_pageOffsetX = effectiveRect.origin.y;
-						_pageOffsetY = effectiveRect.origin.x;
-						break;
-					}
-				}
-
-				NSInteger page_w = _pageWidth; // Integer width
-				NSInteger page_h = _pageHeight; // Integer height
-
-				if (page_w % 2) page_w--; if (page_h % 2) page_h--; // Even
-
-				viewRect.size = CGSizeMake(page_w, page_h); // View size
-			}
-			else // Error out with a diagnostic
-			{
-                (void)(CGPDFDocumentRelease(_PDFDocRef)), _PDFDocRef = NULL;
-
-				NSAssert(NO, @"CGPDFPageRef == NULL");
-			}
-		}
-		else // Error out with a diagnostic
-		{
-			NSAssert(NO, @"CGPDFDocumentRef == NULL");
-		}
-	}
-	else // Error out with a diagnostic
-	{
-		NSAssert(NO, @"fileURL == nil");
-	}
-
-	ReaderContentPage *view = [self initWithFrame:viewRect];
-
-	if (view != nil) [self buildAnnotationLinksList];
-
-	return view;
-}
-
-- (void)removeFromSuperview
-{
-	self.layer.delegate = nil;
-
-	//self.layer.contents = nil;
-
-	[super removeFromSuperview];
-}
-
-- (void)dealloc
-{
-    (void)(CGPDFPageRelease(_PDFPageRef)), _PDFPageRef = NULL;
-
-    (void)(CGPDFDocumentRelease(_PDFDocRef)), _PDFDocRef = NULL;
-}
-
-#if (READER_DISABLE_RETINA == TRUE) // Option
-
-- (void)didMoveToWindow
-{
-	self.contentScaleFactor = 1.0f; // Override scale factor
-}
-
-#endif // end of READER_DISABLE_RETINA Option
-
-#pragma mark - CATiledLayer delegate methods
-
-- (void)drawLayer:(CATiledLayer *)layer inContext:(CGContextRef)context
-{
-	ReaderContentPage *readerContentPage = self; // Retain self
-
-	CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); // White
-
-	CGContextFillRect(context, CGContextGetClipBoundingBox(context)); // Fill
-
-	//NSLog(@"%s %@", __FUNCTION__, NSStringFromCGRect(CGContextGetClipBoundingBox(context)));
-
-	CGContextTranslateCTM(context, 0.0f, self.bounds.size.height); CGContextScaleCTM(context, 1.0f, -1.0f);
-
-	CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(_PDFPageRef, kCGPDFCropBox, self.bounds, 0, true));
-
-	//CGContextSetRenderingIntent(context, kCGRenderingIntentDefault); CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
-
-	CGContextDrawPDFPage(context, _PDFPageRef); // Render the PDF page into the context
-
-	if (readerContentPage != nil) readerContentPage = nil; // Release self
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderDocumentLink class implementation
-//
-
-@implementation ReaderDocumentLink
-{
-	CGPDFDictionaryRef _dictionary;
-
-	CGRect _rect;
-}
-
-#pragma mark - Properties
-
-@synthesize rect = _rect;
-@synthesize dictionary = _dictionary;
-
-#pragma mark - ReaderDocumentLink class methods
-
-+ (instancetype)newWithRect:(CGRect)linkRect dictionary:(CGPDFDictionaryRef)linkDictionary
-{
-	return [[ReaderDocumentLink alloc] initWithRect:linkRect dictionary:linkDictionary];
-}
-
-#pragma mark - ReaderDocumentLink instance methods
-
-- (instancetype)initWithRect:(CGRect)linkRect dictionary:(CGPDFDictionaryRef)linkDictionary
-{
-	if ((self = [super init]))
-	{
-		_dictionary = linkDictionary;
-
-		_rect = linkRect;
-	}
-
-	return self;
-}
-
-@end

+ 0 - 31
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentTile.h

@@ -1,31 +0,0 @@
-//
-//	ReaderContentTile.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-#import <QuartzCore/QuartzCore.h>
-
-@interface ReaderContentTile : CATiledLayer
-
-@end

+ 0 - 71
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentTile.m

@@ -1,71 +0,0 @@
-//
-//	ReaderContentTile.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderContentTile.h"
-
-@implementation ReaderContentTile
-
-#pragma mark - Constants
-
-#define LEVELS_OF_DETAIL 16
-
-#pragma mark - ReaderContentTile class methods
-
-+ (CFTimeInterval)fadeDuration
-{
-	return 0.001; // iOS bug (flickering tiles) workaround
-}
-
-#pragma mark - ReaderContentTile instance methods
-
-- (instancetype)init
-{
-	if ((self = [super init])) // Initialize superclass
-	{
-		self.levelsOfDetail = LEVELS_OF_DETAIL; // Zoom levels
-
-		self.levelsOfDetailBias = (LEVELS_OF_DETAIL - 1); // Bias
-
-		UIScreen *mainScreen = [UIScreen mainScreen]; // Main screen
-
-		CGFloat screenScale = [mainScreen scale]; // Main screen scale
-
-		CGRect screenBounds = [mainScreen bounds]; // Main screen bounds
-
-		CGFloat w_pixels = (screenBounds.size.width * screenScale);
-
-		CGFloat h_pixels = (screenBounds.size.height * screenScale);
-
-		CGFloat max = ((w_pixels < h_pixels) ? h_pixels : w_pixels);
-
-		CGFloat sizeOfTiles = ((max < 512.0f) ? 512.0f : 1024.0f);
-
-		self.tileSize = CGSizeMake(sizeOfTiles, sizeOfTiles);
-	}
-
-	return self;
-}
-
-@end

+ 0 - 66
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentView.h

@@ -1,66 +0,0 @@
-//
-//	ReaderContentView.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ReaderThumbView.h"
-
-@class ReaderContentView;
-@class ReaderContentPage;
-@class ReaderContentThumb;
-
-@protocol ReaderContentViewDelegate <NSObject>
-
-@required // Delegate protocols
-
-- (void)contentView:(ReaderContentView *)contentView touchesBegan:(NSSet *)touches;
-
-@end
-
-@interface ReaderContentView : UIScrollView
-
-@property (nonatomic, weak, readwrite) id <ReaderContentViewDelegate> message;
-
-- (instancetype)initWithFrame:(CGRect)frame fileURL:(NSURL *)fileURL page:(NSUInteger)page password:(NSString *)phrase;
-
-- (void)showPageThumb:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase guid:(NSString *)guid;
-
-- (id)processSingleTap:(UITapGestureRecognizer *)recognizer;
-
-- (void)zoomIncrement:(UITapGestureRecognizer *)recognizer;
-- (void)zoomDecrement:(UITapGestureRecognizer *)recognizer;
-- (void)zoomResetAnimated:(BOOL)animated;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderContentThumb class interface
-//
-
-@interface ReaderContentThumb : ReaderThumbView
-
-@end

+ 0 - 402
iOSClient/Library/VFR Pdf Reader/Sources/ReaderContentView.m

@@ -1,402 +0,0 @@
-//
-//	ReaderContentView.m
-//	Reader v2.8.7
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2016 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ReaderContentView.h"
-#import "ReaderContentPage.h"
-#import "ReaderThumbCache.h"
-
-#import <QuartzCore/QuartzCore.h>
-
-@interface ReaderContentView () <UIScrollViewDelegate>
-
-@end
-
-@implementation ReaderContentView
-{
-	UIView *theContainerView;
-
-	UIUserInterfaceIdiom userInterfaceIdiom;
-
-	ReaderContentPage *theContentPage;
-
-	ReaderContentThumb *theThumbView;
-
-	CGFloat realMaximumZoom;
-	CGFloat tempMaximumZoom;
-
-	BOOL zoomBounced;
-}
-
-#pragma mark - Constants
-
-#define ZOOM_FACTOR 2.0f
-#define ZOOM_MAXIMUM 16.0f
-
-#define PAGE_THUMB_SMALL 144
-#define PAGE_THUMB_LARGE 240
-
-static void *ReaderContentViewContext = &ReaderContentViewContext;
-
-static CGFloat g_BugFixWidthInset = 0.0f;
-
-#pragma mark - Properties
-
-@synthesize message;
-
-#pragma mark - ReaderContentView functions
-
-static inline CGFloat zoomScaleThatFits(CGSize target, CGSize source)
-{
-	CGFloat w_scale = (target.width / (source.width + g_BugFixWidthInset));
-
-	CGFloat h_scale = (target.height / source.height);
-
-	return ((w_scale < h_scale) ? w_scale : h_scale);
-}
-
-#pragma mark - ReaderContentView class methods
-
-+ (void)initialize
-{
-	if (self == [ReaderContentView self]) // Do once - iOS 8.0 UIScrollView bug workaround
-	{
-		if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) // Not iPads
-		{
-			NSString *iosVersion = [UIDevice currentDevice].systemVersion; // iOS version as a string
-
-			if ([@"8.0" compare:iosVersion options:NSNumericSearch] != NSOrderedDescending) // 8.0 and up
-			{
-//				if ([@"8.2" compare:iosVersion options:NSNumericSearch] == NSOrderedDescending) // Below 8.2
-//				{
-					g_BugFixWidthInset = 2.0f * [[UIScreen mainScreen] scale]; // Reduce width of content view
-//				}
-			}
-		}
-	}
-}
-
-#pragma mark - ReaderContentView instance methods
-
-- (void)updateMinimumMaximumZoom
-{
-	CGFloat zoomScale = zoomScaleThatFits(self.bounds.size, theContentPage.bounds.size);
-
-	self.minimumZoomScale = zoomScale; self.maximumZoomScale = (zoomScale * ZOOM_MAXIMUM);
-
-	realMaximumZoom = self.maximumZoomScale; tempMaximumZoom = (realMaximumZoom * ZOOM_FACTOR);
-}
-
-- (void)centerScrollViewContent
-{
-	CGFloat iw = 0.0f; CGFloat ih = 0.0f; // Content width and height insets
-
-	CGSize boundsSize = self.bounds.size; CGSize contentSize = self.contentSize; // Sizes
-
-	if (contentSize.width < boundsSize.width) iw = ((boundsSize.width - contentSize.width) * 0.5f);
-
-	if (contentSize.height < boundsSize.height) ih = ((boundsSize.height - contentSize.height) * 0.5f);
-
-	UIEdgeInsets insets = UIEdgeInsetsMake(ih, iw, ih, iw); // Create (possibly updated) content insets
-
-	if (UIEdgeInsetsEqualToEdgeInsets(self.contentInset, insets) == false) self.contentInset = insets;
-}
-
-- (instancetype)initWithFrame:(CGRect)frame fileURL:(NSURL *)fileURL page:(NSUInteger)page password:(NSString *)phrase
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.scrollsToTop = NO;
-		self.delaysContentTouches = NO;
-		self.showsVerticalScrollIndicator = NO;
-		self.showsHorizontalScrollIndicator = NO;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-		self.backgroundColor = [UIColor clearColor];
-		self.autoresizesSubviews = NO;
-		self.clipsToBounds = NO;
-		self.delegate = self;
-
-		userInterfaceIdiom = [UIDevice currentDevice].userInterfaceIdiom; // User interface idiom
-
-		theContentPage = [[ReaderContentPage alloc] initWithURL:fileURL page:page password:phrase];
-
-		if (theContentPage != nil) // Must have a valid and initialized content page
-		{
-			theContainerView = [[UIView alloc] initWithFrame:theContentPage.bounds];
-
-			theContainerView.autoresizesSubviews = NO;
-			theContainerView.userInteractionEnabled = NO;
-			theContainerView.contentMode = UIViewContentModeRedraw;
-			theContainerView.autoresizingMask = UIViewAutoresizingNone;
-			theContainerView.backgroundColor = [UIColor whiteColor];
-
-#if (READER_SHOW_SHADOWS == TRUE) // Option
-
-			theContainerView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
-			theContainerView.layer.shadowRadius = 4.0f; theContainerView.layer.shadowOpacity = 1.0f;
-			theContainerView.layer.shadowPath = [UIBezierPath bezierPathWithRect:theContainerView.bounds].CGPath;
-
-#endif // end of READER_SHOW_SHADOWS Option
-
-			self.contentSize = theContentPage.bounds.size; [self centerScrollViewContent];
-
-#if (READER_ENABLE_PREVIEW == TRUE) // Option
-
-			theThumbView = [[ReaderContentThumb alloc] initWithFrame:theContentPage.bounds]; // Page thumb view
-
-			[theContainerView addSubview:theThumbView]; // Add the page thumb view to the container view
-
-#endif // end of READER_ENABLE_PREVIEW Option
-
-			[theContainerView addSubview:theContentPage]; // Add the content page to the container view
-
-			[self addSubview:theContainerView]; // Add the container view to the scroll view
-
-			[self updateMinimumMaximumZoom]; // Update the minimum and maximum zoom scales
-
-			self.zoomScale = self.minimumZoomScale; // Set the zoom scale to fit page content
-
-			[self addObserver:self forKeyPath:@"frame" options:0 context:ReaderContentViewContext];
-		}
-
-		self.tag = page; // Tag the view with the page number
-	}
-
-	return self;
-}
-
-- (void)dealloc
-{
-	[self removeObserver:self forKeyPath:@"frame" context:ReaderContentViewContext];
-}
-
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-{
-	if (context == ReaderContentViewContext) // Our context
-	{
-		if ((object == self) && [keyPath isEqualToString:@"frame"])
-		{
-			[self centerScrollViewContent]; // Center content
-
-			CGFloat oldMinimumZoomScale = self.minimumZoomScale;
-
-			[self updateMinimumMaximumZoom]; // Update zoom scale limits
-
-			if (self.zoomScale == oldMinimumZoomScale) // Old minimum
-			{
-				self.zoomScale = self.minimumZoomScale;
-			}
-			else // Check against minimum zoom scale
-			{
-				if (self.zoomScale < self.minimumZoomScale)
-				{
-					self.zoomScale = self.minimumZoomScale;
-				}
-				else // Check against maximum zoom scale
-				{
-					if (self.zoomScale > self.maximumZoomScale)
-					{
-						self.zoomScale = self.maximumZoomScale;
-					}
-				}
-			}
-		}
-	}
-}
-
-- (void)showPageThumb:(NSURL *)fileURL page:(NSInteger)page password:(NSString *)phrase guid:(NSString *)guid
-{
-#if (READER_ENABLE_PREVIEW == TRUE) // Option
-
-	CGSize size = ((userInterfaceIdiom == UIUserInterfaceIdiomPad) ? CGSizeMake(PAGE_THUMB_LARGE, PAGE_THUMB_LARGE) : CGSizeMake(PAGE_THUMB_SMALL, PAGE_THUMB_SMALL));
-
-	ReaderThumbRequest *request = [ReaderThumbRequest newForView:theThumbView fileURL:fileURL password:phrase guid:guid page:page size:size];
-
-	UIImage *image = [[ReaderThumbCache sharedInstance] thumbRequest:request priority:YES]; // Request the page thumb
-
-	if ([image isKindOfClass:[UIImage class]]) [theThumbView showImage:image]; // Show image from cache
-
-#endif // end of READER_ENABLE_PREVIEW Option
-}
-
-- (id)processSingleTap:(UITapGestureRecognizer *)recognizer
-{
-	return [theContentPage processSingleTap:recognizer];
-}
-
-- (CGRect)zoomRectForScale:(CGFloat)scale withCenter:(CGPoint)center
-{
-	CGRect zoomRect; // Centered zoom rect
-
-	zoomRect.size.width = (self.bounds.size.width / scale);
-	zoomRect.size.height = (self.bounds.size.height / scale);
-
-	zoomRect.origin.x = (center.x - (zoomRect.size.width * 0.5f));
-	zoomRect.origin.y = (center.y - (zoomRect.size.height * 0.5f));
-
-	return zoomRect;
-}
-
-- (void)zoomIncrement:(UITapGestureRecognizer *)recognizer
-{
-	CGFloat zoomScale = self.zoomScale; // Current zoom
-
-	CGPoint point = [recognizer locationInView:theContentPage];
-
-	if (zoomScale < self.maximumZoomScale) // Zoom in
-	{
-		zoomScale *= ZOOM_FACTOR; // Zoom in by zoom factor amount
-
-		if (zoomScale > self.maximumZoomScale) zoomScale = self.maximumZoomScale;
-
-		CGRect zoomRect = [self zoomRectForScale:zoomScale withCenter:point];
-
-		[self zoomToRect:zoomRect animated:YES];
-	}
-	else // Handle fully zoomed in
-	{
-		if (zoomBounced == NO) // Zoom bounce
-		{
-			self.maximumZoomScale = tempMaximumZoom;
-
-			[self setZoomScale:tempMaximumZoom animated:YES];
-		}
-		else // Zoom all the way out
-		{
-			zoomScale = self.minimumZoomScale;
-
-			[self setZoomScale:zoomScale animated:YES];
-		}
-	}
-}
-
-- (void)zoomDecrement:(UITapGestureRecognizer *)recognizer
-{
-	CGFloat zoomScale = self.zoomScale; // Current zoom
-
-	CGPoint point = [recognizer locationInView:theContentPage];
-
-	if (zoomScale > self.minimumZoomScale) // Zoom out
-	{
-		zoomScale /= ZOOM_FACTOR; // Zoom out by zoom factor amount
-
-		if (zoomScale < self.minimumZoomScale) zoomScale = self.minimumZoomScale;
-
-		CGRect zoomRect = [self zoomRectForScale:zoomScale withCenter:point];
-
-		[self zoomToRect:zoomRect animated:YES];
-	}
-	else // Handle fully zoomed out
-	{
-		zoomScale = self.maximumZoomScale; // Full zoom in
-
-		CGRect zoomRect = [self zoomRectForScale:zoomScale withCenter:point];
-
-		[self zoomToRect:zoomRect animated:YES];
-	}
-}
-
-- (void)zoomResetAnimated:(BOOL)animated
-{
-	if (self.zoomScale > self.minimumZoomScale) // Reset zoom
-	{
-		if (animated) [self setZoomScale:self.minimumZoomScale animated:YES]; else self.zoomScale = self.minimumZoomScale; zoomBounced = NO;
-	}
-}
-
-#pragma mark - UIScrollViewDelegate methods
-
-- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
-{
-	return theContainerView;
-}
-
-- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale
-{
-	if (self.zoomScale > realMaximumZoom) // Bounce back to real maximum zoom scale
-	{
-		[self setZoomScale:realMaximumZoom animated:YES]; self.maximumZoomScale = realMaximumZoom; zoomBounced = YES;
-	}
-	else // Normal scroll view did end zooming
-	{
-		if (self.zoomScale < realMaximumZoom) zoomBounced = NO;
-	}
-}
-
-- (void)scrollViewDidZoom:(UIScrollView *)scrollView
-{
-	[self centerScrollViewContent]; // Center content
-}
-
-#pragma mark - UIResponder instance methods
-
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesBegan:touches withEvent:event]; // Message superclass
-
-	[message contentView:self touchesBegan:touches]; // Message delegate
-}
-
-- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesCancelled:touches withEvent:event]; // Message superclass
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesEnded:touches withEvent:event]; // Message superclass
-}
-
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesMoved:touches withEvent:event]; // Message superclass
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderContentThumb class implementation
-//
-
-@implementation ReaderContentThumb
-
-#pragma mark - ReaderContentThumb instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame])) // Superclass init
-	{
-		imageView.contentMode = UIViewContentModeScaleAspectFill;
-
-		imageView.clipsToBounds = YES; // Needed for aspect fill
-	}
-
-	return self;
-}
-
-@end

+ 0 - 55
iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocument.h

@@ -1,55 +0,0 @@
-//
-//	ReaderDocument.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface ReaderDocument : NSObject <NSObject, NSCoding>
-
-@property (nonatomic, strong, readonly) NSString *guid;
-@property (nonatomic, strong, readonly) NSDate *fileDate;
-@property (nonatomic, strong, readwrite) NSDate *lastOpen;
-@property (nonatomic, strong, readonly) NSNumber *fileSize;
-@property (nonatomic, strong, readonly) NSNumber *pageCount;
-@property (nonatomic, strong, readwrite) NSNumber *pageNumber;
-@property (nonatomic, strong, readonly) NSMutableIndexSet *bookmarks;
-@property (nonatomic, strong, readonly) NSString *password;
-@property (nonatomic, strong, readonly) NSString *fileName;
-@property (nonatomic, strong, readonly) NSURL *fileURL;
-
-@property (nonatomic, readonly) BOOL canEmail;
-@property (nonatomic, readonly) BOOL canExport;
-@property (nonatomic, readonly) BOOL canPrint;
-
-+ (ReaderDocument *)withDocumentFilePath:(NSString *)filePath password:(NSString *)phrase;
-
-+ (ReaderDocument *)unarchiveFromFileName:(NSString *)filePath password:(NSString *)phrase;
-
-- (instancetype)initWithFilePath:(NSString *)filePath password:(NSString *)phrase;
-
-- (BOOL)archiveDocumentProperties;
-
-- (void)updateDocumentProperties;
-
-@end

+ 0 - 354
iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocument.m

@@ -1,354 +0,0 @@
-//
-//	ReaderDocument.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderDocument.h"
-#import "CGPDFDocument.h"
-#import <fcntl.h>
-
-@interface ReaderDocument ()
-
-@property (nonatomic, strong, readwrite) NSString *password;
-@property (nonatomic, strong, readwrite) NSString *filePath;
-
-@end
-
-@implementation ReaderDocument
-{
-	NSString *_guid;
-
-	NSDate *_fileDate;
-
-	NSDate *_lastOpen;
-
-	NSNumber *_fileSize;
-
-	NSNumber *_pageCount;
-
-	NSNumber *_pageNumber;
-
-	NSMutableIndexSet *_bookmarks;
-
-	NSString *_password;
-
-	NSString *_fileName;
-
-	NSString *_filePath;
-
-	NSURL *_fileURL;
-}
-
-#pragma mark - Properties
-
-@synthesize guid = _guid;
-@synthesize fileDate = _fileDate;
-@synthesize lastOpen = _lastOpen;
-@synthesize fileSize = _fileSize;
-@synthesize pageCount = _pageCount;
-@synthesize pageNumber = _pageNumber;
-@synthesize bookmarks = _bookmarks;
-@synthesize password = _password;
-@synthesize filePath = _filePath;
-@dynamic fileName, fileURL;
-@dynamic canEmail, canExport, canPrint;
-
-#pragma mark - ReaderDocument class methods
-
-+ (NSString *)GUID
-{
-	CFUUIDRef theUUID = CFUUIDCreate(NULL);
-
-	CFStringRef theString = CFUUIDCreateString(NULL, theUUID);
-
-	NSString *unique = [NSString stringWithString:(__bridge id)theString];
-
-	CFRelease(theString); CFRelease(theUUID); // Cleanup CF objects
-
-	return unique;
-}
-
-+ (NSString *)documentsPath
-{
-	NSFileManager *fileManager = [NSFileManager defaultManager]; // Singleton
-
-	NSURL *pathURL = [fileManager URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL];
-
-	return [pathURL path]; // Path to the application's "~/Documents" directory
-}
-
-+ (NSString *)applicationSupportPath
-{
-	NSFileManager *fileManager = [NSFileManager defaultManager]; // Singleton
-
-	NSURL *pathURL = [fileManager URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:NULL];
-
-	return [pathURL path]; // Path to the application's "~/Library/Application Support" directory
-}
-
-+ (NSString *)archiveFilePath:(NSString *)fileName
-{
-	NSFileManager *fileManager = [NSFileManager defaultManager]; // Singleton
-
-	NSString *applicationSupportPath = [ReaderDocument applicationSupportPath]; // See above
-
-	NSString *archivePath = [applicationSupportPath stringByAppendingPathComponent:@"Reader Metadata"];
-
-	[fileManager createDirectoryAtPath:archivePath withIntermediateDirectories:NO attributes:nil error:NULL];
-
-	NSString *archiveName = [[fileName stringByDeletingPathExtension] stringByAppendingPathExtension:@"plist"];
-
-	return [archivePath stringByAppendingPathComponent:archiveName]; // "{archivePath}/'fileName'.plist"
-}
-
-+ (ReaderDocument *)unarchiveFromFileName:(NSString *)filePath password:(NSString *)phrase
-{
-	ReaderDocument *document = nil; // ReaderDocument object
-
-	NSString *fileName = [filePath lastPathComponent]; // File name only
-
-	NSString *archiveFilePath = [ReaderDocument archiveFilePath:fileName];
-
-	@try // Unarchive an archived ReaderDocument object from its property list
-	{
-		document = [NSKeyedUnarchiver unarchiveObjectWithFile:archiveFilePath];
-
-		if (document != nil) // Set the document's file path and password properties
-		{
-			document.filePath = [filePath copy]; document.password = [phrase copy];
-		}
-	}
-	@catch (NSException *exception) // Exception handling (just in case O_o)
-	{
-		#ifdef DEBUG
-			NSLog(@"%s Caught %@: %@", __FUNCTION__, [exception name], [exception reason]);
-		#endif
-	}
-
-	return document;
-}
-
-+ (ReaderDocument *)withDocumentFilePath:(NSString *)filePath password:(NSString *)phrase
-{
-	ReaderDocument *document = nil; // ReaderDocument object
-
-	document = [ReaderDocument unarchiveFromFileName:filePath password:phrase];
-
-	if (document == nil) // Unarchive failed so create a new ReaderDocument object
-	{
-		document = [[ReaderDocument alloc] initWithFilePath:filePath password:phrase];
-	}
-
-	return document;
-}
-
-+ (BOOL)isPDF:(NSString *)filePath
-{
-	BOOL state = NO;
-
-	if (filePath != nil) // Must have a file path
-	{
-		const char *path = [filePath fileSystemRepresentation];
-
-		int fd = open(path, O_RDONLY); // Open the file
-
-		if (fd > 0) // We have a valid file descriptor
-		{
-			const char sig[1024]; // File signature buffer
-
-			ssize_t len = read(fd, (void *)&sig, sizeof(sig));
-
-			state = (strnstr(sig, "%PDF", len) != NULL);
-
-			close(fd); // Close the file
-		}
-	}
-
-	return state;
-}
-
-#pragma mark - ReaderDocument instance methods
-
-- (instancetype)initWithFilePath:(NSString *)filePath password:(NSString *)phrase
-{
-	if ((self = [super init])) // Initialize superclass first
-	{
-		if ([ReaderDocument isPDF:filePath] == YES) // Valid PDF
-		{
-			_guid = [ReaderDocument GUID]; // Create document's GUID
-
-			_password = [phrase copy]; // Keep copy of document password
-
-			_filePath = [filePath copy]; // Keep copy of document file path
-
-			_pageNumber = [NSNumber numberWithInteger:1]; // Start on page one
-
-			_bookmarks = [NSMutableIndexSet new]; // Bookmarked pages index set
-
-			CFURLRef docURLRef = (__bridge CFURLRef)[self fileURL]; // CFURLRef from NSURL
-
-			CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateUsingUrl(docURLRef, _password);
-
-			if (thePDFDocRef != NULL) // Get the total number of pages in the document
-			{
-				NSInteger pageCount = CGPDFDocumentGetNumberOfPages(thePDFDocRef);
-
-				_pageCount = [NSNumber numberWithInteger:pageCount];
-
-				CGPDFDocumentRelease(thePDFDocRef); // Cleanup
-			}
-			else // Cupertino, we have a problem with the document
-			{
-				NSAssert(NO, @"CGPDFDocumentRef == NULL");
-			}
-
-			_lastOpen = [NSDate dateWithTimeIntervalSinceReferenceDate:0.0];
-
-			NSFileManager *fileManager = [NSFileManager defaultManager]; // Singleton
-
-			NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:_filePath error:NULL];
-
-			_fileDate = [fileAttributes objectForKey:NSFileModificationDate]; // File date
-
-			_fileSize = [fileAttributes objectForKey:NSFileSize]; // File size (bytes)
-
-			[self archiveDocumentProperties]; // Archive ReaderDocument object
-		}
-		else // Not a valid PDF file
-		{
-			self = nil;
-		}
-	}
-
-	return self;
-}
-
-- (NSString *)fileName
-{
-	if (_fileName == nil) _fileName = [_filePath lastPathComponent];
-
-	return _fileName;
-}
-
-- (NSURL *)fileURL
-{
-	if (_fileURL == nil) _fileURL = [[NSURL alloc] initFileURLWithPath:_filePath isDirectory:NO];
-
-	return _fileURL;
-}
-
-- (BOOL)canEmail
-{
-	return YES;
-}
-
-- (BOOL)canExport
-{
-	return YES;
-}
-
-- (BOOL)canPrint
-{
-	return YES;
-}
-
-- (BOOL)archiveDocumentProperties
-{
-	NSString *archiveFilePath = [ReaderDocument archiveFilePath:[self fileName]];
-
-	return [NSKeyedArchiver archiveRootObject:self toFile:archiveFilePath];
-}
-
-- (void)updateDocumentProperties
-{
-	CFURLRef docURLRef = (__bridge CFURLRef)[self fileURL]; // CFURLRef from NSURL
-
-	CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateUsingUrl(docURLRef, _password);
-
-	if (thePDFDocRef != NULL) // Get the total number of pages in the document
-	{
-		NSInteger pageCount = CGPDFDocumentGetNumberOfPages(thePDFDocRef);
-
-		_pageCount = [NSNumber numberWithInteger:pageCount];
-
-		CGPDFDocumentRelease(thePDFDocRef); // Cleanup
-	}
-
-	NSFileManager *fileManager = [NSFileManager defaultManager]; // Singleton
-
-	NSDictionary *fileAttributes = [fileManager attributesOfItemAtPath:_filePath error:NULL];
-
-	_fileDate = [fileAttributes objectForKey:NSFileModificationDate]; // File date
-
-	_fileSize = [fileAttributes objectForKey:NSFileSize]; // File size (bytes)
-}
-
-#pragma mark - NSCoding protocol methods
-
-- (void)encodeWithCoder:(NSCoder *)encoder
-{
-	[encoder encodeObject:_guid forKey:@"FileGUID"];
-
-	[encoder encodeObject:_fileDate forKey:@"FileDate"];
-
-	[encoder encodeObject:_pageCount forKey:@"PageCount"];
-
-	[encoder encodeObject:_pageNumber forKey:@"PageNumber"];
-
-	[encoder encodeObject:_bookmarks forKey:@"Bookmarks"];
-
-	[encoder encodeObject:_fileSize forKey:@"FileSize"];
-
-	[encoder encodeObject:_lastOpen forKey:@"LastOpen"];
-}
-
-- (instancetype)initWithCoder:(NSCoder *)decoder
-{
-	if ((self = [super init])) // Superclass init
-	{
-		_guid = [decoder decodeObjectForKey:@"FileGUID"];
-
-		_fileDate = [decoder decodeObjectForKey:@"FileDate"];
-
-		_pageCount = [decoder decodeObjectForKey:@"PageCount"];
-
-		_pageNumber = [decoder decodeObjectForKey:@"PageNumber"];
-
-		_bookmarks = [decoder decodeObjectForKey:@"Bookmarks"];
-
-		_fileSize = [decoder decodeObjectForKey:@"FileSize"];
-
-		_lastOpen = [decoder decodeObjectForKey:@"LastOpen"];
-
-		if (_guid == nil) _guid = [ReaderDocument GUID];
-
-		if (_bookmarks != nil)
-			_bookmarks = [_bookmarks mutableCopy];
-		else
-			_bookmarks = [NSMutableIndexSet new];
-	}
-
-	return self;
-}
-
-@end

+ 0 - 45
iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocumentOutline.h

@@ -1,45 +0,0 @@
-//
-//	ReaderDocumentOutline.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2012-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface ReaderDocumentOutline : NSObject <NSObject>
-
-+ (NSArray *)outlineFromFileURL:(NSURL *)fileURL password:(NSString *)phrase;
-
-+ (void)logDocumentOutlineArray:(NSArray *)array;
-
-@end
-
-@interface DocumentOutlineEntry : NSObject <NSObject>
-
-+ (instancetype)newWithTitle:(NSString *)title target:(id)target level:(NSInteger)level;
-
-@property (nonatomic, assign, readonly) NSInteger level;
-@property (nonatomic, strong, readwrite) NSMutableArray *children;
-@property (nonatomic, strong, readonly) NSString *title;
-@property (nonatomic, strong, readonly) id target;
-
-@end

+ 0 - 467
iOSClient/Library/VFR Pdf Reader/Sources/ReaderDocumentOutline.m

@@ -1,467 +0,0 @@
-//
-//	ReaderDocumentOutline.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2012-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderDocumentOutline.h"
-#import "CGPDFDocument.h"
-
-@implementation ReaderDocumentOutline
-
-#pragma mark - Build option flags
-
-#define HIERARCHICAL_OUTLINE TRUE
-
-#pragma mark - ReaderDocumentOutline functions
-
-void logDictionaryEntry(const char *key, CGPDFObjectRef object, void *info)
-{
-	//CGPDFDictionaryApplyFunction(dictionary, logDictionaryEntry, NULL);
-
-	NSString *kind = nil; // CGPDFObject type
-
-	CGPDFObjectType type = CGPDFObjectGetType(object);
-
-	switch (type) // CGPDFObjectTypes
-	{
-		case kCGPDFObjectTypeNull:
-			kind = @"CGPDFObjectTypeNull";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeBoolean:
-			kind = @"CGPDFObjectTypeBoolean";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeInteger:
-			kind = @"CGPDFObjectTypeInteger";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeReal:
-			kind = @"CGPDFObjectTypeReal";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeName:
-		{
-			kind = @"CGPDFObjectTypeName"; const char *pdfName = NULL;
-
-			if (CGPDFObjectGetValue(object, kCGPDFObjectTypeName, &pdfName))
-			{
-				if (pdfName != NULL) NSLog(@"%s %@ %s", key, kind, pdfName);
-			}
-			break;
-		}
-
-		case kCGPDFObjectTypeString:
-		{
-			kind = @"CGPDFObjectTypeString"; CGPDFStringRef pdfString = NULL;
-
-			if (CGPDFObjectGetValue(object, kCGPDFObjectTypeString, &pdfString))
-			{
-				const unsigned char *string = CGPDFStringGetBytePtr(pdfString);
-
-				if (string != NULL) NSLog(@"%s %@ %s", key, kind, string);
-			}
-			break;
-		}
-
-		case kCGPDFObjectTypeArray:
-			kind = @"CGPDFObjectTypeArray";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeDictionary:
-			kind = @"CGPDFObjectTypeDictionary";
-			NSLog(@"%s %@", key, kind);
-			break;
-
-		case kCGPDFObjectTypeStream:
-			kind = @"CGPDFObjectTypeStream";
-			NSLog(@"%s %@", key, kind);
-			break;
-	}
-}
-
-#pragma mark - ReaderDocumentOutline class methods
-
-+ (void)logDocumentOutlineArray:(NSArray *)array
-{
-	for (DocumentOutlineEntry *item in array) // Enumerate array entries
-	{
-		NSInteger indent = (item.level * 2); // Indent amount for NSLog output
-
-		NSLog(@"%@%@", [@"" stringByPaddingToLength:indent withString:@" " startingAtIndex:0], item);
-
-		[self logDocumentOutlineArray:item.children]; // Log any child entries
-	}
-}
-
-+ (CGPDFArrayRef)destinationWithName:(const char *)destinationName inDestsTree:(CGPDFDictionaryRef)node
-{
-	CGPDFArrayRef destinationArray = NULL;
-
-	CGPDFArrayRef limitsArray = NULL; // Limits array
-
-	if (CGPDFDictionaryGetArray(node, "Limits", &limitsArray) == true)
-	{
-		CGPDFStringRef lowerLimit = NULL; CGPDFStringRef upperLimit = NULL;
-
-		if (CGPDFArrayGetString(limitsArray, 0, &lowerLimit) == true) // Lower limit
-		{
-			if (CGPDFArrayGetString(limitsArray, 1, &upperLimit) == true) // Upper limit
-			{
-				const char *ll = (const char *)CGPDFStringGetBytePtr(lowerLimit); // Lower string
-				const char *ul = (const char *)CGPDFStringGetBytePtr(upperLimit); // Upper string
-
-				if ((strcmp(destinationName, ll) < 0) || (strcmp(destinationName, ul) > 0))
-				{
-					return NULL; // Destination name is outside this node's limits
-				}
-			}
-		}
-	}
-
-	CGPDFArrayRef namesArray = NULL; // Names array
-
-	if (CGPDFDictionaryGetArray(node, "Names", &namesArray) == true)
-	{
-		NSInteger namesCount = CGPDFArrayGetCount(namesArray);
-
-		for (NSInteger index = 0; index < namesCount; index += 2)
-		{
-			CGPDFStringRef destName; // Destination name string
-
-			if (CGPDFArrayGetString(namesArray, index, &destName) == true)
-			{
-				const char *dn = (const char *)CGPDFStringGetBytePtr(destName);
-
-				if (strcmp(dn, destinationName) == 0) // Found the destination name
-				{
-					if (CGPDFArrayGetArray(namesArray, (index + 1), &destinationArray) == false)
-					{
-						CGPDFDictionaryRef destinationDictionary = NULL; // Destination dictionary
-
-						if (CGPDFArrayGetDictionary(namesArray, (index + 1), &destinationDictionary) == true)
-						{
-							CGPDFDictionaryGetArray(destinationDictionary, "D", &destinationArray);
-						}
-					}
-
-					return destinationArray; // Return the destination array
-				}
-			}
-		}
-	}
-
-	CGPDFArrayRef kidsArray = NULL; // Kids array
-
-	if (CGPDFDictionaryGetArray(node, "Kids", &kidsArray) == true)
-	{
-		NSInteger kidsCount = CGPDFArrayGetCount(kidsArray);
-
-		for (NSInteger index = 0; index < kidsCount; index++)
-		{
-			CGPDFDictionaryRef kidNode = NULL; // Kid node dictionary
-
-			if (CGPDFArrayGetDictionary(kidsArray, index, &kidNode) == true) // Recurse into node
-			{
-				destinationArray = [self destinationWithName:destinationName inDestsTree:kidNode];
-
-				if (destinationArray != NULL) return destinationArray; // Return destination array
-			}
-		}
-	}
-
-	return NULL;
-}
-
-+ (id)outlineEntryTarget:(CGPDFDictionaryRef)outlineDictionary document:(CGPDFDocumentRef)document
-{
-	id entryTarget = nil; // Entry target object
-
-	CGPDFStringRef destName = NULL; const char *destString = NULL;
-
-	CGPDFDictionaryRef actionDictionary = NULL; CGPDFArrayRef destArray = NULL;
-
-	if (CGPDFDictionaryGetDictionary(outlineDictionary, "A", &actionDictionary) == true)
-	{
-		const char *actionType = NULL; // Outline entry action type string
-
-		if (CGPDFDictionaryGetName(actionDictionary, "S", &actionType) == true)
-		{
-			if (strcmp(actionType, "GoTo") == 0) // GoTo action type
-			{
-				if (CGPDFDictionaryGetArray(actionDictionary, "D", &destArray) == false)
-				{
-					CGPDFDictionaryGetString(actionDictionary, "D", &destName);
-				}
-			}
-			else // Handle other entry action type possibility
-			{
-				if (strcmp(actionType, "URI") == 0) // URI action type
-				{
-					CGPDFStringRef uriString = NULL; // Action's URI string
-
-					if (CGPDFDictionaryGetString(actionDictionary, "URI", &uriString) == true)
-					{
-						const char *uri = (const char *)CGPDFStringGetBytePtr(uriString); // Destination URI string
-
-						entryTarget = [NSURL URLWithString:[NSString stringWithCString:uri encoding:NSASCIIStringEncoding]];
-					}
-				}
-			}
-		}
-	}
-	else // Handle other entry target possibilities
-	{
-		if (CGPDFDictionaryGetArray(outlineDictionary, "Dest", &destArray) == false)
-		{
-			if (CGPDFDictionaryGetString(outlineDictionary, "Dest", &destName) == false)
-			{
-				CGPDFDictionaryGetName(outlineDictionary, "Dest", &destString);
-			}
-		}
-	}
-
-	if (destName != NULL) // Handle a destination name
-	{
-		CGPDFDictionaryRef catalogDictionary = CGPDFDocumentGetCatalog(document);
-
-		CGPDFDictionaryRef namesDictionary = NULL; // Destination names in the document
-
-		if (CGPDFDictionaryGetDictionary(catalogDictionary, "Names", &namesDictionary) == true)
-		{
-			CGPDFDictionaryRef destsDictionary = NULL; // Document destinations dictionary
-
-			if (CGPDFDictionaryGetDictionary(namesDictionary, "Dests", &destsDictionary) == true)
-			{
-				const char *destinationName = (const char *)CGPDFStringGetBytePtr(destName); // Name
-
-				destArray = [self destinationWithName:destinationName inDestsTree:destsDictionary];
-			}
-		}
-	}
-
-	if (destString != NULL) // Handle a destination string
-	{
-		CGPDFDictionaryRef catalogDictionary = CGPDFDocumentGetCatalog(document);
-
-		CGPDFDictionaryRef destsDictionary = NULL; // Document destinations dictionary
-
-		if (CGPDFDictionaryGetDictionary(catalogDictionary, "Dests", &destsDictionary) == true)
-		{
-			CGPDFDictionaryRef targetDictionary = NULL; // Destination target dictionary
-
-			if (CGPDFDictionaryGetDictionary(destsDictionary, destString, &targetDictionary) == true)
-			{
-				CGPDFDictionaryGetArray(targetDictionary, "D", &destArray);
-			}
-		}
-	}
-
-	if (destArray != NULL) // Handle a destination array
-	{
-		NSInteger targetPageNumber = 0; // The target page number
-
-		CGPDFDictionaryRef pageDictionaryFromDestArray = NULL; // Target reference
-
-		if (CGPDFArrayGetDictionary(destArray, 0, &pageDictionaryFromDestArray) == true)
-		{
-			NSInteger pageCount = CGPDFDocumentGetNumberOfPages(document); // Pages
-
-			for (NSInteger pageNumber = 1; pageNumber <= pageCount; pageNumber++)
-			{
-				CGPDFPageRef pageRef = CGPDFDocumentGetPage(document, pageNumber);
-
-				CGPDFDictionaryRef pageDictionaryFromPage = CGPDFPageGetDictionary(pageRef);
-
-				if (pageDictionaryFromPage == pageDictionaryFromDestArray) // Found it
-				{
-					targetPageNumber = pageNumber; break;
-				}
-			}
-		}
-		else // Try page number from array possibility
-		{
-			CGPDFInteger pageNumber = 0; // Page number in array
-
-			if (CGPDFArrayGetInteger(destArray, 0, &pageNumber) == true)
-			{
-				targetPageNumber = (pageNumber + 1); // 1-based
-			}
-		}
-
-		if (targetPageNumber > 0) // We have a target page number
-		{
-			entryTarget = [NSNumber numberWithInteger:targetPageNumber];
-		}
-	}
-
-	return entryTarget;
-}
-
-+ (void)outlineItems:(CGPDFDictionaryRef)outlineDictionary document:(CGPDFDocumentRef)document array:(NSMutableArray *)array level:(NSInteger)level
-{
-	do // Loop through current level outline entries
-	{
-		DocumentOutlineEntry *outlineEntry = nil; // An entry
-
-		CGPDFStringRef string = NULL; // Outline entry title string
-
-		if (CGPDFDictionaryGetString(outlineDictionary, "Title", &string) == true)
-		{
-			CFStringRef title = NULL; // Actual outline title (CFObject) string
-
-			if ((title = CGPDFStringCopyTextString(string)) != NULL) // Copy of CFObject string
-			{
-				NSString *titleString = (__bridge NSString *)title; // CFString to NSString toll-free bridge cast
-
-				id entryTarget = [self outlineEntryTarget:outlineDictionary document:document]; // Get target object
-
-				NSString *trimmed = [titleString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
-
-				outlineEntry = [DocumentOutlineEntry newWithTitle:trimmed target:entryTarget level:level]; // New entry
-
-				[array addObject:outlineEntry]; CFRelease(title); // Add new entry and cleanup
-			}
-		}
-
-		if (outlineEntry != nil) // Must have a current outline entry
-		{
-			CGPDFDictionaryRef childItem = NULL; // First child outline item
-
-			if (CGPDFDictionaryGetDictionary(outlineDictionary, "First", &childItem) == true)
-			{
-#if (HIERARCHICAL_OUTLINE == TRUE) // Option
-				NSMutableArray *childArray = [NSMutableArray array]; outlineEntry.children = childArray;
-
-				[self outlineItems:childItem document:document array:childArray level:(level + 1)];
-#else // Flat
-				[self outlineItems:childItem document:document array:array level:(level + 1)];
-
-#endif // end of HIERARCHICAL_OUTLINE Option
-			}
-		}
-
-	} while (CGPDFDictionaryGetDictionary(outlineDictionary, "Next", &outlineDictionary) == true);
-}
-
-+ (NSArray *)outlineFromFileURL:(NSURL *)fileURL password:(NSString *)phrase
-{
-	NSMutableArray *outlineArray = nil; // Mutable outline array
-
-	if ((fileURL != nil) && [fileURL isFileURL]) // Check for valid file URL
-	{
-		CGPDFDocumentRef document = CGPDFDocumentCreateUsingUrl((__bridge CFURLRef)fileURL, phrase);
-
-		if (document != NULL) // Check for non-NULL CGPDFDocumentRef
-		{
-			CGPDFDictionaryRef outlines = NULL; // Document's outlines
-
-			CGPDFDictionaryRef catalog = CGPDFDocumentGetCatalog(document);
-
-			if (CGPDFDictionaryGetDictionary(catalog, "Outlines", &outlines) == true)
-			{
-				CGPDFDictionaryRef firstItem = NULL; // First outline item entry
-
-				if (CGPDFDictionaryGetDictionary(outlines, "First", &firstItem) == true)
-				{
-					outlineArray = [NSMutableArray array]; // Top level outline entries array
-
-					[self outlineItems:firstItem document:document array:outlineArray level:0];
-				}
-			}
-
-			CGPDFDocumentRelease(document); // Cleanup
-		}
-	}
-
-	//[self logDocumentOutlineArray:outlineArray]; // Log it
-
-	return [outlineArray copy]; // NSArray
-}
-
-@end
-
-#pragma mark -
-
-//
-//	DocumentOutlineEntry class implementation
-//
-
-@interface DocumentOutlineEntry ()
-
-@property (nonatomic, assign, readwrite) NSInteger level;
-@property (nonatomic, strong, readwrite) NSString *title;
-@property (nonatomic, strong, readwrite) id target;
-
-@end
-
-@implementation DocumentOutlineEntry
-{
-	NSInteger _level;
-
-	NSMutableArray *_children;
-
-	NSString *_title;
-
-	id _target;
-}
-
-#pragma mark - Properties
-
-@synthesize level = _level;
-@synthesize children = _children;
-@synthesize target = _target;
-@synthesize title = _title;
-
-#pragma mark - DocumentOutlineEntry class methods
-
-+ (instancetype)newWithTitle:(NSString *)title target:(id)target level:(NSInteger)level
-{
-	return [[DocumentOutlineEntry alloc] initWithTitle:title target:target level:level];
-}
-
-#pragma mark - DocumentOutlineEntry instance methods
-
-- (instancetype)initWithTitle:(NSString *)title target:(id)target level:(NSInteger)level
-{
-	if ((self = [super init]))
-	{
-		self.title = title; self.target = target; self.level = level;
-	}
-
-	return self;
-}
-
-- (NSString *)description
-{
-	NSString *format = @"%@ Title = '%@', Target = '%@', Level = (%i)";
-
-	return [[NSString alloc] initWithFormat:format, [super description], _title, _target, _level];
-}
-
-@end

+ 0 - 88
iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainPagebar.h

@@ -1,88 +0,0 @@
-//
-//	ReaderMainPagebar.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ReaderThumbView.h"
-
-@class ReaderMainPagebar;
-@class ReaderTrackControl;
-@class ReaderPagebarThumb;
-@class ReaderDocument;
-
-@protocol ReaderMainPagebarDelegate <NSObject>
-
-@required // Delegate protocols
-
-- (void)pagebar:(ReaderMainPagebar *)pagebar gotoPage:(NSInteger)page;
-
-@end
-
-@interface ReaderMainPagebar : UIView
-
-@property (nonatomic, weak, readwrite) id <ReaderMainPagebarDelegate> delegate;
-
-- (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)object;
-
-- (void)updatePagebar;
-
-- (void)hidePagebar;
-- (void)showPagebar;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderTrackControl class interface
-//
-
-@interface ReaderTrackControl : UIControl
-
-@property (nonatomic, assign, readonly) CGFloat value;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderPagebarThumb class interface
-//
-
-@interface ReaderPagebarThumb : ReaderThumbView
-
-- (instancetype)initWithFrame:(CGRect)frame small:(BOOL)small;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderPagebarShadow class interface
-//
-
-@interface ReaderPagebarShadow : UIView
-
-@end

+ 0 - 642
iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainPagebar.m

@@ -1,642 +0,0 @@
-//
-//	ReaderMainPagebar.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ReaderMainPagebar.h"
-#import "ReaderThumbCache.h"
-#import "ReaderDocument.h"
-
-#import <QuartzCore/QuartzCore.h>
-
-@implementation ReaderMainPagebar
-{
-	ReaderDocument *document;
-
-	ReaderTrackControl *trackControl;
-
-	NSMutableDictionary *miniThumbViews;
-
-	ReaderPagebarThumb *pageThumbView;
-
-	UILabel *pageNumberLabel;
-
-	UIView *pageNumberView;
-
-	NSTimer *enableTimer;
-	NSTimer *trackTimer;
-}
-
-#pragma mark - Constants
-
-#define THUMB_SMALL_GAP 2
-#define THUMB_SMALL_WIDTH 22
-#define THUMB_SMALL_HEIGHT 28
-
-#define THUMB_LARGE_WIDTH 32
-#define THUMB_LARGE_HEIGHT 42
-
-#define PAGE_NUMBER_WIDTH 96.0f
-#define PAGE_NUMBER_HEIGHT 30.0f
-
-#define PAGE_NUMBER_SPACE_SMALL 16.0f
-#define PAGE_NUMBER_SPACE_LARGE 32.0f
-
-#define SHADOW_HEIGHT 4.0f
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - ReaderMainPagebar class methods
-
-+ (Class)layerClass
-{
-#if (READER_FLAT_UI == FALSE) // Option
-	return [CAGradientLayer class];
-#else
-	return [CALayer class];
-#endif // end of READER_FLAT_UI Option
-}
-
-#pragma mark - ReaderMainPagebar instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	return [self initWithFrame:frame document:nil];
-}
-
-- (void)updatePageThumbView:(NSInteger)page
-{
-	NSInteger pages = [document.pageCount integerValue];
-
-	if (pages > 1) // Only update frame if more than one page
-	{
-		CGFloat controlWidth = trackControl.bounds.size.width;
-
-		CGFloat useableWidth = (controlWidth - THUMB_LARGE_WIDTH);
-
-		CGFloat stride = (useableWidth / (pages - 1)); // Page stride
-
-		NSInteger X = (stride * (page - 1)); CGFloat pageThumbX = X;
-
-		CGRect pageThumbRect = pageThumbView.frame; // Current frame
-
-		if (pageThumbX != pageThumbRect.origin.x) // Only if different
-		{
-			pageThumbRect.origin.x = pageThumbX; // The new X position
-
-			pageThumbView.frame = pageThumbRect; // Update the frame
-		}
-	}
-
-	if (page != pageThumbView.tag) // Only if page number changed
-	{
-		pageThumbView.tag = page; [pageThumbView reuse]; // Reuse the thumb view
-
-		CGSize size = CGSizeMake(THUMB_LARGE_WIDTH, THUMB_LARGE_HEIGHT); // Maximum thumb size
-
-		NSURL *fileURL = document.fileURL; NSString *guid = document.guid; NSString *phrase = document.password;
-
-		ReaderThumbRequest *request = [ReaderThumbRequest newForView:pageThumbView fileURL:fileURL password:phrase guid:guid page:page size:size];
-
-		UIImage *image = [[ReaderThumbCache sharedInstance] thumbRequest:request priority:YES]; // Request the thumb
-
-		UIImage *thumb = ([image isKindOfClass:[UIImage class]] ? image : nil); [pageThumbView showImage:thumb];
-	}
-}
-
-- (void)updatePageNumberText:(NSInteger)page
-{
-	if (page != pageNumberLabel.tag) // Only if page number changed
-	{
-		NSInteger pages = [document.pageCount integerValue]; // Total pages
-
-		NSString *format = NSLocalizedString(@"%i of %i", @"format"); // Format
-
-		NSString *number = [[NSString alloc] initWithFormat:format, (int)page, (int)pages];
-
-		pageNumberLabel.text = number; // Update the page number label text
-
-		pageNumberLabel.tag = page; // Update the last page number tag
-	}
-}
-
-- (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)object
-{
-	assert(object != nil); // Must have a valid ReaderDocument
-
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = YES;
-		self.userInteractionEnabled = YES;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
-
-		if ([self.layer isKindOfClass:[CAGradientLayer class]])
-		{
-			self.backgroundColor = [UIColor clearColor];
-
-			CAGradientLayer *layer = (CAGradientLayer *)self.layer;
-			UIColor *liteColor = [UIColor colorWithWhite:0.82f alpha:0.8f];
-			UIColor *darkColor = [UIColor colorWithWhite:0.32f alpha:0.8f];
-			layer.colors = [NSArray arrayWithObjects:(id)liteColor.CGColor, (id)darkColor.CGColor, nil];
-
-			CGRect shadowRect = self.bounds; shadowRect.size.height = SHADOW_HEIGHT; shadowRect.origin.y -= shadowRect.size.height;
-
-			ReaderPagebarShadow *shadowView = [[ReaderPagebarShadow alloc] initWithFrame:shadowRect];
-
-			[self addSubview:shadowView]; // Add shadow to toolbar
-		}
-		else // Follow The Fuglyosity of Flat Fad
-		{
-			self.backgroundColor = [UIColor colorWithWhite:0.94f alpha:0.94f];
-
-			CGRect lineRect = self.bounds; lineRect.size.height = 1.0f; lineRect.origin.y -= lineRect.size.height;
-
-			UIView *lineView = [[UIView alloc] initWithFrame:lineRect];
-			lineView.autoresizesSubviews = NO;
-			lineView.userInteractionEnabled = NO;
-			lineView.contentMode = UIViewContentModeRedraw;
-			lineView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			lineView.backgroundColor = [UIColor colorWithWhite:0.64f alpha:0.94f];
-			[self addSubview:lineView];
-		}
-
-		CGFloat space = (([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) ? PAGE_NUMBER_SPACE_LARGE : PAGE_NUMBER_SPACE_SMALL);
-		CGFloat numberY = (0.0f - (PAGE_NUMBER_HEIGHT + space)); CGFloat numberX = ((self.bounds.size.width - PAGE_NUMBER_WIDTH) * 0.5f);
-		CGRect numberRect = CGRectMake(numberX, numberY, PAGE_NUMBER_WIDTH, PAGE_NUMBER_HEIGHT);
-
-		pageNumberView = [[UIView alloc] initWithFrame:numberRect]; // Page numbers view
-
-		pageNumberView.autoresizesSubviews = NO;
-		pageNumberView.userInteractionEnabled = NO;
-		pageNumberView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
-		pageNumberView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.4f];
-
-		pageNumberView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
-		pageNumberView.layer.shadowColor = [UIColor colorWithWhite:0.0f alpha:0.6f].CGColor;
-		pageNumberView.layer.shadowPath = [UIBezierPath bezierPathWithRect:pageNumberView.bounds].CGPath;
-		pageNumberView.layer.shadowRadius = 2.0f; pageNumberView.layer.shadowOpacity = 1.0f;
-
-		CGRect textRect = CGRectInset(pageNumberView.bounds, 4.0f, 2.0f); // Inset the text a bit
-
-		pageNumberLabel = [[UILabel alloc] initWithFrame:textRect]; // Page numbers label
-
-		pageNumberLabel.autoresizesSubviews = NO;
-		pageNumberLabel.autoresizingMask = UIViewAutoresizingNone;
-		pageNumberLabel.textAlignment = NSTextAlignmentCenter;
-		pageNumberLabel.backgroundColor = [UIColor clearColor];
-		pageNumberLabel.textColor = [UIColor whiteColor];
-		pageNumberLabel.font = [UIFont systemFontOfSize:16.0f];
-		pageNumberLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
-		pageNumberLabel.shadowColor = [UIColor blackColor];
-		pageNumberLabel.adjustsFontSizeToFitWidth = YES;
-		pageNumberLabel.minimumScaleFactor = 0.75f;
-
-		[pageNumberView addSubview:pageNumberLabel]; // Add label view
-
-		[self addSubview:pageNumberView]; // Add page numbers display view
-
-		trackControl = [[ReaderTrackControl alloc] initWithFrame:self.bounds]; // Track control view
-
-		[trackControl addTarget:self action:@selector(trackViewTouchDown:) forControlEvents:UIControlEventTouchDown];
-		[trackControl addTarget:self action:@selector(trackViewValueChanged:) forControlEvents:UIControlEventValueChanged];
-		[trackControl addTarget:self action:@selector(trackViewTouchUp:) forControlEvents:UIControlEventTouchUpOutside];
-		[trackControl addTarget:self action:@selector(trackViewTouchUp:) forControlEvents:UIControlEventTouchUpInside];
-
-		[self addSubview:trackControl]; // Add the track control and thumbs view
-
-		document = object; // Retain the document object for our use
-
-		[self updatePageNumberText:[document.pageNumber integerValue]];
-
-		miniThumbViews = [NSMutableDictionary new]; // Small thumbs
-	}
-
-	return self;
-}
-
-- (void)removeFromSuperview
-{
-	[trackTimer invalidate]; [enableTimer invalidate];
-
-	[super removeFromSuperview];
-}
-
-- (void)layoutSubviews
-{
-	CGRect controlRect = CGRectInset(self.bounds, 4.0f, 0.0f);
-
-	CGFloat thumbWidth = (THUMB_SMALL_WIDTH + THUMB_SMALL_GAP);
-
-	NSInteger thumbs = (controlRect.size.width / thumbWidth);
-
-	NSInteger pages = [document.pageCount integerValue]; // Pages
-
-	if (thumbs > pages) thumbs = pages; // No more than total pages
-
-	CGFloat controlWidth = ((thumbs * thumbWidth) - THUMB_SMALL_GAP);
-
-	controlRect.size.width = controlWidth; // Update control width
-
-	CGFloat widthDelta = (self.bounds.size.width - controlWidth);
-
-	NSInteger X = (widthDelta * 0.5f); controlRect.origin.x = X;
-
-	trackControl.frame = controlRect; // Update track control frame
-
-	if (pageThumbView == nil) // Create the page thumb view when needed
-	{
-		CGFloat heightDelta = (controlRect.size.height - THUMB_LARGE_HEIGHT);
-
-		NSInteger thumbY = (heightDelta * 0.5f); NSInteger thumbX = 0; // Thumb X, Y
-
-		CGRect thumbRect = CGRectMake(thumbX, thumbY, THUMB_LARGE_WIDTH, THUMB_LARGE_HEIGHT);
-
-		pageThumbView = [[ReaderPagebarThumb alloc] initWithFrame:thumbRect]; // Create the thumb view
-
-		pageThumbView.layer.zPosition = 1.0f; // Z position so that it sits on top of the small thumbs
-
-		[trackControl addSubview:pageThumbView]; // Add as the first subview of the track control
-	}
-
-	[self updatePageThumbView:[document.pageNumber integerValue]]; // Update page thumb view
-
-	NSInteger strideThumbs = (thumbs - 1); if (strideThumbs < 1) strideThumbs = 1;
-
-	CGFloat stride = ((CGFloat)pages / (CGFloat)strideThumbs); // Page stride
-
-	CGFloat heightDelta = (controlRect.size.height - THUMB_SMALL_HEIGHT);
-
-	NSInteger thumbY = (heightDelta * 0.5f); NSInteger thumbX = 0; // Initial X, Y
-
-	CGRect thumbRect = CGRectMake(thumbX, thumbY, THUMB_SMALL_WIDTH, THUMB_SMALL_HEIGHT);
-
-	NSMutableDictionary *thumbsToHide = [miniThumbViews mutableCopy];
-
-	for (NSInteger thumb = 0; thumb < thumbs; thumb++) // Iterate through needed thumbs
-	{
-		NSInteger page = ((stride * thumb) + 1); if (page > pages) page = pages; // Page
-
-		NSNumber *key = [NSNumber numberWithInteger:page]; // Page number key for thumb view
-
-		ReaderPagebarThumb *smallThumbView = [miniThumbViews objectForKey:key]; // Thumb view
-
-		if (smallThumbView == nil) // We need to create a new small thumb view for the page number
-		{
-			CGSize size = CGSizeMake(THUMB_SMALL_WIDTH, THUMB_SMALL_HEIGHT); // Maximum thumb size
-
-			NSURL *fileURL = document.fileURL; NSString *guid = document.guid; NSString *phrase = document.password;
-
-			smallThumbView = [[ReaderPagebarThumb alloc] initWithFrame:thumbRect small:YES]; // Create a small thumb view
-
-			ReaderThumbRequest *thumbRequest = [ReaderThumbRequest newForView:smallThumbView fileURL:fileURL password:phrase guid:guid page:page size:size];
-
-			UIImage *image = [[ReaderThumbCache sharedInstance] thumbRequest:thumbRequest priority:NO]; // Request the thumb
-
-			if ([image isKindOfClass:[UIImage class]]) [smallThumbView showImage:image]; // Use thumb image from cache
-
-			[trackControl addSubview:smallThumbView]; [miniThumbViews setObject:smallThumbView forKey:key];
-		}
-		else // Resue existing small thumb view for the page number
-		{
-			smallThumbView.hidden = NO; [thumbsToHide removeObjectForKey:key];
-
-			if (CGRectEqualToRect(smallThumbView.frame, thumbRect) == false)
-			{
-				smallThumbView.frame = thumbRect; // Update thumb frame
-			}
-		}
-
-		thumbRect.origin.x += thumbWidth; // Next thumb X position
-	}
-
-	[thumbsToHide enumerateKeysAndObjectsUsingBlock: // Hide unused thumbs
-		^(id key, id object, BOOL *stop)
-		{
-			ReaderPagebarThumb *thumb = object; thumb.hidden = YES;
-		}
-	];
-}
-
-- (void)updatePagebarViews
-{
-	NSInteger page = [document.pageNumber integerValue]; // #
-
-	[self updatePageNumberText:page]; // Update page number text
-
-	[self updatePageThumbView:page]; // Update page thumb view
-}
-
-- (void)updatePagebar
-{
-	if (self.hidden == NO) // Only if visible
-	{
-		[self updatePagebarViews]; // Update views
-	}
-}
-
-- (void)hidePagebar
-{
-	if (self.hidden == NO) // Only if visible
-	{
-		[UIView animateWithDuration:0.25 delay:0.0
-			options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
-			animations:^(void)
-			{
-				self.alpha = 0.0f;
-			}
-			completion:^(BOOL finished)
-			{
-				self.hidden = YES;
-			}
-		];
-	}
-}
-
-- (void)showPagebar
-{
-	if (self.hidden == YES) // Only if hidden
-	{
-		[self updatePagebarViews]; // Update views first
-
-		[UIView animateWithDuration:0.25 delay:0.0
-			options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
-			animations:^(void)
-			{
-				self.hidden = NO;
-				self.alpha = 1.0f;
-			}
-			completion:NULL
-		];
-	}
-}
-
-#pragma mark - ReaderTrackControl action methods
-
-- (void)trackTimerFired:(NSTimer *)timer
-{
-	[trackTimer invalidate]; trackTimer = nil; // Cleanup timer
-
-	if (trackControl.tag != [document.pageNumber integerValue]) // Only if different
-	{
-		[delegate pagebar:self gotoPage:trackControl.tag]; // Go to document page
-	}
-}
-
-- (void)enableTimerFired:(NSTimer *)timer
-{
-	[enableTimer invalidate]; enableTimer = nil; // Cleanup timer
-
-	trackControl.userInteractionEnabled = YES; // Enable track control interaction
-}
-
-- (void)restartTrackTimer
-{
-	if (trackTimer != nil) { [trackTimer invalidate]; trackTimer = nil; } // Invalidate and release previous timer
-
-	trackTimer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(trackTimerFired:) userInfo:nil repeats:NO];
-}
-
-- (void)startEnableTimer
-{
-	if (enableTimer != nil) { [enableTimer invalidate]; enableTimer = nil; } // Invalidate and release previous timer
-
-	enableTimer = [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(enableTimerFired:) userInfo:nil repeats:NO];
-}
-
-- (NSInteger)trackViewPageNumber:(ReaderTrackControl *)trackView
-{
-	CGFloat controlWidth = trackView.bounds.size.width; // View width
-
-	CGFloat stride = (controlWidth / [document.pageCount integerValue]);
-
-	NSInteger page = (trackView.value / stride); // Integer page number
-
-	return (page + 1); // + 1
-}
-
-- (void)trackViewTouchDown:(ReaderTrackControl *)trackView
-{
-	NSInteger page = [self trackViewPageNumber:trackView]; // Page
-
-	if (page != [document.pageNumber integerValue]) // Only if different
-	{
-		[self updatePageNumberText:page]; // Update page number text
-
-		[self updatePageThumbView:page]; // Update page thumb view
-
-		[self restartTrackTimer]; // Start the track timer
-	}
-
-	trackView.tag = page; // Start page tracking
-}
-
-- (void)trackViewValueChanged:(ReaderTrackControl *)trackView
-{
-	NSInteger page = [self trackViewPageNumber:trackView]; // Page
-
-	if (page != trackView.tag) // Only if the page number has changed
-	{
-		[self updatePageNumberText:page]; // Update page number text
-
-		[self updatePageThumbView:page]; // Update page thumb view
-
-		trackView.tag = page; // Update the page tracking tag
-
-		[self restartTrackTimer]; // Restart the track timer
-	}
-}
-
-- (void)trackViewTouchUp:(ReaderTrackControl *)trackView
-{
-	[trackTimer invalidate]; trackTimer = nil; // Cleanup
-
-	if (trackView.tag != [document.pageNumber integerValue]) // Only if different
-	{
-		trackView.userInteractionEnabled = NO; // Disable track control interaction
-
-		[delegate pagebar:self gotoPage:trackView.tag]; // Go to document page
-
-		[self startEnableTimer]; // Start track control enable timer
-	}
-
-	trackView.tag = 0; // Reset page tracking
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderTrackControl class implementation
-//
-
-@implementation ReaderTrackControl
-{
-	CGFloat _value;
-}
-
-#pragma mark - Properties
-
-@synthesize value = _value;
-
-#pragma mark - ReaderTrackControl instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = NO;
-		self.userInteractionEnabled = YES;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingNone;
-		self.backgroundColor = [UIColor clearColor];
-		self.exclusiveTouch = YES;
-	}
-
-	return self;
-}
-
-- (CGFloat)limitValue:(CGFloat)valueX
-{
-	CGFloat minX = self.bounds.origin.x; // 0.0f;
-	CGFloat maxX = (self.bounds.size.width - 1.0f);
-
-	if (valueX < minX) valueX = minX; // Minimum X
-	if (valueX > maxX) valueX = maxX; // Maximum X
-
-	return valueX;
-}
-
-#pragma mark - UIControl subclass methods
-
-- (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
-{
-	CGPoint point = [touch locationInView:self]; // Touch point
-
-	_value = [self limitValue:point.x]; // Limit control value
-
-	return YES;
-}
-
-- (BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
-{
-	if (self.touchInside == YES) // Only if inside the control
-	{
-		CGPoint point = [touch locationInView:touch.view]; // Touch point
-
-		CGFloat x = [self limitValue:point.x]; // Potential new control value
-
-		if (x != _value) // Only if the new value has changed since the last time
-		{
-			_value = x; [self sendActionsForControlEvents:UIControlEventValueChanged];
-		}
-	}
-
-	return YES;
-}
-
-- (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event
-{
-	CGPoint point = [touch locationInView:self]; // Touch point
-
-	_value = [self limitValue:point.x]; // Limit control value
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderPagebarThumb class implementation
-//
-
-@implementation ReaderPagebarThumb
-
-#pragma mark - ReaderPagebarThumb instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	return [self initWithFrame:frame small:NO];
-}
-
-- (instancetype)initWithFrame:(CGRect)frame small:(BOOL)small
-{
-	if ((self = [super initWithFrame:frame])) // Superclass init
-	{
-		CGFloat value = (small ? 0.6f : 0.7f); // Size based alpha value
-
-		UIColor *background = [UIColor colorWithWhite:0.8f alpha:value];
-
-		self.backgroundColor = background; imageView.backgroundColor = background;
-
-		imageView.layer.borderColor = [UIColor colorWithWhite:0.4f alpha:0.6f].CGColor;
-
-		imageView.layer.borderWidth = 1.0f; // Give the thumb image view a border
-	}
-
-	return self;
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderPagebarShadow class implementation
-//
-
-@implementation ReaderPagebarShadow
-
-#pragma mark - ReaderPagebarShadow class methods
-
-+ (Class)layerClass
-{
-	return [CAGradientLayer class];
-}
-
-#pragma mark - ReaderPagebarShadow instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = NO;
-		self.userInteractionEnabled = NO;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-		self.backgroundColor = [UIColor clearColor];
-
-		CAGradientLayer *layer = (CAGradientLayer *)self.layer;
-		UIColor *blackColor = [UIColor colorWithWhite:0.42f alpha:1.0f];
-		UIColor *clearColor = [UIColor colorWithWhite:0.42f alpha:0.0f];
-		layer.colors = [NSArray arrayWithObjects:(id)clearColor.CGColor, (id)blackColor.CGColor, nil];
-	}
-
-	return self;
-}
-
-@end

+ 0 - 57
iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainToolbar.h

@@ -1,57 +0,0 @@
-//
-//	ReaderMainToolbar.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "UIXToolbarView.h"
-
-@class ReaderMainToolbar;
-@class ReaderDocument;
-
-@protocol ReaderMainToolbarDelegate <NSObject>
-
-@required // Delegate protocols
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar doneButton:(UIButton *)button;
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar thumbsButton:(UIButton *)button;
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar exportButton:(UIButton *)button;
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar printButton:(UIButton *)button;
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar emailButton:(UIButton *)button;
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar markButton:(UIButton *)button;
-
-@end
-
-@interface ReaderMainToolbar : UIXToolbarView
-
-@property (nonatomic, weak, readwrite) id <ReaderMainToolbarDelegate> delegate;
-
-- (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)document;
-
-- (void)setBookmarkState:(BOOL)state;
-
-- (void)hideToolbar;
-- (void)showToolbar;
-
-@end

+ 0 - 356
iOSClient/Library/VFR Pdf Reader/Sources/ReaderMainToolbar.m

@@ -1,356 +0,0 @@
-//
-//	ReaderMainToolbar.m
-//	Reader v2.9.0
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ReaderMainToolbar.h"
-#import "ReaderDocument.h"
-
-#import <MessageUI/MessageUI.h>
-
-@implementation ReaderMainToolbar
-{
-	UIButton *markButton;
-
-	UIImage *markImageN;
-	UIImage *markImageY;
-}
-
-#pragma mark - Constants
-
-#define BUTTON_X 8.0f
-#define BUTTON_Y 8.0f
-
-#define BUTTON_SPACE 8.0f
-#define BUTTON_HEIGHT 30.0f
-
-#define BUTTON_FONT_SIZE 15.0f
-#define TEXT_BUTTON_PADDING 24.0f
-
-#define ICON_BUTTON_WIDTH 40.0f
-
-#define TITLE_FONT_SIZE 19.0f
-#define TITLE_HEIGHT 28.0f
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - ReaderMainToolbar instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	return [self initWithFrame:frame document:nil];
-}
-
-- (instancetype)initWithFrame:(CGRect)frame document:(ReaderDocument *)document
-{
-	assert(document != nil); // Must have a valid ReaderDocument
-
-	if ((self = [super initWithFrame:frame]))
-	{
-		CGFloat viewWidth = self.bounds.size.width; // Toolbar view width
-
-#if (READER_FLAT_UI == TRUE) // Option
-		UIImage *buttonH = nil; UIImage *buttonN = nil;
-#else
-		UIImage *buttonH = [[UIImage imageNamed:@"Reader-Button-H"] stretchableImageWithLeftCapWidth:5 topCapHeight:0];
-		UIImage *buttonN = [[UIImage imageNamed:@"Reader-Button-N"] stretchableImageWithLeftCapWidth:5 topCapHeight:0];
-#endif // end of READER_FLAT_UI Option
-
-		BOOL largeDevice = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
-
-		const CGFloat buttonSpacing = BUTTON_SPACE; const CGFloat iconButtonWidth = ICON_BUTTON_WIDTH;
-
-		CGFloat titleX = BUTTON_X; CGFloat titleWidth = (viewWidth - (titleX + titleX));
-
-		CGFloat leftButtonX = BUTTON_X; // Left-side button start X position
-
-#if (READER_STANDALONE == FALSE) // Option
-
-		UIFont *doneButtonFont = [UIFont systemFontOfSize:BUTTON_FONT_SIZE];
-		NSString *doneButtonText = NSLocalizedString(@"Done", @"button text");
-		CGSize doneButtonSize = [doneButtonText sizeWithAttributes:@{NSFontAttributeName : doneButtonFont}];
-		CGFloat doneButtonWidth = (ceil(doneButtonSize.width) + TEXT_BUTTON_PADDING);
-
-		UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-		doneButton.frame = CGRectMake(leftButtonX, BUTTON_Y, doneButtonWidth, BUTTON_HEIGHT);
-		[doneButton setTitleColor:[UIColor colorWithWhite:0.0f alpha:1.0f] forState:UIControlStateNormal];
-		[doneButton setTitleColor:[UIColor colorWithWhite:1.0f alpha:1.0f] forState:UIControlStateHighlighted];
-		[doneButton setTitle:doneButtonText forState:UIControlStateNormal]; doneButton.titleLabel.font = doneButtonFont;
-		[doneButton addTarget:self action:@selector(doneButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-		[doneButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-		[doneButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-		doneButton.autoresizingMask = UIViewAutoresizingNone;
-		//doneButton.backgroundColor = [UIColor grayColor];
-		doneButton.exclusiveTouch = YES;
-
-		[self addSubview:doneButton]; leftButtonX += (doneButtonWidth + buttonSpacing);
-
-		titleX += (doneButtonWidth + buttonSpacing); titleWidth -= (doneButtonWidth + buttonSpacing);
-
-#endif // end of READER_STANDALONE Option
-
-#if (READER_ENABLE_THUMBS == TRUE) // Option
-
-		UIButton *thumbsButton = [UIButton buttonWithType:UIButtonTypeCustom];
-		thumbsButton.frame = CGRectMake(leftButtonX, BUTTON_Y, iconButtonWidth, BUTTON_HEIGHT);
-		[thumbsButton setImage:[UIImage imageNamed:@"Reader-Thumbs"] forState:UIControlStateNormal];
-		[thumbsButton addTarget:self action:@selector(thumbsButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-		[thumbsButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-		[thumbsButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-		thumbsButton.autoresizingMask = UIViewAutoresizingNone;
-		//thumbsButton.backgroundColor = [UIColor grayColor];
-		thumbsButton.exclusiveTouch = YES;
-
-		[self addSubview:thumbsButton]; //leftButtonX += (iconButtonWidth + buttonSpacing);
-
-		titleX += (iconButtonWidth + buttonSpacing); titleWidth -= (iconButtonWidth + buttonSpacing);
-
-#endif // end of READER_ENABLE_THUMBS Option
-
-		CGFloat rightButtonX = viewWidth; // Right-side buttons start X position
-
-#if (READER_BOOKMARKS == TRUE) // Option
-
-		rightButtonX -= (iconButtonWidth + buttonSpacing); // Position
-
-		UIButton *flagButton = [UIButton buttonWithType:UIButtonTypeCustom];
-		flagButton.frame = CGRectMake(rightButtonX, BUTTON_Y, iconButtonWidth, BUTTON_HEIGHT);
-		//[flagButton setImage:[UIImage imageNamed:@"Reader-Mark-N"] forState:UIControlStateNormal];
-		[flagButton addTarget:self action:@selector(markButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-		[flagButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-		[flagButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-		flagButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-		//flagButton.backgroundColor = [UIColor grayColor];
-		flagButton.exclusiveTouch = YES;
-
-		[self addSubview:flagButton]; titleWidth -= (iconButtonWidth + buttonSpacing);
-
-		markButton = flagButton; markButton.enabled = NO; markButton.tag = NSIntegerMin;
-
-		markImageN = [UIImage imageNamed:@"Reader-Mark-N"]; // N image
-		markImageY = [UIImage imageNamed:@"Reader-Mark-Y"]; // Y image
-
-#endif // end of READER_BOOKMARKS Option
-
-		if (document.canEmail == YES) // Document email enabled
-		{
-			if ([MFMailComposeViewController canSendMail] == YES) // Can email
-			{
-				unsigned long long fileSize = [document.fileSize unsignedLongLongValue];
-
-				if (fileSize < 15728640ull) // Check attachment size limit (15MB)
-				{
-					rightButtonX -= (iconButtonWidth + buttonSpacing); // Next position
-
-					UIButton *emailButton = [UIButton buttonWithType:UIButtonTypeCustom];
-					emailButton.frame = CGRectMake(rightButtonX, BUTTON_Y, iconButtonWidth, BUTTON_HEIGHT);
-					[emailButton setImage:[UIImage imageNamed:@"Reader-Email"] forState:UIControlStateNormal];
-					[emailButton addTarget:self action:@selector(emailButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-					[emailButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-					[emailButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-					emailButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-					//emailButton.backgroundColor = [UIColor grayColor];
-					emailButton.exclusiveTouch = YES;
-
-					[self addSubview:emailButton]; titleWidth -= (iconButtonWidth + buttonSpacing);
-				}
-			}
-		}
-
-		if ((document.canPrint == YES) && (document.password == nil)) // Document print enabled
-		{
-			Class printInteractionController = NSClassFromString(@"UIPrintInteractionController");
-
-			if ((printInteractionController != nil) && [printInteractionController isPrintingAvailable])
-			{
-				rightButtonX -= (iconButtonWidth + buttonSpacing); // Next position
-
-				UIButton *printButton = [UIButton buttonWithType:UIButtonTypeCustom];
-				printButton.frame = CGRectMake(rightButtonX, BUTTON_Y, iconButtonWidth, BUTTON_HEIGHT);
-				[printButton setImage:[UIImage imageNamed:@"Reader-Print"] forState:UIControlStateNormal];
-				[printButton addTarget:self action:@selector(printButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-				[printButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-				[printButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-				printButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-				//printButton.backgroundColor = [UIColor grayColor];
-				printButton.exclusiveTouch = YES;
-
-				[self addSubview:printButton]; titleWidth -= (iconButtonWidth + buttonSpacing);
-			}
-		}
-
-		if (document.canExport == YES) // Document export enabled
-		{
-			rightButtonX -= (iconButtonWidth + buttonSpacing); // Next position
-
-			UIButton *exportButton = [UIButton buttonWithType:UIButtonTypeCustom];
-			exportButton.frame = CGRectMake(rightButtonX, BUTTON_Y, iconButtonWidth, BUTTON_HEIGHT);
-			[exportButton setImage:[UIImage imageNamed:@"Reader-Export"] forState:UIControlStateNormal];
-			[exportButton addTarget:self action:@selector(exportButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-			[exportButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-			[exportButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-			exportButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-			//exportButton.backgroundColor = [UIColor grayColor];
-			exportButton.exclusiveTouch = YES;
-
-			[self addSubview:exportButton]; titleWidth -= (iconButtonWidth + buttonSpacing);
-		}
-
-		if (largeDevice == YES) // Show document filename in toolbar
-		{
-			CGRect titleRect = CGRectMake(titleX, BUTTON_Y, titleWidth, TITLE_HEIGHT);
-
-			UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleRect];
-
-			titleLabel.textAlignment = NSTextAlignmentCenter;
-			titleLabel.font = [UIFont systemFontOfSize:TITLE_FONT_SIZE];
-			titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
-			titleLabel.textColor = [UIColor colorWithWhite:0.0f alpha:1.0f];
-			titleLabel.backgroundColor = [UIColor clearColor];
-			titleLabel.adjustsFontSizeToFitWidth = YES;
-			titleLabel.minimumScaleFactor = 0.75f;
-			titleLabel.text = [document.fileName stringByDeletingPathExtension];
-#if (READER_FLAT_UI == FALSE) // Option
-			titleLabel.shadowColor = [UIColor colorWithWhite:0.75f alpha:1.0f];
-			titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
-#endif // end of READER_FLAT_UI Option
-
-			[self addSubview:titleLabel]; 
-		}
-	}
-
-	return self;
-}
-
-- (void)setBookmarkState:(BOOL)state
-{
-#if (READER_BOOKMARKS == TRUE) // Option
-
-	if (state != markButton.tag) // Only if different state
-	{
-		if (self.hidden == NO) // Only if toolbar is visible
-		{
-			UIImage *image = (state ? markImageY : markImageN);
-
-			[markButton setImage:image forState:UIControlStateNormal];
-		}
-
-		markButton.tag = state; // Update bookmarked state tag
-	}
-
-	if (markButton.enabled == NO) markButton.enabled = YES;
-
-#endif // end of READER_BOOKMARKS Option
-}
-
-- (void)updateBookmarkImage
-{
-#if (READER_BOOKMARKS == TRUE) // Option
-
-	if (markButton.tag != NSIntegerMin) // Valid tag
-	{
-		BOOL state = markButton.tag; // Bookmarked state
-
-		UIImage *image = (state ? markImageY : markImageN);
-
-		[markButton setImage:image forState:UIControlStateNormal];
-	}
-
-	if (markButton.enabled == NO) markButton.enabled = YES;
-
-#endif // end of READER_BOOKMARKS Option
-}
-
-- (void)hideToolbar
-{
-	if (self.hidden == NO)
-	{
-		[UIView animateWithDuration:0.25 delay:0.0
-			options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
-			animations:^(void)
-			{
-				self.alpha = 0.0f;
-			}
-			completion:^(BOOL finished)
-			{
-				self.hidden = YES;
-			}
-		];
-	}
-}
-
-- (void)showToolbar
-{
-	if (self.hidden == YES)
-	{
-		[self updateBookmarkImage]; // First
-
-		[UIView animateWithDuration:0.25 delay:0.0
-			options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction
-			animations:^(void)
-			{
-				self.hidden = NO;
-				self.alpha = 1.0f;
-			}
-			completion:NULL
-		];
-	}
-}
-
-#pragma mark - UIButton action methods
-
-- (void)doneButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self doneButton:button];
-}
-
-- (void)thumbsButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self thumbsButton:button];
-}
-
-- (void)exportButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self exportButton:button];
-}
-
-- (void)printButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self printButton:button];
-}
-
-- (void)emailButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self emailButton:button];
-}
-
-- (void)markButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self markButton:button];
-}
-
-@end

+ 0 - 54
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbCache.h

@@ -1,54 +0,0 @@
-//
-//	ReaderThumbCache.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ReaderThumbRequest.h"
-
-@interface ReaderThumbCache : NSObject <NSObject>
-
-+ (ReaderThumbCache *)sharedInstance;
-
-+ (void)touchThumbCacheWithGUID:(NSString *)guid;
-
-+ (void)createThumbCacheWithGUID:(NSString *)guid;
-
-+ (void)removeThumbCacheWithGUID:(NSString *)guid;
-
-+ (void)purgeThumbCachesOlderThan:(NSTimeInterval)age;
-
-+ (NSString *)thumbCachePathForGUID:(NSString *)guid;
-
-- (id)thumbRequest:(ReaderThumbRequest *)request priority:(BOOL)priority;
-
-- (void)setObject:(UIImage *)image forKey:(NSString *)key;
-
-- (void)removeObjectForKey:(NSString *)key;
-
-- (void)removeNullForKey:(NSString *)key;
-
-- (void)removeAllObjects;
-
-@end

+ 0 - 228
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbCache.m

@@ -1,228 +0,0 @@
-//
-//	ReaderThumbCache.m
-//	Reader v2.9.0
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbCache.h"
-#import "ReaderThumbQueue.h"
-#import "ReaderThumbFetch.h"
-#import "ReaderThumbView.h"
-
-@implementation ReaderThumbCache
-{
-	NSCache *thumbCache;
-}
-
-#pragma mark - Constants
-
-#define CACHE_SIZE 2097152
-
-#pragma mark - ReaderThumbCache class methods
-
-+ (ReaderThumbCache *)sharedInstance
-{
-	static dispatch_once_t predicate = 0;
-
-	static ReaderThumbCache *object = nil; // Object
-
-	dispatch_once(&predicate, ^{ object = [self new]; });
-
-	return object; // ReaderThumbCache singleton
-}
-
-+ (NSString *)appCachesPath
-{
-	static dispatch_once_t predicate = 0;
-
-	static NSString *theCachesPath = nil; // Application caches path string
-
-	dispatch_once(&predicate, // Save a copy of the application caches path the first time it is needed
-	^{
-		NSArray *cachesPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-
-		theCachesPath = [[cachesPaths objectAtIndex:0] copy]; // Keep a copy for later abusage
-	});
-
-	return theCachesPath;
-}
-
-+ (NSString *)thumbCachePathForGUID:(NSString *)guid
-{
-	NSString *cachesPath = [ReaderThumbCache appCachesPath]; // Caches path
-
-	return [cachesPath stringByAppendingPathComponent:guid]; // Append GUID
-}
-
-+ (void)createThumbCacheWithGUID:(NSString *)guid
-{
-	NSFileManager *fileManager = [NSFileManager new]; // File manager instance
-
-	NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:guid]; // Thumb cache path
-
-	[fileManager createDirectoryAtPath:cachePath withIntermediateDirectories:NO attributes:nil error:NULL];
-}
-
-+ (void)removeThumbCacheWithGUID:(NSString *)guid
-{
-	dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0),
-	^{
-		NSFileManager *fileManager = [NSFileManager new]; // File manager instance
-
-		NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:guid]; // Thumb cache path
-
-		[fileManager removeItemAtPath:cachePath error:NULL]; // Remove thumb cache directory
-	});
-}
-
-+ (void)touchThumbCacheWithGUID:(NSString *)guid
-{
-	NSFileManager *fileManager = [NSFileManager new]; // File manager instance
-
-	NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:guid]; // Thumb cache path
-
-	NSDictionary *attributes = [NSDictionary dictionaryWithObject:[NSDate date] forKey:NSFileModificationDate];
-
-	[fileManager setAttributes:attributes ofItemAtPath:cachePath error:NULL]; // New modification date
-}
-
-+ (void)purgeThumbCachesOlderThan:(NSTimeInterval)age
-{
-	dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0),
-	^{
-		NSDate *now = [NSDate date]; // Right about now time
-
-		NSString *cachesPath = [ReaderThumbCache appCachesPath]; // Caches path
-
-		NSFileManager *fileManager = [NSFileManager new]; // File manager instance
-
-		NSArray *cachesList = [fileManager contentsOfDirectoryAtPath:cachesPath error:NULL];
-
-		if (cachesList != nil) // Process caches directory contents
-		{
-			for (NSString *cacheName in cachesList) // Enumerate directory contents
-			{
-				if (cacheName.length == 36) // This is a very hacky cache ident kludge
-				{
-					NSString *cachePath = [cachesPath stringByAppendingPathComponent:cacheName];
-
-					NSDictionary *attributes = [fileManager attributesOfItemAtPath:cachePath error:NULL];
-
-					NSDate *cacheDate = [attributes objectForKey:NSFileModificationDate]; // Cache date
-
-					NSTimeInterval seconds = [now timeIntervalSinceDate:cacheDate]; // Cache age
-
-					if (seconds > age) // Older than so remove the thumb cache
-					{
-						[fileManager removeItemAtPath:cachePath error:NULL];
-
-						#ifdef DEBUG
-							NSLog(@"%s purged %@", __FUNCTION__, cacheName);
-						#endif
-					}
-				}
-			}
-		}
-	});
-}
-
-#pragma mark - ReaderThumbCache instance methods
-
-- (instancetype)init
-{
-	if ((self = [super init])) // Initialize
-	{
-		thumbCache = [NSCache new]; // Cache
-
-		[thumbCache setName:@"ReaderThumbCache"];
-
-		[thumbCache setTotalCostLimit:CACHE_SIZE];
-	}
-
-	return self;
-}
-
-- (id)thumbRequest:(ReaderThumbRequest *)request priority:(BOOL)priority
-{
-	@synchronized(thumbCache) // Mutex lock
-	{
-		id object = [thumbCache objectForKey:request.cacheKey];
-
-		if (object == nil) // Thumb object does not yet exist in the cache
-		{
-			object = [NSNull null]; // Return an NSNull thumb placeholder object
-
-			[thumbCache setObject:object forKey:request.cacheKey cost:2]; // Cache the placeholder object
-
-			ReaderThumbFetch *thumbFetch = [[ReaderThumbFetch alloc] initWithRequest:request]; // Create a thumb fetch operation
-
-			[thumbFetch setQueuePriority:(priority ? NSOperationQueuePriorityNormal : NSOperationQueuePriorityLow)]; // Queue priority
-
-			request.thumbView.operation = thumbFetch; //[thumbFetch setThreadPriority:(priority ? 0.55 : 0.35)]; // Thread priority
-
-			[[ReaderThumbQueue sharedInstance] addLoadOperation:thumbFetch]; // Queue the operation
-		}
-
-		return object; // NSNull or UIImage
-	}
-}
-
-- (void)setObject:(UIImage *)image forKey:(NSString *)key
-{
-	@synchronized(thumbCache) // Mutex lock
-	{
-		NSUInteger bytes = (image.size.width * image.size.height * 4.0f);
-
-		[thumbCache setObject:image forKey:key cost:bytes]; // Cache image
-	}
-}
-
-- (void)removeObjectForKey:(NSString *)key
-{
-	@synchronized(thumbCache) // Mutex lock
-	{
-		[thumbCache removeObjectForKey:key];
-	}
-}
-
-- (void)removeNullForKey:(NSString *)key
-{
-	@synchronized(thumbCache) // Mutex lock
-	{
-		id object = [thumbCache objectForKey:key];
-
-		if ([object isMemberOfClass:[NSNull class]])
-		{
-			[thumbCache removeObjectForKey:key];
-		}
-	}
-}
-
-- (void)removeAllObjects
-{
-	@synchronized(thumbCache) // Mutex lock
-	{
-		[thumbCache removeAllObjects];
-	}
-}
-
-@end

+ 0 - 36
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbFetch.h

@@ -1,36 +0,0 @@
-//
-//	ReaderThumbFetch.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-#import "ReaderThumbQueue.h"
-
-@class ReaderThumbRequest;
-
-@interface ReaderThumbFetch : ReaderThumbOperation
-
-- (instancetype)initWithRequest:(ReaderThumbRequest *)options;
-
-@end

+ 0 - 128
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbFetch.m

@@ -1,128 +0,0 @@
-//
-//	ReaderThumbFetch.m
-//	Reader v2.9.0
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbFetch.h"
-#import "ReaderThumbRender.h"
-#import "ReaderThumbCache.h"
-#import "ReaderThumbView.h"
-
-#import <ImageIO/ImageIO.h>
-
-@implementation ReaderThumbFetch
-{
-	ReaderThumbRequest *request;
-}
-
-#pragma mark - ReaderThumbFetch instance methods
-
-- (instancetype)initWithRequest:(ReaderThumbRequest *)options
-{
-	if ((self = [super initWithGUID:options.guid]))
-	{
-		request = options;
-	}
-
-	return self;
-}
-
-- (void)cancel
-{
-	[super cancel]; // Cancel the operation
-
-	request.thumbView.operation = nil; // Break retain loop
-
-	request.thumbView = nil; // Release target thumb view on cancel
-
-	[[ReaderThumbCache sharedInstance] removeNullForKey:request.cacheKey];
-}
-
-- (NSURL *)thumbFileURL
-{
-	NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:request.guid]; // Thumb cache path
-
-	NSString *fileName = [[NSString alloc] initWithFormat:@"%@.png", request.thumbName]; // Thumb file name
-
-	return [NSURL fileURLWithPath:[cachePath stringByAppendingPathComponent:fileName]]; // File URL
-}
-
-- (void)main
-{
-	CGImageRef imageRef = NULL; NSURL *thumbURL = [self thumbFileURL];
-
-	CGImageSourceRef loadRef = CGImageSourceCreateWithURL((__bridge CFURLRef)thumbURL, NULL);
-
-	if (loadRef != NULL) // Load the existing thumb image
-	{
-		imageRef = CGImageSourceCreateImageAtIndex(loadRef, 0, NULL); // Load it
-
-		CFRelease(loadRef); // Release CGImageSource reference
-	}
-	else // Existing thumb image not found - so create and queue up a thumb render operation on the work queue
-	{
-		ReaderThumbRender *thumbRender = [[ReaderThumbRender alloc] initWithRequest:request]; // Create a thumb render operation
-
-		[thumbRender setQueuePriority:self.queuePriority]; //[thumbRender setThreadPriority:(self.threadPriority - 0.1)]; // Priority
-
-		if (self.isCancelled == NO) // We're not cancelled - so update things and add the render operation to the work queue
-		{
-			request.thumbView.operation = thumbRender; // Update the thumb view operation property to the new operation
-
-			[[ReaderThumbQueue sharedInstance] addWorkOperation:thumbRender]; return; // Queue the operation
-		}
-	}
-
-	if (imageRef != NULL) // Create a UIImage from a CGImage and show it
-	{
-		UIImage *image = [UIImage imageWithCGImage:imageRef scale:request.scale orientation:UIImageOrientationUp];
-
-		CGImageRelease(imageRef); // Release the CGImage reference from the above thumb load code
-
-		UIGraphicsBeginImageContextWithOptions(image.size, YES, request.scale); // Graphics context
-
-		[image drawAtPoint:CGPointZero]; // Decode and draw the image on this background thread
-
-		UIImage *decoded = UIGraphicsGetImageFromCurrentImageContext(); // Newly decoded image
-
-		UIGraphicsEndImageContext(); // Cleanup after the bitmap-based graphics drawing context
-
-		[[ReaderThumbCache sharedInstance] setObject:decoded forKey:request.cacheKey]; // Cache it
-
-		if (self.isCancelled == NO) // Show the image in the target thumb view on the main thread
-		{
-			ReaderThumbView *thumbView = request.thumbView; // Target thumb view for image show
-
-			NSUInteger targetTag = request.targetTag; // Target reference tag for image show
-
-			dispatch_async(dispatch_get_main_queue(), // Queue image show on main thread
-			^{
-				if (thumbView.targetTag == targetTag) [thumbView showImage:decoded];
-			});
-		}
-	}
-
-	request.thumbView.operation = nil; // Break retain loop
-}
-
-@end

+ 0 - 54
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbQueue.h

@@ -1,54 +0,0 @@
-//
-//	ReaderThumbQueue.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface ReaderThumbQueue : NSObject <NSObject>
-
-+ (ReaderThumbQueue *)sharedInstance;
-
-- (void)addLoadOperation:(NSOperation *)operation;
-
-- (void)addWorkOperation:(NSOperation *)operation;
-
-- (void)cancelOperationsWithGUID:(NSString *)guid;
-
-- (void)cancelAllOperations;
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderThumbOperation class interface
-//
-
-@interface ReaderThumbOperation : NSOperation
-
-@property (nonatomic, strong, readonly) NSString *guid;
-
-- (instancetype)initWithGUID:(NSString *)guid;
-
-@end

+ 0 - 141
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbQueue.m

@@ -1,141 +0,0 @@
-//
-//	ReaderThumbQueue.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbQueue.h"
-
-@implementation ReaderThumbQueue
-{
-	NSOperationQueue *loadQueue;
-
-	NSOperationQueue *workQueue;
-}
-
-#pragma mark - ReaderThumbQueue class methods
-
-+ (ReaderThumbQueue *)sharedInstance
-{
-	static dispatch_once_t predicate = 0;
-
-	static ReaderThumbQueue *object = nil; // Object
-
-	dispatch_once(&predicate, ^{ object = [self new]; });
-
-	return object; // ReaderThumbQueue singleton
-}
-
-#pragma mark - ReaderThumbQueue instance methods
-
-- (instancetype)init
-{
-	if ((self = [super init])) // Initialize
-	{
-		loadQueue = [NSOperationQueue new];
-
-		[loadQueue setName:@"ReaderThumbLoadQueue"];
-
-		[loadQueue setMaxConcurrentOperationCount:1];
-
-		workQueue = [NSOperationQueue new];
-
-		[workQueue setName:@"ReaderThumbWorkQueue"];
-
-		[workQueue setMaxConcurrentOperationCount:1];
-	}
-
-	return self;
-}
-
-- (void)addLoadOperation:(NSOperation *)operation
-{
-	if ([operation isKindOfClass:[ReaderThumbOperation class]])
-	{
-		[loadQueue addOperation:operation]; // Add to load queue
-	}
-}
-
-- (void)addWorkOperation:(NSOperation *)operation
-{
-	if ([operation isKindOfClass:[ReaderThumbOperation class]])
-	{
-		[workQueue addOperation:operation]; // Add to work queue
-	}
-}
-
-- (void)cancelOperationsWithGUID:(NSString *)guid
-{
-	[loadQueue setSuspended:YES]; [workQueue setSuspended:YES];
-
-	for (ReaderThumbOperation *operation in loadQueue.operations)
-	{
-		if ([operation isKindOfClass:[ReaderThumbOperation class]])
-		{
-			if ([operation.guid isEqualToString:guid]) [operation cancel];
-		}
-	}
-
-	for (ReaderThumbOperation *operation in workQueue.operations)
-	{
-		if ([operation isKindOfClass:[ReaderThumbOperation class]])
-		{
-			if ([operation.guid isEqualToString:guid]) [operation cancel];
-		}
-	}
-
-	[workQueue setSuspended:NO]; [loadQueue setSuspended:NO];
-}
-
-- (void)cancelAllOperations
-{
-	[loadQueue cancelAllOperations]; [workQueue cancelAllOperations];
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ReaderThumbOperation class implementation
-//
-
-@implementation ReaderThumbOperation
-{
-	NSString *_guid;
-}
-
-@synthesize guid = _guid;
-
-#pragma mark - ReaderThumbOperation instance methods
-
-- (instancetype)initWithGUID:(NSString *)guid
-{
-	if ((self = [super init]))
-	{
-		_guid = guid;
-	}
-
-	return self;
-}
-
-@end

+ 0 - 36
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRender.h

@@ -1,36 +0,0 @@
-//
-//	ReaderThumbRender.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <Foundation/Foundation.h>
-
-#import "ReaderThumbQueue.h"
-
-@class ReaderThumbRequest;
-
-@interface ReaderThumbRender : ReaderThumbOperation
-
-- (instancetype)initWithRequest:(ReaderThumbRequest *)options;
-
-@end

+ 0 - 204
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRender.m

@@ -1,204 +0,0 @@
-//
-//	ReaderThumbRender.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbRender.h"
-#import "ReaderThumbCache.h"
-#import "ReaderThumbView.h"
-#import "CGPDFDocument.h"
-
-#import <ImageIO/ImageIO.h>
-
-@implementation ReaderThumbRender
-{
-	ReaderThumbRequest *request;
-}
-
-#pragma mark - ReaderThumbRender instance methods
-
-- (instancetype)initWithRequest:(ReaderThumbRequest *)options
-{
-	if ((self = [super initWithGUID:options.guid]))
-	{
-		request = options;
-	}
-
-	return self;
-}
-
-- (void)cancel
-{
-	[super cancel]; // Cancel the operation
-
-	request.thumbView.operation = nil; // Break retain loop
-
-	request.thumbView = nil; // Release target thumb view on cancel
-
-	[[ReaderThumbCache sharedInstance] removeNullForKey:request.cacheKey];
-}
-
-- (NSURL *)thumbFileURL
-{
-	NSFileManager *fileManager = [NSFileManager new]; // File manager instance
-
-	NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:request.guid]; // Thumb cache path
-
-	[fileManager createDirectoryAtPath:cachePath withIntermediateDirectories:NO attributes:nil error:NULL];
-
-	NSString *fileName = [[NSString alloc] initWithFormat:@"%@.png", request.thumbName]; // Thumb file name
-
-	return [NSURL fileURLWithPath:[cachePath stringByAppendingPathComponent:fileName]]; // File URL
-}
-
-- (void)main
-{
-	NSInteger page = request.thumbPage; NSString *password = request.password;
-
-	CGImageRef imageRef = NULL; CFURLRef fileURL = (__bridge CFURLRef)request.fileURL;
-
-	CGPDFDocumentRef thePDFDocRef = CGPDFDocumentCreateUsingUrl(fileURL, password);
-
-	if (thePDFDocRef != NULL) // Check for non-NULL CGPDFDocumentRef
-	{
-		CGPDFPageRef thePDFPageRef = CGPDFDocumentGetPage(thePDFDocRef, page);
-
-		if (thePDFPageRef != NULL) // Check for non-NULL CGPDFPageRef
-		{
-			CGFloat thumb_w = request.thumbSize.width; // Maximum thumb width
-			CGFloat thumb_h = request.thumbSize.height; // Maximum thumb height
-
-			CGRect cropBoxRect = CGPDFPageGetBoxRect(thePDFPageRef, kCGPDFCropBox);
-			CGRect mediaBoxRect = CGPDFPageGetBoxRect(thePDFPageRef, kCGPDFMediaBox);
-			CGRect effectiveRect = CGRectIntersection(cropBoxRect, mediaBoxRect);
-
-			NSInteger pageRotate = CGPDFPageGetRotationAngle(thePDFPageRef); // Angle
-
-			CGFloat page_w = 0.0f; CGFloat page_h = 0.0f; // Rotated page size
-
-			switch (pageRotate) // Page rotation (in degrees)
-			{
-				default: // Default case
-				case 0: case 180: // 0 and 180 degrees
-				{
-					page_w = effectiveRect.size.width;
-					page_h = effectiveRect.size.height;
-					break;
-				}
-
-				case 90: case 270: // 90 and 270 degrees
-				{
-					page_h = effectiveRect.size.width;
-					page_w = effectiveRect.size.height;
-					break;
-				}
-			}
-
-			CGFloat scale_w = (thumb_w / page_w); // Width scale
-			CGFloat scale_h = (thumb_h / page_h); // Height scale
-
-			CGFloat scale = 0.0f; // Page to target thumb size scale
-
-			if (page_h > page_w)
-				scale = ((thumb_h > thumb_w) ? scale_w : scale_h); // Portrait
-			else
-				scale = ((thumb_h < thumb_w) ? scale_h : scale_w); // Landscape
-
-			NSInteger target_w = (page_w * scale); // Integer target thumb width
-			NSInteger target_h = (page_h * scale); // Integer target thumb height
-
-			if (target_w % 2) target_w--; if (target_h % 2) target_h--; // Even
-
-			target_w *= request.scale; target_h *= request.scale; // Screen scale
-
-			CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB(); // RGB color space
-
-			CGBitmapInfo bmi = (kCGBitmapByteOrder32Little | kCGImageAlphaNoneSkipFirst);
-
-			CGContextRef context = CGBitmapContextCreate(NULL, target_w, target_h, 8, 0, rgb, bmi);
-
-			if (context != NULL) // Must have a valid custom CGBitmap context to draw into
-			{
-				CGRect thumbRect = CGRectMake(0.0f, 0.0f, target_w, target_h); // Target thumb rect
-
-				CGContextSetRGBFillColor(context, 1.0f, 1.0f, 1.0f, 1.0f); CGContextFillRect(context, thumbRect); // White fill
-
-				CGContextConcatCTM(context, CGPDFPageGetDrawingTransform(thePDFPageRef, kCGPDFCropBox, thumbRect, 0, true)); // Fit rect
-
-				//CGContextSetRenderingIntent(context, kCGRenderingIntentDefault); CGContextSetInterpolationQuality(context, kCGInterpolationDefault);
-
-				CGContextDrawPDFPage(context, thePDFPageRef); // Render the PDF page into the custom CGBitmap context
-
-				imageRef = CGBitmapContextCreateImage(context); // Create CGImage from custom CGBitmap context
-
-				CGContextRelease(context); // Release custom CGBitmap context reference
-			}
-
-			CGColorSpaceRelease(rgb); // Release device RGB color space reference
-		}
-
-		CGPDFDocumentRelease(thePDFDocRef); // Release CGPDFDocumentRef reference
-	}
-
-	if (imageRef != NULL) // Create UIImage from CGImage and show it, then save thumb as PNG
-	{
-		UIImage *image = [UIImage imageWithCGImage:imageRef scale:request.scale orientation:UIImageOrientationUp];
-
-		[[ReaderThumbCache sharedInstance] setObject:image forKey:request.cacheKey]; // Update cache
-
-		if (self.isCancelled == NO) // Show the image in the target thumb view on the main thread
-		{
-			ReaderThumbView *thumbView = request.thumbView; // Target thumb view for image show
-
-			NSUInteger targetTag = request.targetTag; // Target reference tag for image show
-
-			dispatch_async(dispatch_get_main_queue(), // Queue image show on main thread
-			^{
-				if (thumbView.targetTag == targetTag) [thumbView showImage:image];
-			});
-		}
-
-		CFURLRef thumbURL = (__bridge CFURLRef)[self thumbFileURL]; // Thumb cache path with PNG file name URL
-
-		CGImageDestinationRef thumbRef = CGImageDestinationCreateWithURL(thumbURL, (CFStringRef)@"public.png", 1, NULL);
-
-		if (thumbRef != NULL) // Write the thumb image file out to the thumb cache directory
-		{
-			CGImageDestinationAddImage(thumbRef, imageRef, NULL); // Add the image
-
-			CGImageDestinationFinalize(thumbRef); // Finalize the image file
-
-			CFRelease(thumbRef); // Release CGImageDestination reference
-		}
-
-		CGImageRelease(imageRef); // Release CGImage reference
-	}
-	else // No image - so remove the placeholder object from the cache
-	{
-		[[ReaderThumbCache sharedInstance] removeNullForKey:request.cacheKey];
-	}
-
-	request.thumbView.operation = nil; // Break retain loop
-}
-
-@end

+ 0 - 45
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRequest.h

@@ -1,45 +0,0 @@
-//
-//	ReaderThumbRequest.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-@class ReaderThumbView;
-
-@interface ReaderThumbRequest : NSObject <NSObject>
-
-@property (nonatomic, strong, readonly) NSURL *fileURL;
-@property (nonatomic, strong, readonly) NSString *guid;
-@property (nonatomic, strong, readonly) NSString *password;
-@property (nonatomic, strong, readonly) NSString *cacheKey;
-@property (nonatomic, strong, readonly) NSString *thumbName;
-@property (nonatomic, strong, readwrite) ReaderThumbView *thumbView;
-@property (nonatomic, assign, readonly) NSUInteger targetTag;
-@property (nonatomic, assign, readonly) NSInteger thumbPage;
-@property (nonatomic, assign, readonly) CGSize thumbSize;
-@property (nonatomic, assign, readonly) CGFloat scale;
-
-+ (instancetype)newForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size;
-
-@end

+ 0 - 96
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbRequest.m

@@ -1,96 +0,0 @@
-//
-//	ReaderThumbRequest.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbRequest.h"
-#import "ReaderThumbView.h"
-
-@implementation ReaderThumbRequest
-{
-	NSURL *_fileURL;
-
-	NSString *_guid;
-
-	NSString *_password;
-
-	NSString *_cacheKey;
-
-	NSString *_thumbName;
-
-	ReaderThumbView *_thumbView;
-
-	NSUInteger _targetTag;
-
-	NSInteger _thumbPage;
-
-	CGSize _thumbSize;
-
-	CGFloat _scale;
-}
-
-#pragma mark - Properties
-
-@synthesize guid = _guid;
-@synthesize fileURL = _fileURL;
-@synthesize password = _password;
-@synthesize thumbView = _thumbView;
-@synthesize thumbPage = _thumbPage;
-@synthesize thumbSize = _thumbSize;
-@synthesize thumbName = _thumbName;
-@synthesize targetTag = _targetTag;
-@synthesize cacheKey = _cacheKey;
-@synthesize scale = _scale;
-
-#pragma mark - ReaderThumbRequest class methods
-
-+ (instancetype)newForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size
-{
-	return [[ReaderThumbRequest alloc] initForView:view fileURL:url password:phrase guid:guid page:page size:size];
-}
-
-#pragma mark - ReaderThumbRequest instance methods
-
-- (instancetype)initForView:(ReaderThumbView *)view fileURL:(NSURL *)url password:(NSString *)phrase guid:(NSString *)guid page:(NSInteger)page size:(CGSize)size
-{
-	if ((self = [super init])) // Initialize object
-	{
-		NSInteger w = size.width; NSInteger h = size.height;
-
-		_thumbView = view; _thumbPage = page; _thumbSize = size;
-
-		_fileURL = [url copy]; _password = [phrase copy]; _guid = [guid copy];
-
-		_thumbName = [[NSString alloc] initWithFormat:@"%07i-%04ix%04i", (int)page, (int)w, (int)h];
-
-		_cacheKey = [[NSString alloc] initWithFormat:@"%@+%@", _thumbName, _guid];
-
-		_targetTag = [_cacheKey hash]; _thumbView.targetTag = _targetTag;
-
-		_scale = [[UIScreen mainScreen] scale]; // Thumb screen scale
-	}
-
-	return self;
-}
-
-@end

+ 0 - 45
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbView.h

@@ -1,45 +0,0 @@
-//
-//	ReaderThumbView.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface ReaderThumbView : UIView
-{
-@protected // Instance variables
-
-	UIImageView *imageView;
-}
-
-@property (atomic, strong, readwrite) NSOperation *operation;
-
-@property (nonatomic, assign, readwrite) NSUInteger targetTag;
-
-- (void)showImage:(UIImage *)image;
-
-- (void)showTouched:(BOOL)touched;
-
-- (void)reuse;
-
-@end

+ 0 - 93
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbView.m

@@ -1,93 +0,0 @@
-//
-//	ReaderThumbView.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbView.h"
-
-@implementation ReaderThumbView
-{
-	NSOperation *_operation;
-
-	NSUInteger _targetTag;
-}
-
-#pragma mark - Properties
-
-@synthesize operation = _operation;
-@synthesize targetTag = _targetTag;
-
-#pragma mark - ReaderThumbView instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = NO;
-		self.userInteractionEnabled = NO;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingNone;
-		self.backgroundColor = [UIColor clearColor];
-
-		imageView = [[UIImageView alloc] initWithFrame:self.bounds];
-
-		imageView.autoresizesSubviews = NO;
-		imageView.userInteractionEnabled = NO;
-		imageView.autoresizingMask = UIViewAutoresizingNone;
-		imageView.contentMode = UIViewContentModeScaleAspectFit;
-
-		[self addSubview:imageView];
-	}
-
-	return self;
-}
-
-- (void)showImage:(UIImage *)image
-{
-	imageView.image = image; // Show image
-}
-
-- (void)showTouched:(BOOL)touched
-{
-	// Implemented by ReaderThumbView subclass
-}
-
-- (void)removeFromSuperview
-{
-	_targetTag = 0; // Clear target tag
-
-	[self.operation cancel]; // Cancel operation
-
-	[super removeFromSuperview]; // Remove view
-}
-
-- (void)reuse
-{
-	_targetTag = 0; // Clear target tag
-
-	[self.operation cancel]; // Cancel operation
-
-	imageView.image = nil; // Release image
-}
-
-@end

+ 0 - 68
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbsView.h

@@ -1,68 +0,0 @@
-//
-//	ReaderThumbsView.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ReaderThumbView.h"
-
-@class ReaderThumbsView;
-
-@protocol ReaderThumbsViewDelegate <NSObject, UIScrollViewDelegate>
-
-@required // Delegate protocols
-
-- (NSUInteger)numberOfThumbsInThumbsView:(ReaderThumbsView *)thumbsView;
-
-- (id)thumbsView:(ReaderThumbsView *)thumbsView thumbCellWithFrame:(CGRect)frame;
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView updateThumbCell:(id)thumbCell forIndex:(NSInteger)index;
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView didSelectThumbWithIndex:(NSInteger)index;
-
-@optional // Delegate protocols
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView refreshThumbCell:(id)thumbCell forIndex:(NSInteger)index;
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView didPressThumbWithIndex:(NSInteger)index;
-
-@end
-
-@interface ReaderThumbsView : UIScrollView
-
-@property (nonatomic, weak, readwrite) id <ReaderThumbsViewDelegate> delegate;
-
-- (void)setThumbSize:(CGSize)thumbSize;
-
-- (void)reloadThumbsCenterOnIndex:(NSInteger)index;
-
-- (void)reloadThumbsContentOffset:(CGPoint)newContentOffset;
-
-- (void)refreshThumbWithIndex:(NSInteger)index;
-
-- (void)refreshVisibleThumbs;
-
-- (CGPoint)insetContentOffset;
-
-@end

+ 0 - 545
iOSClient/Library/VFR Pdf Reader/Sources/ReaderThumbsView.m

@@ -1,545 +0,0 @@
-//
-//	ReaderThumbsView.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderThumbsView.h"
-
-@interface ReaderThumbsView () <UIScrollViewDelegate, UIGestureRecognizerDelegate>
-
-@end
-
-@implementation ReaderThumbsView
-{
-	CGPoint lastContentOffset;
-
-	ReaderThumbView *touchedCell;
-
-	NSMutableArray *thumbCellsQueue;
-
-	NSMutableArray *thumbCellsVisible;
-
-	NSInteger _thumbsX, _thumbsY, _thumbX;
-
-	CGSize _thumbSize, _lastViewSize;
-
-	NSUInteger _thumbCount;
-
-	BOOL canUpdate;
-}
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - ReaderThumbsView instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.scrollsToTop = NO;
-		self.autoresizesSubviews = NO;
-		self.delaysContentTouches = NO;
-		self.alwaysBounceVertical = YES;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
-		self.backgroundColor = [UIColor clearColor];
-
-		[super setDelegate:self]; // Set the superclass UIScrollView delegate
-
-		thumbCellsQueue = [NSMutableArray new]; thumbCellsVisible = [NSMutableArray new]; // Cell management arrays
-
-		UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
-		//tapGesture.numberOfTouchesRequired = 1; tapGesture.numberOfTapsRequired = 1; tapGesture.delegate = self;
-		[self addGestureRecognizer:tapGesture]; 
-
-		UILongPressGestureRecognizer *pressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handlePressGesture:)];
-		pressGesture.minimumPressDuration = 0.8; //pressGesture.numberOfTouchesRequired = 1; pressGesture.delegate = self;
-		[self addGestureRecognizer:pressGesture]; 
-
-		lastContentOffset = CGPointMake(CGFLOAT_MIN, CGFLOAT_MIN);
-	}
-
-	return self;
-}
-
-- (void)requeueThumbCell:(ReaderThumbView *)tvCell
-{
-	[thumbCellsQueue addObject:tvCell];
-
-	[thumbCellsVisible removeObject:tvCell];
-
-	tvCell.tag = NSIntegerMin; tvCell.hidden = YES;
-
-	[tvCell reuse]; // Reuse the cell
-}
-
-- (void)requeueAllThumbCells
-{
-	if (thumbCellsVisible.count > 0)
-	{
-		NSArray *visible = [thumbCellsVisible copy];
-
-		for (ReaderThumbView *tvCell in visible)
-		{
-			[self requeueThumbCell:tvCell];
-		}
-	}
-}
-
-- (ReaderThumbView *)dequeueThumbCellWithFrame:(CGRect)frame
-{
-	ReaderThumbView *theCell = nil;
-
-	if (thumbCellsQueue.count > 0) // Reuse existing cell
-	{
-		theCell = [thumbCellsQueue objectAtIndex:0];
-
-		[thumbCellsQueue removeObjectAtIndex:0]; // Dequeue it
-
-		theCell.frame = frame; // Position the reused cell
-	}
-	else // Allocate a brand new thumb cell subclass for our use
-	{
-		theCell = [delegate thumbsView:self thumbCellWithFrame:frame];
-
-		//assert([theCell isKindOfClass:[ReaderThumbView class]]);
-
-		theCell.tag = NSIntegerMin; theCell.hidden = YES;
-
-		[self insertSubview:theCell atIndex:0]; // Add
-	}
-
-	[thumbCellsVisible addObject:theCell]; 
-
-	return theCell;
-}
-
-- (NSMutableIndexSet *)visibleIndexSetForContentOffset
-{
-	CGFloat minY = self.contentOffset.y; // Content offset
-	CGFloat maxY = (minY + self.bounds.size.height - 1.0f);
-
-	NSInteger startRow = (minY / _thumbSize.height); // Start row
-	NSInteger finalRow = (maxY / _thumbSize.height); // Final row
-
-	NSInteger startIndex = (startRow * _thumbsX); // Start index
-	NSInteger finalIndex = (finalRow * _thumbsX); // Final index
-
-	finalIndex += (_thumbsX - 1); // Last index value in last row
-
-	NSInteger maximumIndex = (_thumbCount - 1); // Maximum index value
-
-	if (finalIndex > maximumIndex) finalIndex = maximumIndex; // Limit it
-
-	NSRange indexRange = NSMakeRange(startIndex, (finalIndex - startIndex + 1));
-
-	return [NSMutableIndexSet indexSetWithIndexesInRange:indexRange];
-}
-
-- (ReaderThumbView *)thumbCellContainingPoint:(CGPoint)point
-{
-	ReaderThumbView *theCell = nil;
-
-	for (ReaderThumbView *tvCell in thumbCellsVisible)
-	{
-		if (CGRectContainsPoint(tvCell.frame, point) == true)
-		{
-			theCell = tvCell; break; // Found it
-		}
-	}
-
-	return theCell;
-}
-
-- (CGRect)thumbCellFrameForIndex:(NSInteger)index
-{
-	CGRect thumbRect; thumbRect.size = _thumbSize;
-
-	NSInteger thumbY = ((index / _thumbsX) * _thumbSize.height); // X, Y
-
-	NSInteger thumbX = (((index % _thumbsX) * _thumbSize.width) + _thumbX);
-
-	thumbRect.origin.x = thumbX; thumbRect.origin.y = thumbY;
-
-	return thumbRect;
-}
-
-- (void)updateContentSize:(NSUInteger)thumbCount
-{
-	canUpdate = NO; // Disable updates
-
-	if (thumbCount > 0) // Have some thumbs
-	{
-		CGFloat bw = self.bounds.size.width;
-
-		_thumbsX = (bw / _thumbSize.width);
-
-		if (_thumbsX < 1) _thumbsX = 1;
-
-		_thumbsY = (thumbCount / _thumbsX);
-
-		if ((_thumbsX * _thumbsY) < thumbCount) _thumbsY++;
-
-		CGFloat tw = (_thumbsX * _thumbSize.width);
-		CGFloat th = (_thumbsY * _thumbSize.height);
-
-		if (tw < bw)
-			_thumbX = ((bw - tw) * 0.5f);
-		else
-			_thumbX = 0; // Reset
-
-		if (tw < bw) tw = bw; // Limit
-
-		[self setContentSize:CGSizeMake(tw, th)];
-	}
-	else // Zero (0) thumbs
-	{
-		[self setContentSize:CGSizeZero];
-	}
-
-	canUpdate = YES; // Enable updates
-}
-
-- (void)layoutSubviews
-{
-	if (CGSizeEqualToSize(_lastViewSize, CGSizeZero) == true)
-	{
-		_lastViewSize = self.bounds.size; // Initial view size
-	}
-	else
-	if (CGSizeEqualToSize(_lastViewSize, self.bounds.size) == false)
-	{
-		_lastViewSize = self.bounds.size; // Track the view size
-
-		[self updateContentSize:_thumbCount]; // Update the content size
-
-		NSMutableArray *requeueCells = [NSMutableArray array]; // Requeue cell list
-
-		NSMutableIndexSet *visibleIndexSet = [self visibleIndexSetForContentOffset];
-
-		for (ReaderThumbView *tvCell in thumbCellsVisible) // Enumerate visible cells
-		{
-			NSInteger index = tvCell.tag; // Get the cell's index value
-
-			if ([visibleIndexSet containsIndex:index] == YES) // Visible cell
-			{
-				tvCell.frame = [self thumbCellFrameForIndex:index]; // Frame
-
-				[visibleIndexSet removeIndex:index]; // Remove from set
-			}
-			else // Add it to the list of cells to requeue
-			{
-				[requeueCells addObject:tvCell];
-			}
-		}
-
-		for (ReaderThumbView *tvCell in requeueCells) // Enumerate requeue cells
-		{
-			[self requeueThumbCell:tvCell]; // Requeue the thumb cell
-		}
-
-		[visibleIndexSet enumerateIndexesUsingBlock: // Enumerate visible indexes
-			^(NSUInteger index, BOOL *stop)
-			{
-				CGRect thumbRect = [self thumbCellFrameForIndex:index]; // Frame
-
-				ReaderThumbView *tvCell = [self dequeueThumbCellWithFrame:thumbRect];
-
-				[delegate thumbsView:self updateThumbCell:tvCell forIndex:index];
-
-				tvCell.tag = index; tvCell.hidden = NO; // Tag and show it
-			}
-		];
-	}
-}
-
-- (void)setThumbSize:(CGSize)thumbSize
-{
-	if (CGSizeEqualToSize(_thumbSize, CGSizeZero) == true)
-	{
-		if (CGSizeEqualToSize(thumbSize, CGSizeZero) == false)
-		{
-			_thumbSize = thumbSize; // Set the maximum thumb size
-		}
-	}
-}
-
-- (void)reloadThumbsCenterOnIndex:(NSInteger)index
-{
-	assert(delegate != nil); // Check delegate
-
-	assert(CGSizeEqualToSize(_thumbSize, CGSizeZero) == false);
-
-	if (self.decelerating == YES) // Stop scroll view movement
-	{
-		[self setContentOffset:self.contentOffset animated:NO];
-	}
-
-	CGPoint newContentOffset = CGPointZero; // At top
-
-	lastContentOffset = CGPointMake(CGFLOAT_MIN, CGFLOAT_MIN);
-
-	[self requeueAllThumbCells]; // Start off fresh
-
-	_thumbCount = 0; // Reset the thumb count to zero
-
-	NSUInteger thumbCount = [delegate numberOfThumbsInThumbsView:self];
-
-	[self updateContentSize:thumbCount]; _thumbCount = thumbCount;
-
-	if (thumbCount > 0) // Have some thumbs
-	{
-		NSInteger boundsHeight = self.bounds.size.height;
-
-		NSInteger maxY = (self.contentSize.height - boundsHeight);
-
-		NSInteger minY = 0; maxY--; if (maxY < minY) maxY = minY; // Limits
-
-		if (index < 0) index = 0; else if (index > thumbCount) index = (thumbCount - 1);
-
-		NSInteger thumbY = ((index / _thumbsX) * _thumbSize.height); // Thumb Y
-
-		NSInteger offsetY = (thumbY - (boundsHeight / 2) + (_thumbSize.height / 2));
-
-		if (offsetY < minY) offsetY = minY; else if (offsetY > maxY) offsetY = maxY;
-
-		newContentOffset.y = offsetY; // Calculated content offset Y position
-	}
-
-	newContentOffset.y -= self.contentInset.top; // Content inset adjust
-
-	if (CGPointEqualToPoint(self.contentOffset, newContentOffset) == false)
-		[self setContentOffset:newContentOffset animated:NO];
-	else
-		[self scrollViewDidScroll:self];
-
-	[self flashScrollIndicators];
-}
-
-- (void)reloadThumbsContentOffset:(CGPoint)newContentOffset
-{
-	assert(delegate != nil); // Check delegate
-
-	assert(CGSizeEqualToSize(_thumbSize, CGSizeZero) == false);
-
-	if (self.decelerating == YES) // Stop scroll view movement
-	{
-		[self setContentOffset:self.contentOffset animated:NO];
-	}
-
-	lastContentOffset = CGPointMake(CGFLOAT_MIN, CGFLOAT_MIN);
-
-	[self requeueAllThumbCells]; // Start off fresh
-
-	_thumbCount = 0; // Reset the thumb count to zero
-
-	NSUInteger thumbCount = [delegate numberOfThumbsInThumbsView:self];
-
-	[self updateContentSize:thumbCount]; _thumbCount = thumbCount;
-
-	if (thumbCount > 0) // Have some thumbs
-	{
-		NSInteger boundsHeight = self.bounds.size.height;
-
-		NSInteger maxY = (self.contentSize.height - boundsHeight);
-
-		NSInteger minY = 0; maxY--; if (maxY < minY) maxY = minY; // Limits
-
-		NSInteger offsetY = newContentOffset.y; // Requested content offset Y
-
-		if (offsetY < minY) offsetY = minY; else if (offsetY > maxY) offsetY = maxY;
-
-		newContentOffset.y = offsetY; newContentOffset.x = 0.0f; // Validated
-	}
-	else // Zero (0) thumbs
-	{
-		newContentOffset = CGPointZero;
-	}
-
-	newContentOffset.y -= self.contentInset.top; // Content inset adjust
-
-	if (CGPointEqualToPoint(self.contentOffset, newContentOffset) == false)
-		[self setContentOffset:newContentOffset animated:NO];
-	else
-		[self scrollViewDidScroll:self];
-
-	[self flashScrollIndicators];
-}
-
-- (void)refreshThumbWithIndex:(NSInteger)index
-{
-	for (ReaderThumbView *tvCell in thumbCellsVisible) // Enumerate visible cells
-	{
-		if (tvCell.tag == index) // Found a visible thumb cell with the index value
-		{
-			if ([delegate respondsToSelector:@selector(thumbsView:refreshThumbCell:forIndex:)])
-			{
-				[delegate thumbsView:self refreshThumbCell:tvCell forIndex:index]; // Refresh
-			}
-
-			break;
-		}
-	}
-}
-
-- (void)refreshVisibleThumbs
-{
-	for (ReaderThumbView *tvCell in thumbCellsVisible) // Enumerate visible cells
-	{
-		if ([delegate respondsToSelector:@selector(thumbsView:refreshThumbCell:forIndex:)])
-		{
-			[delegate thumbsView:self refreshThumbCell:tvCell forIndex:tvCell.tag]; // Refresh
-		}
-	}
-}
-
-- (CGPoint)insetContentOffset
-{
-	CGPoint insetContentOffset = self.contentOffset; // Offset
-
-	insetContentOffset.y += self.contentInset.top; // Inset adjust
-
-	return insetContentOffset; // Adjusted content offset
-}
-
-#pragma mark - UIGestureRecognizer action methods
-
-- (void)handleTapGesture:(UITapGestureRecognizer *)recognizer
-{
-	if (recognizer.state == UIGestureRecognizerStateRecognized) // Handle the tap
-	{
-		CGPoint point = [recognizer locationInView:recognizer.view]; // Tap location
-
-		ReaderThumbView *tvCell = [self thumbCellContainingPoint:point]; // Look for cell
-
-		if (tvCell != nil) [delegate thumbsView:self didSelectThumbWithIndex:tvCell.tag];
-	}
-}
-
-- (void)handlePressGesture:(UILongPressGestureRecognizer *)recognizer
-{
-	if (recognizer.state == UIGestureRecognizerStateBegan) // Handle the press
-	{
-		if ([delegate respondsToSelector:@selector(thumbsView:didPressThumbWithIndex:)])
-		{
-			CGPoint point = [recognizer locationInView:recognizer.view]; // Press location
-
-			ReaderThumbView *tvCell = [self thumbCellContainingPoint:point]; // Look for cell
-
-			if (tvCell != nil) [delegate thumbsView:self didPressThumbWithIndex:tvCell.tag];
-		}
-	}
-}
-
-#pragma mark - UIScrollViewDelegate methods
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView
-{
-	if ((canUpdate == YES) && (_thumbCount > 0)) // Check flag and thumb count
-	{
-		if (CGPointEqualToPoint(scrollView.contentOffset, lastContentOffset) == false)
-		{
-			lastContentOffset = scrollView.contentOffset; // Work around a 'feature'
-
-			CGRect visibleBounds = self.bounds; // Visible bounds in the scroll view
-
-			NSMutableArray *requeueCells = [NSMutableArray array]; // Requeue cell list
-
-			NSMutableIndexSet *visibleCellSet = [NSMutableIndexSet indexSet]; // Visible set
-
-			for (ReaderThumbView *tvCell in thumbCellsVisible) // Enumerate visible cells
-			{
-				if (CGRectIntersectsRect(tvCell.frame, visibleBounds) == true)
-					[visibleCellSet addIndex:tvCell.tag];
-				else
-					[requeueCells addObject:tvCell];
-			}
-
-			for (ReaderThumbView *tvCell in requeueCells) // Enumerate requeue cells
-			{
-				[self requeueThumbCell:tvCell]; // Requeue the thumb cell
-			}
-
-			NSMutableIndexSet *visibleIndexSet = [self visibleIndexSetForContentOffset];
-
-			[visibleIndexSet enumerateIndexesUsingBlock: // Enumerate visible indexes
-				^(NSUInteger index, BOOL *stop)
-				{
-					if ([visibleCellSet containsIndex:index] == NO) // Index not visible
-					{
-						CGRect thumbRect = [self thumbCellFrameForIndex:index]; // Frame
-
-						ReaderThumbView *tvCell = [self dequeueThumbCellWithFrame:thumbRect];
-
-						[delegate thumbsView:self updateThumbCell:tvCell forIndex:index];
-
-						tvCell.tag = index; tvCell.hidden = NO; // Tag and show it
-					}
-				}
-			];
-		}
-	}
-}
-
-#pragma mark - UIResponder instance methods
-
-- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesBegan:touches withEvent:event]; // Message superclass
-
-	if (touchedCell != nil) { [touchedCell showTouched:NO]; touchedCell = nil; }
-
-	if (touches.count == 1) // Show selection on single touch
-	{
-		UITouch *touch = [touches anyObject]; // Get touch from set
-
-		CGPoint point = [touch locationInView:touch.view]; // Touch location
-
-		ReaderThumbView *tvCell = [self thumbCellContainingPoint:point]; // Look for cell
-
-		if (tvCell != nil) { touchedCell = tvCell; [touchedCell showTouched:YES]; }
-	}
-}
-
-- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesCancelled:touches withEvent:event]; // Message superclass
-
-	if (touchedCell != nil) { [touchedCell showTouched:NO]; touchedCell = nil; }
-}
-
-- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesEnded:touches withEvent:event]; // Message superclass
-
-	if (touchedCell != nil) { [touchedCell showTouched:NO]; touchedCell = nil; }
-}
-
-- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
-{
-	[super touchesMoved:touches withEvent:event]; // Message superclass
-}
-
-@end

+ 0 - 53
iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.h

@@ -1,53 +0,0 @@
-//
-//	ReaderViewController.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ReaderDocument.h"
-
-@class ReaderViewController;
-
-@protocol ReaderViewControllerDelegate <NSObject>
-
-@optional // Delegate protocols
-
-- (void)dismissReaderViewController:(ReaderViewController *)viewController;
-
-//TWS
-- (void)handleSingleTapReader;
-- (void)handleSwipeUpDown;
-
-@end
-
-@interface ReaderViewController : UIViewController
-
-@property (nonatomic, weak, readwrite) id <ReaderViewControllerDelegate> delegate;
-
-- (instancetype)initWithReaderDocument:(ReaderDocument *)object;
-
-//TWS
-- (void)updateContentViews;
-
-@end

+ 0 - 928
iOSClient/Library/VFR Pdf Reader/Sources/ReaderViewController.m

@@ -1,928 +0,0 @@
-//
-//	ReaderViewController.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-07-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ReaderViewController.h"
-#import "ThumbsViewController.h"
-#import "ReaderMainToolbar.h"
-#import "ReaderMainPagebar.h"
-#import "ReaderContentView.h"
-#import "ReaderThumbCache.h"
-#import "ReaderThumbQueue.h"
-
-#import <MessageUI/MessageUI.h>
-
-@interface ReaderViewController () <UIScrollViewDelegate, UIGestureRecognizerDelegate, MFMailComposeViewControllerDelegate, UIDocumentInteractionControllerDelegate,
-									ReaderMainToolbarDelegate, ReaderMainPagebarDelegate, ReaderContentViewDelegate, ThumbsViewControllerDelegate>
-@end
-
-@implementation ReaderViewController
-{
-	ReaderDocument *document;
-
-	UIScrollView *theScrollView;
-
-	ReaderMainToolbar *mainToolbar;
-
-	ReaderMainPagebar *mainPagebar;
-
-	NSMutableDictionary *contentViews;
-
-	UIUserInterfaceIdiom userInterfaceIdiom;
-
-	NSInteger currentPage, minimumPage, maximumPage;
-
-	UIDocumentInteractionController *documentInteraction;
-
-	UIPrintInteractionController *printInteraction;
-
-	CGFloat scrollViewOutset;
-
-	CGSize lastAppearSize;
-
-	NSDate *lastHideTime;
-
-	BOOL ignoreDidScroll;
-}
-
-#pragma mark - Constants
-
-#define STATUS_HEIGHT 20.0f
-
-#define TOOLBAR_HEIGHT 44.0f
-#define PAGEBAR_HEIGHT 48.0f
-
-#define SCROLLVIEW_OUTSET_SMALL 4.0f
-#define SCROLLVIEW_OUTSET_LARGE 8.0f
-
-#define TAP_AREA_SIZE 48.0f
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - ReaderViewController methods
-
-- (void)updateContentSize:(UIScrollView *)scrollView
-{
-	CGFloat contentHeight = scrollView.bounds.size.height; // Height
-
-	CGFloat contentWidth = (scrollView.bounds.size.width * maximumPage);
-
-	scrollView.contentSize = CGSizeMake(contentWidth, contentHeight);
-}
-
-- (void)updateContentViews:(UIScrollView *)scrollView
-{
-	[self updateContentSize:scrollView]; // Update content size first
-
-	[contentViews enumerateKeysAndObjectsUsingBlock: // Enumerate content views
-		^(NSNumber *key, ReaderContentView *contentView, BOOL *stop)
-		{
-			NSInteger page = [key integerValue]; // Page number value
-
-			CGRect viewRect = CGRectZero; viewRect.size = scrollView.bounds.size;
-
-			viewRect.origin.x = (viewRect.size.width * (page - 1)); // Update X
-
-			contentView.frame = CGRectInset(viewRect, scrollViewOutset, 0.0f);
-		}
-	];
-
-	NSInteger page = currentPage; // Update scroll view offset to current page
-
-	CGPoint contentOffset = CGPointMake((scrollView.bounds.size.width * (page - 1)), 0.0f);
-
-	if (CGPointEqualToPoint(scrollView.contentOffset, contentOffset) == false) // Update
-	{
-		scrollView.contentOffset = contentOffset; // Update content offset
-	}
-
-	[mainToolbar setBookmarkState:[document.bookmarks containsIndex:page]];
-
-	[mainPagebar updatePagebar]; // Update page bar
-}
-
-- (void)addContentView:(UIScrollView *)scrollView page:(NSInteger)page
-{
-	CGRect viewRect = CGRectZero; viewRect.size = scrollView.bounds.size;
-
-	viewRect.origin.x = (viewRect.size.width * (page - 1)); viewRect = CGRectInset(viewRect, scrollViewOutset, 0.0f);
-
-	NSURL *fileURL = document.fileURL; NSString *phrase = document.password; NSString *guid = document.guid; // Document properties
-
-	ReaderContentView *contentView = [[ReaderContentView alloc] initWithFrame:viewRect fileURL:fileURL page:page password:phrase]; // ReaderContentView
-
-	contentView.message = self; [contentViews setObject:contentView forKey:[NSNumber numberWithInteger:page]]; [scrollView addSubview:contentView];
-
-	[contentView showPageThumb:fileURL page:page password:phrase guid:guid]; // Request page preview thumb
-}
-
-- (void)layoutContentViews:(UIScrollView *)scrollView
-{
-	CGFloat viewWidth = scrollView.bounds.size.width; // View width
-
-	CGFloat contentOffsetX = scrollView.contentOffset.x; // Content offset X
-
-	NSInteger pageB = ((contentOffsetX + viewWidth - 1.0f) / viewWidth); // Pages
-
-	NSInteger pageA = (contentOffsetX / viewWidth); pageB += 2; // Add extra pages
-
-	if (pageA < minimumPage) pageA = minimumPage; if (pageB > maximumPage) pageB = maximumPage;
-
-	NSRange pageRange = NSMakeRange(pageA, (pageB - pageA + 1)); // Make page range (A to B)
-
-	NSMutableIndexSet *pageSet = [NSMutableIndexSet indexSetWithIndexesInRange:pageRange];
-
-	for (NSNumber *key in [contentViews allKeys]) // Enumerate content views
-	{
-		NSInteger page = [key integerValue]; // Page number value
-
-		if ([pageSet containsIndex:page] == NO) // Remove content view
-		{
-			ReaderContentView *contentView = [contentViews objectForKey:key];
-
-			[contentView removeFromSuperview]; [contentViews removeObjectForKey:key];
-		}
-		else // Visible content view - so remove it from page set
-		{
-			[pageSet removeIndex:page];
-		}
-	}
-
-	NSInteger pages = pageSet.count;
-
-	if (pages > 0) // We have pages to add
-	{
-		NSEnumerationOptions options = 0; // Default
-
-		if (pages == 2) // Handle case of only two content views
-		{
-			if ((maximumPage > 2) && ([pageSet lastIndex] == maximumPage)) options = NSEnumerationReverse;
-		}
-		else if (pages == 3) // Handle three content views - show the middle one first
-		{
-			NSMutableIndexSet *workSet = [pageSet mutableCopy]; options = NSEnumerationReverse;
-
-			[workSet removeIndex:[pageSet firstIndex]]; [workSet removeIndex:[pageSet lastIndex]];
-
-			NSInteger page = [workSet firstIndex]; [pageSet removeIndex:page];
-
-			[self addContentView:scrollView page:page];
-		}
-
-		[pageSet enumerateIndexesWithOptions:options usingBlock: // Enumerate page set
-			^(NSUInteger page, BOOL *stop)
-			{
-				[self addContentView:scrollView page:page];
-			}
-		];
-	}
-}
-
-- (void)handleScrollViewDidEnd:(UIScrollView *)scrollView
-{
-	CGFloat viewWidth = scrollView.bounds.size.width; // Scroll view width
-
-	CGFloat contentOffsetX = scrollView.contentOffset.x; // Content offset X
-
-	NSInteger page = (contentOffsetX / viewWidth); page++; // Page number
-
-	if (page != currentPage) // Only if on different page
-	{
-		currentPage = page; document.pageNumber = [NSNumber numberWithInteger:page];
-
-		[contentViews enumerateKeysAndObjectsUsingBlock: // Enumerate content views
-			^(NSNumber *key, ReaderContentView *contentView, BOOL *stop)
-			{
-				if ([key integerValue] != page) [contentView zoomResetAnimated:NO];
-			}
-		];
-
-		[mainToolbar setBookmarkState:[document.bookmarks containsIndex:page]];
-
-		[mainPagebar updatePagebar]; // Update page bar
-	}
-}
-
-- (void)showDocumentPage:(NSInteger)page
-{
-	if (page != currentPage) // Only if on different page
-	{
-		if ((page < minimumPage) || (page > maximumPage)) return;
-
-		currentPage = page; document.pageNumber = [NSNumber numberWithInteger:page];
-
-		CGPoint contentOffset = CGPointMake((theScrollView.bounds.size.width * (page - 1)), 0.0f);
-
-		if (CGPointEqualToPoint(theScrollView.contentOffset, contentOffset) == true)
-			[self layoutContentViews:theScrollView];
-		else
-			[theScrollView setContentOffset:contentOffset];
-
-		[contentViews enumerateKeysAndObjectsUsingBlock: // Enumerate content views
-			^(NSNumber *key, ReaderContentView *contentView, BOOL *stop)
-			{
-				if ([key integerValue] != page) [contentView zoomResetAnimated:NO];
-			}
-		];
-
-		[mainToolbar setBookmarkState:[document.bookmarks containsIndex:page]];
-
-		[mainPagebar updatePagebar]; // Update page bar
-	}
-}
-
-- (void)showDocument
-{
-	[self updateContentSize:theScrollView]; // Update content size first
-
-	[self showDocumentPage:[document.pageNumber integerValue]]; // Show page
-
-	document.lastOpen = [NSDate date]; // Update document last opened date
-}
-
-- (void)closeDocument
-{
-	if (printInteraction != nil) [printInteraction dismissAnimated:NO];
-
-	[document archiveDocumentProperties]; // Save any ReaderDocument changes
-
-	[[ReaderThumbQueue sharedInstance] cancelOperationsWithGUID:document.guid];
-
-	[[ReaderThumbCache sharedInstance] removeAllObjects]; // Empty the thumb cache
-
-	if ([delegate respondsToSelector:@selector(dismissReaderViewController:)] == YES)
-	{
-		[delegate dismissReaderViewController:self]; // Dismiss the ReaderViewController
-	}
-	else // We have a "Delegate must respond to -dismissReaderViewController:" error
-	{
-		NSAssert(NO, @"Delegate must respond to -dismissReaderViewController:");
-	}
-}
-
-#pragma mark - UIViewController methods
-
-- (instancetype)initWithReaderDocument:(ReaderDocument *)object
-{
-	if ((self = [super initWithNibName:nil bundle:nil])) // Initialize superclass
-	{
-		if ((object != nil) && ([object isKindOfClass:[ReaderDocument class]])) // Valid object
-		{
-			userInterfaceIdiom = [UIDevice currentDevice].userInterfaceIdiom; // User interface idiom
-
-			NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; // Default notification center
-
-			[notificationCenter addObserver:self selector:@selector(applicationWillResign:) name:UIApplicationWillTerminateNotification object:nil];
-
-			[notificationCenter addObserver:self selector:@selector(applicationWillResign:) name:UIApplicationWillResignActiveNotification object:nil];
-
-			scrollViewOutset = ((userInterfaceIdiom == UIUserInterfaceIdiomPad) ? SCROLLVIEW_OUTSET_LARGE : SCROLLVIEW_OUTSET_SMALL);
-
-			[object updateDocumentProperties]; document = object; // Retain the supplied ReaderDocument object for our use
-
-			[ReaderThumbCache touchThumbCacheWithGUID:object.guid]; // Touch the document thumb cache directory
-		}
-		else // Invalid ReaderDocument object
-		{
-			self = nil;
-		}
-	}
-
-	return self;
-}
-
-- (void)dealloc
-{
-	[[NSNotificationCenter defaultCenter] removeObserver:self];
-}
-
-- (void)viewDidLoad
-{
-	[super viewDidLoad];
-
-	assert(document != nil); // Must have a valid ReaderDocument
-
-	self.view.backgroundColor = [UIColor grayColor]; // Neutral gray
-
-	UIView *fakeStatusBar = nil; CGRect viewRect = self.view.bounds; // View bounds
-
-	if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) // iOS 7+
-	{
-		if ([self prefersStatusBarHidden] == NO) // Visible status bar
-		{
-			CGRect statusBarRect = viewRect; statusBarRect.size.height = STATUS_HEIGHT;
-			fakeStatusBar = [[UIView alloc] initWithFrame:statusBarRect]; // UIView
-			fakeStatusBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			fakeStatusBar.backgroundColor = [UIColor blackColor];
-			fakeStatusBar.contentMode = UIViewContentModeRedraw;
-			fakeStatusBar.userInteractionEnabled = NO;
-
-			viewRect.origin.y += STATUS_HEIGHT; viewRect.size.height -= STATUS_HEIGHT;
-		}
-	}
-
-	CGRect scrollViewRect = CGRectInset(viewRect, -scrollViewOutset, 0.0f);
-	theScrollView = [[UIScrollView alloc] initWithFrame:scrollViewRect]; // All
-	theScrollView.autoresizesSubviews = NO; theScrollView.contentMode = UIViewContentModeRedraw;
-	theScrollView.showsHorizontalScrollIndicator = NO; theScrollView.showsVerticalScrollIndicator = NO;
-	theScrollView.scrollsToTop = NO; theScrollView.delaysContentTouches = NO; theScrollView.pagingEnabled = YES;
-	theScrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
-	theScrollView.backgroundColor = [UIColor clearColor]; theScrollView.delegate = self;
-	[self.view addSubview:theScrollView];
-
-	CGRect toolbarRect = viewRect; toolbarRect.size.height = TOOLBAR_HEIGHT;
-	mainToolbar = [[ReaderMainToolbar alloc] initWithFrame:toolbarRect document:document]; // ReaderMainToolbar
-	mainToolbar.delegate = self; // ReaderMainToolbarDelegate
-	//TWS [self.view addSubview:mainToolbar];
-
-	CGRect pagebarRect = self.view.bounds; pagebarRect.size.height = PAGEBAR_HEIGHT;
-	pagebarRect.origin.y = (self.view.bounds.size.height - pagebarRect.size.height);
-	mainPagebar = [[ReaderMainPagebar alloc] initWithFrame:pagebarRect document:document]; // ReaderMainPagebar
-	mainPagebar.delegate = self; // ReaderMainPagebarDelegate
-	[self.view addSubview:mainPagebar];
-
-	if (fakeStatusBar != nil) [self.view addSubview:fakeStatusBar]; // Add status bar background view
-
-	UITapGestureRecognizer *singleTapOne = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
-	singleTapOne.numberOfTouchesRequired = 1; singleTapOne.numberOfTapsRequired = 1; singleTapOne.delegate = self;
-	[self.view addGestureRecognizer:singleTapOne];
-
-	UITapGestureRecognizer *doubleTapOne = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
-	doubleTapOne.numberOfTouchesRequired = 1; doubleTapOne.numberOfTapsRequired = 2; doubleTapOne.delegate = self;
-	[self.view addGestureRecognizer:doubleTapOne];
-
-	UITapGestureRecognizer *doubleTapTwo = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
-	doubleTapTwo.numberOfTouchesRequired = 2; doubleTapTwo.numberOfTapsRequired = 2; doubleTapTwo.delegate = self;
-	[self.view addGestureRecognizer:doubleTapTwo];
-    
-    UISwipeGestureRecognizer *swipeUpDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUpDown:)];
-    swipeUpDown.direction = UISwipeGestureRecognizerDirectionDown | UISwipeGestureRecognizerDirectionUp;
-    [self.view addGestureRecognizer:swipeUpDown];
-
-	[singleTapOne requireGestureRecognizerToFail:doubleTapOne]; // Single tap requires double tap to fail
-
-	contentViews = [NSMutableDictionary new]; lastHideTime = [NSDate date];
-
-	minimumPage = 1; maximumPage = [document.pageCount integerValue];
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-	[super viewWillAppear:animated];
-
-	if (CGSizeEqualToSize(lastAppearSize, CGSizeZero) == false)
-	{
-		if (CGSizeEqualToSize(lastAppearSize, self.view.bounds.size) == false)
-		{
-			[self updateContentViews:theScrollView]; // Update content views
-		}
-
-		lastAppearSize = CGSizeZero; // Reset view size tracking
-	}
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-	[super viewDidAppear:animated];
-
-	if (CGSizeEqualToSize(theScrollView.contentSize, CGSizeZero) == true)
-	{
-		[self performSelector:@selector(showDocument) withObject:nil afterDelay:0.0];
-	}
-
-#if (READER_DISABLE_IDLE == TRUE) // Option
-
-	[UIApplication sharedApplication].idleTimerDisabled = YES;
-
-#endif // end of READER_DISABLE_IDLE Option
-}
-
-- (void)viewWillDisappear:(BOOL)animated
-{
-	[super viewWillDisappear:animated];
-
-	lastAppearSize = self.view.bounds.size; // Track view size
-
-#if (READER_DISABLE_IDLE == TRUE) // Option
-
-	[UIApplication sharedApplication].idleTimerDisabled = NO;
-
-#endif // end of READER_DISABLE_IDLE Option
-}
-
-- (void)viewDidDisappear:(BOOL)animated
-{
-	[super viewDidDisappear:animated];
-}
-
-- (void)viewDidUnload
-{
-#ifdef DEBUG
-	NSLog(@"%s", __FUNCTION__);
-#endif
-
-	mainToolbar = nil; mainPagebar = nil;
-
-	theScrollView = nil; contentViews = nil; lastHideTime = nil;
-
-	documentInteraction = nil; printInteraction = nil;
-
-	lastAppearSize = CGSizeZero; currentPage = 0;
-
-	[super viewDidUnload];
-}
-
-- (BOOL)prefersStatusBarHidden
-{
-	return YES;
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle
-{
-	return UIStatusBarStyleLightContent;
-}
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
-{
-	return YES;
-}
-
-- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
-{
-	if (userInterfaceIdiom == UIUserInterfaceIdiomPad) if (printInteraction != nil) [printInteraction dismissAnimated:NO];
-
-	ignoreDidScroll = YES;
-}
-
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
-{
-	if (CGSizeEqualToSize(theScrollView.contentSize, CGSizeZero) == false)
-	{
-		[self updateContentViews:theScrollView]; lastAppearSize = CGSizeZero;
-	}
-}
-
-- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
-{
-	ignoreDidScroll = NO;
-}
-
-//TWS
-- (void)updateContentViews
-{
-    if (currentPage > 0) {
-        [self updateContentViews:theScrollView];
-    }
-}
-
-- (void)didReceiveMemoryWarning
-{
-#ifdef DEBUG
-	NSLog(@"%s", __FUNCTION__);
-#endif
-
-	[super didReceiveMemoryWarning];
-}
-
-#pragma mark - UIScrollViewDelegate methods
-
-- (void)scrollViewDidScroll:(UIScrollView *)scrollView
-{
-	if (ignoreDidScroll == NO) [self layoutContentViews:scrollView];
-}
-
-- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
-{
-	[self handleScrollViewDidEnd:scrollView];
-}
-
-- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
-{
-	[self handleScrollViewDidEnd:scrollView];
-}
-
-#pragma mark - UIGestureRecognizerDelegate methods
-
-- (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldReceiveTouch:(UITouch *)touch
-{
-	if ([touch.view isKindOfClass:[UIScrollView class]]) return YES;
-
-	return NO;
-}
-
-#pragma mark - UIGestureRecognizer action methods
-
-- (void)decrementPageNumber
-{
-	if ((maximumPage > minimumPage) && (currentPage != minimumPage))
-	{
-		CGPoint contentOffset = theScrollView.contentOffset; // Offset
-
-		contentOffset.x -= theScrollView.bounds.size.width; // View X--
-
-		[theScrollView setContentOffset:contentOffset animated:YES];
-	}
-}
-
-- (void)incrementPageNumber
-{
-	if ((maximumPage > minimumPage) && (currentPage != maximumPage))
-	{
-		CGPoint contentOffset = theScrollView.contentOffset; // Offset
-
-		contentOffset.x += theScrollView.bounds.size.width; // View X++
-
-		[theScrollView setContentOffset:contentOffset animated:YES];
-	}
-}
-
-- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer
-{
-	if (recognizer.state == UIGestureRecognizerStateRecognized)
-	{
-        //TWS
-        if ([self.delegate respondsToSelector:@selector(handleSingleTapReader)])
-            [self.delegate handleSingleTapReader];
-        
-		CGRect viewRect = recognizer.view.bounds; // View bounds
-
-		CGPoint point = [recognizer locationInView:recognizer.view]; // Point
-
-		CGRect areaRect = CGRectInset(viewRect, TAP_AREA_SIZE, 0.0f); // Area rect
-
-		if (CGRectContainsPoint(areaRect, point) == true) // Single tap is inside area
-		{
-			NSNumber *key = [NSNumber numberWithInteger:currentPage]; // Page number key
-
-			ReaderContentView *targetView = [contentViews objectForKey:key]; // View
-
-			id target = [targetView processSingleTap:recognizer]; // Target object
-
-			if (target != nil) // Handle the returned target object
-			{
-				if ([target isKindOfClass:[NSURL class]]) // Open a URL
-				{
-					NSURL *url = (NSURL *)target; // Cast to a NSURL object
-
-					if (url.scheme == nil) // Handle a missing URL scheme
-					{
-						NSString *www = url.absoluteString; // Get URL string
-
-						if ([www hasPrefix:@"www"] == YES) // Check for 'www' prefix
-						{
-							NSString *http = [[NSString alloc] initWithFormat:@"http://%@", www];
-
-							url = [NSURL URLWithString:http]; // Proper http-based URL
-						}
-					}
-
-					if ([[UIApplication sharedApplication] openURL:url] == NO)
-					{
-						#ifdef DEBUG
-							NSLog(@"%s '%@'", __FUNCTION__, url); // Bad or unknown URL
-						#endif
-					}
-				}
-				else // Not a URL, so check for another possible object type
-				{
-					if ([target isKindOfClass:[NSNumber class]]) // Goto page
-					{
-						NSInteger number = [target integerValue]; // Number
-
-						[self showDocumentPage:number]; // Show the page
-					}
-				}
-			}
-			else // Nothing active tapped in the target content view
-			{
-				if ([lastHideTime timeIntervalSinceNow] < -0.75) // Delay since hide
-				{
-					if ((mainToolbar.alpha < 1.0f) || (mainPagebar.alpha < 1.0f)) // Hidden
-					{
-						[mainToolbar showToolbar]; [mainPagebar showPagebar]; // Show
-					}
-				}
-			}
-
-			return;
-		}
-
-		CGRect nextPageRect = viewRect;
-		nextPageRect.size.width = TAP_AREA_SIZE;
-		nextPageRect.origin.x = (viewRect.size.width - TAP_AREA_SIZE);
-
-		if (CGRectContainsPoint(nextPageRect, point) == true) // page++
-		{
-			[self incrementPageNumber]; return;
-		}
-
-		CGRect prevPageRect = viewRect;
-		prevPageRect.size.width = TAP_AREA_SIZE;
-
-		if (CGRectContainsPoint(prevPageRect, point) == true) // page--
-		{
-			[self decrementPageNumber]; return;
-		}
-	}
-}
-
-- (void)handleDoubleTap:(UITapGestureRecognizer *)recognizer
-{
-	if (recognizer.state == UIGestureRecognizerStateRecognized)
-	{
-		CGRect viewRect = recognizer.view.bounds; // View bounds
-
-		CGPoint point = [recognizer locationInView:recognizer.view]; // Point
-
-		CGRect zoomArea = CGRectInset(viewRect, TAP_AREA_SIZE, TAP_AREA_SIZE); // Area
-
-		if (CGRectContainsPoint(zoomArea, point) == true) // Double tap is inside zoom area
-		{
-			NSNumber *key = [NSNumber numberWithInteger:currentPage]; // Page number key
-
-			ReaderContentView *targetView = [contentViews objectForKey:key]; // View
-
-			switch (recognizer.numberOfTouchesRequired) // Touches count
-			{
-				case 1: // One finger double tap: zoom++
-				{
-					[targetView zoomIncrement:recognizer]; break;
-				}
-
-				case 2: // Two finger double tap: zoom--
-				{
-					[targetView zoomDecrement:recognizer]; break;
-				}
-			}
-
-			return;
-		}
-
-		CGRect nextPageRect = viewRect;
-		nextPageRect.size.width = TAP_AREA_SIZE;
-		nextPageRect.origin.x = (viewRect.size.width - TAP_AREA_SIZE);
-
-		if (CGRectContainsPoint(nextPageRect, point) == true) // page++
-		{
-			[self incrementPageNumber]; return;
-		}
-
-		CGRect prevPageRect = viewRect;
-		prevPageRect.size.width = TAP_AREA_SIZE;
-
-		if (CGRectContainsPoint(prevPageRect, point) == true) // page--
-		{
-			[self decrementPageNumber]; return;
-		}
-	}
-}
-
-- (void)handleSwipeUpDown:(UITapGestureRecognizer *)recognizer
-{
-    //TWS
-    if ([self.delegate respondsToSelector:@selector(handleSwipeUpDown)])
-        [self.delegate handleSwipeUpDown];
-}
-
-#pragma mark - ReaderContentViewDelegate methods
-
-- (void)contentView:(ReaderContentView *)contentView touchesBegan:(NSSet *)touches
-{
-	if ((mainToolbar.alpha > 0.0f) || (mainPagebar.alpha > 0.0f))
-	{
-		if (touches.count == 1) // Single touches only
-		{
-			UITouch *touch = [touches anyObject]; // Touch info
-
-			CGPoint point = [touch locationInView:self.view]; // Touch location
-
-			CGRect areaRect = CGRectInset(self.view.bounds, TAP_AREA_SIZE, TAP_AREA_SIZE);
-
-			if (CGRectContainsPoint(areaRect, point) == false) return;
-		}
-
-		[mainToolbar hideToolbar]; [mainPagebar hidePagebar]; // Hide
-
-		lastHideTime = [NSDate date]; // Set last hide time
-	}
-}
-
-#pragma mark - ReaderMainToolbarDelegate methods
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar doneButton:(UIButton *)button
-{
-#if (READER_STANDALONE == FALSE) // Option
-
-	[self closeDocument]; // Close ReaderViewController
-
-#endif // end of READER_STANDALONE Option
-}
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar thumbsButton:(UIButton *)button
-{
-#if (READER_ENABLE_THUMBS == TRUE) // Option
-
-    //TWS
-    [[UIApplication sharedApplication] setStatusBarHidden:YES];
-    
-	if (printInteraction != nil) [printInteraction dismissAnimated:NO];
-
-	ThumbsViewController *thumbsViewController = [[ThumbsViewController alloc] initWithReaderDocument:document];
-
-	thumbsViewController.title = self.title; thumbsViewController.delegate = self; // ThumbsViewControllerDelegate
-
-	thumbsViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
-	thumbsViewController.modalPresentationStyle = UIModalPresentationFullScreen;
-
-	[self presentViewController:thumbsViewController animated:NO completion:NULL];
-
-#endif // end of READER_ENABLE_THUMBS Option
-}
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar exportButton:(UIButton *)button
-{
-	if (printInteraction != nil) [printInteraction dismissAnimated:YES];
-
-	NSURL *fileURL = document.fileURL; // Document file URL
-
-	documentInteraction = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
-
-	documentInteraction.delegate = self; // UIDocumentInteractionControllerDelegate
-
-	[documentInteraction presentOpenInMenuFromRect:button.bounds inView:button animated:YES];
-}
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar printButton:(UIButton *)button
-{
-	if ([UIPrintInteractionController isPrintingAvailable] == YES)
-	{
-		NSURL *fileURL = document.fileURL; // Document file URL
-
-		if ([UIPrintInteractionController canPrintURL:fileURL] == YES)
-		{
-			printInteraction = [UIPrintInteractionController sharedPrintController];
-
-			UIPrintInfo *printInfo = [UIPrintInfo printInfo];
-			printInfo.duplex = UIPrintInfoDuplexLongEdge;
-			printInfo.outputType = UIPrintInfoOutputGeneral;
-			printInfo.jobName = document.fileName;
-
-			printInteraction.printInfo = printInfo;
-			printInteraction.printingItem = fileURL;
-			printInteraction.showsPageRange = YES;
-
-			if (userInterfaceIdiom == UIUserInterfaceIdiomPad) // Large device printing
-			{
-				[printInteraction presentFromRect:button.bounds inView:button animated:YES completionHandler:
-					^(UIPrintInteractionController *pic, BOOL completed, NSError *error)
-					{
-						#ifdef DEBUG
-							if ((completed == NO) && (error != nil)) NSLog(@"%s %@", __FUNCTION__, error);
-						#endif
-					}
-				];
-			}
-			else // Handle printing on small device
-			{
-				[printInteraction presentAnimated:YES completionHandler:
-					^(UIPrintInteractionController *pic, BOOL completed, NSError *error)
-					{
-						#ifdef DEBUG
-							if ((completed == NO) && (error != nil)) NSLog(@"%s %@", __FUNCTION__, error);
-						#endif
-					}
-				];
-			}
-		}
-	}
-}
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar emailButton:(UIButton *)button
-{
-	if ([MFMailComposeViewController canSendMail] == NO) return;
-
-	if (printInteraction != nil) [printInteraction dismissAnimated:YES];
-
-	unsigned long long fileSize = [document.fileSize unsignedLongLongValue];
-
-	if (fileSize < 15728640ull) // Check attachment size limit (15MB)
-	{
-		NSURL *fileURL = document.fileURL; NSString *fileName = document.fileName;
-
-		NSData *attachment = [NSData dataWithContentsOfURL:fileURL options:(NSDataReadingMapped|NSDataReadingUncached) error:nil];
-
-		if (attachment != nil) // Ensure that we have valid document file attachment data available
-		{
-			MFMailComposeViewController *mailComposer = [MFMailComposeViewController new];
-
-			[mailComposer addAttachmentData:attachment mimeType:@"application/pdf" fileName:fileName];
-
-			[mailComposer setSubject:fileName]; // Use the document file name for the subject
-
-			mailComposer.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
-			mailComposer.modalPresentationStyle = UIModalPresentationFormSheet;
-
-			mailComposer.mailComposeDelegate = self; // MFMailComposeViewControllerDelegate
-
-			[self presentViewController:mailComposer animated:YES completion:NULL];
-		}
-	}
-}
-
-- (void)tappedInToolbar:(ReaderMainToolbar *)toolbar markButton:(UIButton *)button
-{
-#if (READER_BOOKMARKS == TRUE) // Option
-
-	if (printInteraction != nil) [printInteraction dismissAnimated:YES];
-
-	if ([document.bookmarks containsIndex:currentPage]) // Remove bookmark
-	{
-		[document.bookmarks removeIndex:currentPage]; [mainToolbar setBookmarkState:NO];
-	}
-	else // Add the bookmarked page number to the bookmark index set
-	{
-		[document.bookmarks addIndex:currentPage]; [mainToolbar setBookmarkState:YES];
-	}
-
-#endif // end of READER_BOOKMARKS Option
-}
-
-#pragma mark - MFMailComposeViewControllerDelegate methods
-
-- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
-{
-#ifdef DEBUG
-	if ((result == MFMailComposeResultFailed) && (error != NULL)) NSLog(@"%@", error);
-#endif
-
-	[self dismissViewControllerAnimated:YES completion:NULL];
-}
-
-#pragma mark - UIDocumentInteractionControllerDelegate methods
-
-- (void)documentInteractionControllerDidDismissOpenInMenu:(UIDocumentInteractionController *)controller
-{
-	documentInteraction = nil;
-}
-
-#pragma mark - ThumbsViewControllerDelegate methods
-
-- (void)thumbsViewController:(ThumbsViewController *)viewController gotoPage:(NSInteger)page
-{
-#if (READER_ENABLE_THUMBS == TRUE) // Option
-
-	[self showDocumentPage:page];
-
-#endif // end of READER_ENABLE_THUMBS Option
-}
-
-- (void)dismissThumbsViewController:(ThumbsViewController *)viewController
-{
-#if (READER_ENABLE_THUMBS == TRUE) // Option
-
-	[self dismissViewControllerAnimated:NO completion:NULL];
-
-#endif // end of READER_ENABLE_THUMBS Option
-}
-
-#pragma mark - ReaderMainPagebarDelegate methods
-
-- (void)pagebar:(ReaderMainPagebar *)pagebar gotoPage:(NSInteger)page
-{
-	[self showDocumentPage:page];
-}
-
-#pragma mark - UIApplication notification methods
-
-- (void)applicationWillResign:(NSNotification *)notification
-{
-	[document archiveDocumentProperties]; // Save any ReaderDocument changes
-
-	if (userInterfaceIdiom == UIUserInterfaceIdiomPad) if (printInteraction != nil) [printInteraction dismissAnimated:NO];
-}
-
-@end

+ 0 - 47
iOSClient/Library/VFR Pdf Reader/Sources/ThumbsMainToolbar.h

@@ -1,47 +0,0 @@
-//
-//	ThumbsMainToolbar.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "UIXToolbarView.h"
-
-@class ThumbsMainToolbar;
-
-@protocol ThumbsMainToolbarDelegate <NSObject>
-
-@required // Delegate protocols
-
-- (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar doneButton:(UIButton *)button;
-- (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar showControl:(UISegmentedControl *)control;
-
-@end
-
-@interface ThumbsMainToolbar : UIXToolbarView
-
-@property (nonatomic, weak, readwrite) id <ThumbsMainToolbarDelegate> delegate;
-
-- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title;
-
-@end

+ 0 - 169
iOSClient/Library/VFR Pdf Reader/Sources/ThumbsMainToolbar.m

@@ -1,169 +0,0 @@
-//
-//	ThumbsMainToolbar.m
-//	Reader v2.9.0
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ThumbsMainToolbar.h"
-
-@implementation ThumbsMainToolbar
-
-#pragma mark - Constants
-
-#define BUTTON_X 8.0f
-#define BUTTON_Y 8.0f
-
-#define BUTTON_SPACE 8.0f
-#define BUTTON_HEIGHT 30.0f
-
-#define BUTTON_FONT_SIZE 15.0f
-#define TEXT_BUTTON_PADDING 24.0f
-
-#define SHOW_CONTROL_WIDTH 78.0f
-#define ICON_BUTTON_WIDTH 40.0f
-
-#define TITLE_FONT_SIZE 19.0f
-#define TITLE_HEIGHT 28.0f
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - ThumbsMainToolbar instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	return [self initWithFrame:frame title:nil];
-}
-
-- (instancetype)initWithFrame:(CGRect)frame title:(NSString *)title
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		CGFloat viewWidth = self.bounds.size.width; // Toolbar view width
-
-#if (READER_FLAT_UI == TRUE) // Option
-		UIImage *buttonH = nil; UIImage *buttonN = nil;
-#else
-		UIImage *buttonH = [[UIImage imageNamed:@"Reader-Button-H"] stretchableImageWithLeftCapWidth:5 topCapHeight:0];
-		UIImage *buttonN = [[UIImage imageNamed:@"Reader-Button-N"] stretchableImageWithLeftCapWidth:5 topCapHeight:0];
-#endif // end of READER_FLAT_UI Option
-
-		BOOL largeDevice = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad);
-
-		const CGFloat buttonSpacing = BUTTON_SPACE; //const CGFloat iconButtonWidth = ICON_BUTTON_WIDTH;
-
-		CGFloat titleX = BUTTON_X; CGFloat titleWidth = (viewWidth - (titleX + titleX));
-
-		CGFloat leftButtonX = BUTTON_X; // Left-side button start X position
-
-		UIFont *doneButtonFont = [UIFont systemFontOfSize:BUTTON_FONT_SIZE];
-		NSString *doneButtonText = NSLocalizedString(@"Done", @"button text");
-		CGSize doneButtonSize = [doneButtonText sizeWithAttributes:@{NSFontAttributeName : doneButtonFont}];
-		CGFloat doneButtonWidth = (ceil(doneButtonSize.width) + TEXT_BUTTON_PADDING);
-
-		UIButton *doneButton = [UIButton buttonWithType:UIButtonTypeCustom];
-		doneButton.frame = CGRectMake(leftButtonX, BUTTON_Y, doneButtonWidth, BUTTON_HEIGHT);
-		[doneButton setTitleColor:[UIColor colorWithWhite:0.0f alpha:1.0f] forState:UIControlStateNormal];
-		[doneButton setTitleColor:[UIColor colorWithWhite:1.0f alpha:1.0f] forState:UIControlStateHighlighted];
-		[doneButton setTitle:doneButtonText forState:UIControlStateNormal]; doneButton.titleLabel.font = doneButtonFont;
-		[doneButton addTarget:self action:@selector(doneButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-		[doneButton setBackgroundImage:buttonH forState:UIControlStateHighlighted];
-		[doneButton setBackgroundImage:buttonN forState:UIControlStateNormal];
-		doneButton.autoresizingMask = UIViewAutoresizingNone;
-		//doneButton.backgroundColor = [UIColor grayColor];
-		doneButton.exclusiveTouch = YES;
-
-		[self addSubview:doneButton]; //leftButtonX += (doneButtonWidth + buttonSpacing);
-
-		titleX += (doneButtonWidth + buttonSpacing); titleWidth -= (doneButtonWidth + buttonSpacing);
-
-#if (READER_BOOKMARKS == TRUE) // Option
-
-		CGFloat showControlX = (viewWidth - (SHOW_CONTROL_WIDTH + buttonSpacing));
-
-		UIImage *thumbsImage = [UIImage imageNamed:@"Reader-Thumbs"];
-		UIImage *bookmarkImage = [UIImage imageNamed:@"Reader-Mark-Y"];
-		NSArray *buttonItems = [NSArray arrayWithObjects:thumbsImage, bookmarkImage, nil];
-
-		BOOL useTint = [self respondsToSelector:@selector(tintColor)]; // iOS 7 and up
-
-		UISegmentedControl *showControl = [[UISegmentedControl alloc] initWithItems:buttonItems];
-		showControl.frame = CGRectMake(showControlX, BUTTON_Y, SHOW_CONTROL_WIDTH, BUTTON_HEIGHT);
-		showControl.tintColor = (useTint ? [UIColor blackColor] : [UIColor colorWithWhite:0.8f alpha:1.0f]);
-		showControl.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
-		//showControl.segmentedControlStyle = UISegmentedControlStyleBar;
-		showControl.selectedSegmentIndex = 0; // Default segment index
-		//showControl.backgroundColor = [UIColor grayColor];
-		showControl.exclusiveTouch = YES;
-
-		[showControl addTarget:self action:@selector(showControlTapped:) forControlEvents:UIControlEventValueChanged];
-
-		[self addSubview:showControl];
-
-		titleWidth -= (SHOW_CONTROL_WIDTH + buttonSpacing);
-
-#endif // end of READER_BOOKMARKS Option
-
-		if (largeDevice == YES) // Show document filename in toolbar
-		{
-			CGRect titleRect = CGRectMake(titleX, BUTTON_Y, titleWidth, TITLE_HEIGHT);
-
-			UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleRect];
-
-			titleLabel.textAlignment = NSTextAlignmentCenter;
-			titleLabel.font = [UIFont systemFontOfSize:TITLE_FONT_SIZE];
-			titleLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters;
-			titleLabel.textColor = [UIColor colorWithWhite:0.0f alpha:1.0f];
-			titleLabel.backgroundColor = [UIColor clearColor];
-			titleLabel.adjustsFontSizeToFitWidth = YES;
-			titleLabel.minimumScaleFactor = 0.75f;
-			titleLabel.text = title;
-#if (READER_FLAT_UI == FALSE) // Option
-			titleLabel.shadowColor = [UIColor colorWithWhite:0.65f alpha:1.0f];
-			titleLabel.shadowOffset = CGSizeMake(0.0f, 1.0f);
-#endif // end of READER_FLAT_UI Option
-
-			[self addSubview:titleLabel];
-		}
-	}
-
-	return self;
-}
-
-#pragma mark - UISegmentedControl action methods
-
-- (void)showControlTapped:(UISegmentedControl *)control
-{
-	[delegate tappedInToolbar:self showControl:control];
-}
-
-#pragma mark - UIButton action methods
-
-- (void)doneButtonTapped:(UIButton *)button
-{
-	[delegate tappedInToolbar:self doneButton:button];
-}
-
-@end

+ 0 - 66
iOSClient/Library/VFR Pdf Reader/Sources/ThumbsViewController.h

@@ -1,66 +0,0 @@
-//
-//	ThumbsViewController.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "ThumbsMainToolbar.h"
-#import "ReaderThumbsView.h"
-
-@class ReaderDocument;
-@class ThumbsViewController;
-
-@protocol ThumbsViewControllerDelegate <NSObject>
-
-@required // Delegate protocols
-
-- (void)thumbsViewController:(ThumbsViewController *)viewController gotoPage:(NSInteger)page;
-
-- (void)dismissThumbsViewController:(ThumbsViewController *)viewController;
-
-@end
-
-@interface ThumbsViewController : UIViewController
-
-@property (nonatomic, weak, readwrite) id <ThumbsViewControllerDelegate> delegate;
-
-- (instancetype)initWithReaderDocument:(ReaderDocument *)object;
-
-@end
-
-#pragma mark -
-
-//
-//	ThumbsPageThumb class interface
-//
-
-@interface ThumbsPageThumb : ReaderThumbView
-
-- (CGSize)maximumContentSize;
-
-- (void)showText:(NSString *)text;
-
-- (void)showBookmark:(BOOL)show;
-
-@end

+ 0 - 514
iOSClient/Library/VFR Pdf Reader/Sources/ThumbsViewController.m

@@ -1,514 +0,0 @@
-//
-//	ThumbsViewController.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "ThumbsViewController.h"
-#import "ReaderThumbRequest.h"
-#import "ReaderThumbCache.h"
-#import "ReaderDocument.h"
-
-#import <QuartzCore/QuartzCore.h>
-
-@interface ThumbsViewController () <ThumbsMainToolbarDelegate, ReaderThumbsViewDelegate>
-
-@end
-
-@implementation ThumbsViewController
-{
-	ReaderDocument *document;
-
-	ThumbsMainToolbar *mainToolbar;
-
-	ReaderThumbsView *theThumbsView;
-
-	NSMutableArray *bookmarked;
-
-	CGPoint thumbsOffset;
-	CGPoint markedOffset;
-
-	BOOL updateBookmarked;
-	BOOL showBookmarked;
-}
-
-#pragma mark - Constants
-
-#define STATUS_HEIGHT 20.0f
-
-#define TOOLBAR_HEIGHT 44.0f
-
-#define PAGE_THUMB_SMALL 160
-#define PAGE_THUMB_LARGE 256
-
-#pragma mark - Properties
-
-@synthesize delegate;
-
-#pragma mark - UIViewController methods
-
-- (instancetype)initWithReaderDocument:(ReaderDocument *)object
-{
-	if ((self = [super initWithNibName:nil bundle:nil])) // Initialize superclass
-	{
-		if ((object != nil) && ([object isKindOfClass:[ReaderDocument class]])) // Valid object
-		{
-			updateBookmarked = YES; bookmarked = [NSMutableArray new]; // Bookmarked pages
-
-			document = object; // Retain the ReaderDocument object for our use
-		}
-		else // Invalid ReaderDocument object
-		{
-			self = nil;
-		}
-	}
-
-	return self;
-}
-
-- (void)viewDidLoad
-{
-	[super viewDidLoad];
-
-	assert(delegate != nil); assert(document != nil);
-
-	self.view.backgroundColor = [UIColor grayColor]; // Neutral gray
-
-	CGRect scrollViewRect = self.view.bounds; UIView *fakeStatusBar = nil;
-
-	if ([self respondsToSelector:@selector(edgesForExtendedLayout)]) // iOS 7+
-	{
-		if ([self prefersStatusBarHidden] == NO) // Visible status bar
-		{
-			CGRect statusBarRect = self.view.bounds; // Status bar frame
-			statusBarRect.size.height = STATUS_HEIGHT; // Default status height
-			fakeStatusBar = [[UIView alloc] initWithFrame:statusBarRect]; // UIView
-			fakeStatusBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			fakeStatusBar.backgroundColor = [UIColor blackColor];
-			fakeStatusBar.contentMode = UIViewContentModeRedraw;
-			fakeStatusBar.userInteractionEnabled = NO;
-
-			scrollViewRect.origin.y += STATUS_HEIGHT; scrollViewRect.size.height -= STATUS_HEIGHT;
-		}
-	}
-
-	NSString *toolbarTitle = [document.fileName stringByDeletingPathExtension];
-
-	CGRect toolbarRect = scrollViewRect; // Toolbar frame
-	toolbarRect.size.height = TOOLBAR_HEIGHT; // Default toolbar height
-	mainToolbar = [[ThumbsMainToolbar alloc] initWithFrame:toolbarRect title:toolbarTitle]; // ThumbsMainToolbar
-	mainToolbar.delegate = self; // ThumbsMainToolbarDelegate
-	[self.view addSubview:mainToolbar];
-
-	if (fakeStatusBar != nil) [self.view addSubview:fakeStatusBar]; // Add status bar background view
-
-	UIEdgeInsets scrollViewInsets = UIEdgeInsetsZero; // Scroll view toolbar insets
-
-	if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) // iPad
-	{
-		scrollViewRect.origin.y += TOOLBAR_HEIGHT; scrollViewRect.size.height -= TOOLBAR_HEIGHT;
-	}
-	else // Set UIScrollView insets for non-UIUserInterfaceIdiomPad case
-	{
-		scrollViewInsets.top = TOOLBAR_HEIGHT;
-	}
-
-	theThumbsView = [[ReaderThumbsView alloc] initWithFrame:scrollViewRect]; // ReaderThumbsView
-	theThumbsView.contentInset = scrollViewInsets; theThumbsView.scrollIndicatorInsets = scrollViewInsets;
-	theThumbsView.delegate = self; // ReaderThumbsViewDelegate
-	[self.view insertSubview:theThumbsView belowSubview:mainToolbar];
-
-	if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
-	{
-		CGRect viewRect = self.view.bounds; CGSize viewSize = viewRect.size; // View size
-
-		CGFloat min = ((viewSize.width < viewSize.height) ? viewSize.width : viewSize.height);
-
-		CGFloat thumbSize = ((min > 320.0f) ? floorf(min / 3.0f) : PAGE_THUMB_SMALL);
-
-		[theThumbsView setThumbSize:CGSizeMake(thumbSize, thumbSize)];
-	}
-	else // Set thumb size for large (iPad) devices
-	{
-		[theThumbsView setThumbSize:CGSizeMake(PAGE_THUMB_LARGE, PAGE_THUMB_LARGE)];
-	}
-}
-
-- (void)viewWillAppear:(BOOL)animated
-{
-	[super viewWillAppear:animated];
-
-	[theThumbsView reloadThumbsCenterOnIndex:([document.pageNumber integerValue] - 1)]; // Page
-}
-
-- (void)viewDidAppear:(BOOL)animated
-{
-	[super viewDidAppear:animated];
-}
-
-- (void)viewWillDisappear:(BOOL)animated
-{
-	[super viewWillDisappear:animated];
-}
-
-- (void)viewDidDisappear:(BOOL)animated
-{
-	[super viewDidDisappear:animated];
-}
-
-- (void)viewDidUnload
-{
-#ifdef DEBUG
-	NSLog(@"%s", __FUNCTION__);
-#endif
-
-	mainToolbar = nil; theThumbsView = nil;
-
-	[super viewDidUnload];
-}
-
-- (BOOL)prefersStatusBarHidden
-{
-	return YES;
-}
-
-- (UIStatusBarStyle)preferredStatusBarStyle
-{
-	return UIStatusBarStyleLightContent;
-}
-
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
-{
-	return YES;
-}
-
-/*
-- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
-{
-}
-
-- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
-{
-}
-
-- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
-{
-	//if (fromInterfaceOrientation == self.interfaceOrientation) return;
-}
-*/
-
-- (void)didReceiveMemoryWarning
-{
-#ifdef DEBUG
-	NSLog(@"%s", __FUNCTION__);
-#endif
-
-	[super didReceiveMemoryWarning];
-}
-
-#pragma mark - ThumbsMainToolbarDelegate methods
-
-- (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar showControl:(UISegmentedControl *)control
-{
-	switch (control.selectedSegmentIndex)
-	{
-		case 0: // Show all page thumbs
-		{
-			showBookmarked = NO; // Show all thumbs
-
-			markedOffset = [theThumbsView insetContentOffset];
-
-			[theThumbsView reloadThumbsContentOffset:thumbsOffset];
-
-			break; // We're done
-		}
-
-		case 1: // Show bookmarked thumbs
-		{
-			showBookmarked = YES; // Only bookmarked
-
-			thumbsOffset = [theThumbsView insetContentOffset];
-
-			if (updateBookmarked == YES) // Update bookmarked list
-			{
-				[bookmarked removeAllObjects]; // Empty the list first
-
-				[document.bookmarks enumerateIndexesUsingBlock: // Enumerate
-					^(NSUInteger page, BOOL *stop)
-					{
-						[bookmarked addObject:[NSNumber numberWithInteger:page]];
-					}
-				];
-
-				markedOffset = CGPointZero; updateBookmarked = NO; // Reset
-			}
-
-			[theThumbsView reloadThumbsContentOffset:markedOffset];
-
-			break; // We're done
-		}
-	}
-}
-
-- (void)tappedInToolbar:(ThumbsMainToolbar *)toolbar doneButton:(UIButton *)button
-{
-	[delegate dismissThumbsViewController:self]; // Dismiss thumbs display
-}
-
-#pragma mark - UIThumbsViewDelegate methods
-
-- (NSUInteger)numberOfThumbsInThumbsView:(ReaderThumbsView *)thumbsView
-{
-	return (showBookmarked ? bookmarked.count : [document.pageCount integerValue]);
-}
-
-- (id)thumbsView:(ReaderThumbsView *)thumbsView thumbCellWithFrame:(CGRect)frame
-{
-	return [[ThumbsPageThumb alloc] initWithFrame:frame];
-}
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView updateThumbCell:(ThumbsPageThumb *)thumbCell forIndex:(NSInteger)index
-{
-	CGSize size = [thumbCell maximumContentSize]; // Get the cell's maximum content size
-
-	NSInteger page = (showBookmarked ? [[bookmarked objectAtIndex:index] integerValue] : (index + 1));
-
-	[thumbCell showText:[[NSString alloc] initWithFormat:@"%i", (int)page]]; // Page number place holder
-
-	[thumbCell showBookmark:[document.bookmarks containsIndex:page]]; // Show bookmarked status
-
-	NSURL *fileURL = document.fileURL; NSString *guid = document.guid; NSString *phrase = document.password; // Document info
-
-	ReaderThumbRequest *thumbRequest = [ReaderThumbRequest newForView:thumbCell fileURL:fileURL password:phrase guid:guid page:page size:size];
-
-	UIImage *image = [[ReaderThumbCache sharedInstance] thumbRequest:thumbRequest priority:YES]; // Request the thumbnail
-
-	if ([image isKindOfClass:[UIImage class]]) [thumbCell showImage:image]; // Show image from cache
-}
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView refreshThumbCell:(ThumbsPageThumb *)thumbCell forIndex:(NSInteger)index
-{
-	NSInteger page = (showBookmarked ? [[bookmarked objectAtIndex:index] integerValue] : (index + 1));
-
-	[thumbCell showBookmark:[document.bookmarks containsIndex:page]]; // Show bookmarked status
-}
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView didSelectThumbWithIndex:(NSInteger)index
-{
-	NSInteger page = (showBookmarked ? [[bookmarked objectAtIndex:index] integerValue] : (index + 1));
-
-	[delegate thumbsViewController:self gotoPage:page]; // Show the selected page
-
-	[delegate dismissThumbsViewController:self]; // Dismiss thumbs display
-}
-
-- (void)thumbsView:(ReaderThumbsView *)thumbsView didPressThumbWithIndex:(NSInteger)index
-{
-	NSInteger page = (showBookmarked ? [[bookmarked objectAtIndex:index] integerValue] : (index + 1));
-
-	if ([document.bookmarks containsIndex:page]) [document.bookmarks removeIndex:page]; else [document.bookmarks addIndex:page];
-
-	updateBookmarked = YES; [thumbsView refreshThumbWithIndex:index]; // Refresh page thumb
-}
-
-@end
-
-#pragma mark -
-
-//
-//	ThumbsPageThumb class implementation
-//
-
-@implementation ThumbsPageThumb
-{
-	UIView *backView;
-
-	UIView *tintView;
-
-	UILabel *textLabel;
-
-	UIImageView *bookMark;
-
-	CGSize maximumSize;
-
-	CGRect defaultRect;
-}
-
-#pragma mark - Constants
-
-#define CONTENT_INSET 8.0f
-
-#pragma mark - ThumbsPageThumb instance methods
-
-- (CGRect)markRectInImageView
-{
-	CGRect iconRect = bookMark.frame; iconRect.origin.y = (-2.0f);
-
-	iconRect.origin.x = (imageView.bounds.size.width - bookMark.image.size.width - 8.0f);
-
-	return iconRect; // Frame position rect inside of image view
-}
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		imageView.contentMode = UIViewContentModeCenter;
-
-		defaultRect = CGRectInset(self.bounds, CONTENT_INSET, CONTENT_INSET);
-
-		maximumSize = defaultRect.size; // Maximum thumb content size
-
-		CGFloat newWidth = ((defaultRect.size.width / 4.0f) * 3.0f);
-
-		CGFloat offsetX = ((defaultRect.size.width - newWidth) * 0.5f);
-
-		defaultRect.size.width = newWidth; defaultRect.origin.x += offsetX;
-
-		imageView.frame = defaultRect; // Update the image view frame
-
-		CGFloat fontSize = (([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) ? 19.0f : 16.0f);
-
-		textLabel = [[UILabel alloc] initWithFrame:defaultRect];
-
-		textLabel.autoresizesSubviews = NO;
-		textLabel.userInteractionEnabled = NO;
-		textLabel.contentMode = UIViewContentModeRedraw;
-		textLabel.autoresizingMask = UIViewAutoresizingNone;
-		textLabel.textAlignment = NSTextAlignmentCenter;
-		textLabel.font = [UIFont systemFontOfSize:fontSize];
-		textLabel.textColor = [UIColor colorWithWhite:0.24f alpha:1.0f];
-		textLabel.backgroundColor = [UIColor whiteColor];
-
-		[self insertSubview:textLabel belowSubview:imageView];
-
-		backView = [[UIView alloc] initWithFrame:defaultRect];
-
-		backView.autoresizesSubviews = NO;
-		backView.userInteractionEnabled = NO;
-		backView.contentMode = UIViewContentModeRedraw;
-		backView.autoresizingMask = UIViewAutoresizingNone;
-		backView.backgroundColor = [UIColor whiteColor];
-
-#if (READER_SHOW_SHADOWS == TRUE) // Option
-
-		backView.layer.shadowOffset = CGSizeMake(0.0f, 1.0f);
-		backView.layer.shadowRadius = 3.0f; backView.layer.shadowOpacity = 1.0f;
-		backView.layer.shadowPath = [UIBezierPath bezierPathWithRect:backView.bounds].CGPath;
-
-#endif // end of READER_SHOW_SHADOWS Option
-
-		[self insertSubview:backView belowSubview:textLabel];
-
-		tintView = [[UIView alloc] initWithFrame:imageView.bounds];
-
-		tintView.hidden = YES;
-		tintView.autoresizesSubviews = NO;
-		tintView.userInteractionEnabled = NO;
-		tintView.contentMode = UIViewContentModeRedraw;
-		tintView.autoresizingMask = UIViewAutoresizingNone;
-		tintView.backgroundColor = [UIColor colorWithWhite:0.0f alpha:0.25f];
-
-		[imageView addSubview:tintView];
-
-		UIImage *image = [UIImage imageNamed:@"Reader-Mark-Y"];
-
-		bookMark = [[UIImageView alloc] initWithImage:image];
-
-		bookMark.hidden = YES;
-		bookMark.autoresizesSubviews = NO;
-		bookMark.userInteractionEnabled = NO;
-		bookMark.contentMode = UIViewContentModeCenter;
-		bookMark.autoresizingMask = UIViewAutoresizingNone;
-		bookMark.frame = [self markRectInImageView];
-
-		[imageView addSubview:bookMark];
-	}
-
-	return self;
-}
-
-- (CGSize)maximumContentSize
-{
-	return maximumSize;
-}
-
-- (void)showImage:(UIImage *)image
-{
-	NSInteger x = (self.bounds.size.width * 0.5f);
-	NSInteger y = (self.bounds.size.height * 0.5f);
-
-	CGPoint location = CGPointMake(x, y); // Center point
-
-	CGRect viewRect = CGRectZero; viewRect.size = image.size;
-
-	textLabel.bounds = viewRect; textLabel.center = location; // Position
-
-	imageView.bounds = viewRect; imageView.center = location; imageView.image = image;
-
-	bookMark.frame = [self markRectInImageView]; // Position bookmark image
-
-	tintView.frame = imageView.bounds; backView.bounds = viewRect; backView.center = location;
-
-#if (READER_SHOW_SHADOWS == TRUE) // Option
-
-	backView.layer.shadowPath = [UIBezierPath bezierPathWithRect:backView.bounds].CGPath;
-
-#endif // end of READER_SHOW_SHADOWS Option
-}
-
-- (void)reuse
-{
-	[super reuse]; // Reuse thumb view
-
-	textLabel.text = nil; textLabel.frame = defaultRect;
-
-	imageView.image = nil; imageView.frame = defaultRect;
-
-	bookMark.hidden = YES; bookMark.frame = [self markRectInImageView];
-
-	tintView.hidden = YES; tintView.frame = imageView.bounds; backView.frame = defaultRect;
-
-#if (READER_SHOW_SHADOWS == TRUE) // Option
-
-	backView.layer.shadowPath = [UIBezierPath bezierPathWithRect:backView.bounds].CGPath;
-
-#endif // end of READER_SHOW_SHADOWS Option
-}
-
-- (void)showBookmark:(BOOL)show
-{
-	bookMark.hidden = (show ? NO : YES);
-}
-
-- (void)showTouched:(BOOL)touched
-{
-	tintView.hidden = (touched ? NO : YES);
-}
-
-- (void)showText:(NSString *)text
-{
-	textLabel.text = text;
-}
-
-@end

+ 0 - 40
iOSClient/Library/VFR Pdf Reader/Sources/UIXToolbarView.h

@@ -1,40 +0,0 @@
-//
-//	UIXToolbarView.h
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface UIXToolbarView : UIView
-
-@end
-
-#pragma mark -
-
-//
-//	UIXToolbarShadow class interface
-//
-
-@interface UIXToolbarShadow : UIView
-
-@end

+ 0 - 131
iOSClient/Library/VFR Pdf Reader/Sources/UIXToolbarView.m

@@ -1,131 +0,0 @@
-//
-//	UIXToolbarView.m
-//	Reader v2.8.6
-//
-//	Created by Julius Oklamcak on 2011-09-01.
-//	Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
-//
-//	Permission is hereby granted, free of charge, to any person obtaining a copy
-//	of this software and associated documentation files (the "Software"), to deal
-//	in the Software without restriction, including without limitation the rights to
-//	use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-//	of the Software, and to permit persons to whom the Software is furnished to
-//	do so, subject to the following conditions:
-//
-//	The above copyright notice and this permission notice shall be included in all
-//	copies or substantial portions of the Software.
-//
-//	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-//	OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-//	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-//	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-//	WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-//	CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#import "ReaderConstants.h"
-#import "UIXToolbarView.h"
-
-#import <QuartzCore/QuartzCore.h>
-
-@implementation UIXToolbarView
-
-#pragma mark - Constants
-
-#define SHADOW_HEIGHT 4.0f
-
-#pragma mark - UIXToolbarView class methods
-
-+ (Class)layerClass
-{
-#if (READER_FLAT_UI == FALSE) // Option
-	return [CAGradientLayer class];
-#else
-	return [CALayer class];
-#endif // end of READER_FLAT_UI Option
-}
-
-#pragma mark - UIXToolbarView instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = YES;
-		self.userInteractionEnabled = YES;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-
-		if ([self.layer isKindOfClass:[CAGradientLayer class]])
-		{
-			self.backgroundColor = [UIColor clearColor];
-
-			CAGradientLayer *layer = (CAGradientLayer *)self.layer;
-			UIColor *liteColor = [UIColor colorWithWhite:0.92f alpha:0.8f];
-			UIColor *darkColor = [UIColor colorWithWhite:0.32f alpha:0.8f];
-			layer.colors = [NSArray arrayWithObjects:(id)liteColor.CGColor, (id)darkColor.CGColor, nil];
-
-			CGRect shadowRect = self.bounds; shadowRect.origin.y += shadowRect.size.height; shadowRect.size.height = SHADOW_HEIGHT;
-
-			UIXToolbarShadow *shadowView = [[UIXToolbarShadow alloc] initWithFrame:shadowRect];
-
-			[self addSubview:shadowView]; // Add shadow to toolbar
-		}
-		else // Follow The Fuglyosity of Flat Fad
-		{
-			self.backgroundColor = [UIColor colorWithWhite:0.94f alpha:0.94f];
-
-			CGRect lineRect = self.bounds; lineRect.origin.y += lineRect.size.height; lineRect.size.height = 1.0f;
-
-			UIView *lineView = [[UIView alloc] initWithFrame:lineRect];
-			lineView.autoresizesSubviews = NO;
-			lineView.userInteractionEnabled = NO;
-			lineView.contentMode = UIViewContentModeRedraw;
-			lineView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-			lineView.backgroundColor = [UIColor colorWithWhite:0.64f alpha:0.94f];
-			[self addSubview:lineView];
-		}
-	}
-
-	return self;
-}
-
-@end
-
-#pragma mark -
-
-//
-//	UIXToolbarShadow class implementation
-//
-
-@implementation UIXToolbarShadow
-
-#pragma mark - UIXToolbarShadow class methods
-
-+ (Class)layerClass
-{
-	return [CAGradientLayer class];
-}
-
-#pragma mark - UIXToolbarShadow instance methods
-
-- (instancetype)initWithFrame:(CGRect)frame
-{
-	if ((self = [super initWithFrame:frame]))
-	{
-		self.autoresizesSubviews = NO;
-		self.userInteractionEnabled = NO;
-		self.contentMode = UIViewContentModeRedraw;
-		self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
-		self.backgroundColor = [UIColor clearColor];
-
-		CAGradientLayer *layer = (CAGradientLayer *)self.layer;
-		UIColor *blackColor = [UIColor colorWithWhite:0.24f alpha:1.0f];
-		UIColor *clearColor = [UIColor colorWithWhite:0.24f alpha:0.0f];
-		layer.colors = [NSArray arrayWithObjects:(id)blackColor.CGColor, (id)clearColor.CGColor, nil];
-	}
-
-	return self;
-}
-
-@end

+ 60 - 0
iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeader.swift

@@ -0,0 +1,60 @@
+//
+//  NCActionSheetHeader.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 08/11/2018.
+//  Copyright © 2018 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+
+class NCActionSheetHeader: NSObject {
+    
+    @objc static let sharedInstance: NCActionSheetHeader = {
+        let instance = NCActionSheetHeader()
+        return instance
+    }()
+    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+
+    func actionSheetHeader(isDirectory: Bool, iconName: String, ocId: String, fileNameView: String, text: String) -> UIView? {
+        
+        var image: UIImage?
+        
+        // Header
+        if isDirectory {
+            image = CCGraphics.changeThemingColorImage(UIImage.init(named: "folder"), multiplier: 3, color: NCBrandColor.sharedInstance.brandElement)
+        } else if iconName.count > 0 {
+            image = UIImage.init(named: iconName)
+        } else {
+            image = UIImage.init(named: "file")
+        }
+        if FileManager().fileExists(atPath: CCUtility.getDirectoryProviderStorageIconOcId(ocId, fileNameView: fileNameView)) {
+            image = UIImage.init(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(ocId, fileNameView: fileNameView))
+        }
+        
+        let headerView = UINib(nibName: "NCActionSheetHeaderView", bundle: nil).instantiate(withOwner: self, options: nil).first as! NCActionSheetHeaderView
+        
+        headerView.backgroundColor = NCBrandColor.sharedInstance.backgroundForm
+        headerView.imageItem.image = image
+        headerView.label.text = text
+        headerView.label.textColor = NCBrandColor.sharedInstance.icon
+        
+        return headerView
+    }
+}

+ 32 - 0
iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeaderView.swift

@@ -0,0 +1,32 @@
+//
+//  NCActionSheetHeaderView.swift
+//  Nextcloud
+//
+//  Created by Marino Faggiana on 08/10/2018.
+//  Copyright © 2018 Marino Faggiana. All rights reserved.
+//
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import Foundation
+import UIKit
+
+class NCActionSheetHeaderView: UIView {
+    
+    @IBOutlet weak var imageItem: UIImageView!
+    @IBOutlet weak var label: UILabel!
+
+}

+ 51 - 0
iOSClient/Main/ActionSheetHeaderView/NCActionSheetHeaderView.xib

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina5_5" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="I6b-nN-xlb" customClass="NCActionSheetHeaderView" customModule="Nextcloud" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <subviews>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="lfq-lr-NgS" userLabel="ImageItem">
+                    <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="50" id="LyU-cM-aSJ"/>
+                        <constraint firstAttribute="width" constant="50" id="dY1-pJ-pdP"/>
+                    </constraints>
+                </imageView>
+                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yAB-e1-3vF">
+                    <rect key="frame" x="55" y="0.0" width="354" height="50"/>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <nil key="textColor"/>
+                    <nil key="highlightedColor"/>
+                </label>
+            </subviews>
+            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+            <constraints>
+                <constraint firstItem="yAB-e1-3vF" firstAttribute="leading" secondItem="lfq-lr-NgS" secondAttribute="trailing" constant="5" id="0ZQ-29-0WG"/>
+                <constraint firstItem="2A6-rU-2Mc" firstAttribute="bottom" secondItem="yAB-e1-3vF" secondAttribute="bottom" id="BjK-gV-vSx"/>
+                <constraint firstItem="lfq-lr-NgS" firstAttribute="leading" secondItem="2A6-rU-2Mc" secondAttribute="leading" id="cMS-FO-o0J"/>
+                <constraint firstItem="yAB-e1-3vF" firstAttribute="top" secondItem="2A6-rU-2Mc" secondAttribute="top" id="gFc-7X-Z4w"/>
+                <constraint firstItem="lfq-lr-NgS" firstAttribute="top" secondItem="2A6-rU-2Mc" secondAttribute="top" id="nlU-7A-uMz"/>
+                <constraint firstItem="2A6-rU-2Mc" firstAttribute="trailing" secondItem="yAB-e1-3vF" secondAttribute="trailing" constant="5" id="zl1-OY-Erp"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <viewLayoutGuide key="safeArea" id="2A6-rU-2Mc"/>
+            <connections>
+                <outlet property="imageItem" destination="lfq-lr-NgS" id="jW9-9z-oNq"/>
+                <outlet property="label" destination="yAB-e1-3vF" id="SiI-G5-9og"/>
+            </connections>
+            <point key="canvasLocation" x="-479.71014492753625" y="196.46739130434784"/>
+        </view>
+    </objects>
+</document>

+ 1 - 1
iOSClient/Main/NCDetailNavigationController.swift

@@ -56,7 +56,7 @@ class NCDetailNavigationController: UINavigationController {
     
     @objc func openMenuMore() {
         if let metadata = appDelegate.activeDetail?.metadata {
-            self.toggleMoreMenu(viewController: self, metadata: metadata)
+            //self.toggleMoreMenu(viewController: self, metadata: metadata)
         }
     }
 }