filters

ExportCss.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 EXPORTCSS_H
22#define EXPORTCSS_H
23
24#include <tqmap.h>
25
26#include <KWEFBaseWorker.h>
27#include "ExportFilter.h"
28
29class StyleMap : public TQMap<TQString,LayoutData>
30{
31public:
32 StyleMap(void) {}
33 ~StyleMap(void) {}
34};
35
36class HtmlCssWorker : public HtmlWorker
37{
38public:
39 HtmlCssWorker(void) { }
40 virtual ~HtmlCssWorker(void) { }
41public:
42 virtual bool doOpenStyles(void);
43 virtual bool doCloseStyles(void);
44 virtual bool doFullDefineStyle(LayoutData& layout);
45 virtual bool doFullPaperFormat(const int format,
46 const double width, const double height, const int orientation);
47 virtual bool doFullPaperBorders (const double top, const double left,
48 const double bottom, const double right);
49protected:
50 virtual TQString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered);
51 virtual void openParagraph(const TQString& strTag, const LayoutData& layout,
52 TQChar::Direction direction=TQChar::DirL);
53 virtual void closeParagraph(const TQString& strTag, const LayoutData& layout);
54 virtual void openSpan(const FormatData& formatOrigin, const FormatData& format);
55 virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format);
56private:
57 TQString layoutToCss(const LayoutData& layoutOrigin,const LayoutData& layout,
58 const bool force) const;
59 TQString escapeCssIdentifier(const TQString& strText) const;
60 TQString textFormatToCss(const TextFormatting& formatOrigin,
61 const TextFormatting& formatData, const bool force) const;
62private:
63 TQString m_strPageSize;
64 TQString m_strPaperBorders;
65 StyleMap m_styleMap;
66};
67
68#endif /* EXPORTCSS_H */
virtual bool doOpenStyles(void)
Like HTML's <style>.
virtual bool doCloseStyles(void)
Like HTML's </style>.