Flutter Impeller
impeller::interop::ParagraphStyle Class Referencefinal

#include <paragraph_style.h>

Inheritance diagram for impeller::interop::ParagraphStyle:
impeller::interop::Object< ParagraphStyle, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)> impeller::interop::ObjectBase

Public Member Functions

 ParagraphStyle ()
 
 ~ParagraphStyle () override
 
 ParagraphStyle (const ParagraphStyle &)=delete
 
ParagraphStyleoperator= (const ParagraphStyle &)=delete
 
void SetForeground (ScopedObject< Paint > paint)
 
void SetBackground (ScopedObject< Paint > paint)
 
void SetFontWeight (txt::FontWeight weight)
 
void SetFontStyle (txt::FontStyle style)
 
void SetFontFamily (std::string family)
 
void SetFontSize (double size)
 
void SetHeight (double height)
 
void SetTextAlignment (txt::TextAlign alignment)
 
void SetTextDirection (txt::TextDirection direction)
 
void SetMaxLines (size_t max_lines)
 
void SetLocale (std::string locale)
 
txt::TextStyle CreateTextStyle () const
 
const txt::ParagraphStyle & GetParagraphStyle () const
 
- Public Member Functions inherited from impeller::interop::ObjectBase
 ObjectBase ()=default
 
virtual ~ObjectBase ()=default
 
 ObjectBase (const ObjectBase &)=delete
 
 ObjectBase (ObjectBase &&)=delete
 
ObjectBaseoperator= (const ObjectBase &)=delete
 
ObjectBaseoperator= (ObjectBase &&)=delete
 
void Retain ()
 
void Release ()
 
uint64_t GetRefCountForTests () const
 

Additional Inherited Members

- Public Types inherited from impeller::interop::Object< ParagraphStyle, IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)>
using InteropClass = ParagraphStyle
 
using InteropCSibling = IMPELLER_INTERNAL_HANDLE_NAME(ImpellerParagraphStyle)
 
- Static Public Member Functions inherited from impeller::interop::ObjectBase
static void SafeRetain (void *ptr)
 
static void SafeRelease (void *ptr)
 

Detailed Description

Definition at line 15 of file paragraph_style.h.

Constructor & Destructor Documentation

◆ ParagraphStyle() [1/2]

impeller::interop::ParagraphStyle::ParagraphStyle ( )
explicitdefault

◆ ~ParagraphStyle()

impeller::interop::ParagraphStyle::~ParagraphStyle ( )
overridedefault

◆ ParagraphStyle() [2/2]

impeller::interop::ParagraphStyle::ParagraphStyle ( const ParagraphStyle )
delete

Member Function Documentation

◆ CreateTextStyle()

txt::TextStyle impeller::interop::ParagraphStyle::CreateTextStyle ( ) const

Definition at line 58 of file paragraph_style.cc.

58  {
59  auto style = style_.GetTextStyle();
60 
61  if (foreground_) {
62  style.foreground = foreground_->GetPaint();
63  }
64  if (background_) {
65  style.background = background_->GetPaint();
66  }
67  return style;
68 }

Referenced by impeller::interop::ParagraphBuilder::PushStyle().

◆ GetParagraphStyle()

const txt::ParagraphStyle & impeller::interop::ParagraphStyle::GetParagraphStyle ( ) const

Definition at line 70 of file paragraph_style.cc.

70  {
71  return style_;
72 }

Referenced by impeller::interop::ParagraphBuilder::PushStyle().

◆ operator=()

ParagraphStyle& impeller::interop::ParagraphStyle::operator= ( const ParagraphStyle )
delete

◆ SetBackground()

void impeller::interop::ParagraphStyle::SetBackground ( ScopedObject< Paint paint)

Definition at line 54 of file paragraph_style.cc.

54  {
55  background_ = std::move(paint);
56 }

◆ SetFontFamily()

void impeller::interop::ParagraphStyle::SetFontFamily ( std::string  family)

Definition at line 21 of file paragraph_style.cc.

21  {
22  style_.font_family = std::move(family);
23 }

◆ SetFontSize()

void impeller::interop::ParagraphStyle::SetFontSize ( double  size)

Definition at line 25 of file paragraph_style.cc.

25  {
26  style_.font_size = size;
27 }

◆ SetFontStyle()

void impeller::interop::ParagraphStyle::SetFontStyle ( txt::FontStyle  style)

Definition at line 17 of file paragraph_style.cc.

17  {
18  style_.font_style = style;
19 }

◆ SetFontWeight()

void impeller::interop::ParagraphStyle::SetFontWeight ( txt::FontWeight  weight)

Definition at line 13 of file paragraph_style.cc.

13  {
14  style_.font_weight = weight;
15 }

◆ SetForeground()

void impeller::interop::ParagraphStyle::SetForeground ( ScopedObject< Paint paint)

Definition at line 50 of file paragraph_style.cc.

50  {
51  foreground_ = std::move(paint);
52 }

◆ SetHeight()

void impeller::interop::ParagraphStyle::SetHeight ( double  height)

Definition at line 29 of file paragraph_style.cc.

29  {
30  style_.height = height;
31  style_.has_height_override = (height != 0.0);
32 }

◆ SetLocale()

void impeller::interop::ParagraphStyle::SetLocale ( std::string  locale)

Definition at line 46 of file paragraph_style.cc.

46  {
47  style_.locale = std::move(locale);
48 }

◆ SetMaxLines()

void impeller::interop::ParagraphStyle::SetMaxLines ( size_t  max_lines)

Definition at line 42 of file paragraph_style.cc.

42  {
43  style_.max_lines = max_lines;
44 }

◆ SetTextAlignment()

void impeller::interop::ParagraphStyle::SetTextAlignment ( txt::TextAlign  alignment)

Definition at line 34 of file paragraph_style.cc.

34  {
35  style_.text_align = alignment;
36 }

◆ SetTextDirection()

void impeller::interop::ParagraphStyle::SetTextDirection ( txt::TextDirection  direction)

Definition at line 38 of file paragraph_style.cc.

38  {
39  style_.text_direction = direction;
40 }

The documentation for this class was generated from the following files: