react-native-pdf-sdk 0.0.0-stage → 0.1.0
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 +16 -0
- package/LICENSE +21 -0
- package/PdfSdk.podspec +32 -0
- package/README.md +265 -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,474 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdk-Swift-Cxx-Bridge.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridNativePdfViewSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::pdfsdk { class HybridNativePdfViewSpec; }
|
|
13
|
+
// Forward declaration of `HybridPdfDocumentSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::pdfsdk { class HybridPdfDocumentSpec; }
|
|
15
|
+
// Forward declaration of `HybridPdfSdkSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::pdfsdk { class HybridPdfSdkSpec; }
|
|
17
|
+
// Forward declaration of `PdfErrorCode` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::pdfsdk { enum class PdfErrorCode; }
|
|
19
|
+
// Forward declaration of `PdfErrorEvent` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::pdfsdk { struct PdfErrorEvent; }
|
|
21
|
+
// Forward declaration of `PdfLoadEvent` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::pdfsdk { struct PdfLoadEvent; }
|
|
23
|
+
// Forward declaration of `PdfPageEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::pdfsdk { struct PdfPageEvent; }
|
|
25
|
+
// Forward declaration of `PdfPageSize` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::pdfsdk { struct PdfPageSize; }
|
|
27
|
+
// Forward declaration of `PdfTapEvent` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::pdfsdk { struct PdfTapEvent; }
|
|
29
|
+
// Forward declaration of `PdfZoomEvent` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::pdfsdk { struct PdfZoomEvent; }
|
|
31
|
+
|
|
32
|
+
// Forward declarations of Swift defined types
|
|
33
|
+
// Forward declaration of `HybridNativePdfViewSpec_cxx` to properly resolve imports.
|
|
34
|
+
namespace PdfSdk { class HybridNativePdfViewSpec_cxx; }
|
|
35
|
+
// Forward declaration of `HybridPdfDocumentSpec_cxx` to properly resolve imports.
|
|
36
|
+
namespace PdfSdk { class HybridPdfDocumentSpec_cxx; }
|
|
37
|
+
// Forward declaration of `HybridPdfSdkSpec_cxx` to properly resolve imports.
|
|
38
|
+
namespace PdfSdk { class HybridPdfSdkSpec_cxx; }
|
|
39
|
+
|
|
40
|
+
// Include C++ defined types
|
|
41
|
+
#include "HybridNativePdfViewSpec.hpp"
|
|
42
|
+
#include "HybridPdfDocumentSpec.hpp"
|
|
43
|
+
#include "HybridPdfSdkSpec.hpp"
|
|
44
|
+
#include "PdfErrorCode.hpp"
|
|
45
|
+
#include "PdfErrorEvent.hpp"
|
|
46
|
+
#include "PdfLoadEvent.hpp"
|
|
47
|
+
#include "PdfPageEvent.hpp"
|
|
48
|
+
#include "PdfPageSize.hpp"
|
|
49
|
+
#include "PdfTapEvent.hpp"
|
|
50
|
+
#include "PdfZoomEvent.hpp"
|
|
51
|
+
#include <NitroModules/Promise.hpp>
|
|
52
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
53
|
+
#include <NitroModules/Result.hpp>
|
|
54
|
+
#include <exception>
|
|
55
|
+
#include <functional>
|
|
56
|
+
#include <memory>
|
|
57
|
+
#include <optional>
|
|
58
|
+
#include <string>
|
|
59
|
+
#include <unordered_map>
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
63
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
64
|
+
*/
|
|
65
|
+
namespace margelo::nitro::pdfsdk::bridge::swift {
|
|
66
|
+
|
|
67
|
+
// pragma MARK: std::shared_ptr<Promise<std::string>>
|
|
68
|
+
/**
|
|
69
|
+
* Specialized version of `std::shared_ptr<Promise<std::string>>`.
|
|
70
|
+
*/
|
|
71
|
+
using std__shared_ptr_Promise_std__string__ = std::shared_ptr<Promise<std::string>>;
|
|
72
|
+
inline std::shared_ptr<Promise<std::string>> create_std__shared_ptr_Promise_std__string__() noexcept {
|
|
73
|
+
return Promise<std::string>::create();
|
|
74
|
+
}
|
|
75
|
+
inline PromiseHolder<std::string> wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr<Promise<std::string>> promise) noexcept {
|
|
76
|
+
return PromiseHolder<std::string>(std::move(promise));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// pragma MARK: std::function<void(const std::string& /* result */)>
|
|
80
|
+
/**
|
|
81
|
+
* Specialized version of `std::function<void(const std::string&)>`.
|
|
82
|
+
*/
|
|
83
|
+
using Func_void_std__string = std::function<void(const std::string& /* result */)>;
|
|
84
|
+
/**
|
|
85
|
+
* Wrapper class for a `std::function<void(const std::string& / * result * /)>`, this can be used from Swift.
|
|
86
|
+
*/
|
|
87
|
+
class Func_void_std__string_Wrapper final {
|
|
88
|
+
public:
|
|
89
|
+
explicit Func_void_std__string_Wrapper(std::function<void(const std::string& /* result */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* result */)>>(std::move(func))) {}
|
|
90
|
+
inline void call(std::string result) const noexcept {
|
|
91
|
+
_function->operator()(result);
|
|
92
|
+
}
|
|
93
|
+
private:
|
|
94
|
+
std::unique_ptr<std::function<void(const std::string& /* result */)>> _function;
|
|
95
|
+
} SWIFT_NONCOPYABLE;
|
|
96
|
+
Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
97
|
+
inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept {
|
|
98
|
+
return Func_void_std__string_Wrapper(std::move(value));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
102
|
+
/**
|
|
103
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
104
|
+
*/
|
|
105
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
106
|
+
/**
|
|
107
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
108
|
+
*/
|
|
109
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
110
|
+
public:
|
|
111
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
112
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
113
|
+
_function->operator()(error);
|
|
114
|
+
}
|
|
115
|
+
private:
|
|
116
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
117
|
+
} SWIFT_NONCOPYABLE;
|
|
118
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
119
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
120
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// pragma MARK: std::optional<double>
|
|
124
|
+
/**
|
|
125
|
+
* Specialized version of `std::optional<double>`.
|
|
126
|
+
*/
|
|
127
|
+
using std__optional_double_ = std::optional<double>;
|
|
128
|
+
inline std::optional<double> create_std__optional_double_(const double& value) noexcept {
|
|
129
|
+
return std::optional<double>(value);
|
|
130
|
+
}
|
|
131
|
+
inline bool has_value_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
132
|
+
return optional.has_value();
|
|
133
|
+
}
|
|
134
|
+
inline double get_std__optional_double_(const std::optional<double>& optional) noexcept {
|
|
135
|
+
return optional.value();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// pragma MARK: std::optional<std::string>
|
|
139
|
+
/**
|
|
140
|
+
* Specialized version of `std::optional<std::string>`.
|
|
141
|
+
*/
|
|
142
|
+
using std__optional_std__string_ = std::optional<std::string>;
|
|
143
|
+
inline std::optional<std::string> create_std__optional_std__string_(const std::string& value) noexcept {
|
|
144
|
+
return std::optional<std::string>(value);
|
|
145
|
+
}
|
|
146
|
+
inline bool has_value_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
147
|
+
return optional.has_value();
|
|
148
|
+
}
|
|
149
|
+
inline std::string get_std__optional_std__string_(const std::optional<std::string>& optional) noexcept {
|
|
150
|
+
return optional.value();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// pragma MARK: std::shared_ptr<HybridPdfDocumentSpec>
|
|
154
|
+
/**
|
|
155
|
+
* Specialized version of `std::shared_ptr<HybridPdfDocumentSpec>`.
|
|
156
|
+
*/
|
|
157
|
+
using std__shared_ptr_HybridPdfDocumentSpec_ = std::shared_ptr<HybridPdfDocumentSpec>;
|
|
158
|
+
std::shared_ptr<HybridPdfDocumentSpec> create_std__shared_ptr_HybridPdfDocumentSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
159
|
+
void* NON_NULL get_std__shared_ptr_HybridPdfDocumentSpec_(std__shared_ptr_HybridPdfDocumentSpec_ cppType);
|
|
160
|
+
|
|
161
|
+
// pragma MARK: std::weak_ptr<HybridPdfDocumentSpec>
|
|
162
|
+
using std__weak_ptr_HybridPdfDocumentSpec_ = std::weak_ptr<HybridPdfDocumentSpec>;
|
|
163
|
+
inline std__weak_ptr_HybridPdfDocumentSpec_ weakify_std__shared_ptr_HybridPdfDocumentSpec_(const std::shared_ptr<HybridPdfDocumentSpec>& strong) noexcept { return strong; }
|
|
164
|
+
|
|
165
|
+
// pragma MARK: Result<PdfPageSize>
|
|
166
|
+
using Result_PdfPageSize_ = Result<PdfPageSize>;
|
|
167
|
+
inline Result_PdfPageSize_ create_Result_PdfPageSize_(const PdfPageSize& value) noexcept {
|
|
168
|
+
return Result<PdfPageSize>::withValue(value);
|
|
169
|
+
}
|
|
170
|
+
inline Result_PdfPageSize_ create_Result_PdfPageSize_(const std::exception_ptr& error) noexcept {
|
|
171
|
+
return Result<PdfPageSize>::withError(error);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// pragma MARK: Result<std::shared_ptr<Promise<std::string>>>
|
|
175
|
+
using Result_std__shared_ptr_Promise_std__string___ = Result<std::shared_ptr<Promise<std::string>>>;
|
|
176
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::shared_ptr<Promise<std::string>>& value) noexcept {
|
|
177
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withValue(value);
|
|
178
|
+
}
|
|
179
|
+
inline Result_std__shared_ptr_Promise_std__string___ create_Result_std__shared_ptr_Promise_std__string___(const std::exception_ptr& error) noexcept {
|
|
180
|
+
return Result<std::shared_ptr<Promise<std::string>>>::withError(error);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// pragma MARK: Result<void>
|
|
184
|
+
using Result_void_ = Result<void>;
|
|
185
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
186
|
+
return Result<void>::withValue();
|
|
187
|
+
}
|
|
188
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
189
|
+
return Result<void>::withError(error);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// pragma MARK: std::shared_ptr<HybridPdfSdkSpec>
|
|
193
|
+
/**
|
|
194
|
+
* Specialized version of `std::shared_ptr<HybridPdfSdkSpec>`.
|
|
195
|
+
*/
|
|
196
|
+
using std__shared_ptr_HybridPdfSdkSpec_ = std::shared_ptr<HybridPdfSdkSpec>;
|
|
197
|
+
std::shared_ptr<HybridPdfSdkSpec> create_std__shared_ptr_HybridPdfSdkSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
198
|
+
void* NON_NULL get_std__shared_ptr_HybridPdfSdkSpec_(std__shared_ptr_HybridPdfSdkSpec_ cppType);
|
|
199
|
+
|
|
200
|
+
// pragma MARK: std::weak_ptr<HybridPdfSdkSpec>
|
|
201
|
+
using std__weak_ptr_HybridPdfSdkSpec_ = std::weak_ptr<HybridPdfSdkSpec>;
|
|
202
|
+
inline std__weak_ptr_HybridPdfSdkSpec_ weakify_std__shared_ptr_HybridPdfSdkSpec_(const std::shared_ptr<HybridPdfSdkSpec>& strong) noexcept { return strong; }
|
|
203
|
+
|
|
204
|
+
// pragma MARK: Result<std::shared_ptr<HybridPdfDocumentSpec>>
|
|
205
|
+
using Result_std__shared_ptr_HybridPdfDocumentSpec__ = Result<std::shared_ptr<HybridPdfDocumentSpec>>;
|
|
206
|
+
inline Result_std__shared_ptr_HybridPdfDocumentSpec__ create_Result_std__shared_ptr_HybridPdfDocumentSpec__(const std::shared_ptr<HybridPdfDocumentSpec>& value) noexcept {
|
|
207
|
+
return Result<std::shared_ptr<HybridPdfDocumentSpec>>::withValue(value);
|
|
208
|
+
}
|
|
209
|
+
inline Result_std__shared_ptr_HybridPdfDocumentSpec__ create_Result_std__shared_ptr_HybridPdfDocumentSpec__(const std::exception_ptr& error) noexcept {
|
|
210
|
+
return Result<std::shared_ptr<HybridPdfDocumentSpec>>::withError(error);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// pragma MARK: std::unordered_map<std::string, std::string>
|
|
214
|
+
/**
|
|
215
|
+
* Specialized version of `std::unordered_map<std::string, std::string>`.
|
|
216
|
+
*/
|
|
217
|
+
using std__unordered_map_std__string__std__string_ = std::unordered_map<std::string, std::string>;
|
|
218
|
+
inline std::unordered_map<std::string, std::string> create_std__unordered_map_std__string__std__string_(size_t size) noexcept {
|
|
219
|
+
std::unordered_map<std::string, std::string> map;
|
|
220
|
+
map.reserve(size);
|
|
221
|
+
return map;
|
|
222
|
+
}
|
|
223
|
+
inline std::vector<std::string> get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) noexcept {
|
|
224
|
+
std::vector<std::string> keys;
|
|
225
|
+
keys.reserve(map.size());
|
|
226
|
+
for (const auto& entry : map) {
|
|
227
|
+
keys.push_back(entry.first);
|
|
228
|
+
}
|
|
229
|
+
return keys;
|
|
230
|
+
}
|
|
231
|
+
inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) noexcept {
|
|
232
|
+
return map.find(key)->second;
|
|
233
|
+
}
|
|
234
|
+
inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) noexcept {
|
|
235
|
+
map.emplace(key, value);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// pragma MARK: std::optional<std::unordered_map<std::string, std::string>>
|
|
239
|
+
/**
|
|
240
|
+
* Specialized version of `std::optional<std::unordered_map<std::string, std::string>>`.
|
|
241
|
+
*/
|
|
242
|
+
using std__optional_std__unordered_map_std__string__std__string__ = std::optional<std::unordered_map<std::string, std::string>>;
|
|
243
|
+
inline std::optional<std::unordered_map<std::string, std::string>> create_std__optional_std__unordered_map_std__string__std__string__(const std::unordered_map<std::string, std::string>& value) noexcept {
|
|
244
|
+
return std::optional<std::unordered_map<std::string, std::string>>(value);
|
|
245
|
+
}
|
|
246
|
+
inline bool has_value_std__optional_std__unordered_map_std__string__std__string__(const std::optional<std::unordered_map<std::string, std::string>>& optional) noexcept {
|
|
247
|
+
return optional.has_value();
|
|
248
|
+
}
|
|
249
|
+
inline std::unordered_map<std::string, std::string> get_std__optional_std__unordered_map_std__string__std__string__(const std::optional<std::unordered_map<std::string, std::string>>& optional) noexcept {
|
|
250
|
+
return optional.value();
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// pragma MARK: std::optional<bool>
|
|
254
|
+
/**
|
|
255
|
+
* Specialized version of `std::optional<bool>`.
|
|
256
|
+
*/
|
|
257
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
258
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
259
|
+
return std::optional<bool>(value);
|
|
260
|
+
}
|
|
261
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
262
|
+
return optional.has_value();
|
|
263
|
+
}
|
|
264
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
265
|
+
return optional.value();
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// pragma MARK: std::function<void(const PdfLoadEvent& /* event */)>
|
|
269
|
+
/**
|
|
270
|
+
* Specialized version of `std::function<void(const PdfLoadEvent&)>`.
|
|
271
|
+
*/
|
|
272
|
+
using Func_void_PdfLoadEvent = std::function<void(const PdfLoadEvent& /* event */)>;
|
|
273
|
+
/**
|
|
274
|
+
* Wrapper class for a `std::function<void(const PdfLoadEvent& / * event * /)>`, this can be used from Swift.
|
|
275
|
+
*/
|
|
276
|
+
class Func_void_PdfLoadEvent_Wrapper final {
|
|
277
|
+
public:
|
|
278
|
+
explicit Func_void_PdfLoadEvent_Wrapper(std::function<void(const PdfLoadEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PdfLoadEvent& /* event */)>>(std::move(func))) {}
|
|
279
|
+
inline void call(PdfLoadEvent event) const noexcept {
|
|
280
|
+
_function->operator()(event);
|
|
281
|
+
}
|
|
282
|
+
private:
|
|
283
|
+
std::unique_ptr<std::function<void(const PdfLoadEvent& /* event */)>> _function;
|
|
284
|
+
} SWIFT_NONCOPYABLE;
|
|
285
|
+
Func_void_PdfLoadEvent create_Func_void_PdfLoadEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
286
|
+
inline Func_void_PdfLoadEvent_Wrapper wrap_Func_void_PdfLoadEvent(Func_void_PdfLoadEvent value) noexcept {
|
|
287
|
+
return Func_void_PdfLoadEvent_Wrapper(std::move(value));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// pragma MARK: std::optional<std::function<void(const PdfLoadEvent& /* event */)>>
|
|
291
|
+
/**
|
|
292
|
+
* Specialized version of `std::optional<std::function<void(const PdfLoadEvent& / * event * /)>>`.
|
|
293
|
+
*/
|
|
294
|
+
using std__optional_std__function_void_const_PdfLoadEvent_____event______ = std::optional<std::function<void(const PdfLoadEvent& /* event */)>>;
|
|
295
|
+
inline std::optional<std::function<void(const PdfLoadEvent& /* event */)>> create_std__optional_std__function_void_const_PdfLoadEvent_____event______(const std::function<void(const PdfLoadEvent& /* event */)>& value) noexcept {
|
|
296
|
+
return std::optional<std::function<void(const PdfLoadEvent& /* event */)>>(value);
|
|
297
|
+
}
|
|
298
|
+
inline bool has_value_std__optional_std__function_void_const_PdfLoadEvent_____event______(const std::optional<std::function<void(const PdfLoadEvent& /* event */)>>& optional) noexcept {
|
|
299
|
+
return optional.has_value();
|
|
300
|
+
}
|
|
301
|
+
inline std::function<void(const PdfLoadEvent& /* event */)> get_std__optional_std__function_void_const_PdfLoadEvent_____event______(const std::optional<std::function<void(const PdfLoadEvent& /* event */)>>& optional) noexcept {
|
|
302
|
+
return optional.value();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// pragma MARK: std::function<void(const PdfPageEvent& /* event */)>
|
|
306
|
+
/**
|
|
307
|
+
* Specialized version of `std::function<void(const PdfPageEvent&)>`.
|
|
308
|
+
*/
|
|
309
|
+
using Func_void_PdfPageEvent = std::function<void(const PdfPageEvent& /* event */)>;
|
|
310
|
+
/**
|
|
311
|
+
* Wrapper class for a `std::function<void(const PdfPageEvent& / * event * /)>`, this can be used from Swift.
|
|
312
|
+
*/
|
|
313
|
+
class Func_void_PdfPageEvent_Wrapper final {
|
|
314
|
+
public:
|
|
315
|
+
explicit Func_void_PdfPageEvent_Wrapper(std::function<void(const PdfPageEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PdfPageEvent& /* event */)>>(std::move(func))) {}
|
|
316
|
+
inline void call(PdfPageEvent event) const noexcept {
|
|
317
|
+
_function->operator()(event);
|
|
318
|
+
}
|
|
319
|
+
private:
|
|
320
|
+
std::unique_ptr<std::function<void(const PdfPageEvent& /* event */)>> _function;
|
|
321
|
+
} SWIFT_NONCOPYABLE;
|
|
322
|
+
Func_void_PdfPageEvent create_Func_void_PdfPageEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
323
|
+
inline Func_void_PdfPageEvent_Wrapper wrap_Func_void_PdfPageEvent(Func_void_PdfPageEvent value) noexcept {
|
|
324
|
+
return Func_void_PdfPageEvent_Wrapper(std::move(value));
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// pragma MARK: std::optional<std::function<void(const PdfPageEvent& /* event */)>>
|
|
328
|
+
/**
|
|
329
|
+
* Specialized version of `std::optional<std::function<void(const PdfPageEvent& / * event * /)>>`.
|
|
330
|
+
*/
|
|
331
|
+
using std__optional_std__function_void_const_PdfPageEvent_____event______ = std::optional<std::function<void(const PdfPageEvent& /* event */)>>;
|
|
332
|
+
inline std::optional<std::function<void(const PdfPageEvent& /* event */)>> create_std__optional_std__function_void_const_PdfPageEvent_____event______(const std::function<void(const PdfPageEvent& /* event */)>& value) noexcept {
|
|
333
|
+
return std::optional<std::function<void(const PdfPageEvent& /* event */)>>(value);
|
|
334
|
+
}
|
|
335
|
+
inline bool has_value_std__optional_std__function_void_const_PdfPageEvent_____event______(const std::optional<std::function<void(const PdfPageEvent& /* event */)>>& optional) noexcept {
|
|
336
|
+
return optional.has_value();
|
|
337
|
+
}
|
|
338
|
+
inline std::function<void(const PdfPageEvent& /* event */)> get_std__optional_std__function_void_const_PdfPageEvent_____event______(const std::optional<std::function<void(const PdfPageEvent& /* event */)>>& optional) noexcept {
|
|
339
|
+
return optional.value();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// pragma MARK: std::function<void(const PdfZoomEvent& /* event */)>
|
|
343
|
+
/**
|
|
344
|
+
* Specialized version of `std::function<void(const PdfZoomEvent&)>`.
|
|
345
|
+
*/
|
|
346
|
+
using Func_void_PdfZoomEvent = std::function<void(const PdfZoomEvent& /* event */)>;
|
|
347
|
+
/**
|
|
348
|
+
* Wrapper class for a `std::function<void(const PdfZoomEvent& / * event * /)>`, this can be used from Swift.
|
|
349
|
+
*/
|
|
350
|
+
class Func_void_PdfZoomEvent_Wrapper final {
|
|
351
|
+
public:
|
|
352
|
+
explicit Func_void_PdfZoomEvent_Wrapper(std::function<void(const PdfZoomEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PdfZoomEvent& /* event */)>>(std::move(func))) {}
|
|
353
|
+
inline void call(PdfZoomEvent event) const noexcept {
|
|
354
|
+
_function->operator()(event);
|
|
355
|
+
}
|
|
356
|
+
private:
|
|
357
|
+
std::unique_ptr<std::function<void(const PdfZoomEvent& /* event */)>> _function;
|
|
358
|
+
} SWIFT_NONCOPYABLE;
|
|
359
|
+
Func_void_PdfZoomEvent create_Func_void_PdfZoomEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
360
|
+
inline Func_void_PdfZoomEvent_Wrapper wrap_Func_void_PdfZoomEvent(Func_void_PdfZoomEvent value) noexcept {
|
|
361
|
+
return Func_void_PdfZoomEvent_Wrapper(std::move(value));
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// pragma MARK: std::optional<std::function<void(const PdfZoomEvent& /* event */)>>
|
|
365
|
+
/**
|
|
366
|
+
* Specialized version of `std::optional<std::function<void(const PdfZoomEvent& / * event * /)>>`.
|
|
367
|
+
*/
|
|
368
|
+
using std__optional_std__function_void_const_PdfZoomEvent_____event______ = std::optional<std::function<void(const PdfZoomEvent& /* event */)>>;
|
|
369
|
+
inline std::optional<std::function<void(const PdfZoomEvent& /* event */)>> create_std__optional_std__function_void_const_PdfZoomEvent_____event______(const std::function<void(const PdfZoomEvent& /* event */)>& value) noexcept {
|
|
370
|
+
return std::optional<std::function<void(const PdfZoomEvent& /* event */)>>(value);
|
|
371
|
+
}
|
|
372
|
+
inline bool has_value_std__optional_std__function_void_const_PdfZoomEvent_____event______(const std::optional<std::function<void(const PdfZoomEvent& /* event */)>>& optional) noexcept {
|
|
373
|
+
return optional.has_value();
|
|
374
|
+
}
|
|
375
|
+
inline std::function<void(const PdfZoomEvent& /* event */)> get_std__optional_std__function_void_const_PdfZoomEvent_____event______(const std::optional<std::function<void(const PdfZoomEvent& /* event */)>>& optional) noexcept {
|
|
376
|
+
return optional.value();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// pragma MARK: std::function<void(const PdfErrorEvent& /* event */)>
|
|
380
|
+
/**
|
|
381
|
+
* Specialized version of `std::function<void(const PdfErrorEvent&)>`.
|
|
382
|
+
*/
|
|
383
|
+
using Func_void_PdfErrorEvent = std::function<void(const PdfErrorEvent& /* event */)>;
|
|
384
|
+
/**
|
|
385
|
+
* Wrapper class for a `std::function<void(const PdfErrorEvent& / * event * /)>`, this can be used from Swift.
|
|
386
|
+
*/
|
|
387
|
+
class Func_void_PdfErrorEvent_Wrapper final {
|
|
388
|
+
public:
|
|
389
|
+
explicit Func_void_PdfErrorEvent_Wrapper(std::function<void(const PdfErrorEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PdfErrorEvent& /* event */)>>(std::move(func))) {}
|
|
390
|
+
inline void call(PdfErrorEvent event) const noexcept {
|
|
391
|
+
_function->operator()(event);
|
|
392
|
+
}
|
|
393
|
+
private:
|
|
394
|
+
std::unique_ptr<std::function<void(const PdfErrorEvent& /* event */)>> _function;
|
|
395
|
+
} SWIFT_NONCOPYABLE;
|
|
396
|
+
Func_void_PdfErrorEvent create_Func_void_PdfErrorEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
397
|
+
inline Func_void_PdfErrorEvent_Wrapper wrap_Func_void_PdfErrorEvent(Func_void_PdfErrorEvent value) noexcept {
|
|
398
|
+
return Func_void_PdfErrorEvent_Wrapper(std::move(value));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// pragma MARK: std::optional<std::function<void(const PdfErrorEvent& /* event */)>>
|
|
402
|
+
/**
|
|
403
|
+
* Specialized version of `std::optional<std::function<void(const PdfErrorEvent& / * event * /)>>`.
|
|
404
|
+
*/
|
|
405
|
+
using std__optional_std__function_void_const_PdfErrorEvent_____event______ = std::optional<std::function<void(const PdfErrorEvent& /* event */)>>;
|
|
406
|
+
inline std::optional<std::function<void(const PdfErrorEvent& /* event */)>> create_std__optional_std__function_void_const_PdfErrorEvent_____event______(const std::function<void(const PdfErrorEvent& /* event */)>& value) noexcept {
|
|
407
|
+
return std::optional<std::function<void(const PdfErrorEvent& /* event */)>>(value);
|
|
408
|
+
}
|
|
409
|
+
inline bool has_value_std__optional_std__function_void_const_PdfErrorEvent_____event______(const std::optional<std::function<void(const PdfErrorEvent& /* event */)>>& optional) noexcept {
|
|
410
|
+
return optional.has_value();
|
|
411
|
+
}
|
|
412
|
+
inline std::function<void(const PdfErrorEvent& /* event */)> get_std__optional_std__function_void_const_PdfErrorEvent_____event______(const std::optional<std::function<void(const PdfErrorEvent& /* event */)>>& optional) noexcept {
|
|
413
|
+
return optional.value();
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
// pragma MARK: std::function<void(const PdfTapEvent& /* event */)>
|
|
417
|
+
/**
|
|
418
|
+
* Specialized version of `std::function<void(const PdfTapEvent&)>`.
|
|
419
|
+
*/
|
|
420
|
+
using Func_void_PdfTapEvent = std::function<void(const PdfTapEvent& /* event */)>;
|
|
421
|
+
/**
|
|
422
|
+
* Wrapper class for a `std::function<void(const PdfTapEvent& / * event * /)>`, this can be used from Swift.
|
|
423
|
+
*/
|
|
424
|
+
class Func_void_PdfTapEvent_Wrapper final {
|
|
425
|
+
public:
|
|
426
|
+
explicit Func_void_PdfTapEvent_Wrapper(std::function<void(const PdfTapEvent& /* event */)>&& func): _function(std::make_unique<std::function<void(const PdfTapEvent& /* event */)>>(std::move(func))) {}
|
|
427
|
+
inline void call(PdfTapEvent event) const noexcept {
|
|
428
|
+
_function->operator()(event);
|
|
429
|
+
}
|
|
430
|
+
private:
|
|
431
|
+
std::unique_ptr<std::function<void(const PdfTapEvent& /* event */)>> _function;
|
|
432
|
+
} SWIFT_NONCOPYABLE;
|
|
433
|
+
Func_void_PdfTapEvent create_Func_void_PdfTapEvent(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
434
|
+
inline Func_void_PdfTapEvent_Wrapper wrap_Func_void_PdfTapEvent(Func_void_PdfTapEvent value) noexcept {
|
|
435
|
+
return Func_void_PdfTapEvent_Wrapper(std::move(value));
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// pragma MARK: std::optional<std::function<void(const PdfTapEvent& /* event */)>>
|
|
439
|
+
/**
|
|
440
|
+
* Specialized version of `std::optional<std::function<void(const PdfTapEvent& / * event * /)>>`.
|
|
441
|
+
*/
|
|
442
|
+
using std__optional_std__function_void_const_PdfTapEvent_____event______ = std::optional<std::function<void(const PdfTapEvent& /* event */)>>;
|
|
443
|
+
inline std::optional<std::function<void(const PdfTapEvent& /* event */)>> create_std__optional_std__function_void_const_PdfTapEvent_____event______(const std::function<void(const PdfTapEvent& /* event */)>& value) noexcept {
|
|
444
|
+
return std::optional<std::function<void(const PdfTapEvent& /* event */)>>(value);
|
|
445
|
+
}
|
|
446
|
+
inline bool has_value_std__optional_std__function_void_const_PdfTapEvent_____event______(const std::optional<std::function<void(const PdfTapEvent& /* event */)>>& optional) noexcept {
|
|
447
|
+
return optional.has_value();
|
|
448
|
+
}
|
|
449
|
+
inline std::function<void(const PdfTapEvent& /* event */)> get_std__optional_std__function_void_const_PdfTapEvent_____event______(const std::optional<std::function<void(const PdfTapEvent& /* event */)>>& optional) noexcept {
|
|
450
|
+
return optional.value();
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
// pragma MARK: std::shared_ptr<HybridNativePdfViewSpec>
|
|
454
|
+
/**
|
|
455
|
+
* Specialized version of `std::shared_ptr<HybridNativePdfViewSpec>`.
|
|
456
|
+
*/
|
|
457
|
+
using std__shared_ptr_HybridNativePdfViewSpec_ = std::shared_ptr<HybridNativePdfViewSpec>;
|
|
458
|
+
std::shared_ptr<HybridNativePdfViewSpec> create_std__shared_ptr_HybridNativePdfViewSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
459
|
+
void* NON_NULL get_std__shared_ptr_HybridNativePdfViewSpec_(std__shared_ptr_HybridNativePdfViewSpec_ cppType);
|
|
460
|
+
|
|
461
|
+
// pragma MARK: std::weak_ptr<HybridNativePdfViewSpec>
|
|
462
|
+
using std__weak_ptr_HybridNativePdfViewSpec_ = std::weak_ptr<HybridNativePdfViewSpec>;
|
|
463
|
+
inline std__weak_ptr_HybridNativePdfViewSpec_ weakify_std__shared_ptr_HybridNativePdfViewSpec_(const std::shared_ptr<HybridNativePdfViewSpec>& strong) noexcept { return strong; }
|
|
464
|
+
|
|
465
|
+
// pragma MARK: Result<double>
|
|
466
|
+
using Result_double_ = Result<double>;
|
|
467
|
+
inline Result_double_ create_Result_double_(double value) noexcept {
|
|
468
|
+
return Result<double>::withValue(std::move(value));
|
|
469
|
+
}
|
|
470
|
+
inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
|
|
471
|
+
return Result<double>::withError(error);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
} // namespace margelo::nitro::pdfsdk::bridge::swift
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdk-Swift-Cxx-Umbrella.hpp
|
|
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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridNativePdfViewSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::pdfsdk { class HybridNativePdfViewSpec; }
|
|
13
|
+
// Forward declaration of `HybridPdfDocumentSpec` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::pdfsdk { class HybridPdfDocumentSpec; }
|
|
15
|
+
// Forward declaration of `HybridPdfSdkSpec` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::pdfsdk { class HybridPdfSdkSpec; }
|
|
17
|
+
// Forward declaration of `PdfErrorCode` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::pdfsdk { enum class PdfErrorCode; }
|
|
19
|
+
// Forward declaration of `PdfErrorEvent` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::pdfsdk { struct PdfErrorEvent; }
|
|
21
|
+
// Forward declaration of `PdfFit` to properly resolve imports.
|
|
22
|
+
namespace margelo::nitro::pdfsdk { enum class PdfFit; }
|
|
23
|
+
// Forward declaration of `PdfLoadEvent` to properly resolve imports.
|
|
24
|
+
namespace margelo::nitro::pdfsdk { struct PdfLoadEvent; }
|
|
25
|
+
// Forward declaration of `PdfPageEvent` to properly resolve imports.
|
|
26
|
+
namespace margelo::nitro::pdfsdk { struct PdfPageEvent; }
|
|
27
|
+
// Forward declaration of `PdfPageSize` to properly resolve imports.
|
|
28
|
+
namespace margelo::nitro::pdfsdk { struct PdfPageSize; }
|
|
29
|
+
// Forward declaration of `PdfRenderRequest` to properly resolve imports.
|
|
30
|
+
namespace margelo::nitro::pdfsdk { struct PdfRenderRequest; }
|
|
31
|
+
// Forward declaration of `PdfTapEvent` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::pdfsdk { struct PdfTapEvent; }
|
|
33
|
+
// Forward declaration of `PdfViewSource` to properly resolve imports.
|
|
34
|
+
namespace margelo::nitro::pdfsdk { struct PdfViewSource; }
|
|
35
|
+
// Forward declaration of `PdfZoomEvent` to properly resolve imports.
|
|
36
|
+
namespace margelo::nitro::pdfsdk { struct PdfZoomEvent; }
|
|
37
|
+
|
|
38
|
+
// Include C++ defined types
|
|
39
|
+
#include "HybridNativePdfViewSpec.hpp"
|
|
40
|
+
#include "HybridPdfDocumentSpec.hpp"
|
|
41
|
+
#include "HybridPdfSdkSpec.hpp"
|
|
42
|
+
#include "PdfErrorCode.hpp"
|
|
43
|
+
#include "PdfErrorEvent.hpp"
|
|
44
|
+
#include "PdfFit.hpp"
|
|
45
|
+
#include "PdfLoadEvent.hpp"
|
|
46
|
+
#include "PdfPageEvent.hpp"
|
|
47
|
+
#include "PdfPageSize.hpp"
|
|
48
|
+
#include "PdfRenderRequest.hpp"
|
|
49
|
+
#include "PdfTapEvent.hpp"
|
|
50
|
+
#include "PdfViewSource.hpp"
|
|
51
|
+
#include "PdfZoomEvent.hpp"
|
|
52
|
+
#include <NitroModules/Promise.hpp>
|
|
53
|
+
#include <NitroModules/Result.hpp>
|
|
54
|
+
#include <exception>
|
|
55
|
+
#include <functional>
|
|
56
|
+
#include <memory>
|
|
57
|
+
#include <optional>
|
|
58
|
+
#include <string>
|
|
59
|
+
#include <unordered_map>
|
|
60
|
+
|
|
61
|
+
// C++ helpers for Swift
|
|
62
|
+
#include "PdfSdk-Swift-Cxx-Bridge.hpp"
|
|
63
|
+
|
|
64
|
+
// Common C++ types used in Swift
|
|
65
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
66
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
67
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
68
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
69
|
+
|
|
70
|
+
// Forward declarations of Swift defined types
|
|
71
|
+
// Forward declaration of `HybridNativePdfViewSpec_cxx` to properly resolve imports.
|
|
72
|
+
namespace PdfSdk { class HybridNativePdfViewSpec_cxx; }
|
|
73
|
+
// Forward declaration of `HybridPdfDocumentSpec_cxx` to properly resolve imports.
|
|
74
|
+
namespace PdfSdk { class HybridPdfDocumentSpec_cxx; }
|
|
75
|
+
// Forward declaration of `HybridPdfSdkSpec_cxx` to properly resolve imports.
|
|
76
|
+
namespace PdfSdk { class HybridPdfSdkSpec_cxx; }
|
|
77
|
+
|
|
78
|
+
// Include Swift defined types
|
|
79
|
+
#if __has_include("PdfSdk-Swift.h")
|
|
80
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
81
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "PdfSdk".
|
|
82
|
+
#include "PdfSdk-Swift.h"
|
|
83
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
84
|
+
#elif __has_include(<PdfSdk/PdfSdk-Swift.h>)
|
|
85
|
+
#include <PdfSdk/PdfSdk-Swift.h>
|
|
86
|
+
#else
|
|
87
|
+
#error PdfSdk's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "PdfSdk", and try building the app first.
|
|
88
|
+
#endif
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdkAutolinking.mm
|
|
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 <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "PdfSdk-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridPdfSdkSpecSwift.hpp"
|
|
14
|
+
#include "HybridNativePdfViewSpecSwift.hpp"
|
|
15
|
+
|
|
16
|
+
@interface PdfSdkAutolinking : NSObject
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
@implementation PdfSdkAutolinking
|
|
20
|
+
|
|
21
|
+
+ (void) load {
|
|
22
|
+
using namespace margelo::nitro;
|
|
23
|
+
using namespace margelo::nitro::pdfsdk;
|
|
24
|
+
|
|
25
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
26
|
+
"PdfSdk",
|
|
27
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
28
|
+
std::shared_ptr<HybridPdfSdkSpec> hybridObject = PdfSdk::PdfSdkAutolinking::createPdfSdk();
|
|
29
|
+
return hybridObject;
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
33
|
+
"NativePdfView",
|
|
34
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
35
|
+
std::shared_ptr<HybridNativePdfViewSpec> hybridObject = PdfSdk::PdfSdkAutolinking::createNativePdfView();
|
|
36
|
+
return hybridObject;
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PdfSdkAutolinking.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
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class PdfSdkAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.pdfsdk.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createPdfSdk() -> bridge.std__shared_ptr_HybridPdfSdkSpec_ {
|
|
16
|
+
let hybridObject = HybridPdfSdk()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridPdfSdkSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isPdfSdkRecyclable() -> Bool {
|
|
24
|
+
return HybridPdfSdk.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public static func createNativePdfView() -> bridge.std__shared_ptr_HybridNativePdfViewSpec_ {
|
|
28
|
+
let hybridObject = HybridPdfView()
|
|
29
|
+
return { () -> bridge.std__shared_ptr_HybridNativePdfViewSpec_ in
|
|
30
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
31
|
+
return __cxxWrapped.getCxxPart()
|
|
32
|
+
}()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public static func isNativePdfViewRecyclable() -> Bool {
|
|
36
|
+
return HybridPdfView.self is any RecyclableView.Type
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridNativePdfViewSpecSwift.cpp
|
|
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
|
+
#include "HybridNativePdfViewSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::pdfsdk {
|
|
11
|
+
} // namespace margelo::nitro::pdfsdk
|