react-native-pdf-sdk 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/PdfSdk.podspec +32 -0
- package/README.md +270 -2
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +132 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/cpp-adapter.cpp +9 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfDocument.kt +72 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfSdk.kt +17 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/HybridPdfView.kt +194 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfDocumentLayout.kt +109 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfFailure.kt +36 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfPageSource.kt +141 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSdkPackage.kt +35 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSourceLoader.kt +117 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfSurface.kt +839 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfTileStore.kt +210 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/PdfViewport.kt +255 -0
- package/android/src/main/java/com/margelo/nitro/pdfsdk/TileGrid.kt +276 -0
- package/ios/HybridPdfDocument.swift +71 -0
- package/ios/HybridPdfSdk.swift +10 -0
- package/ios/HybridPdfView.swift +202 -0
- package/ios/PdfDocumentLayout.swift +174 -0
- package/ios/PdfFailure.swift +46 -0
- package/ios/PdfImageCache.swift +83 -0
- package/ios/PdfPageSource.swift +221 -0
- package/ios/PdfScrollPlan.swift +108 -0
- package/ios/PdfSourceLoader.swift +120 -0
- package/ios/PdfSurface.swift +711 -0
- package/ios/PdfTileCanvas.swift +148 -0
- package/ios/PdfTileGrid.swift +518 -0
- package/ios/PdfTileStore.swift +346 -0
- package/ios/PdfViewport.swift +200 -0
- package/lib/commonjs/PdfView.js +149 -0
- package/lib/commonjs/PdfView.js.map +1 -0
- package/lib/commonjs/document.js +38 -0
- package/lib/commonjs/document.js.map +1 -0
- package/lib/commonjs/index.js +26 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js +6 -0
- package/lib/commonjs/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/commonjs/specs/PdfView.nitro.js +6 -0
- package/lib/commonjs/specs/PdfView.nitro.js.map +1 -0
- package/lib/module/PdfView.js +143 -0
- package/lib/module/PdfView.js.map +1 -0
- package/lib/module/document.js +34 -0
- package/lib/module/document.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/PdfSdk.nitro.js +4 -0
- package/lib/module/specs/PdfSdk.nitro.js.map +1 -0
- package/lib/module/specs/PdfView.nitro.js +4 -0
- package/lib/module/specs/PdfView.nitro.js.map +1 -0
- package/lib/typescript/src/PdfView.d.ts +65 -0
- package/lib/typescript/src/PdfView.d.ts.map +1 -0
- package/lib/typescript/src/document.d.ts +22 -0
- package/lib/typescript/src/document.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts +60 -0
- package/lib/typescript/src/specs/PdfSdk.nitro.d.ts.map +1 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts +131 -0
- package/lib/typescript/src/specs/PdfView.nitro.d.ts.map +1 -0
- package/nitro.json +40 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.cmake +87 -0
- package/nitrogen/generated/android/PdfSdk+autolinking.gradle +27 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.cpp +84 -0
- package/nitrogen/generated/android/PdfSdkOnLoad.hpp +34 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfErrorEvent.hpp +80 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfLoadEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfPageEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfTapEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JFunc_void_PdfZoomEvent.hpp +77 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.cpp +266 -0
- package/nitrogen/generated/android/c++/JHybridNativePdfViewSpec.hpp +92 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.cpp +87 -0
- package/nitrogen/generated/android/c++/JHybridPdfDocumentSpec.hpp +65 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.cpp +58 -0
- package/nitrogen/generated/android/c++/JHybridPdfSdkSpec.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfErrorCode.hpp +67 -0
- package/nitrogen/generated/android/c++/JPdfErrorEvent.hpp +63 -0
- package/nitrogen/generated/android/c++/JPdfFit.hpp +64 -0
- package/nitrogen/generated/android/c++/JPdfLoadEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfPageEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfPageSize.hpp +61 -0
- package/nitrogen/generated/android/c++/JPdfRenderRequest.hpp +86 -0
- package/nitrogen/generated/android/c++/JPdfTapEvent.hpp +65 -0
- package/nitrogen/generated/android/c++/JPdfViewSource.hpp +84 -0
- package/nitrogen/generated/android/c++/JPdfZoomEvent.hpp +61 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.cpp +108 -0
- package/nitrogen/generated/android/c++/views/JHybridNativePdfViewStateUpdater.hpp +49 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfErrorEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfLoadEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfPageEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfTapEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/Func_void_PdfZoomEvent.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridNativePdfViewSpec.kt +185 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfDocumentSpec.kt +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/HybridPdfSdkSpec.kt +54 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorCode.kt +26 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfErrorEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfFit.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfLoadEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfPageSize.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfRenderRequest.kt +86 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfSdkOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfTapEvent.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfViewSource.kt +66 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/PdfZoomEvent.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewManager.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pdfsdk/views/HybridNativePdfViewStateUpdater.kt +23 -0
- package/nitrogen/generated/ios/PdfSdk+autolinking.rb +62 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.cpp +123 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Bridge.hpp +474 -0
- package/nitrogen/generated/ios/PdfSdk-Swift-Cxx-Umbrella.hpp +88 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.mm +41 -0
- package/nitrogen/generated/ios/PdfSdkAutolinking.swift +38 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridNativePdfViewSpecSwift.hpp +209 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfDocumentSpecSwift.hpp +105 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPdfSdkSpecSwift.hpp +86 -0
- package/nitrogen/generated/ios/c++/views/HybridNativePdfViewComponent.mm +187 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfErrorEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfLoadEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfPageEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfTapEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_PdfZoomEvent.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec.swift +70 -0
- package/nitrogen/generated/ios/swift/HybridNativePdfViewSpec_cxx.swift +438 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec.swift +57 -0
- package/nitrogen/generated/ios/swift/HybridPdfDocumentSpec_cxx.swift +173 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec.swift +55 -0
- package/nitrogen/generated/ios/swift/HybridPdfSdkSpec_cxx.swift +148 -0
- package/nitrogen/generated/ios/swift/PdfErrorCode.swift +52 -0
- package/nitrogen/generated/ios/swift/PdfErrorEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfFit.swift +48 -0
- package/nitrogen/generated/ios/swift/PdfLoadEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfPageEvent.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfPageSize.swift +34 -0
- package/nitrogen/generated/ios/swift/PdfRenderRequest.swift +129 -0
- package/nitrogen/generated/ios/swift/PdfTapEvent.swift +39 -0
- package/nitrogen/generated/ios/swift/PdfViewSource.swift +97 -0
- package/nitrogen/generated/ios/swift/PdfZoomEvent.swift +34 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.cpp +51 -0
- package/nitrogen/generated/shared/c++/HybridNativePdfViewSpec.hpp +112 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridPdfDocumentSpec.hpp +70 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridPdfSdkSpec.hpp +66 -0
- package/nitrogen/generated/shared/c++/PdfErrorCode.hpp +88 -0
- package/nitrogen/generated/shared/c++/PdfErrorEvent.hpp +89 -0
- package/nitrogen/generated/shared/c++/PdfFit.hpp +84 -0
- package/nitrogen/generated/shared/c++/PdfLoadEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfPageEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfPageSize.hpp +87 -0
- package/nitrogen/generated/shared/c++/PdfRenderRequest.hpp +112 -0
- package/nitrogen/generated/shared/c++/PdfTapEvent.hpp +91 -0
- package/nitrogen/generated/shared/c++/PdfViewSource.hpp +97 -0
- package/nitrogen/generated/shared/c++/PdfZoomEvent.hpp +87 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.cpp +226 -0
- package/nitrogen/generated/shared/c++/views/HybridNativePdfViewComponent.hpp +130 -0
- package/nitrogen/generated/shared/json/NativePdfViewConfig.json +23 -0
- package/package.json +80 -4
- package/react-native.config.js +10 -0
- package/src/PdfView.tsx +221 -0
- package/src/document.ts +34 -0
- package/src/index.ts +16 -0
- package/src/specs/PdfSdk.nitro.ts +60 -0
- package/src/specs/PdfView.nitro.ts +149 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativePdfViewSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A class implementation that bridges HybridNativePdfViewSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridNativePdfViewSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::pdfsdk::bridge::swift`)
|
|
22
|
+
* from `PdfSdk-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.pdfsdk.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridNativePdfViewSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridNativePdfViewSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridNativePdfViewSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridNativePdfViewSpec_cxx` that wraps the given `HybridNativePdfViewSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridNativePdfViewSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridNativePdfViewSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridNativePdfViewSpec() -> any HybridNativePdfViewSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridNativePdfViewSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridNativePdfViewSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridNativePdfViewSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridNativePdfViewSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridNativePdfViewSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridNativePdfViewSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridNativePdfViewSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridNativePdfViewSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridNativePdfViewSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var source: PdfViewSource {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return self.__implementation.source
|
|
128
|
+
}
|
|
129
|
+
@inline(__always)
|
|
130
|
+
set {
|
|
131
|
+
self.__implementation.source = newValue
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public final var page: Double {
|
|
136
|
+
@inline(__always)
|
|
137
|
+
get {
|
|
138
|
+
return self.__implementation.page
|
|
139
|
+
}
|
|
140
|
+
@inline(__always)
|
|
141
|
+
set {
|
|
142
|
+
self.__implementation.page = newValue
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
public final var fit: Int32 {
|
|
147
|
+
@inline(__always)
|
|
148
|
+
get {
|
|
149
|
+
return self.__implementation.fit.rawValue
|
|
150
|
+
}
|
|
151
|
+
@inline(__always)
|
|
152
|
+
set {
|
|
153
|
+
self.__implementation.fit = margelo.nitro.pdfsdk.PdfFit(rawValue: newValue)!
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public final var minZoom: Double {
|
|
158
|
+
@inline(__always)
|
|
159
|
+
get {
|
|
160
|
+
return self.__implementation.minZoom
|
|
161
|
+
}
|
|
162
|
+
@inline(__always)
|
|
163
|
+
set {
|
|
164
|
+
self.__implementation.minZoom = newValue
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
public final var maxZoom: Double {
|
|
169
|
+
@inline(__always)
|
|
170
|
+
get {
|
|
171
|
+
return self.__implementation.maxZoom
|
|
172
|
+
}
|
|
173
|
+
@inline(__always)
|
|
174
|
+
set {
|
|
175
|
+
self.__implementation.maxZoom = newValue
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public final var doubleTapZoom: Double {
|
|
180
|
+
@inline(__always)
|
|
181
|
+
get {
|
|
182
|
+
return self.__implementation.doubleTapZoom
|
|
183
|
+
}
|
|
184
|
+
@inline(__always)
|
|
185
|
+
set {
|
|
186
|
+
self.__implementation.doubleTapZoom = newValue
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
public final var pageGap: Double {
|
|
191
|
+
@inline(__always)
|
|
192
|
+
get {
|
|
193
|
+
return self.__implementation.pageGap
|
|
194
|
+
}
|
|
195
|
+
@inline(__always)
|
|
196
|
+
set {
|
|
197
|
+
self.__implementation.pageGap = newValue
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
public final var backdropColor: Double {
|
|
202
|
+
@inline(__always)
|
|
203
|
+
get {
|
|
204
|
+
return self.__implementation.backdropColor
|
|
205
|
+
}
|
|
206
|
+
@inline(__always)
|
|
207
|
+
set {
|
|
208
|
+
self.__implementation.backdropColor = newValue
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
public final var scrollIndicators: Bool {
|
|
213
|
+
@inline(__always)
|
|
214
|
+
get {
|
|
215
|
+
return self.__implementation.scrollIndicators
|
|
216
|
+
}
|
|
217
|
+
@inline(__always)
|
|
218
|
+
set {
|
|
219
|
+
self.__implementation.scrollIndicators = newValue
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public final var onLoad: bridge.std__optional_std__function_void_const_PdfLoadEvent_____event______ {
|
|
224
|
+
@inline(__always)
|
|
225
|
+
get {
|
|
226
|
+
return { () -> bridge.std__optional_std__function_void_const_PdfLoadEvent_____event______ in
|
|
227
|
+
if let __unwrappedValue = self.__implementation.onLoad {
|
|
228
|
+
return bridge.create_std__optional_std__function_void_const_PdfLoadEvent_____event______({ () -> bridge.Func_void_PdfLoadEvent in
|
|
229
|
+
let __closureWrapper = Func_void_PdfLoadEvent(__unwrappedValue)
|
|
230
|
+
return bridge.create_Func_void_PdfLoadEvent(__closureWrapper.toUnsafe())
|
|
231
|
+
}())
|
|
232
|
+
} else {
|
|
233
|
+
return .init()
|
|
234
|
+
}
|
|
235
|
+
}()
|
|
236
|
+
}
|
|
237
|
+
@inline(__always)
|
|
238
|
+
set {
|
|
239
|
+
self.__implementation.onLoad = { () -> ((_ event: PdfLoadEvent) -> Void)? in
|
|
240
|
+
if bridge.has_value_std__optional_std__function_void_const_PdfLoadEvent_____event______(newValue) {
|
|
241
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_PdfLoadEvent_____event______(newValue)
|
|
242
|
+
return { () -> (PdfLoadEvent) -> Void in
|
|
243
|
+
let __wrappedFunction = bridge.wrap_Func_void_PdfLoadEvent(__unwrapped)
|
|
244
|
+
return { (__event: PdfLoadEvent) -> Void in
|
|
245
|
+
__wrappedFunction.call(__event)
|
|
246
|
+
}
|
|
247
|
+
}()
|
|
248
|
+
} else {
|
|
249
|
+
return nil
|
|
250
|
+
}
|
|
251
|
+
}()
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
public final var onPageChange: bridge.std__optional_std__function_void_const_PdfPageEvent_____event______ {
|
|
256
|
+
@inline(__always)
|
|
257
|
+
get {
|
|
258
|
+
return { () -> bridge.std__optional_std__function_void_const_PdfPageEvent_____event______ in
|
|
259
|
+
if let __unwrappedValue = self.__implementation.onPageChange {
|
|
260
|
+
return bridge.create_std__optional_std__function_void_const_PdfPageEvent_____event______({ () -> bridge.Func_void_PdfPageEvent in
|
|
261
|
+
let __closureWrapper = Func_void_PdfPageEvent(__unwrappedValue)
|
|
262
|
+
return bridge.create_Func_void_PdfPageEvent(__closureWrapper.toUnsafe())
|
|
263
|
+
}())
|
|
264
|
+
} else {
|
|
265
|
+
return .init()
|
|
266
|
+
}
|
|
267
|
+
}()
|
|
268
|
+
}
|
|
269
|
+
@inline(__always)
|
|
270
|
+
set {
|
|
271
|
+
self.__implementation.onPageChange = { () -> ((_ event: PdfPageEvent) -> Void)? in
|
|
272
|
+
if bridge.has_value_std__optional_std__function_void_const_PdfPageEvent_____event______(newValue) {
|
|
273
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_PdfPageEvent_____event______(newValue)
|
|
274
|
+
return { () -> (PdfPageEvent) -> Void in
|
|
275
|
+
let __wrappedFunction = bridge.wrap_Func_void_PdfPageEvent(__unwrapped)
|
|
276
|
+
return { (__event: PdfPageEvent) -> Void in
|
|
277
|
+
__wrappedFunction.call(__event)
|
|
278
|
+
}
|
|
279
|
+
}()
|
|
280
|
+
} else {
|
|
281
|
+
return nil
|
|
282
|
+
}
|
|
283
|
+
}()
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
public final var onZoom: bridge.std__optional_std__function_void_const_PdfZoomEvent_____event______ {
|
|
288
|
+
@inline(__always)
|
|
289
|
+
get {
|
|
290
|
+
return { () -> bridge.std__optional_std__function_void_const_PdfZoomEvent_____event______ in
|
|
291
|
+
if let __unwrappedValue = self.__implementation.onZoom {
|
|
292
|
+
return bridge.create_std__optional_std__function_void_const_PdfZoomEvent_____event______({ () -> bridge.Func_void_PdfZoomEvent in
|
|
293
|
+
let __closureWrapper = Func_void_PdfZoomEvent(__unwrappedValue)
|
|
294
|
+
return bridge.create_Func_void_PdfZoomEvent(__closureWrapper.toUnsafe())
|
|
295
|
+
}())
|
|
296
|
+
} else {
|
|
297
|
+
return .init()
|
|
298
|
+
}
|
|
299
|
+
}()
|
|
300
|
+
}
|
|
301
|
+
@inline(__always)
|
|
302
|
+
set {
|
|
303
|
+
self.__implementation.onZoom = { () -> ((_ event: PdfZoomEvent) -> Void)? in
|
|
304
|
+
if bridge.has_value_std__optional_std__function_void_const_PdfZoomEvent_____event______(newValue) {
|
|
305
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_PdfZoomEvent_____event______(newValue)
|
|
306
|
+
return { () -> (PdfZoomEvent) -> Void in
|
|
307
|
+
let __wrappedFunction = bridge.wrap_Func_void_PdfZoomEvent(__unwrapped)
|
|
308
|
+
return { (__event: PdfZoomEvent) -> Void in
|
|
309
|
+
__wrappedFunction.call(__event)
|
|
310
|
+
}
|
|
311
|
+
}()
|
|
312
|
+
} else {
|
|
313
|
+
return nil
|
|
314
|
+
}
|
|
315
|
+
}()
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
public final var onError: bridge.std__optional_std__function_void_const_PdfErrorEvent_____event______ {
|
|
320
|
+
@inline(__always)
|
|
321
|
+
get {
|
|
322
|
+
return { () -> bridge.std__optional_std__function_void_const_PdfErrorEvent_____event______ in
|
|
323
|
+
if let __unwrappedValue = self.__implementation.onError {
|
|
324
|
+
return bridge.create_std__optional_std__function_void_const_PdfErrorEvent_____event______({ () -> bridge.Func_void_PdfErrorEvent in
|
|
325
|
+
let __closureWrapper = Func_void_PdfErrorEvent(__unwrappedValue)
|
|
326
|
+
return bridge.create_Func_void_PdfErrorEvent(__closureWrapper.toUnsafe())
|
|
327
|
+
}())
|
|
328
|
+
} else {
|
|
329
|
+
return .init()
|
|
330
|
+
}
|
|
331
|
+
}()
|
|
332
|
+
}
|
|
333
|
+
@inline(__always)
|
|
334
|
+
set {
|
|
335
|
+
self.__implementation.onError = { () -> ((_ event: PdfErrorEvent) -> Void)? in
|
|
336
|
+
if bridge.has_value_std__optional_std__function_void_const_PdfErrorEvent_____event______(newValue) {
|
|
337
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_PdfErrorEvent_____event______(newValue)
|
|
338
|
+
return { () -> (PdfErrorEvent) -> Void in
|
|
339
|
+
let __wrappedFunction = bridge.wrap_Func_void_PdfErrorEvent(__unwrapped)
|
|
340
|
+
return { (__event: PdfErrorEvent) -> Void in
|
|
341
|
+
__wrappedFunction.call(__event)
|
|
342
|
+
}
|
|
343
|
+
}()
|
|
344
|
+
} else {
|
|
345
|
+
return nil
|
|
346
|
+
}
|
|
347
|
+
}()
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public final var onTap: bridge.std__optional_std__function_void_const_PdfTapEvent_____event______ {
|
|
352
|
+
@inline(__always)
|
|
353
|
+
get {
|
|
354
|
+
return { () -> bridge.std__optional_std__function_void_const_PdfTapEvent_____event______ in
|
|
355
|
+
if let __unwrappedValue = self.__implementation.onTap {
|
|
356
|
+
return bridge.create_std__optional_std__function_void_const_PdfTapEvent_____event______({ () -> bridge.Func_void_PdfTapEvent in
|
|
357
|
+
let __closureWrapper = Func_void_PdfTapEvent(__unwrappedValue)
|
|
358
|
+
return bridge.create_Func_void_PdfTapEvent(__closureWrapper.toUnsafe())
|
|
359
|
+
}())
|
|
360
|
+
} else {
|
|
361
|
+
return .init()
|
|
362
|
+
}
|
|
363
|
+
}()
|
|
364
|
+
}
|
|
365
|
+
@inline(__always)
|
|
366
|
+
set {
|
|
367
|
+
self.__implementation.onTap = { () -> ((_ event: PdfTapEvent) -> Void)? in
|
|
368
|
+
if bridge.has_value_std__optional_std__function_void_const_PdfTapEvent_____event______(newValue) {
|
|
369
|
+
let __unwrapped = bridge.get_std__optional_std__function_void_const_PdfTapEvent_____event______(newValue)
|
|
370
|
+
return { () -> (PdfTapEvent) -> Void in
|
|
371
|
+
let __wrappedFunction = bridge.wrap_Func_void_PdfTapEvent(__unwrapped)
|
|
372
|
+
return { (__event: PdfTapEvent) -> Void in
|
|
373
|
+
__wrappedFunction.call(__event)
|
|
374
|
+
}
|
|
375
|
+
}()
|
|
376
|
+
} else {
|
|
377
|
+
return nil
|
|
378
|
+
}
|
|
379
|
+
}()
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Methods
|
|
384
|
+
@inline(__always)
|
|
385
|
+
public final func goToPage(page: Double, animated: Bool) -> bridge.Result_void_ {
|
|
386
|
+
do {
|
|
387
|
+
try self.__implementation.goToPage(page: page, animated: animated)
|
|
388
|
+
return bridge.create_Result_void_()
|
|
389
|
+
} catch (let __error) {
|
|
390
|
+
let __exceptionPtr = __error.toCpp()
|
|
391
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@inline(__always)
|
|
396
|
+
public final func setZoom(zoom: Double, animated: Bool) -> bridge.Result_void_ {
|
|
397
|
+
do {
|
|
398
|
+
try self.__implementation.setZoom(zoom: zoom, animated: animated)
|
|
399
|
+
return bridge.create_Result_void_()
|
|
400
|
+
} catch (let __error) {
|
|
401
|
+
let __exceptionPtr = __error.toCpp()
|
|
402
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
@inline(__always)
|
|
407
|
+
public final func coverage() -> bridge.Result_double_ {
|
|
408
|
+
do {
|
|
409
|
+
let __result = try self.__implementation.coverage()
|
|
410
|
+
let __resultCpp = __result
|
|
411
|
+
return bridge.create_Result_double_(__resultCpp)
|
|
412
|
+
} catch (let __error) {
|
|
413
|
+
let __exceptionPtr = __error.toCpp()
|
|
414
|
+
return bridge.create_Result_double_(__exceptionPtr)
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
public final func getView() -> UnsafeMutableRawPointer {
|
|
419
|
+
return Unmanaged.passRetained(__implementation.view).toOpaque()
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
public final func beforeUpdate() {
|
|
423
|
+
__implementation.beforeUpdate()
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
public final func afterUpdate() {
|
|
427
|
+
__implementation.afterUpdate()
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
public final func maybePrepareForRecycle() {
|
|
431
|
+
guard let recyclable = __implementation as? any RecyclableView else { return }
|
|
432
|
+
recyclable.prepareForRecycle()
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
public final func onDropView() {
|
|
436
|
+
__implementation.onDropView()
|
|
437
|
+
}
|
|
438
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridPdfDocumentSpec.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/// See ``HybridPdfDocumentSpec``
|
|
11
|
+
public protocol HybridPdfDocumentSpec_protocol: HybridObject {
|
|
12
|
+
// Properties
|
|
13
|
+
var pageCount: Double { get }
|
|
14
|
+
|
|
15
|
+
// Methods
|
|
16
|
+
func getPageSize(page: Double) throws -> PdfPageSize
|
|
17
|
+
func renderToFile(request: PdfRenderRequest) throws -> Promise<String>
|
|
18
|
+
func close() throws -> Void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public extension HybridPdfDocumentSpec_protocol {
|
|
22
|
+
/// Default implementation of ``HybridObject.toString``
|
|
23
|
+
func toString() -> String {
|
|
24
|
+
return "[HybridObject PdfDocument]"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// See ``HybridPdfDocumentSpec``
|
|
29
|
+
open class HybridPdfDocumentSpec_base {
|
|
30
|
+
private weak var cxxWrapper: HybridPdfDocumentSpec_cxx? = nil
|
|
31
|
+
public init() { }
|
|
32
|
+
public func getCxxWrapper() -> HybridPdfDocumentSpec_cxx {
|
|
33
|
+
#if DEBUG
|
|
34
|
+
guard self is any HybridPdfDocumentSpec else {
|
|
35
|
+
fatalError("`self` is not a `HybridPdfDocumentSpec`! Did you accidentally inherit from `HybridPdfDocumentSpec_base` instead of `HybridPdfDocumentSpec`?")
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
38
|
+
if let cxxWrapper = self.cxxWrapper {
|
|
39
|
+
return cxxWrapper
|
|
40
|
+
} else {
|
|
41
|
+
let cxxWrapper = HybridPdfDocumentSpec_cxx(self as! any HybridPdfDocumentSpec)
|
|
42
|
+
self.cxxWrapper = cxxWrapper
|
|
43
|
+
return cxxWrapper
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A Swift base-protocol representing the PdfDocument HybridObject.
|
|
50
|
+
* Implement this protocol to create Swift-based instances of PdfDocument.
|
|
51
|
+
* ```swift
|
|
52
|
+
* class HybridPdfDocument : HybridPdfDocumentSpec {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
public typealias HybridPdfDocumentSpec = HybridPdfDocumentSpec_protocol & HybridPdfDocumentSpec_base
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridPdfDocumentSpec_cxx.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A class implementation that bridges HybridPdfDocumentSpec over to C++.
|
|
12
|
+
* In C++, we cannot use Swift protocols - so we need to wrap it in a class to make it strongly defined.
|
|
13
|
+
*
|
|
14
|
+
* Also, some Swift types need to be bridged with special handling:
|
|
15
|
+
* - Enums need to be wrapped in Structs, otherwise they cannot be accessed bi-directionally (Swift bug: https://github.com/swiftlang/swift/issues/75330)
|
|
16
|
+
* - Other HybridObjects need to be wrapped/unwrapped from the Swift TCxx wrapper
|
|
17
|
+
* - Throwing methods need to be wrapped with a Result<T, Error> type, as exceptions cannot be propagated to C++
|
|
18
|
+
*/
|
|
19
|
+
open class HybridPdfDocumentSpec_cxx {
|
|
20
|
+
/**
|
|
21
|
+
* The Swift <> C++ bridge's namespace (`margelo::nitro::pdfsdk::bridge::swift`)
|
|
22
|
+
* from `PdfSdk-Swift-Cxx-Bridge.hpp`.
|
|
23
|
+
* This contains specialized C++ templates, and C++ helper functions that can be accessed from Swift.
|
|
24
|
+
*/
|
|
25
|
+
public typealias bridge = margelo.nitro.pdfsdk.bridge.swift
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Holds an instance of the `HybridPdfDocumentSpec` Swift protocol.
|
|
29
|
+
*/
|
|
30
|
+
private var __implementation: any HybridPdfDocumentSpec
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Holds a weak pointer to the C++ class that wraps the Swift class.
|
|
34
|
+
*/
|
|
35
|
+
private var __cxxPart: bridge.std__weak_ptr_HybridPdfDocumentSpec_
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a new `HybridPdfDocumentSpec_cxx` that wraps the given `HybridPdfDocumentSpec`.
|
|
39
|
+
* All properties and methods bridge to C++ types.
|
|
40
|
+
*/
|
|
41
|
+
public init(_ implementation: any HybridPdfDocumentSpec) {
|
|
42
|
+
self.__implementation = implementation
|
|
43
|
+
self.__cxxPart = .init()
|
|
44
|
+
/* no base class */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Get the actual `HybridPdfDocumentSpec` instance this class wraps.
|
|
49
|
+
*/
|
|
50
|
+
@inline(__always)
|
|
51
|
+
public func getHybridPdfDocumentSpec() -> any HybridPdfDocumentSpec {
|
|
52
|
+
return __implementation
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Casts this instance to a retained unsafe raw pointer.
|
|
57
|
+
* This acquires one additional strong reference on the object!
|
|
58
|
+
*/
|
|
59
|
+
public func toUnsafe() -> UnsafeMutableRawPointer {
|
|
60
|
+
return Unmanaged.passRetained(self).toOpaque()
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Casts an unsafe pointer to a `HybridPdfDocumentSpec_cxx`.
|
|
65
|
+
* The pointer has to be a retained opaque `Unmanaged<HybridPdfDocumentSpec_cxx>`.
|
|
66
|
+
* This removes one strong reference from the object!
|
|
67
|
+
*/
|
|
68
|
+
public class func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> HybridPdfDocumentSpec_cxx {
|
|
69
|
+
return Unmanaged<HybridPdfDocumentSpec_cxx>.fromOpaque(pointer).takeRetainedValue()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gets (or creates) the C++ part of this Hybrid Object.
|
|
74
|
+
* The C++ part is a `std::shared_ptr<HybridPdfDocumentSpec>`.
|
|
75
|
+
*/
|
|
76
|
+
public func getCxxPart() -> bridge.std__shared_ptr_HybridPdfDocumentSpec_ {
|
|
77
|
+
let cachedCxxPart = self.__cxxPart.lock()
|
|
78
|
+
if Bool(fromCxx: cachedCxxPart) {
|
|
79
|
+
return cachedCxxPart
|
|
80
|
+
} else {
|
|
81
|
+
let newCxxPart = bridge.create_std__shared_ptr_HybridPdfDocumentSpec_(self.toUnsafe())
|
|
82
|
+
__cxxPart = bridge.weakify_std__shared_ptr_HybridPdfDocumentSpec_(newCxxPart)
|
|
83
|
+
return newCxxPart
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Get the memory size of the Swift class (plus size of any other allocations)
|
|
91
|
+
* so the JS VM can properly track it and garbage-collect the JS object if needed.
|
|
92
|
+
*/
|
|
93
|
+
@inline(__always)
|
|
94
|
+
public var memorySize: Int {
|
|
95
|
+
return MemoryHelper.getSizeOf(self.__implementation) + self.__implementation.memorySize
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Compares this object with the given [other] object for reference equality.
|
|
100
|
+
*/
|
|
101
|
+
@inline(__always)
|
|
102
|
+
public func equals(other: HybridPdfDocumentSpec_cxx) -> Bool {
|
|
103
|
+
return self.__implementation === other.__implementation
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Call dispose() on the Swift class.
|
|
108
|
+
* This _may_ be called manually from JS.
|
|
109
|
+
*/
|
|
110
|
+
@inline(__always)
|
|
111
|
+
public func dispose() {
|
|
112
|
+
self.__implementation.dispose()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Call toString() on the Swift class.
|
|
117
|
+
*/
|
|
118
|
+
@inline(__always)
|
|
119
|
+
public func toString() -> String {
|
|
120
|
+
return self.__implementation.toString()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Properties
|
|
124
|
+
public final var pageCount: Double {
|
|
125
|
+
@inline(__always)
|
|
126
|
+
get {
|
|
127
|
+
return self.__implementation.pageCount
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Methods
|
|
132
|
+
@inline(__always)
|
|
133
|
+
public final func getPageSize(page: Double) -> bridge.Result_PdfPageSize_ {
|
|
134
|
+
do {
|
|
135
|
+
let __result = try self.__implementation.getPageSize(page: page)
|
|
136
|
+
let __resultCpp = __result
|
|
137
|
+
return bridge.create_Result_PdfPageSize_(__resultCpp)
|
|
138
|
+
} catch (let __error) {
|
|
139
|
+
let __exceptionPtr = __error.toCpp()
|
|
140
|
+
return bridge.create_Result_PdfPageSize_(__exceptionPtr)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
@inline(__always)
|
|
145
|
+
public final func renderToFile(request: PdfRenderRequest) -> bridge.Result_std__shared_ptr_Promise_std__string___ {
|
|
146
|
+
do {
|
|
147
|
+
let __result = try self.__implementation.renderToFile(request: request)
|
|
148
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__string__ in
|
|
149
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__string__()
|
|
150
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__string__(__promise)
|
|
151
|
+
__result
|
|
152
|
+
.then({ __result in __promiseHolder.resolve(std.string(__result)) })
|
|
153
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
154
|
+
return __promise
|
|
155
|
+
}()
|
|
156
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__resultCpp)
|
|
157
|
+
} catch (let __error) {
|
|
158
|
+
let __exceptionPtr = __error.toCpp()
|
|
159
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__string___(__exceptionPtr)
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@inline(__always)
|
|
164
|
+
public final func close() -> bridge.Result_void_ {
|
|
165
|
+
do {
|
|
166
|
+
try self.__implementation.close()
|
|
167
|
+
return bridge.create_Result_void_()
|
|
168
|
+
} catch (let __error) {
|
|
169
|
+
let __exceptionPtr = __error.toCpp()
|
|
170
|
+
return bridge.create_Result_void_(__exceptionPtr)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|