filters

element.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_ELEMENT_H__
00024 #define __KWORD_ELEMENT_H__
00025 
00026 #include <qtextstream.h>
00027 #include "xmlparser.h"
00028 #include "border.h"
00029 
00030 /* FRAMESET */
00031 enum SType
00032 {
00033     ST_NONE,
00034     ST_TEXT,
00035     ST_PICTURE,
00036     ST_PART,            /* This last Type mustn't be */
00037     ST_FORMULA,     /* displayed where they are. */
00038     ST_CLIPART,
00039     ST_HLINE
00040 };
00041 
00042 enum SSect
00043 {
00044     SS_NONE,
00045     SS_HEADERS,
00046     SS_FOOTERS,
00047     SS_BODY,
00048     SS_FOOTNOTES,
00049     SS_TABLE
00050 };
00051 
00052 enum SInfo
00053 {
00054     SI_NONE,
00055     SI_FIRST,
00056     SI_ODD,
00057     SI_EVEN
00058 };
00059 
00060 /* FRAME */
00061 enum TAround
00062 {
00063     TA_NONE,
00064     TA_FRAME,
00065     TA_TEXT
00066 };
00067 
00068 enum TCreate
00069 {
00070     TC_EXTEND,
00071     TC_CREATE,
00072     TC_IGNORE
00073 };
00074 
00075 enum TNFrame
00076 {
00077     TF_RECONNECT,
00078     TF_NOCREATION,
00079     TF_COPY
00080 };
00081 
00082 enum TSide
00083 {
00084     TS_ANYSIDE,
00085     TS_ODDPAGE,
00086     TS_EVENPAGE
00087 };
00088 
00089 /***********************************************************************/
00090 /* Class: Element                                                      */
00091 /***********************************************************************/
00092 
00097 class Element: public XmlParser, public Border
00098 {
00099     /* FRAMESET PARAM */
00100     SType   _type;
00101     SSect   _section;
00102     SInfo   _hinfo;
00103     QString _name;
00104     bool    _removable;
00105     bool    _visible;
00106     QString _grpMgr;
00107     int     _row,
00108         _col,
00109         _rows,
00110         _cols;
00111 
00112     /* USEFULL DATA */
00113 
00114     public:
00121         Element();
00122 
00123         /* 
00124          * Destructor
00125          *
00126          */
00127         virtual ~Element();
00128 
00129         /*virtual bool  hasColor() const = 0;
00130         virtual bool  hasUline() const = 0;*/
00134         SSect    getSection () const { return _section;        }
00135         SType    getType    () const { return _type;           }
00136         SInfo    getInfo    () const { return _hinfo;          }
00137         QString  getName    () const { return _name;           }
00138         bool     isVisible  () const { return _visible;        }
00139         bool     isRemovable() const { return _removable;      }
00140         QString  getGrpMgr  () const { return _grpMgr;         }
00141         int      getRow     () const { return _row;            }
00142         int      getCol     () const { return _col;            }
00143         int      getRows    () const { return _rows;           }
00144         int      getCols    () const { return _cols;           }
00145         bool     isTable    () const { return (_section == SS_TABLE); }
00146 
00150         void setType     (SType       t)   { _type      = t;   }
00151         void setSection  (SSect       s)   { _section   = s;   }
00152         void setVisible  (bool        v)   { _visible   = v;   }
00153         void setRemovable(bool        r)   { _removable = r;   }
00154         void setGrpMgr   (QString     g)   { _grpMgr    = g;   }
00155         void setRow      (int         r)   { _row       = r;   }
00156         void setCol      (int         c)   { _col       = c;   }
00157         void setRows     (int         r)   { _rows      = r;   }
00158         void setCols     (int         c)   { _cols      = c;   }
00159 
00168         virtual void analyse(const QDomNode);
00169         virtual void generate(QTextStream&) = 0;
00170 
00171     private:
00172         void analyseParam(const QDomNode);
00173 };
00174 
00175 #endif /* __KWORD_ELEMENT_H__ */
KDE Home | KDE Accessibility Home | Description of Access Keys