this repo has no description
1
2/**
3 * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4 *
5 * Do not edit this file as changes may cause incorrect behavior and will be lost
6 * once the code is regenerated.
7 *
8 * @generated by codegen project: GeneratePropsH.js
9 */
10#pragma once
11
12#include <react/renderer/components/view/ViewProps.h>
13#include <react/renderer/core/PropsParserContext.h>
14#include <react/renderer/core/propsConversions.h>
15
16namespace facebook::react {
17
18class RNCSafeAreaProviderProps final : public ViewProps {
19 public:
20 RNCSafeAreaProviderProps() = default;
21 RNCSafeAreaProviderProps(const PropsParserContext& context, const RNCSafeAreaProviderProps &sourceProps, const RawProps &rawProps);
22
23#pragma mark - Props
24
25
26
27 #ifdef RN_SERIALIZABLE_STATE
28 ComponentName getDiffPropsImplementationTarget() const override;
29
30 folly::dynamic getDiffProps(const Props* prevProps) const override;
31 #endif
32};
33
34enum class RNCSafeAreaViewMode { Padding, Margin };
35
36static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNCSafeAreaViewMode &result) {
37 auto string = (std::string)value;
38 if (string == "padding") { result = RNCSafeAreaViewMode::Padding; return; }
39 if (string == "margin") { result = RNCSafeAreaViewMode::Margin; return; }
40 abort();
41}
42
43static inline std::string toString(const RNCSafeAreaViewMode &value) {
44 switch (value) {
45 case RNCSafeAreaViewMode::Padding: return "padding";
46 case RNCSafeAreaViewMode::Margin: return "margin";
47 }
48}
49
50#ifdef RN_SERIALIZABLE_STATE
51static inline folly::dynamic toDynamic(const RNCSafeAreaViewMode &value) {
52 return toString(value);
53}
54#endif
55struct RNCSafeAreaViewEdgesStruct {
56 std::string top{};
57 std::string right{};
58 std::string bottom{};
59 std::string left{};
60
61#ifdef RN_SERIALIZABLE_STATE
62 bool operator==(const RNCSafeAreaViewEdgesStruct&) const = default;
63
64 folly::dynamic toDynamic() const {
65 folly::dynamic result = folly::dynamic::object();
66 result["top"] = top;
67 result["right"] = right;
68 result["bottom"] = bottom;
69 result["left"] = left;
70 return result;
71 }
72#endif
73};
74
75static inline void fromRawValue(const PropsParserContext& context, const RawValue &value, RNCSafeAreaViewEdgesStruct &result) {
76 auto map = (std::unordered_map<std::string, RawValue>)value;
77
78 auto tmp_top = map.find("top");
79 if (tmp_top != map.end()) {
80 fromRawValue(context, tmp_top->second, result.top);
81 }
82 auto tmp_right = map.find("right");
83 if (tmp_right != map.end()) {
84 fromRawValue(context, tmp_right->second, result.right);
85 }
86 auto tmp_bottom = map.find("bottom");
87 if (tmp_bottom != map.end()) {
88 fromRawValue(context, tmp_bottom->second, result.bottom);
89 }
90 auto tmp_left = map.find("left");
91 if (tmp_left != map.end()) {
92 fromRawValue(context, tmp_left->second, result.left);
93 }
94}
95
96static inline std::string toString(const RNCSafeAreaViewEdgesStruct &value) {
97 return "[Object RNCSafeAreaViewEdgesStruct]";
98}
99
100#ifdef RN_SERIALIZABLE_STATE
101static inline folly::dynamic toDynamic(const RNCSafeAreaViewEdgesStruct &value) {
102 return value.toDynamic();
103}
104#endif
105class RNCSafeAreaViewProps final : public ViewProps {
106 public:
107 RNCSafeAreaViewProps() = default;
108 RNCSafeAreaViewProps(const PropsParserContext& context, const RNCSafeAreaViewProps &sourceProps, const RawProps &rawProps);
109
110#pragma mark - Props
111
112 RNCSafeAreaViewMode mode{RNCSafeAreaViewMode::Padding};
113 RNCSafeAreaViewEdgesStruct edges{};
114
115 #ifdef RN_SERIALIZABLE_STATE
116 ComponentName getDiffPropsImplementationTarget() const override;
117
118 folly::dynamic getDiffProps(const Props* prevProps) const override;
119 #endif
120};
121
122} // namespace facebook::react