filters

variableformat.h

00001 /*
00002 ** Header file for inclusion with kword_xml2latex.c
00003 **
00004 ** Copyright (C) 2000 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_VARIABLEFORMAT_H__
00023 #define __KWORD_VARIABLEFORMAT_H__
00024 
00025 #include <qstring.h>
00026 #include <qcolor.h>
00027 #include "textzone.h"
00028 
00029 enum _EVarType
00030 {
00031     VAR_DATE,
00032     VAR_UNUSED,
00033     VAR_TIME,
00034     VAR_UNUSED2,
00035     VAR_PAGE,
00036     VAR_UNUSED3,
00037     VAR_CUSTOM,
00038     VAR_MAILMERGE,
00039     VAR_FIELD,
00040     VAR_LINK,
00041     VAR_NOTE,
00042     VAR_FOOTNOTE
00043 };
00044 
00045 typedef enum _EVarType EVarType;
00046 
00047 /***********************************************************************/
00048 /* Class: VariableFormat                                               */
00049 /***********************************************************************/
00050 
00055 class VariableFormat: public TextZone
00056 {
00057     /*QString      _police;
00058     unsigned int _size;*/           /* Size of the police   */
00059     //unsigned int _weight;     /* bold                 */
00060     /*bool         _italic;
00061     bool         _underline;
00062     bool         _strikeout;
00063     EAlign       _vertalign;
00064     QColor*      _textcolor;*/
00065 
00066     /* VARIABLE */
00067     QString  _key;
00068     EVarType _varType;
00069     QString  _text;
00070 
00071     /* DATE */
00072     int  _day;
00073     int  _month;
00074     int  _year;
00075     bool _fix;
00076 
00077     /* HOUR */
00078     int _hour;
00079     int _minute;
00080     int _seconde;
00081 
00082     /* FOOTNOTE */
00083     QString _numberingtype;
00084     QString _notetype;
00085     QString _frameset;
00086     QString _value;
00087 
00088     /* NOTE */
00089     QString _note;
00090 
00091     public:
00098         VariableFormat(Para* para): TextZone(para)
00099         {
00100             setSize(11);
00101             setWeight(0);
00102             setItalic(false);
00103             setUnderlined(UNDERLINE_NONE);
00104             setStrikeout(0);
00105             setPos(0);
00106             setLength(0);
00107         }
00108 
00109         /* 
00110          * Destructor
00111          *
00112          * The destructor must remove the list of little zones.
00113          *
00114          */
00115         virtual ~VariableFormat() {}
00116 
00117         /* ==== Getters ==== */
00118         QString      getKey       () const { return _key;     }
00119         QString      getText      () const { return _text;    }
00120         EVarType     getType      () const { return _varType; }
00121         int          getDay       () const { return _day;     }
00122         int          getMonth     () const { return _month;   }
00123         int          getYear      () const { return _year;    }
00124         int          getHour      () const { return _hour;    }
00125         int          getMinute    () const { return _minute;  }
00126         int          getSeconde   () const { return _seconde; }
00127         QString      getNumberingtype() const { return _numberingtype; }
00128         QString      getNotetype  () const { return _notetype; }
00129         QString      getFrameset  () const { return _frameset; }
00130         QString      getValue     () const { return _value;    }
00131         QString      getNote      () const { return _note;     }
00132         
00133         bool         isFix        () const { return (_fix       == true); }
00134 
00135         /* ==== Setters ==== */
00136         void setType       (const int t)           { _varType   = (EVarType) t; }
00137         void setKey        (QString k)             { _key       = k; }
00138         void setText       (QString t)             { _text      = t; }
00139         void setFix        (bool f)                { _fix       = f; }
00140         void setDay        (const int d)           { _day       = d; }
00141         void setMonth      (const int m)           { _year      = m; }
00142         void setYear       (const int y)           { _month     = y; }
00143         void setHour       (const int h)           { _hour      = h; }
00144         void setMinute     (const int m)           { _minute    = m; }
00145         void setSeconde    (const int s)           { _seconde   = s; }
00146         void setColor      (const int, const int, const int);
00147     void setNumberingtype(const QString nt) { _numberingtype = nt; }
00148         void setNotetype  (const QString nt)    { _notetype = nt; }
00149         void setFrameset  (const QString fs)    { _frameset = fs; }
00150         void setValue     (const QString val)   { _value = val;   }
00151         void setNote      (const QString note)  { _note  = note;  }
00152 
00153         /* ==== Helpfull functions ==== */
00154         void analyseFormat(const QDomNode);
00155         void analyseDate      (const QDomNode);
00156         void analyseTime      (const QDomNode);
00157         void analyseFootnote  (const QDomNode);
00158         void analyseNote      (const QDomNode);
00159         void analyseType      (const QDomNode);
00160 };
00161 
00162 #endif /* __KWORD_VARIABLEFORMAT_H__ */
KDE Home | KDE Accessibility Home | Description of Access Keys