![]() |
Qt 6.x
The Qt SDK
|
#include <qtextodfwriter_p.h>
Public Member Functions | |
QTextOdfWriter (const QTextDocument &document, QIODevice *device) | |
bool | writeAll () |
void | setCreateArchive (bool on) |
bool | createArchive () const |
void | writeBlock (QXmlStreamWriter &writer, const QTextBlock &block) |
void | writeFormats (QXmlStreamWriter &writer, const QSet< int > &formatIds) const |
void | writeBlockFormat (QXmlStreamWriter &writer, QTextBlockFormat format, int formatIndex) const |
void | writeCharacterFormat (QXmlStreamWriter &writer, QTextCharFormat format, int formatIndex) const |
void | writeListFormat (QXmlStreamWriter &writer, QTextListFormat format, int formatIndex) const |
void | writeFrameFormat (QXmlStreamWriter &writer, QTextFrameFormat format, int formatIndex) const |
void | writeTableFormat (QXmlStreamWriter &writer, QTextTableFormat format, int formatIndex) const |
void | writeTableCellFormat (QXmlStreamWriter &writer, QTextTableCellFormat format, int formatIndex, QList< QTextFormat > &styles) const |
void | writeFrame (QXmlStreamWriter &writer, const QTextFrame *frame) |
void | writeInlineCharacter (QXmlStreamWriter &writer, const QTextFragment &fragment) const |
Public Attributes | |
const QString | officeNS |
const QString | textNS |
const QString | styleNS |
const QString | foNS |
const QString | tableNS |
const QString | drawNS |
const QString | xlinkNS |
const QString | svgNS |
const int | defaultImageResolution = 11811 |
Protected Member Functions | |
void | tableCellStyleElement (QXmlStreamWriter &writer, const int &formatIndex, const QTextTableCellFormat &format, bool hasBorder, int tableId=0, const QTextTableFormat tableFormatTmp=QTextTableFormat()) const |
Definition at line 48 of file qtextodfwriter_p.h.
QTextOdfWriter::QTextOdfWriter | ( | const QTextDocument & | document, |
QIODevice * | device | ||
) |
Definition at line 953 of file qtextodfwriter.cpp.
|
inline |
Definition at line 54 of file qtextodfwriter_p.h.
|
inline |
Definition at line 53 of file qtextodfwriter_p.h.
|
protected |
Definition at line 887 of file qtextodfwriter.cpp.
References QTextCharFormat::AlignBottom, QTextCharFormat::AlignMiddle, QTextCharFormat::AlignTop, arg, QTextFrameFormat::border(), QTextFrameFormat::borderBrush(), QTextFrameFormat::borderStyle(), borderStyleName(), QTextTableFormat::cellPadding(), QBrush::color(), foNS, QString::fromLatin1(), QColor::HexRgb, QColor::name(), pixelToPoint(), pos, styleNS, and QTextFormat::TextVerticalAlignment.
Referenced by writeTableCellFormat().
bool QTextOdfWriter::writeAll | ( | ) |
Definition at line 969 of file qtextodfwriter.cpp.
References QTextDocument::allFormats(), QList< T >::append(), QFragmentMap< Fragment >::begin(), QTextDocumentPrivate::begin(), QListSpecialMethodsBase< T >::contains(), QHash< Key, T >::contains(), QOutputStrategy::contentStream, copy(), drawNS, QFragmentMap< Fragment >::end(), foNS, QTextFragmentData::format, QTextBlockData::format, QTextObject::formatIndex(), QString::fromLatin1(), QTextDocumentPrivate::get(), QHash< Key, T >::insert(), QSet< T >::insert(), QIODevice::isWritable(), QFragmentMap< QTextBlockData >::Iterator, QTextDocument::objectForFormat(), officeNS, QIODevice::open(), qWarning, QTextDocument::rootFrame(), styleNS, svgNS, tableNS, textNS, QHash< Key, T >::value(), writeFormats(), writeFrame(), QIODeviceBase::WriteOnly, and xlinkNS.
Referenced by QTextDocumentWriter::write().
void QTextOdfWriter::writeBlock | ( | QXmlStreamWriter & | writer, |
const QTextBlock & | block | ||
) |
Definition at line 260 of file qtextodfwriter.cpp.
References QTextFormat::AnchorHref, arg, QString::at(), QTextBlock::begin(), QTextBlock::blockFormatIndex(), QTextList::format(), QTextObject::formatIndex(), QString::fromLatin1(), i, QTextListFormat::indent(), QList< T >::isEmpty(), QTextBlock::length(), QString::mid(), QString::number(), QStack< T >::pop(), QStack< T >::push(), QString::size(), QList< T >::size(), QTextBlock::textList(), textNS, QStack< T >::top(), QChar::unicode(), writeInlineCharacter(), and xlinkNS.
Referenced by writeFrame().
void QTextOdfWriter::writeBlockFormat | ( | QXmlStreamWriter & | writer, |
QTextBlockFormat | format, | ||
int | formatIndex | ||
) | const |
Definition at line 523 of file qtextodfwriter.cpp.
References Qt::AlignAbsolute, Qt::AlignHCenter, Qt::AlignHorizontal_Mask, Qt::AlignJustify, Qt::AlignLeading, Qt::AlignLeft, alignment, Qt::AlignRight, Qt::AlignTrailing, arg, QTextFormat::BackgroundBrush, QList< T >::begin(), QTextFormat::BlockAlignment, QTextFormat::BlockBottomMargin, QTextFormat::BlockIndent, QTextFormat::BlockLeftMargin, QTextFormat::BlockNonBreakableLines, QTextFormat::BlockRightMargin, QTextFormat::BlockTopMargin, QTextOption::CenterTab, QTextOption::DelimiterTab, QList< T >::end(), QTextBlockFormat::FixedHeight, foNS, QString::fromLatin1(), QTextOption::LeftTab, QTextBlockFormat::LineDistanceHeight, QTextFormat::LineHeightType, QTextBlockFormat::MinimumHeight, QString::number(), QTextFormat::PageBreak_AlwaysAfter, QTextFormat::PageBreak_AlwaysBefore, QTextFormat::PageBreakPolicy, pixelToPoint(), QTextBlockFormat::ProportionalHeight, qMax(), qWarning, QTextOption::RightTab, QTextBlockFormat::SingleHeight, styleNS, QTextFormat::TabPositions, and QTextFormat::TextIndent.
Referenced by writeFormats().
void QTextOdfWriter::writeCharacterFormat | ( | QXmlStreamWriter & | writer, |
QTextCharFormat | format, | ||
int | formatIndex | ||
) | const |
Definition at line 632 of file qtextodfwriter.cpp.
References QTextCharFormat::AlignBaseline, QTextCharFormat::AlignBottom, QTextCharFormat::AlignMiddle, QTextCharFormat::AlignNormal, QTextCharFormat::AlignSubScript, QTextCharFormat::AlignSuperScript, QTextCharFormat::AlignTop, QFont::AllLowercase, QFont::AllUppercase, QTextFormat::AnchorHref, QTextFormat::AnchorName, arg, QTextFormat::BackgroundBrush, QFont::Bold, QFont::Capitalize, QTextCharFormat::DashDotDotLine, QTextCharFormat::DashDotLine, QTextCharFormat::DashUnderline, QTextCharFormat::DotLine, foNS, QTextFormat::FontCapitalization, QTextFormat::FontFixedPitch, QTextFormat::FontLetterSpacing, QTextFormat::FontOverline, QTextFormat::FontPointSize, QTextFormat::FontStrikeOut, QTextFormat::FontUnderline, QTextFormat::FontWeight, QTextFormat::FontWordSpacing, QTextFormat::ForegroundBrush, QString::fromLatin1(), QTextFormat::IsAnchor, QFont::MixedCase, QFont::Normal, QTextCharFormat::NoUnderline, QString::number(), QTextFormat::OldFontFamily, pixelToPoint(), QTextCharFormat::SingleUnderline, QFont::SmallCaps, QTextCharFormat::SpellCheckUnderline, styleNS, QTextFormat::TextOutline, QTextFormat::TextToolTip, QTextFormat::TextUnderlineColor, QTextFormat::TextUnderlineStyle, QTextFormat::TextVerticalAlignment, and QTextCharFormat::WaveUnderline.
Referenced by writeFormats().
void QTextOdfWriter::writeFormats | ( | QXmlStreamWriter & | writer, |
const QSet< int > & | formatIds | ||
) | const |
Definition at line 492 of file qtextodfwriter.cpp.
References QTextDocument::allFormats(), QList< T >::at(), QTextFormat::BlockFormat, QTextFormat::CharFormat, QTextFormat::FrameFormat, QString::fromLatin1(), QTextFormat::isTableCellFormat(), QTextFormat::isTableFormat(), QTextFormat::ListFormat, officeNS, QTextFormat::toBlockFormat(), QTextFormat::toCharFormat(), QTextFormat::toFrameFormat(), QTextFormat::toListFormat(), QTextFormat::toTableCellFormat(), QTextFormat::toTableFormat(), QTextFormat::type(), writeBlockFormat(), writeCharacterFormat(), writeFrameFormat(), writeListFormat(), writeTableCellFormat(), and writeTableFormat().
Referenced by writeAll().
void QTextOdfWriter::writeFrame | ( | QXmlStreamWriter & | writer, |
const QTextFrame * | frame | ||
) |
Definition at line 186 of file qtextodfwriter.cpp.
References arg, child, QTextTableCell::columnSpan(), QHash< Key, T >::contains(), QSet< T >::contains(), QTextTableCell::format(), frame, QString::fromLatin1(), QTextFormat::isTableCellFormat(), QString::number(), QTextBlock::position(), Q_ASSERT, QTextTableCell::row(), QTextTableCell::rowSpan(), QTextTableCell::tableCellFormatIndex(), tableNS, textNS, writeBlock(), and writeFrame().
Referenced by writeAll(), and writeFrame().
void QTextOdfWriter::writeFrameFormat | ( | QXmlStreamWriter & | writer, |
QTextFrameFormat | format, | ||
int | formatIndex | ||
) | const |
Definition at line 776 of file qtextodfwriter.cpp.
References arg, foNS, QTextFormat::FrameBottomMargin, QTextFormat::FrameLeftMargin, QTextFormat::FrameRightMargin, QTextFormat::FrameTopMargin, QString::fromLatin1(), pixelToPoint(), qMax(), and styleNS.
Referenced by writeFormats().
void QTextOdfWriter::writeInlineCharacter | ( | QXmlStreamWriter & | writer, |
const QTextFragment & | fragment | ||
) | const |
Definition at line 407 of file qtextodfwriter.cpp.
References QOutputStrategy::addFile(), QTextFragment::charFormat(), QOutputStrategy::createUniqueImageName(), QBuffer::data(), drawNS, file, QString::fromLatin1(), QTextFormat::hasProperty(), QTextImageFormat::height(), QTextFormat::ImageHeight, QTextDocument::ImageResource, QTextFormat::ImageWidth, QTextFormat::isImageFormat(), mimeType, QTextImageFormat::name(), QFile::open(), pixelToPoint(), QString::prepend(), probeImageData(), QStringLiteral, QTextImageFormat::quality(), QIODevice::readAll(), QIODeviceBase::ReadOnly, QTextDocument::resource(), QFileDevice::seek(), QImageWriter::setQuality(), svgNS, textNS, QVariant::toByteArray(), QTextFormat::toImageFormat(), url, QVariant::userType(), variant, QTextImageFormat::width(), QImageWriter::write(), and xlinkNS.
Referenced by writeBlock().
void QTextOdfWriter::writeListFormat | ( | QXmlStreamWriter & | writer, |
QTextListFormat | format, | ||
int | formatIndex | ||
) | const |
Definition at line 739 of file qtextodfwriter.cpp.
References QString::arg(), arg, bulletChar(), foNS, QString::fromLatin1(), QTextListFormat::ListDecimal, QTextListFormat::ListLowerAlpha, QTextListFormat::ListLowerRoman, QTextFormat::ListNumberPrefix, QTextFormat::ListNumberSuffix, QTextListFormat::ListUpperAlpha, QTextListFormat::ListUpperRoman, QString::number(), spacing, styleNS, and textNS.
Referenced by writeFormats().
void QTextOdfWriter::writeTableCellFormat | ( | QXmlStreamWriter & | writer, |
QTextTableCellFormat | format, | ||
int | formatIndex, | ||
QList< QTextFormat > & | styles | ||
) | const |
Definition at line 868 of file qtextodfwriter.cpp.
References QList< T >::at(), QHash< Key, T >::contains(), qDebug, tableCellStyleElement(), QTextFormat::toTableFormat(), and QHash< Key, T >::value().
Referenced by writeFormats().
void QTextOdfWriter::writeTableFormat | ( | QXmlStreamWriter & | writer, |
QTextTableFormat | format, | ||
int | formatIndex | ||
) | const |
! HARD-CODING variableWidth Constraints to 100% / nr constraints
Definition at line 804 of file qtextodfwriter.cpp.
References Qt::AlignHCenter, Qt::AlignJustify, Qt::AlignLeft, Qt::AlignRight, arg, QSet< T >::contains(), QTextLength::FixedLength, QString::fromLatin1(), QSet< T >::insert(), QString::number(), QTextLength::PercentageLength, styleNS, and tableNS.
Referenced by writeFormats().
const int QTextOdfWriter::defaultImageResolution = 11811 |
Definition at line 69 of file qtextodfwriter_p.h.
const QString QTextOdfWriter::drawNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), and writeInlineCharacter().
const QString QTextOdfWriter::foNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by tableCellStyleElement(), writeAll(), writeBlockFormat(), writeCharacterFormat(), writeFrameFormat(), and writeListFormat().
const QString QTextOdfWriter::officeNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), and writeFormats().
const QString QTextOdfWriter::styleNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by tableCellStyleElement(), writeAll(), writeBlockFormat(), writeCharacterFormat(), writeFrameFormat(), writeListFormat(), and writeTableFormat().
const QString QTextOdfWriter::svgNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), and writeInlineCharacter().
const QString QTextOdfWriter::tableNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), writeFrame(), and writeTableFormat().
const QString QTextOdfWriter::textNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), writeBlock(), writeFrame(), writeInlineCharacter(), and writeListFormat().
const QString QTextOdfWriter::xlinkNS |
Definition at line 68 of file qtextodfwriter_p.h.
Referenced by writeAll(), writeBlock(), and writeInlineCharacter().