Files
react-native/ReactCommon/fabric/components/text/paragraph/ParagraphLocalData.cpp
T
David VaccaandFacebook Github Bot 9ad193c35b Implement Local Data in Android Fabric C++
Summary: This diff introduces the concept of Local Data in Android Fabric C++ and as an example we uses it to implement Text View.

Reviewed By: shergin

Differential Revision: D9583970

fbshipit-source-id: ab7478b16ef4327ff574ca1467870ab9cb684ea0
2018-09-17 18:49:06 -07:00

52 lines
1.3 KiB
C++

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ParagraphLocalData.h"
#include <fabric/components/text/conversions.h>
#include <fabric/debug/debugStringConvertibleUtils.h>
namespace facebook {
namespace react {
AttributedString ParagraphLocalData::getAttributedString() const {
return attributedString_;
}
void ParagraphLocalData::setAttributedString(AttributedString attributedString) {
ensureUnsealed();
attributedString_ = attributedString;
}
SharedTextLayoutManager ParagraphLocalData::getTextLayoutManager() const {
return textLayoutManager_;
}
void ParagraphLocalData::setTextLayoutManager(SharedTextLayoutManager textLayoutManager) {
ensureUnsealed();
textLayoutManager_ = textLayoutManager;
}
folly::dynamic ParagraphLocalData::getDynamic() const {
return toDynamic(*this);
}
#pragma mark - DebugStringConvertible
std::string ParagraphLocalData::getDebugName() const {
return "ParagraphLocalData";
}
SharedDebugStringConvertibleList ParagraphLocalData::getDebugProps() const {
return {
debugStringConvertibleItem("attributedString", attributedString_, "")
};
}
} // namespace react
} // namespace facebook