Paragraph — Aspose.Slides FOSS for C++ API Reference

The Paragraph class represents a single paragraph of text inside a TextFrame. Each paragraph contains one or more Portion objects (text runs with uniform formatting).

Namespace: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/paragraph.h>
class Paragraph

Header: include/Aspose/Slides/Foss/paragraph.h


Constructors

SignatureDescription
Paragraph()Create a new empty paragraph.

Properties

PropertyAccessorDescription
text()ReadReturns the concatenated text of all portions.
set_text(const std::string&)WriteReplace all text in this paragraph.

IParagraph Interface

The IParagraph interface (from i_paragraph.h) defines:

MethodDescription
text()Get the paragraph text.
set_text(const std::string&)Set the paragraph text.

IParagraphFormat Interface

The IParagraphFormat interface controls paragraph-level formatting:

PropertyAccessorDescription
alignment() / set_alignment(TextAlignment)Read/WriteText alignment.
depth() / set_depth(int)Read/WriteOutline/indent depth.
space_within() / set_space_within(float)Read/WriteLine spacing within the paragraph.
space_before() / set_space_before(float)Read/WriteSpace before the paragraph.
space_after() / set_space_after(float)Read/WriteSpace after the paragraph.
margin_left() / set_margin_left(float)Read/WriteLeft margin.
margin_right() / set_margin_right(float)Read/WriteRight margin.
indent() / set_indent(float)Read/WriteFirst-line indent.
default_tab_size() / set_default_tab_size(float)Read/WriteDefault tab stop size.
font_alignment() / set_font_alignment(FontAlignment)Read/WriteFont alignment within the line.
right_to_left() / set_right_to_left(NullableBool)Read/WriteRight-to-left text direction.
east_asian_line_break() / set_east_asian_line_break(NullableBool)Read/WriteEast Asian line break rules.
latin_line_break() / set_latin_line_break(NullableBool)Read/WriteLatin line break rules.
hanging_punctuation() / set_hanging_punctuation(NullableBool)Read/WriteHanging punctuation.

ParagraphCollection

The ParagraphCollection class is an iterable collection of Paragraph objects. Key methods:

MethodDescription
size()Number of paragraphs.
remove_at(int index)Remove paragraph at index.
begin() / end()Iterator support.

See Also