kword/latex/export/format.h
1
2/*
3** Header file for inclusion with kword_xml2latex.c
4**
5** Copyright (C) 2000 Robert JACOLIN
6**
7** This library is free software; you can redistribute it and/or
8** modify it under the terms of the GNU Library General Public
9** License as published by the Free Software Foundation; either
10** version 2 of the License, or (at your option) any later version.
11**
12** This library is distributed in the hope that it will be useful,
13** but WITHOUT ANY WARRANTY; without even the implied warranty of
14** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15** Library General Public License for more details.
16**
17** To receive a copy of the GNU Library General Public License, write to the
18** Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20**
21*/
22
23#ifndef __KWORD_FORMAT_H__
24#define __KWORD_FORMAT_H__
25
26#include <tqtextstream.h>
27#include <tqstring.h>
28#include <tqcolor.h>
29#include "xmlparser.h"
30
31enum _EFormat
32{
33 EF_ERROR, /* 0 */
34 EF_TEXTZONE, /* 1 */
35 EF_PICTURE, /* 2 */
36 EF_TABULATOR, /* 3 */
37 EF_VARIABLE, /* 4 */
38 EF_FOOTNOTE, /* 5 */
39 EF_ANCHOR /* 6 */
40};
41
42typedef enum _EFormat EFormat;
43
44class Para;
45
46/***********************************************************************/
47/* Class: Format */
48/***********************************************************************/
49
56class Format: public XmlParser
57{
58 EFormat _id;
59 unsigned int _pos;
60 unsigned int _taille; /* Length of the string */
61
62 /* USEFULL DATA */
63 Para* _para; /* Parent class */
64
65 public:
73 Format(Para *para= 0): _id((EFormat) 0), _para(para)
74 {}
75
76 /*
77 * Destructor
78 *
79 * Nothing to do
80 */
81 virtual ~Format() {}
82
86 EFormat getId () const { return _id; }
87 Para* getPara () const { return _para; }
88 EFormat getFormatType() const { return _id; }
89 unsigned int getPos () const { return _pos; }
90 unsigned int getLength () const { return _taille; }
91
95 void setId (int id) { _id = (EFormat) id; }
96 void setPara (Para* para) { _para = para; }
97 void setPos (const unsigned int pos){ _pos = pos; }
98 void setLength (const unsigned int t) { _taille = t; }
99
107 virtual void analyse(const TQDomNode);
108
109 virtual void generate(TQTextStream&) = 0;
110 //virtual void generate(TQTextStream&, int = 0);
111
112};
113
114#endif /* __KWORD_FORMAT_H__ */
This class describe a cell, row or column format.
void generate(TQTextStream &out, Column *col=NULL, Row *row=NULL)
Generate the cell format inherited from the row or the colum format or use its own format.
EFormat getId() const
Accessors.
void setId(int id)
Modifiers.
Format(Para *para=0)
Constructors.
virtual void analyse(const TQDomNode)
Helpfull functions.
This class hold a real paragraph.
Definition para.h:59
This class supply some convenients methods to access to a DOM tree.