variableformat.h
1/*
2** Header file for inclusion with kword_xml2latex.c
3**
4** Copyright (C) 2000 Robert JACOLIN
5**
6** This library is free software; you can redistribute it and/or
7** modify it under the terms of the GNU Library General Public
8** License as published by the Free Software Foundation; either
9** version 2 of the License, or (at your option) any later version.
10**
11** This library is distributed in the hope that it will be useful,
12** but WITHOUT ANY WARRANTY; without even the implied warranty of
13** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14** Library General Public License for more details.
15**
16** To receive a copy of the GNU Library General Public License, write to the
17** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19**
20*/
21
22#ifndef __KWORD_VARIABLEFORMAT_H__
23#define __KWORD_VARIABLEFORMAT_H__
24
25#include <tqstring.h>
26#include <tqcolor.h>
27#include "textzone.h"
28
29enum _EVarType
30{
31 VAR_DATE,
32 VAR_UNUSED,
33 VAR_TIME,
34 VAR_UNUSED2,
35 VAR_PAGE,
36 VAR_UNUSED3,
37 VAR_CUSTOM,
38 VAR_MAILMERGE,
39 VAR_FIELD,
40 VAR_LINK,
41 VAR_NOTE,
42 VAR_FOOTNOTE
43};
44
45typedef enum _EVarType EVarType;
46
47/***********************************************************************/
48/* Class: VariableFormat */
49/***********************************************************************/
50
56{
57 /*TQString _police;
58 unsigned int _size;*/ /* Size of the police */
59 //unsigned int _weight; /* bold */
60 /*bool _italic;
61 bool _underline;
62 bool _strikeout;
63 EAlign _vertalign;
64 TQColor* _textcolor;*/
65
66 /* VARIABLE */
67 TQString _key;
68 EVarType _varType;
69 TQString _text;
70
71 /* DATE */
72 int _day;
73 int _month;
74 int _year;
75 bool _fix;
76
77 /* HOUR */
78 int _hour;
79 int _minute;
80 int _seconde;
81
82 /* FOOTNOTE */
83 TQString _numberingtype;
84 TQString _notetype;
85 TQString _frameset;
86 TQString _value;
87
88 /* NOTE */
89 TQString _note;
90
91 public:
99 {
100 setSize(11);
101 setWeight(0);
102 setItalic(false);
103 setUnderlined(UNDERLINE_NONE);
104 setStrikeout(0);
105 setPos(0);
106 setLength(0);
107 }
108
109 /*
110 * Destructor
111 *
112 * The destructor must remove the list of little zones.
113 *
114 */
115 virtual ~VariableFormat() {}
116
117 /* ==== Getters ==== */
118 TQString getKey () const { return _key; }
119 TQString getText () const { return _text; }
120 EVarType getType () const { return _varType; }
121 int getDay () const { return _day; }
122 int getMonth () const { return _month; }
123 int getYear () const { return _year; }
124 int getHour () const { return _hour; }
125 int getMinute () const { return _minute; }
126 int getSeconde () const { return _seconde; }
127 TQString getNumberingtype() const { return _numberingtype; }
128 TQString getNotetype () const { return _notetype; }
129 TQString getFrameset () const { return _frameset; }
130 TQString getValue () const { return _value; }
131 TQString getNote () const { return _note; }
132
133 bool isFix () const { return (_fix == true); }
134
135 /* ==== Setters ==== */
136 void setType (const int t) { _varType = (EVarType) t; }
137 void setKey (TQString k) { _key = k; }
138 void setText (TQString t) { _text = t; }
139 void setFix (bool f) { _fix = f; }
140 void setDay (const int d) { _day = d; }
141 void setMonth (const int m) { _year = m; }
142 void setYear (const int y) { _month = y; }
143 void setHour (const int h) { _hour = h; }
144 void setMinute (const int m) { _minute = m; }
145 void setSeconde (const int s) { _seconde = s; }
146 void setColor (const int, const int, const int);
147 void setNumberingtype(const TQString nt) { _numberingtype = nt; }
148 void setNotetype (const TQString nt) { _notetype = nt; }
149 void setFrameset (const TQString fs) { _frameset = fs; }
150 void setValue (const TQString val) { _value = val; }
151 void setNote (const TQString note) { _note = note; }
152
153 /* ==== Helpfull functions ==== */
154 void analyseFormat(const TQDomNode);
155 void analyseDate (const TQDomNode);
156 void analyseTime (const TQDomNode);
157 void analyseFootnote (const TQDomNode);
158 void analyseNote (const TQDomNode);
159 void analyseType (const TQDomNode);
160};
161
162#endif /* __KWORD_VARIABLEFORMAT_H__ */
This class hold a real paragraph.
Definition para.h:59
This class hold a zone of text with only one formating.
Definition textzone.h:41
This class hold informations formating the textzone.
VariableFormat(Para *para)
Constructors.