html/export/ExportFilter.h
1/*
2 This file is part of the KDE project
3 Copyright (C) 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef EXPORTFILTERFULLPOWER_H
22#define EXPORTFILTERFULLPOWER_H
23
24#include <tqvaluestack.h>
25
26#include <KWEFBaseWorker.h>
27
28class ListInfo
29{
30public:
31 CounterData::Style m_typeList;
32 bool m_orderedList;
33};
34
35class HtmlWorker : public KWEFBaseWorker
36{
37public:
38 HtmlWorker(void) : m_ioDevice(NULL), m_streamOut(NULL) { }
39 virtual ~HtmlWorker(void) { delete m_streamOut; delete m_ioDevice; }
40public:
41 virtual bool doOpenFile(const TQString& filenameOut, const TQString& to);
42 virtual bool doCloseFile(void); // Close file in normal conditions
43 virtual bool doOpenDocument(void);
44 virtual bool doCloseDocument(void);
45 virtual bool doFullParagraph(const TQString& paraText, const LayoutData& layout,
46 const ValueListFormatData& paraFormatDataList);
47 virtual bool doFullDocumentInfo(const KWEFDocumentInfo& docInfo);
48 virtual bool doOpenTextFrameSet(void);
49 virtual bool doCloseTextFrameSet(void);
50 virtual bool doOpenHead(void);
51 virtual bool doCloseHead(void);
52 virtual bool doOpenBody(void);
53 virtual bool doCloseBody(void);
54protected:
55 virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered)=0;
60 virtual void openParagraph(const TQString& strTag,
61 const LayoutData& layout, TQChar::Direction direction=TQChar::DirL)=0;
62 virtual void closeParagraph(const TQString& strTag,
63 const LayoutData& layout)=0;
64 virtual void openSpan(const FormatData& formatOrigin, const FormatData& format)=0;
65 virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format)=0;
66 virtual void writeDocType(void);
67
68 virtual TQString customCSSURL(void) const { return TQString(); }
69public:
70 inline bool isXML (void) const { return m_xml; }
71 inline void setXML (const bool flag ) { m_xml=flag; }
72 inline TQTextCodec* getCodec(void) const { return m_codec; }
73 inline void setCodec(TQTextCodec* codec) { m_codec=codec; }
74protected:
75 TQString escapeHtmlText(const TQString& strText) const;
84 TQString getAdditionalFileName(const TQString& additionalName);
85private:
86 void ProcessParagraphData ( const TQString& strTag, const TQString &paraText,
87 const LayoutData& layout, const ValueListFormatData &paraFormatDataList);
88 void formatTextParagraph(const TQString& strText,
89 const FormatData& formatOrigin, const FormatData& format);
90 bool makeTable(const FrameAnchor& anchor);
91 bool makeImage(const FrameAnchor& anchor);
92protected:
93 TQIODevice* m_ioDevice;
94 TQTextStream* m_streamOut;
95 TQTextCodec* m_codec;
96 TQString m_strTitle;
97 TQString m_fileName;
98 TQString m_strFileDir;
99 TQString m_strSubDirectoryName;
100 TQValueStack<ListInfo> m_listStack;
101 bool m_xml;
102};
103
104#endif /* EXPORTFILTERFULLPOWER_H */
This is basically <FRAMESET> tag.
Base worker of the libexport system.
virtual bool doCloseBody(void)
Like HTML's </BODY>
virtual bool doCloseHead(void)
Like HTML's </HEAD>
virtual bool doOpenHead(void)
Like HTML's <HEAD>
virtual bool doOpenBody(void)
Like HTML's <BODY>
Paragraph layout.