/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include #include #include #include #include #include namespace facebook { namespace react { class ParagraphShadowNode; using SharedParagraphShadowNode = std::shared_ptr; /* * `ShadowNode` for component, represents -like component * containing and displaying text. Text content is represented as nested * and components. */ class ParagraphShadowNode: public ConcreteViewShadowNode, public BaseTextShadowNode { public: using ConcreteViewShadowNode::ConcreteViewShadowNode; ComponentName getComponentName() const override; /* * Returns a `AttributedString` which represents text content of the node. */ AttributedString getAttributedString() const; /* * Associates a shared TextLayoutManager with the node. * `ParagraphShadowNode` uses the manager to measure text content * and construct `ParagraphLocalData` objects. */ void setTextLayoutManager(SharedTextLayoutManager textLayoutManager); #pragma mark - LayoutableShadowNode void layout(LayoutContext layoutContext) override; Size measure(LayoutConstraints layoutConstraints) const override; private: /* * Creates a `LocalData` object (with `AttributedText` and * `TextLayoutManager`) if needed. */ void updateLocalData(); SharedTextLayoutManager textLayoutManager_; }; } // namespace react } // namespace facebook