Flutter Impeller
paragraph_style.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_STYLE_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_STYLE_H_
7 
8 #include "flutter/txt/src/txt/paragraph_style.h"
12 
13 namespace impeller::interop {
14 
15 class ParagraphStyle final
16  : public Object<ParagraphStyle,
17  IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)> {
18  public:
19  explicit ParagraphStyle();
20 
21  ~ParagraphStyle() override;
22 
23  ParagraphStyle(const ParagraphStyle&) = delete;
24 
26 
28 
30 
31  void SetFontWeight(txt::FontWeight weight);
32 
33  void SetFontStyle(txt::FontStyle style);
34 
35  void SetFontFamily(std::string family);
36 
37  void SetFontSize(double size);
38 
39  void SetHeight(double height);
40 
41  void SetTextAlignment(txt::TextAlign alignment);
42 
43  void SetTextDirection(txt::TextDirection direction);
44 
45  void SetTextDecoration(const ImpellerTextDecoration& decoration);
46 
47  void SetMaxLines(size_t max_lines);
48 
49  void SetLocale(std::string locale);
50 
51  void SetEllipsis(const std::string& string);
52 
53  txt::TextStyle CreateTextStyle() const;
54 
55  const txt::ParagraphStyle& GetParagraphStyle() const;
56 
57  private:
58  txt::ParagraphStyle style_;
59  ScopedObject<Paint> foreground_;
60  ScopedObject<Paint> background_;
61  std::optional<ImpellerTextDecoration> decoration_;
62 };
63 
64 } // namespace impeller::interop
65 
66 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_STYLE_H_
ParagraphStyle(const ParagraphStyle &)=delete
ParagraphStyle & operator=(const ParagraphStyle &)=delete
void SetFontWeight(txt::FontWeight weight)
void SetFontFamily(std::string family)
void SetTextDecoration(const ImpellerTextDecoration &decoration)
void SetTextDirection(txt::TextDirection direction)
void SetBackground(ScopedObject< Paint > paint)
void SetForeground(ScopedObject< Paint > paint)
txt::TextStyle CreateTextStyle() const
void SetLocale(std::string locale)
void SetFontStyle(txt::FontStyle style)
void SetEllipsis(const std::string &string)
const txt::ParagraphStyle & GetParagraphStyle() const
void SetMaxLines(size_t max_lines)
void SetTextAlignment(txt::TextAlign alignment)