filters

ExportCss.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2001, 2002 Nicolas GOUTTE <goutte@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef EXPORTCSS_H
00022 #define EXPORTCSS_H
00023 
00024 #include <qmap.h>
00025 
00026 #include <KWEFBaseWorker.h>
00027 #include "ExportFilter.h"
00028 
00029 class StyleMap : public QMap<QString,LayoutData>
00030 {
00031 public:
00032     StyleMap(void) {}
00033     ~StyleMap(void) {}
00034 };
00035 
00036 class HtmlCssWorker : public HtmlWorker
00037 {
00038 public:
00039     HtmlCssWorker(void) { }
00040     virtual ~HtmlCssWorker(void) { }
00041 public:
00042     virtual bool doOpenStyles(void); 
00043     virtual bool doCloseStyles(void); 
00044     virtual bool doFullDefineStyle(LayoutData& layout);
00045     virtual bool doFullPaperFormat(const int format,
00046         const double width, const double height, const int orientation);
00047     virtual bool doFullPaperBorders (const double top, const double left,
00048         const double bottom, const double right); 
00049 protected:
00050     virtual QString getStartOfListOpeningTag(const CounterData::Style typeList, bool& ordered);
00051     virtual void openParagraph(const QString& strTag, const LayoutData& layout,
00052                                QChar::Direction direction=QChar::DirL);
00053     virtual void closeParagraph(const QString& strTag, const LayoutData& layout);
00054     virtual void openSpan(const FormatData& formatOrigin, const FormatData& format);
00055     virtual void closeSpan(const FormatData& formatOrigin, const FormatData& format);
00056 private:
00057     QString layoutToCss(const LayoutData& layoutOrigin,const LayoutData& layout,
00058         const bool force) const;
00059     QString escapeCssIdentifier(const QString& strText) const;
00060     QString textFormatToCss(const TextFormatting& formatOrigin,
00061         const TextFormatting& formatData, const bool force) const;
00062 private:
00063     QString m_strPageSize;
00064     QString m_strPaperBorders;
00065     StyleMap m_styleMap;
00066 };
00067 
00068 #endif /* EXPORTCSS_H */
KDE Home | KDE Accessibility Home | Description of Access Keys