filters

kwdwriter.h

00001 /***************************************************************************
00002                           kwdwriter.h  -  description
00003                              -------------------
00004     begin                : Wed Sep 5 2001
00005     copyright            : (C) 2001 by Frank Dekervel
00006     email                : Frank.Dekervel@student.kuleuven.ac.be
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as        *
00013  *   published by                                                          *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef KWDWRITER_H
00020 #define KWDWRITER_H
00021 
00022 
00023 #include <qrect.h>
00024 #include <KoStore.h>
00025 #include <qdom.h>
00026 
00032 class KoTextZoomHandler;
00033 
00034 class KWDWriter {
00035 public: 
00036     KWDWriter(KoStore *store);
00037     ~KWDWriter();
00038 
00039 
00043     bool writeDoc();
00044 
00045 
00049     QDomElement addFrameSet(QDomElement parent, int frametype=1,
00050                    int frameinfo=0, QString name=QString::null,
00051                    int visible=1);
00052 
00057     bool isInTable() const;
00058 
00062     int createTable();
00063 
00064 
00068     QDomElement createTableCell(int tableno, int nrow,
00069                 int ncol, int colspan, QRect rect);
00070 
00071 
00072 
00076     QDomElement fetchTableCell(int tableno, int rowno, int colno);
00077 
00078 
00084     void finishTable(int tableno, QRect rect);
00085     void finishTable(int tableno);
00086 
00092     void createInline(QDomElement paragraph, QDomElement toInline);
00093 
00094 
00098     void createHR(QDomElement paragraph, int width=1);
00099 
00103     QDomElement currentLayout(QDomElement paragraph);
00104 
00108     QDomElement addFrame(QDomElement frameset, QRect rect, int runaround=0, int copy=0,
00109                                 //int top=42, int left=28, int bottom=799, int right=567,
00110                                 int newFrameBehaviour=0, int runaroundGap=2
00111                 );
00112 
00113 
00117     QDomElement addParagraph(QDomElement parent);
00118     QDomElement addParagraph(QDomElement parent, QDomElement layout);
00119 
00123         QDomElement formatAttribute(QDomElement paragraph, QString name, QString attrName, QString attr);
00124 
00128     QString getLayoutAttribute(QDomElement paragraph, QString name, QString attrName);
00129 
00130 
00134         QDomElement layoutAttribute(QDomElement paragraph, QString name, QString attrName, QString attr);
00135 
00140         QDomElement startFormat(QDomElement paragraph);
00141         QDomElement startFormat(QDomElement paragraph, QDomElement formatToClone);
00142 
00143 
00148      void cleanUpParagraph(QDomElement paragraph);
00149 
00153     void addText(QDomElement paragraph, QString text, int format_id, bool keep_formatting=false);
00154 
00159     QDomElement currentFormat(QDomElement paragraph, bool start_new_one=false);
00160 
00164     QDomElement createLink(QDomElement paragraph, QString linkName, QString hrefName);
00165 
00169     QDomElement setLayout(QDomElement paragraph, QDomElement layout);
00170 
00174     QString getText(QDomElement paragraph);
00175 
00179     QRect getRect(QDomElement frameset);
00180 
00184         QDomElement mainFrameset();
00185 
00189     void createDocInfo(QString author, QString title);
00190 
00194         QDomElement docroot();
00195 
00199     void appendKWordVariable(QDomDocument& doc, QDomElement& format,
00200         const QString& text, const QString& key, int type, QDomElement& child);
00201 
00202 private:
00206     void addRect(QDomElement e, QRect rect);
00207 
00208         
00209 protected:
00210     KoStore *_store;
00211     QDomElement _mainFrameset;
00212     QDomDocument *_doc;
00213     QDomDocument *_docinfo;
00214     QDomElement _docinfoMain;
00215     KoTextZoomHandler *_zoomhandler;
00216     int tableNo;
00217     bool insidetable;
00218     
00219 };
00220 
00221 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys