| 1 | #pragma once |
| 2 | |
| 3 | #include <react/renderer/components/T3SourceTextSpec/EventEmitters.h> |
| 4 | #include <react/renderer/components/T3SourceTextSpec/Props.h> |
| 5 | #include <react/renderer/components/view/ConcreteViewShadowNode.h> |
| 6 | #include <react/renderer/core/LayoutContext.h> |
| 7 | #include <react/renderer/core/ShadowNode.h> |
| 8 | #include <react/renderer/textlayoutmanager/TextLayoutManager.h> |
| 9 | |
| 10 | namespace facebook::react { |
| 11 | |
| 12 | extern const char T3SourceTextComponentName[]; |
| 13 | |
| 14 | class T3SourceTextStateReal final { |
| 15 | public: |
| 16 | AttributedString attributedString; |
| 17 | }; |
| 18 | |
| 19 | class T3SourceTextShadowNode final |
| 20 | : public ConcreteViewShadowNode<T3SourceTextComponentName, |
| 21 | T3SourceTextProps, T3SourceTextEventEmitter, |
| 22 | T3SourceTextStateReal> { |
| 23 | public: |
| 24 | using ConcreteViewShadowNode::ConcreteViewShadowNode; |
| 25 | |
| 26 | T3SourceTextShadowNode(const ShadowNode &sourceShadowNode, |
| 27 | const ShadowNodeFragment &fragment); |
| 28 | |
| 29 | static ShadowNodeTraits BaseTraits() { |
| 30 | auto traits = ConcreteViewShadowNode::BaseTraits(); |
| 31 | traits.set(ShadowNodeTraits::Trait::LeafYogaNode); |
| 32 | traits.set(ShadowNodeTraits::Trait::MeasurableYogaNode); |
| 33 | return traits; |
| 34 | } |
| 35 | |
| 36 | void layout(LayoutContext layoutContext) override; |
| 37 | |
| 38 | Size |
| 39 | measureContent(const LayoutContext &layoutContext, |
| 40 | const LayoutConstraints &layoutConstraints) const override; |
| 41 | |
| 42 | private: |
| 43 | mutable AttributedString _attributedString; |
| 44 | }; |
| 45 | } // namespace facebook::react |