Valentin Shergin ee535fafe3 Fabric: Making fabric/textlayoutmanager compilable on Android
Summary:
@public
This compiles, but it works only on iOS for now.

Reviewed By: mdvacca

Differential Revision: D8655540

fbshipit-source-id: 7e9a73fadb317dd62298af6f347344ac4229a8a5
2018-07-01 21:37:00 -07:00

55 lines
1.2 KiB
C++

/**
* 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 <memory>
#include <fabric/attributedstring/AttributedString.h>
#include <fabric/attributedstring/ParagraphAttributes.h>
#include <fabric/core/LayoutConstraints.h>
namespace facebook {
namespace react {
class TextLayoutManager;
using SharedTextLayoutManager = std::shared_ptr<const TextLayoutManager>;
/*
* Cross platform facade for Android-specific TextLayoutManager.
*/
class TextLayoutManager {
public:
TextLayoutManager();
~TextLayoutManager();
/*
* Measures `attributedString` using native text rendering infrastructure.
*/
Size measure(
AttributedString attributedString,
ParagraphAttributes paragraphAttributes,
LayoutConstraints layoutConstraints
) const;
/*
* Returns an opaque pointer to platform-specific TextLayoutManager.
* Is used on a native views layer to delegate text rendering to the manager.
*/
void *getNativeTextLayoutManager() const;
private:
void *self_;
};
} // namespace react
} // namespace facebook