2 * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
9 #include "ParagraphStyle.h"
13 typedef List
<TextSpan
, false> TextSpanList
;
19 Paragraph(const ParagraphStyle
& style
);
20 Paragraph(const Paragraph
& other
);
22 Paragraph
& operator=(const Paragraph
& other
);
23 bool operator==(const Paragraph
& other
) const;
24 bool operator!=(const Paragraph
& other
) const;
26 void SetStyle(const ParagraphStyle
& style
);
27 inline const ParagraphStyle
& Style() const
30 inline const TextSpanList
& TextSpans() const
31 { return fTextSpans
; }
33 bool Prepend(const TextSpan
& span
);
34 bool Append(const TextSpan
& span
);
35 bool Insert(int32 offset
, const TextSpan
& span
);
36 bool Remove(int32 offset
, int32 length
);
41 bool EndsWith(BString string
) const;
44 BString
Text(int32 start
, int32 length
) const;
45 Paragraph
SubParagraph(int32 start
, int32 length
) const;
47 void PrintToStream() const;
50 void _InvalidateCachedLength();
53 ParagraphStyle fStyle
;
54 TextSpanList fTextSpans
;
55 mutable int32 fCachedLength
;