37 _autoCreate = TC_EXTEND;
38 _newFrameBehaviour = TF_RECONNECT;
39 _sheetSide = TS_ANYSIDE;
71 kdDebug(30522) <<
"FRAME ANALYSE (TextFrame)" << endl;
74 analyseParamFrame(getChild(balise,
"FRAME"));
76 for(
int index = 0; index < getNbChild(balise); index++)
78 if(getChildName(balise, index).compare(
"PARAGRAPH")== 0)
83 prg->
analyse(getChild(balise, index));
84 if(prg->
getInfo() == EP_FOOTNOTE)
96 kdDebug(30522) <<
"PARA ADDED" << endl;
100 kdDebug(30522) <<
"END OF A FRAME ANALYSE" << endl;
106void TextFrame::analyseParamFrame(
const TQDomNode balise)
109 setLeft(getAttr(balise,
"left").toDouble());
110 setTop(getAttr(balise,
"top").toDouble());
111 setRight(getAttr(balise,
"right").toDouble());
112 setBottom(getAttr(balise,
"bottom").toDouble());
113 setRunAround(getAttr(balise,
"runaround").toInt());
114 setAroundGap(getAttr(balise,
"runaroundGap").toInt());
115 setAutoCreate(getAttr(balise,
"autoCreateNewFrame").toInt());
116 setNewFrame(getAttr(balise,
"newFrameBehaviour").toInt());
117 setSheetSide(getAttr(balise,
"sheetSide").toInt());
118 if(getAttr(balise,
"lWidth").toInt() > 0)
120 setLeftWidth(getAttr(balise,
"lWidth").toInt());
123 if(getAttr(balise,
"rWidth").toInt() > 0)
125 setRightWidth(getAttr(balise,
"rWidth").toInt());
128 if(getAttr(balise,
"tWidth").toInt() > 0)
130 setTopWidth(getAttr(balise,
"tWidth").toInt());
133 if(getAttr(balise,
"bWidth").toInt() > 0)
135 setBottomWidth(getAttr(balise,
"bWidth").toInt());
138 setLeftRed(getAttr(balise,
"lRed").toInt());
139 setLeftGreen(getAttr(balise,
"lGreen").toInt());
140 setLeftBlue(getAttr(balise,
"lBlue").toInt());
142 setRightRed(getAttr(balise,
"rRed").toInt());
143 setRightGreen(getAttr(balise,
"rGreen").toInt());
144 setRightBlue(getAttr(balise,
"rBlue").toInt());
146 setTopRed(getAttr(balise,
"tRed").toInt());
147 setTopGreen(getAttr(balise,
"tGreen").toInt());
148 setTopBlue(getAttr(balise,
"tBlue").toInt());
150 setBottomRed(getAttr(balise,
"bRed").toInt());
151 setBottomGreen(getAttr(balise,
"bGreen").toInt());
152 setBottomBlue(getAttr(balise,
"bBlue").toInt());
154 setLeftStyle(getAttr(balise,
"lStyle").toInt());
155 setRightStyle(getAttr(balise,
"rStyle").toInt());
156 setTopStyle(getAttr(balise,
"tStyle").toInt());
157 setBottomStyle(getAttr(balise,
"bStyle").toInt());
158 setBkRed(getAttr(balise,
"bkred").toInt());
159 setBkGreen(getAttr(balise,
"bkgreen").toInt());
160 setBkBlue(getAttr(balise,
"bkblue").toInt());
176 kdDebug(30522) <<
"TEXT GENERATION" << endl;
177 kdDebug(30522) <<
"NB PARA " << _parags.count() << endl;
182 Config::instance()->writeIndent(out);
183 out <<
"\\begin{minipage}{";
184 out << (getRight() -
getLeft()) <<
"pt}" << endl;
187 _lastTypeEnum = TL_NONE;
189 Para* currentPara = _parags.first();
190 while( currentPara != 0)
193 if((!currentPara->
isChapter() && _lastTypeEnum == TL_NONE &&
194 _lastEnv != getNextEnv(_parags, _parags.at()) &&
195 currentPara->notEmpty()) ||
196 _lastEnv != getNextEnv(_parags, _parags.at()) )
199 _lastEnv = currentPara->getEnv();
203 if(isBeginEnum(lastPara, currentPara))
206 _lastTypeEnum = currentPara->getCounterType();
211 lastPara = currentPara;
212 currentPara = _parags.next();
215 if(isCloseEnum(lastPara, currentPara))
218 _lastTypeEnum = TL_NONE;
221 if((!lastPara->
isChapter() && _lastEnv != getNextEnv(_parags, _parags.at()) &&
222 lastPara->notEmpty()) ||
223 _lastEnv != getNextEnv(_parags, _parags.at()))
235 Config::instance()->desindent();
236 Config::instance()->writeIndent(out);
237 out <<
"\\end{minipage}" << endl;
241EEnv TextFrame::getNextEnv(TQPtrList<Para> liste,
const int pos)
247 for(index = liste.at(pos); index != 0 && index->
isChapter(); index = liste.next())
252 return index->getEnv();
259bool TextFrame::isBeginEnum(
Para* previous,
Para* next)
265 kdDebug(30522) <<
"---------------------------------" << endl;
266 kdDebug(30522) <<
getSection() <<
" = " << SS_HEADERS << endl;
267 if(next->isList() &&
getSection() != SS_FOOTNOTES &&
270 if(previous == 0 || !previous->isList() ||
271 (previous->isList() && (
272 (previous->getCounterDepth() < next->getCounterDepth()) ||
273 (previous->getCounterType() != next->getCounterType() &&
274 previous->getCounterDepth() == next->getCounterDepth()))
282bool TextFrame::isCloseEnum(
Para* previous,
Para* next)
284 if(previous->isList() &&
getSection() != SS_FOOTNOTES &&
287 if(next == 0 || !next->isList() ||
288 (next->isList() && next->getCounterDepth() < previous->getCounterDepth()) ||
289 (next->isList() && next->getCounterType() != previous->getCounterType() &&
290 next->getCounterDepth() == previous->getCounterDepth()) ||
void useLeftBorder()
Modifiors.
void setType(SType t)
Modifiors.
SSect getSection() const
Accessors.
virtual void analyse(const TQDomNode)
Helpfull functions.
bool isChapter() const
Accessors.
This class hold a real paragraph.
void analyse(const TQDomNode)
Modifiers.
SSect getFrameType() const
void openList(TQTextStream &)
Write the markup to begin a list.
void generateBeginEnv(TQTextStream &)
If the paragraph has a different environment, change it.
void generate(TQTextStream &)
Write the paragraph in a file.
void generateEndEnv(TQTextStream &)
If the next paragraph has a different environment, close it.
void closeList(TQTextStream &, Para *)
Write the markup to close a list.
void analyse(const TQDomNode)
Get informations from a markup tree.
void generate(TQTextStream &)
Write the text in a file.
void setLeft(const double l)
Modifiors.
double getLeft() const
Accessors.