| 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(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 const txt::ParagraphStyle& GetParagraphStyle() const;
52
53 private:
54 txt::ParagraphStyle style_;
55 ScopedObject<Paint> foreground_;
56 ScopedObject<Paint> background_;
57 };
58
59 } // namespace impeller::interop
60
61 #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::SetFontWeight
void SetFontWeight(txt::FontWeight weight)
Definition: paragraph_style.cc:13
impeller::interop::ParagraphStyle::SetFontFamily
void SetFontFamily(std::string family)
Definition: paragraph_style.cc:21
impeller::interop::ParagraphStyle::SetTextDirection
void SetTextDirection(txt::TextDirection direction)
Definition: paragraph_style.cc:38
impeller::interop::ParagraphStyle::SetHeight
void SetHeight(double height)
Definition: paragraph_style.cc:29
impeller::interop::ParagraphStyle::SetBackground
void SetBackground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:54
impeller::interop::ParagraphStyle::SetForeground
void SetForeground(ScopedObject< Paint > paint)
Definition: paragraph_style.cc:50
impeller::interop::ParagraphStyle::CreateTextStyle
txt::TextStyle CreateTextStyle() const
Definition: paragraph_style.cc:58
impeller::interop::ParagraphStyle::SetLocale
void SetLocale(std::string locale)
Definition: paragraph_style.cc:46
impeller::interop::ParagraphStyle::ParagraphStyle
ParagraphStyle()
impeller::interop::ParagraphStyle::SetFontSize
void SetFontSize(double size)
Definition: paragraph_style.cc:25
impeller::interop::ParagraphStyle::SetFontStyle
void SetFontStyle(txt::FontStyle style)
Definition: paragraph_style.cc:17
impeller::interop::ParagraphStyle::GetParagraphStyle
const txt::ParagraphStyle & GetParagraphStyle() const
Definition: paragraph_style.cc:70
impeller::interop::ParagraphStyle::SetMaxLines
void SetMaxLines(size_t max_lines)
Definition: paragraph_style.cc:42
impeller::interop::ParagraphStyle::SetTextAlignment
void SetTextAlignment(txt::TextAlign alignment)
Definition: paragraph_style.cc:34
impeller::interop::ScopedObject
Definition: object.h:67
impeller.h
impeller::interop
Definition: context_gles.cc:12
object.h
paint.h