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 
11 #include "third_party/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 
25  ParagraphStyle& operator=(const ParagraphStyle&) = delete;
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 SetMaxLines(size_t max_lines);
46 
47  void SetLocale(std::string locale);
48 
49  txt::TextStyle CreateTextStyle() const;
50 
51  private:
52  txt::ParagraphStyle style_;
53  ScopedObject<Paint> foreground_;
54  ScopedObject<Paint> backgrond_;
55 };
56 
57 } // namespace impeller::interop
58 
59 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PARAGRAPH_STYLE_H_
impeller.h
impeller::interop::Object
Definition: object.h:56
impeller::interop::ScopedObject
Definition: object.h:67
impeller::interop::ParagraphStyle::operator=
ParagraphStyle & operator=(const ParagraphStyle &)=delete
impeller::interop::ParagraphStyle::~ParagraphStyle
~ParagraphStyle() override
impeller::interop::ParagraphStyle::SetBackground
void SetBackground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:53
impeller::interop::ParagraphStyle::SetFontFamily
void SetFontFamily(std::string family)
Definition: paragraph_style.cc:21
impeller::interop
Definition: color_filter.cc:7
impeller::interop::ParagraphStyle::SetMaxLines
void SetMaxLines(size_t max_lines)
Definition: paragraph_style.cc:41
impeller::interop::ParagraphStyle::CreateTextStyle
txt::TextStyle CreateTextStyle() const
Definition: paragraph_style.cc:57
impeller::interop::ParagraphStyle::SetFontStyle
void SetFontStyle(txt::FontStyle style)
Definition: paragraph_style.cc:17
impeller::interop::ParagraphStyle::ParagraphStyle
ParagraphStyle()
impeller::interop::ParagraphStyle::SetLocale
void SetLocale(std::string locale)
Definition: paragraph_style.cc:45
impeller::interop::ParagraphStyle::SetTextAlignment
void SetTextAlignment(txt::TextAlign alignment)
Definition: paragraph_style.cc:33
impeller::interop::ParagraphStyle
Definition: paragraph_style.h:15
impeller::interop::ParagraphStyle::SetFontSize
void SetFontSize(double size)
Definition: paragraph_style.cc:25
impeller::interop::ParagraphStyle::SetFontWeight
void SetFontWeight(txt::FontWeight weight)
Definition: paragraph_style.cc:13
impeller::interop::ParagraphStyle::SetHeight
void SetHeight(double height)
Definition: paragraph_style.cc:29
impeller::interop::ParagraphStyle::SetForeground
void SetForeground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:49
paint.h
impeller::interop::ParagraphStyle::SetTextDirection
void SetTextDirection(txt::TextDirection direction)
Definition: paragraph_style.cc:37
object.h