/* * Copyright (c) Meta Platforms, Inc. and 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 #include #include #include #include #include #include #include #include #include #include #include namespace facebook { namespace react { class TextInputProps final : public ViewProps, public BaseTextProps { public: TextInputProps() = default; TextInputProps( const PropsParserContext &context, TextInputProps const &sourceProps, RawProps const &rawProps); void setProp( const PropsParserContext &context, RawPropsPropNameHash hash, const char *propName, RawValue const &value); #pragma mark - Props TextInputTraits const traits{}; ParagraphAttributes const paragraphAttributes{}; std::string const defaultValue{}; std::string const placeholder{}; SharedColor const placeholderTextColor{}; int maxLength{}; /* * Tint colors */ SharedColor const cursorColor{}; SharedColor const selectionColor{}; // TODO: Rename to `tintColor` and make universal. SharedColor const underlineColorAndroid{}; /* * "Private" (only used by TextInput.js) props */ std::string const text{}; int const mostRecentEventCount{0}; bool autoFocus{false}; std::optional selection{}; std::string const inputAccessoryViewID{}; bool onKeyPressSync{false}; bool onChangeSync{false}; /* * Accessors */ TextAttributes getEffectiveTextAttributes(Float fontSizeMultiplier) const; ParagraphAttributes getEffectiveParagraphAttributes() const; }; } // namespace react } // namespace facebook