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 ParagraphHeader: include/Aspose/Slides/Foss/paragraph.h
Constructors
| Signature | Description |
|---|---|
Paragraph() | Create a new empty paragraph. |
Properties
| Property | Accessor | Description |
|---|---|---|
text() | Read | Returns the concatenated text of all portions. |
set_text(const std::string&) | Write | Replace all text in this paragraph. |
IParagraph Interface
The IParagraph interface (from i_paragraph.h) defines:
| Method | Description |
|---|---|
text() | Get the paragraph text. |
set_text(const std::string&) | Set the paragraph text. |
IParagraphFormat Interface
The IParagraphFormat interface controls paragraph-level formatting:
| Property | Accessor | Description |
|---|---|---|
alignment() / set_alignment(TextAlignment) | Read/Write | Text alignment. |
depth() / set_depth(int) | Read/Write | Outline/indent depth. |
space_within() / set_space_within(float) | Read/Write | Line spacing within the paragraph. |
space_before() / set_space_before(float) | Read/Write | Space before the paragraph. |
space_after() / set_space_after(float) | Read/Write | Space after the paragraph. |
margin_left() / set_margin_left(float) | Read/Write | Left margin. |
margin_right() / set_margin_right(float) | Read/Write | Right margin. |
indent() / set_indent(float) | Read/Write | First-line indent. |
default_tab_size() / set_default_tab_size(float) | Read/Write | Default tab stop size. |
font_alignment() / set_font_alignment(FontAlignment) | Read/Write | Font alignment within the line. |
right_to_left() / set_right_to_left(NullableBool) | Read/Write | Right-to-left text direction. |
east_asian_line_break() / set_east_asian_line_break(NullableBool) | Read/Write | East Asian line break rules. |
latin_line_break() / set_latin_line_break(NullableBool) | Read/Write | Latin line break rules. |
hanging_punctuation() / set_hanging_punctuation(NullableBool) | Read/Write | Hanging punctuation. |
ParagraphCollection
The ParagraphCollection class is an iterable collection of Paragraph objects. Key methods:
| Method | Description |
|---|---|
size() | Number of paragraphs. |
remove_at(int index) | Remove paragraph at index. |
begin() / end() | Iterator support. |