Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
txt::Paragraph Class Referenceabstract

#include <paragraph.h>

Classes

struct  PositionWithAffinity
 
struct  Range
 
struct  TextBox
 

Public Types

enum  Affinity { UPSTREAM , DOWNSTREAM }
 
enum class  RectHeightStyle {
  kTight , kMax , kIncludeLineSpacingMiddle , kIncludeLineSpacingTop ,
  kIncludeLineSpacingBottom , kStrut
}
 
enum class  RectWidthStyle { kTight , kMax }
 

Public Member Functions

virtual ~Paragraph ()=default
 
virtual double GetMaxWidth ()=0
 
virtual double GetHeight ()=0
 
virtual double GetLongestLine ()=0
 
virtual double GetMinIntrinsicWidth ()=0
 
virtual double GetMaxIntrinsicWidth ()=0
 
virtual double GetAlphabeticBaseline ()=0
 
virtual double GetIdeographicBaseline ()=0
 
virtual bool DidExceedMaxLines ()=0
 
virtual void Layout (double width)=0
 
virtual bool Paint (flutter::DisplayListBuilder *builder, double x, double y)=0
 
virtual std::vector< TextBoxGetRectsForRange (size_t start, size_t end, RectHeightStyle rect_height_style, RectWidthStyle rect_width_style)=0
 
virtual std::vector< TextBoxGetRectsForPlaceholders ()=0
 
virtual PositionWithAffinity GetGlyphPositionAtCoordinate (double dx, double dy)=0
 
virtual bool GetGlyphInfoAt (unsigned offset, skia::textlayout::Paragraph::GlyphInfo *glyphInfo) const =0
 
virtual bool GetClosestGlyphInfoAtCoordinate (double dx, double dy, skia::textlayout::Paragraph::GlyphInfo *glyphInfo) const =0
 
virtual Range< size_t > GetWordBoundary (size_t offset)=0
 
virtual std::vector< LineMetrics > & GetLineMetrics ()=0
 
virtual bool GetLineMetricsAt (int lineNumber, skia::textlayout::LineMetrics *lineMetrics) const =0
 
virtual size_t GetNumberOfLines () const =0
 
virtual int GetLineNumberAt (size_t utf16Offset) const =0
 

Detailed Description

Definition at line 35 of file paragraph.h.

Member Enumeration Documentation

◆ Affinity

Enumerator
UPSTREAM 
DOWNSTREAM 

Definition at line 37 of file paragraph.h.

◆ RectHeightStyle

Enumerator
kTight 
kMax 
kIncludeLineSpacingMiddle 
kIncludeLineSpacingTop 
kIncludeLineSpacingBottom 
kStrut 

Definition at line 41 of file paragraph.h.

41 {
42 // Provide tight bounding boxes that fit heights per run.
43 kTight,
44
45 // The height of the boxes will be the maximum height of all runs in the
46 // line. All rects in the same line will be the same height.
47 kMax,
48
49 // Extends the top and/or bottom edge of the bounds to fully cover any line
50 // spacing. The top edge of each line should be the same as the bottom edge
51 // of the line above. There should be no gaps in vertical coverage given any
52 // ParagraphStyle line_height.
53 //
54 // The top and bottom of each rect will cover half of the
55 // space above and half of the space below the line.
57 // The line spacing will be added to the top of the rect.
59 // The line spacing will be added to the bottom of the rect.
61
62 // Calculate boxes based on the strut's metrics.
63 kStrut
64 };

◆ RectWidthStyle

enum class txt::Paragraph::RectWidthStyle
strong
Enumerator
kTight 
kMax 

Definition at line 66 of file paragraph.h.

66 {
67 // Provide tight bounding boxes that fit widths to the runs of each line
68 // independently.
69 kTight,
70
71 // Extends the width of the last rect of each line to match the position of
72 // the widest rect over all the lines.
73 kMax
74 };

Constructor & Destructor Documentation

◆ ~Paragraph()

virtual txt::Paragraph::~Paragraph ( )
virtualdefault

Member Function Documentation

◆ DidExceedMaxLines()

virtual bool txt::Paragraph::DidExceedMaxLines ( )
pure virtual

◆ GetAlphabeticBaseline()

virtual double txt::Paragraph::GetAlphabeticBaseline ( )
pure virtual

◆ GetClosestGlyphInfoAtCoordinate()

virtual bool txt::Paragraph::GetClosestGlyphInfoAtCoordinate ( double  dx,
double  dy,
skia::textlayout::Paragraph::GlyphInfo glyphInfo 
) const
pure virtual

◆ GetGlyphInfoAt()

virtual bool txt::Paragraph::GetGlyphInfoAt ( unsigned  offset,
skia::textlayout::Paragraph::GlyphInfo glyphInfo 
) const
pure virtual

◆ GetGlyphPositionAtCoordinate()

virtual PositionWithAffinity txt::Paragraph::GetGlyphPositionAtCoordinate ( double  dx,
double  dy 
)
pure virtual

◆ GetHeight()

virtual double txt::Paragraph::GetHeight ( )
pure virtual

◆ GetIdeographicBaseline()

virtual double txt::Paragraph::GetIdeographicBaseline ( )
pure virtual

◆ GetLineMetrics()

virtual std::vector< LineMetrics > & txt::Paragraph::GetLineMetrics ( )
pure virtual

◆ GetLineMetricsAt()

virtual bool txt::Paragraph::GetLineMetricsAt ( int  lineNumber,
skia::textlayout::LineMetrics lineMetrics 
) const
pure virtual

◆ GetLineNumberAt()

virtual int txt::Paragraph::GetLineNumberAt ( size_t  utf16Offset) const
pure virtual

◆ GetLongestLine()

virtual double txt::Paragraph::GetLongestLine ( )
pure virtual

◆ GetMaxIntrinsicWidth()

virtual double txt::Paragraph::GetMaxIntrinsicWidth ( )
pure virtual

◆ GetMaxWidth()

virtual double txt::Paragraph::GetMaxWidth ( )
pure virtual

◆ GetMinIntrinsicWidth()

virtual double txt::Paragraph::GetMinIntrinsicWidth ( )
pure virtual

◆ GetNumberOfLines()

virtual size_t txt::Paragraph::GetNumberOfLines ( ) const
pure virtual

◆ GetRectsForPlaceholders()

virtual std::vector< TextBox > txt::Paragraph::GetRectsForPlaceholders ( )
pure virtual

◆ GetRectsForRange()

virtual std::vector< TextBox > txt::Paragraph::GetRectsForRange ( size_t  start,
size_t  end,
RectHeightStyle  rect_height_style,
RectWidthStyle  rect_width_style 
)
pure virtual

◆ GetWordBoundary()

virtual Range< size_t > txt::Paragraph::GetWordBoundary ( size_t  offset)
pure virtual

◆ Layout()

virtual void txt::Paragraph::Layout ( double  width)
pure virtual

◆ Paint()

virtual bool txt::Paragraph::Paint ( flutter::DisplayListBuilder builder,
double  x,
double  y 
)
pure virtual

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