Flutter Engine
 
Loading...
Searching...
No Matches
paragraph_builder.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_BUILDER_H_
6#define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_BUILDER_H_
7
8#include <memory>
9
16
17namespace impeller::interop {
18
20 : public Object<ParagraphBuilder,
21 IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphBuilder)> {
22 public:
24
26
28
30
31 bool IsValid() const;
32
33 void PushStyle(const ParagraphStyle& style);
34
35 void PopStyle();
36
37 void AddText(const uint8_t* data, size_t byte_length);
38
40
41 private:
43 mutable std::unique_ptr<txt::ParagraphBuilder> lazy_builder_;
44
45 const std::unique_ptr<txt::ParagraphBuilder>& GetBuilder(
46 const txt::ParagraphStyle& style) const;
47
48 const std::unique_ptr<txt::ParagraphBuilder>& GetBuilder() const;
49};
50
51} // namespace impeller::interop
52
53#endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_BUILDER_H_
ParagraphBuilder(const ParagraphBuilder &)=delete
ParagraphBuilder & operator=(const ParagraphBuilder &)=delete
ScopedObject< Paragraph > Build(Scalar width) const
void PushStyle(const ParagraphStyle &style)
void AddText(const uint8_t *data, size_t byte_length)
float Scalar
Definition scalar.h:19
int32_t width
std::shared_ptr< const fml::Mapping > data