filters

format.h

00001 
00002 /*
00003 ** Header file for inclusion with kword_xml2latex.c
00004 **
00005 ** Copyright (C) 2000 Robert JACOLIN
00006 **
00007 ** This library is free software; you can redistribute it and/or
00008 ** modify it under the terms of the GNU Library General Public
00009 ** License as published by the Free Software Foundation; either
00010 ** version 2 of the License, or (at your option) any later version.
00011 **
00012 ** This library is distributed in the hope that it will be useful,
00013 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 ** Library General Public License for more details.
00016 **
00017 ** To receive a copy of the GNU Library General Public License, write to the
00018 ** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 **
00021 */
00022 
00023 #ifndef __KWORD_FORMAT_H__
00024 #define __KWORD_FORMAT_H__
00025 
00026 #include <qtextstream.h>
00027 #include <qstring.h>
00028 #include <qcolor.h>
00029 #include "xmlparser.h"
00030 
00031 enum _EFormat
00032 {
00033     EF_ERROR,       /* 0 */
00034     EF_TEXTZONE,        /* 1 */
00035     EF_PICTURE,     /* 2 */
00036     EF_TABULATOR,       /* 3 */
00037     EF_VARIABLE,        /* 4 */
00038     EF_FOOTNOTE,        /* 5 */
00039     EF_ANCHOR       /* 6 */
00040 };
00041 
00042 typedef enum _EFormat EFormat;
00043 
00044 class Para;
00045 
00046 /***********************************************************************/
00047 /* Class: Format                                                       */
00048 /***********************************************************************/
00049 
00056 class Format: public XmlParser
00057 {
00058     EFormat _id;
00059     unsigned int _pos;
00060     unsigned int _taille;       /* Length of the string */
00061 
00062     /* USEFULL DATA */
00063     Para*   _para;      /* Parent class */
00064 
00065     public:
00073         Format(Para *para= 0): _id((EFormat) 0), _para(para)
00074         {}
00075 
00076         /* 
00077          * Destructor
00078          *
00079          * Nothing to do
00080          */
00081         virtual ~Format() {}
00082 
00086         EFormat getId        () const { return _id;   }
00087         Para*   getPara      () const { return _para; }
00088         EFormat getFormatType() const { return _id;   }
00089         unsigned int getPos       () const { return _pos;       }
00090         unsigned int getLength    () const { return _taille;    }
00091 
00095         void setId   (int   id)   { _id   = (EFormat) id; }
00096         void setPara (Para* para) { _para = para;         }
00097         void setPos        (const unsigned int pos){ _pos       = pos;  }
00098         void setLength     (const unsigned int t)  { _taille    = t; }
00099 
00107         virtual void analyse(const QDomNode);
00108 
00109         virtual void generate(QTextStream&) = 0;
00110         //virtual void generate(QTextStream&, int = 0);
00111 
00112 };
00113 
00114 #endif /* __KWORD_FORMAT_H__ */
KDE Home | KDE Accessibility Home | Description of Access Keys