Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

T3SourceTextShadowNode.h

45 lines1.4 KB

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​
10namespace facebook::react {
11​
12extern const char T3SourceTextComponentName[];
13​
14class T3SourceTextStateReal final {
15public:
16 AttributedString attributedString;
17};
18​
19class T3SourceTextShadowNode final
20 : public ConcreteViewShadowNode<T3SourceTextComponentName,
21 T3SourceTextProps, T3SourceTextEventEmitter,
22 T3SourceTextStateReal> {
23public:
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​
42private:
43 mutable AttributedString _attributedString;
44};
45} // namespace facebook::react