22#include <tqtextcodec.h>
28#include <KWEFBaseWorker.h>
30#include "ExportFilter.h"
31#include "ExportDocStruct.h"
33TQString HtmlDocStructWorker::getStartOfListOpeningTag(
const CounterData::Style typeList,
bool& ordered)
38 case CounterData::STYLE_CUSTOMBULLET:
40 case CounterData::STYLE_NONE:
41 case CounterData::STYLE_CIRCLEBULLET:
42 case CounterData::STYLE_SQUAREBULLET:
43 case CounterData::STYLE_DISCBULLET:
49 case CounterData::STYLE_NUM:
50 case CounterData::STYLE_ALPHAB_L:
51 case CounterData::STYLE_ALPHAB_U:
52 case CounterData::STYLE_ROM_NUM_L:
53 case CounterData::STYLE_ROM_NUM_U:
54 case CounterData::STYLE_CUSTOM:
64void HtmlDocStructWorker::openFormatData(
const FormatData& formatOrigin,
65 const FormatData& format,
const bool force,
const bool allowBold)
69 if (format.text.fontName.contains(
"ourier"))
71 *m_streamOut <<
"<tt>";
74 if (force || (formatOrigin.text.italic!=format.text.italic))
76 if (format.text.italic)
78 *m_streamOut <<
"<i>";
82 if (force || ((formatOrigin.text.weight>=75)!=(format.text.weight>=75)))
84 if (allowBold && (format.text.weight >= 75))
86 *m_streamOut <<
"<b>";
90 if (force || (formatOrigin.text.verticalAlignment!=format.text.verticalAlignment))
92 if (1==format.text.verticalAlignment)
94 *m_streamOut <<
"<sub>";
96 else if (2==format.text.verticalAlignment)
98 *m_streamOut <<
"<sup>";
105void HtmlDocStructWorker::closeFormatData(
const FormatData& formatOrigin,
106 const FormatData& format,
const bool force,
const bool allowBold)
108 if (force || (formatOrigin.text.verticalAlignment!=format.text.verticalAlignment))
110 if (2==format.text.verticalAlignment)
112 *m_streamOut <<
"</sup>";
114 else if (1==format.text.verticalAlignment)
116 *m_streamOut <<
"</sub>";
120 if (force || ((formatOrigin.text.weight>=75)!=(format.text.weight>=75)))
122 if (allowBold && (format.text.weight >= 75))
124 *m_streamOut <<
"</b>";
128 if (force || (formatOrigin.text.italic!=format.text.italic))
130 if (format.text.italic)
132 *m_streamOut <<
"</i>";
136 if (format.text.fontName.contains(
"ourier"))
138 *m_streamOut <<
"</tt>";
142void HtmlDocStructWorker::openParagraph(
const TQString& strTag,
145 *m_streamOut <<
'<' << strTag <<
">";
146 openFormatData(layout.formatData,layout.formatData,
true,(strTag[0]!=
'h'));
149void HtmlDocStructWorker::closeParagraph(
const TQString& strTag,
152 closeFormatData(layout.formatData,layout.formatData,
true,(strTag[0]!=
'h'));
153 *m_streamOut <<
"</" << strTag <<
">\n";
156void HtmlDocStructWorker::openSpan(
const FormatData& formatOrigin,
const FormatData& format)
158 openFormatData(formatOrigin,format,
false,
true);
161void HtmlDocStructWorker::closeSpan(
const FormatData& formatOrigin,
const FormatData& format)
163 closeFormatData(formatOrigin,format,
false,
true);