para.h
1/*
2** Header file for inclusion with kword_xml2latex.c
3**
4** Copyright (C) 2000,2002 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_PARA_H__
23#define __KWORD_PARA_H__
24
25#include <tqstring.h>
26#include <tqptrstack.h> /* historic list */
27#include <tqptrlist.h> /* for list of format */
28
29/*#include "listeformat.h"*/ /* children class contents the zone (italic, footnote,
30 variable. */
31#include "layout.h" /* set of informations about the paragraph style. */
32#include "element.h" /* to use the father class. */
33#include "format.h" /* child class */
34
35enum EP_INFO
36{
37 EP_NONE,
38 EP_FOOTNOTE
39};
40
41/*enum EP_HARDBRK
42{
43 EP_FLOW,
44 EP_NEXT
45};*/
46
47class TextFrame;
48
49/***********************************************************************/
50/* Class: Para */
51/***********************************************************************/
52
58class Para: public Layout
59{
60 /* MARKUP DATA */
61 TQString _text;
62 TQString* _name;
63 EP_INFO _info;
64 //EP_HARDBRK _hardbrk;
65 TQPtrList<Format>* _lines;
66
67 /* TO MANAGE THE LIST */
68
69 /* USEFULL DATA */
70 TextFrame* _element; /* Father frame */
71 unsigned int _currentPos; /* Begining of the text to use the good format */
72 static TQPtrStack<EType> _historicList; /* opened lists but not closed */
73 int _nbLines; /* Nb of lines in a cell (table) */
74 static int _tabulation; /* Size of the para tabulation (for lists). */
75
76 public:
84 Para(TextFrame *textFrame = 0);
85
86 /*
87 * Destructor
88 *
89 * The destructor must remove the list of little zones.
90 */
91 virtual ~Para();
92
100 //bool isColored () const;
104 //bool isUlined () const;
105 //Para* getNext () const { return _next; }
106 //Para* getPrevious () const { return _previous; }
110 TQString* getName () const { return _name; }
114 EP_INFO getInfo () const { return _info; }
118 TextFrame* getFrame () const { return _element; }
122 SSect getFrameType () const;
126 EFormat getTypeFormat(const TQDomNode) const;
130 int getNbCharPara() const;
131
132 bool notEmpty() const { return (_lines == 0) ? false : (_lines->count() != 0); }
136 //void setNext (Para *p) { _next = p; }
137 //void setPrevious(Para *p) { _previous = p; }
138
146 void analyse (const TQDomNode);
147
151 void generate (TQTextStream&);
152
156 void generateBeginEnv(TQTextStream&);
157
161 void generateEndEnv(TQTextStream&);
162
166 void generateTitle (TQTextStream&);
167
171 void openList (TQTextStream&);
172
176 void closeList (TQTextStream&, Para*);
177
178 private:
179 void analyseParam (const TQDomNode);
180 void analyseName (const TQDomNode);
181 void analyseInfo (const TQDomNode);
182 //void analyseBrk (const TQDomNode);
183 void analyseLayoutPara(const TQDomNode);
184 void analyseFormat (const TQDomNode);
185 void analyseFormats (const TQDomNode);
186
190 void generateDebut (TQTextStream&);
191 void generateFin (TQTextStream&);
192
196 void closeList (EType, TQTextStream&);
197
198};
199
200#endif /* __KWORD_PARA_H__ */
This class tells about a paragraph and its contents.
Definition layout.h:67
This class hold a real paragraph.
Definition para.h:59
void analyse(const TQDomNode)
Modifiers.
Definition para.cpp:129
SSect getFrameType() const
Definition para.cpp:69
void openList(TQTextStream &)
Write the markup to begin a list.
Definition para.cpp:476
void generateBeginEnv(TQTextStream &)
If the paragraph has a different environment, change it.
Definition para.cpp:447
EP_INFO getInfo() const
Definition para.h:114
void generate(TQTextStream &)
Write the paragraph in a file.
Definition para.cpp:359
TextFrame * getFrame() const
Definition para.h:118
TQString * getName() const
Accessors.
Definition para.h:110
void generateEndEnv(TQTextStream &)
If the next paragraph has a different environment, close it.
Definition para.cpp:545
int getNbCharPara() const
Definition para.cpp:92
EFormat getTypeFormat(const TQDomNode) const
Definition para.cpp:80
void closeList(TQTextStream &, Para *)
Write the markup to close a list.
Definition para.cpp:584
void generateTitle(TQTextStream &)
If the paragraph is a title, generate the command.
Definition para.cpp:657
This class hold 2 lists of paragraphs for the text and for the footnotes.
Definition textFrame.h:40