filters

para.h

00001 /*
00002 ** Header file for inclusion with kword_xml2latex.c
00003 **
00004 ** Copyright (C) 2000,2002 Robert JACOLIN
00005 **
00006 ** This library is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU Library General Public
00008 ** License as published by the Free Software Foundation; either
00009 ** version 2 of the License, or (at your option) any later version.
00010 **
00011 ** This library is distributed in the hope that it will be useful,
00012 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 ** Library General Public License for more details.
00015 **
00016 ** To receive a copy of the GNU Library General Public License, write to the
00017 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 **
00020 */
00021 
00022 #ifndef __KWORD_PARA_H__
00023 #define __KWORD_PARA_H__
00024 
00025 #include <qstring.h>
00026 #include <qptrstack.h>      /* historic list */
00027 #include <qptrlist.h>       /* for list of format */
00028 
00029 /*#include "listeformat.h"*/    /* children class contents the zone (italic, footnote,
00030                    variable. */
00031 #include "layout.h"     /* set of informations about the paragraph style. */
00032 #include "element.h"        /* to use the father class. */
00033 #include "format.h"     /* child class */
00034 
00035 enum EP_INFO
00036 {
00037     EP_NONE,
00038     EP_FOOTNOTE
00039 };
00040 
00041 /*enum EP_HARDBRK
00042 {
00043     EP_FLOW,
00044     EP_NEXT
00045 };*/
00046 
00047 class TextFrame;
00048 
00049 /***********************************************************************/
00050 /* Class: Para                                                         */
00051 /***********************************************************************/
00052 
00058 class Para: public Layout
00059 {
00060     /* MARKUP DATA */
00061     QString        _text;
00062     QString*       _name;
00063     EP_INFO        _info;
00064     //EP_HARDBRK     _hardbrk;
00065     QPtrList<Format>* _lines;
00066 
00067     /* TO MANAGE THE LIST */
00068 
00069     /* USEFULL DATA */
00070     TextFrame*              _element;       /* Father frame */
00071     unsigned int            _currentPos;    /* Begining of the text to use the good format */
00072     static QPtrStack<EType> _historicList;  /* opened lists but not closed */
00073     int                     _nbLines;       /* Nb of lines in a cell (table) */
00074     static int              _tabulation;    /* Size of the para tabulation (for lists). */
00075 
00076     public:
00084         Para(TextFrame *textFrame = 0);
00085 
00086         /* 
00087          * Destructor
00088          *
00089          * The destructor must remove the list of little zones.
00090          */
00091         virtual ~Para();
00092 
00100         //bool     isColored    () const;
00104         //bool     isUlined     () const;
00105         //Para*    getNext      () const { return _next;      }
00106         //Para*    getPrevious  () const { return _previous;  }
00110         QString* getName      () const { return _name;      }
00114         EP_INFO  getInfo      () const { return _info;      }
00118         TextFrame*   getFrame     () const { return _element;   }
00122         SSect    getFrameType () const;
00126         EFormat  getTypeFormat(const QDomNode) const;
00130         int getNbCharPara() const;
00131 
00132         bool notEmpty() const { return (_lines == 0) ? false : (_lines->count() != 0); }
00136         //void setNext    (Para *p)  { _next      = p;    }
00137         //void setPrevious(Para *p)  { _previous  = p;    }
00138 
00146         void analyse         (const QDomNode);
00147 
00151         void generate        (QTextStream&);
00152 
00156         void generateBeginEnv(QTextStream&);
00157 
00161         void generateEndEnv(QTextStream&);
00162 
00166         void generateTitle    (QTextStream&);
00167 
00171         void openList         (QTextStream&);
00172 
00176         void closeList        (QTextStream&, Para*);
00177 
00178     private:
00179         void analyseParam     (const QDomNode);
00180         void analyseName      (const QDomNode);
00181         void analyseInfo      (const QDomNode);
00182         //void analyseBrk       (const QDomNode);
00183         void analyseLayoutPara(const QDomNode);
00184         void analyseFormat    (const QDomNode);
00185         void analyseFormats   (const QDomNode);
00186 
00190         void generateDebut    (QTextStream&);
00191         void generateFin      (QTextStream&);
00192 
00196         void closeList        (EType, QTextStream&);
00197 
00198 };
00199 
00200 #endif /* __KWORD_PARA_H__ */
KDE Home | KDE Accessibility Home | Description of Access Keys