mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
da5ea0215a
Summary: Keep track of AndroidTextInput's mostRecentEventCount in C++ State. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D18672368 fbshipit-source-id: ea7a635629050a6d4957cbcef6ec0bda5faaad9a
69 lines
1.8 KiB
C++
69 lines
1.8 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.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <react/attributedstring/AttributedString.h>
|
|
#include <react/attributedstring/ParagraphAttributes.h>
|
|
#include <react/textlayoutmanager/TextLayoutManager.h>
|
|
|
|
#ifdef ANDROID
|
|
#include <folly/dynamic.h>
|
|
#endif
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
/*
|
|
* State for <Paragraph> component.
|
|
* Represents what to render and how to render.
|
|
*/
|
|
class AndroidTextInputState final {
|
|
public:
|
|
int64_t mostRecentEventCount{0};
|
|
|
|
/*
|
|
* All content of <Paragraph> component represented as an `AttributedString`.
|
|
*/
|
|
AttributedString attributedString;
|
|
|
|
/*
|
|
* Represents all visual attributes of a paragraph of text represented as
|
|
* a ParagraphAttributes.
|
|
*/
|
|
ParagraphAttributes paragraphAttributes;
|
|
|
|
/*
|
|
* `TextLayoutManager` provides a connection to platform-specific
|
|
* text rendering infrastructure which is capable to render the
|
|
* `AttributedString`.
|
|
*/
|
|
SharedTextLayoutManager layoutManager;
|
|
|
|
#ifdef ANDROID
|
|
AndroidTextInputState(
|
|
int64_t mostRecentEventCount,
|
|
AttributedString const &attributedString,
|
|
ParagraphAttributes const ¶graphAttributes,
|
|
SharedTextLayoutManager const &layoutManager)
|
|
: mostRecentEventCount(mostRecentEventCount),
|
|
attributedString(attributedString),
|
|
paragraphAttributes(paragraphAttributes),
|
|
layoutManager(layoutManager) {}
|
|
AndroidTextInputState() = default;
|
|
AndroidTextInputState(
|
|
AndroidTextInputState const &previousState,
|
|
folly::dynamic const &data) {
|
|
assert(false && "Not supported");
|
|
};
|
|
folly::dynamic getDynamic() const;
|
|
#endif
|
|
};
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|