![]() |
Scribus
Open source desktop publishing at your fingertips
|
#include <textwriter.h>
Public Member Functions | |
TextWriter (ScribusDoc *doc) | |
void | open (PageItem *textframe) |
void | close () |
CharStyle | getCurrentCharStyle () |
ParagraphStyle | getCurrentStyle () |
void | setCharStyle (const CharStyle &cstyle) |
void | setCharStyle (const QString &name) |
void | setStyle (const ParagraphStyle &pstyle) |
void | setStyle (const QString &name) |
void | appendText (const QString &text) |
void | defineCharStyle (const QString name, const CharStyle &cstyle) |
void | defineStyle (const QString &name, const ParagraphStyle &pstyle) |
void | defineFont (const QString &name, const QString &family, const QString &variant, bool bold=false, bool italic=false) |
void | defineColor (const QString &name, const ScColor &color) |
ScribusDoc * | currentDoc () |
Helper class for importing text
void TextWriter::appendText | ( | const QString & | text | ) |
Appends text using current character style and paragraph style
void TextWriter::close | ( | ) |
Writes all pending information to the target. This method returns the document into a consistent state. Failing to call it may cause data loss or corruption.
void TextWriter::defineCharStyle | ( | const QString | name, |
const CharStyle & | cstyle | ||
) |
Introduces a new named character style into the document
void TextWriter::defineColor | ( | const QString & | name, |
const ScColor & | color | ||
) |
Introduces a new named color into the document
void TextWriter::defineFont | ( | const QString & | name, |
const QString & | family, | ||
const QString & | variant, | ||
bool | bold = false , |
||
bool | italic = false |
||
) |
Introduces a new named font into the document. If the document already uses a font 'name', use that. Otherwise find a match using 'family', 'variant', 'bold' and 'italic'
void TextWriter::defineStyle | ( | const QString & | name, |
const ParagraphStyle & | pstyle | ||
) |
Introduces a new named paragraph style into the document
CharStyle TextWriter::getCurrentCharStyle | ( | ) |
Return the current character style
ParagraphStyle TextWriter::getCurrentStyle | ( | ) |
Return the current character style
void TextWriter::open | ( | PageItem * | textframe | ) |
Sets the target for following set* and append operations. Only one pageitem of a linked chain may be opened at the same time, it's responsibility of the programmer to ensure that
void TextWriter::setCharStyle | ( | const CharStyle & | cstyle | ) |
Sets the character style for following append operations
void TextWriter::setStyle | ( | const ParagraphStyle & | pstyle | ) |
Sets the paragraph style for following append operations, ie. the style to be used when the next paragraph separator (
) is appended. The current paragraph style will not be changed