| 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"
9 #include "impeller/toolkit/interop/impeller.h"
10 #include "impeller/toolkit/interop/object.h"
11 #include "impeller/toolkit/interop/paint.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
27 void SetForeground(ScopedObject<Paint> paint);
28
29 void SetBackground(ScopedObject<Paint> paint);
30
31 void SetFontWeight(int 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_
impeller::interop::Object
Definition: object.h:56
impeller::interop::ParagraphStyle
Definition: paragraph_style.h:17
impeller::interop::ParagraphStyle::ParagraphStyle
ParagraphStyle(const ParagraphStyle &)=delete
impeller::interop::ParagraphStyle::~ParagraphStyle
~ParagraphStyle() override
impeller::interop::ParagraphStyle::operator=
ParagraphStyle & operator=(const ParagraphStyle &)=delete
impeller::interop::ParagraphStyle::SetFontFamily
void SetFontFamily(std::string family)
Definition: paragraph_style.cc:23
impeller::interop::ParagraphStyle::SetTextDecoration
void SetTextDecoration(const ImpellerTextDecoration &decoration)
Definition: paragraph_style.cc:84
impeller::interop::ParagraphStyle::SetTextDirection
void SetTextDirection(txt::TextDirection direction)
Definition: paragraph_style.cc:40
impeller::interop::ParagraphStyle::SetHeight
void SetHeight(double height)
Definition: paragraph_style.cc:31
impeller::interop::ParagraphStyle::SetBackground
void SetBackground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:56
impeller::interop::ParagraphStyle::SetForeground
void SetForeground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:52
impeller::interop::ParagraphStyle::CreateTextStyle
txt::TextStyle CreateTextStyle() const
Definition: paragraph_style.cc:60
impeller::interop::ParagraphStyle::SetFontWeight
void SetFontWeight(int weight)
Definition: paragraph_style.cc:15
impeller::interop::ParagraphStyle::SetLocale
void SetLocale(std::string locale)
Definition: paragraph_style.cc:48
impeller::interop::ParagraphStyle::ParagraphStyle
ParagraphStyle()
impeller::interop::ParagraphStyle::SetFontSize
void SetFontSize(double size)
Definition: paragraph_style.cc:27
impeller::interop::ParagraphStyle::SetFontStyle
void SetFontStyle(txt::FontStyle style)
Definition: paragraph_style.cc:19
impeller::interop::ParagraphStyle::SetEllipsis
void SetEllipsis(const std::string &string)
Definition: paragraph_style.cc:89
impeller::interop::ParagraphStyle::GetParagraphStyle
const txt::ParagraphStyle & GetParagraphStyle() const
Definition: paragraph_style.cc:80
impeller::interop::ParagraphStyle::SetMaxLines
void SetMaxLines(size_t max_lines)
Definition: paragraph_style.cc:44
impeller::interop::ParagraphStyle::SetTextAlignment
void SetTextAlignment(txt::TextAlign alignment)
Definition: paragraph_style.cc:36
impeller::interop::ScopedObject
Definition: object.h:67
impeller.h
impeller::interop
Definition: context_gles.cc:12
object.h
ImpellerTextDecoration
Definition: impeller.h:646
paint.h