Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/addon/doxmlparser/src/dochandler.cpp

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: dochandler.cpp,v 1.33 2002/10/13 21:01:58 dimitri Exp $
4 *
5 *
6 * Copyright (C) 1997-2006 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 */
15
16#include <qmap.h>
17
18#include "dochandler.h"
19#include "debug.h"
20#include "linkedtexthandler.h"
21
22
23//----------------------------------------------------------------------
24
25class TypeNameMapper
26{
27 public:
28 TypeNameMapper()
29 {
30 m_map.insert("see", SimpleSectHandler::See);
31 m_map.insert("return", SimpleSectHandler::Return);
32 m_map.insert("author", SimpleSectHandler::Author);
33 m_map.insert("version", SimpleSectHandler::Version);
34 m_map.insert("since", SimpleSectHandler::Since);
35 m_map.insert("date", SimpleSectHandler::Date);
36 m_map.insert("bug", SimpleSectHandler::Bug);
37 m_map.insert("note", SimpleSectHandler::Note);
38 m_map.insert("warning", SimpleSectHandler::Warning);
39 m_map.insert("par", SimpleSectHandler::Par);
40 m_map.insert("deprecated",SimpleSectHandler::Deprecated);
41 m_map.insert("pre", SimpleSectHandler::Pre);
42 m_map.insert("post", SimpleSectHandler::Post);
43 m_map.insert("invariant", SimpleSectHandler::Invar);
44 m_map.insert("remark", SimpleSectHandler::Remark);
45 m_map.insert("attention", SimpleSectHandler::Attention);
46 m_map.insert("todo", SimpleSectHandler::Todo);
47 m_map.insert("test", SimpleSectHandler::Test);
48 m_map.insert("rcs", SimpleSectHandler::RCS);
49 m_map.insert("enumvalues",SimpleSectHandler::EnumValues);
50 m_map.insert("examples", SimpleSectHandler::Examples);
51 }
52 SimpleSectHandler::Types stringToType(const QString &typeStr)
53 {
54 return m_map[typeStr];
55 }
56 private:
57 QMap<QString,SimpleSectHandler::Types> m_map;
58};
59
60class HighlightMapper
61{
62 public:
63 HighlightMapper()
64 {
65 m_map.insert("comment", HighlightHandler::Comment);
66 m_map.insert("keyword", HighlightHandler::Keyword);
67 m_map.insert("keywordtype", HighlightHandler::KeywordType);
68 m_map.insert("keywordflow", HighlightHandler::KeywordFlow);
69 m_map.insert("charliteral", HighlightHandler::CharLiteral);
70 m_map.insert("stringliteral", HighlightHandler::StringLiteral);
71 m_map.insert("preprocessor", HighlightHandler::Preprocessor);
72 }
73 HighlightHandler::HighlightKind stringToKind(const QString &kindStr)
74 {
75 return m_map[kindStr];
76 }
77 private:
78 QMap<QString,HighlightHandler::HighlightKind> m_map;
79};
80
81static TypeNameMapper *s_typeMapper;
82static HighlightMapper *s_highlightMapper;
83
84void dochandler_init()
85{
86 s_typeMapper = new TypeNameMapper;
87 s_highlightMapper = new HighlightMapper;
88}
89
90void dochandler_exit()
91{
92 delete s_typeMapper;
93 delete s_highlightMapper;
94}
95
96//----------------------------------------------------------------------
97// MarkupHandler
98//----------------------------------------------------------------------
99
100MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
101 : m_children(children), m_curString(curString),
102 m_curMarkup(IDocMarkup::Normal), m_headingLevel(0)
103{
104 addStartHandler("bold",this,&MarkupHandler::startBold);
105 addEndHandler("bold",this,&MarkupHandler::endBold);
106
107 addStartHandler("emphasis",this,&MarkupHandler::startEmphasis);
108 addEndHandler("emphasis",this,&MarkupHandler::endEmphasis);
109
110 addStartHandler("computeroutput",this,&MarkupHandler::startComputerOutput);
111 addEndHandler("computeroutput",this,&MarkupHandler::endComputerOutput);
112
113 addStartHandler("center",this,&MarkupHandler::startCenter);
114 addEndHandler("center",this,&MarkupHandler::endCenter);
115
116 addStartHandler("small",this,&MarkupHandler::startSmallFont);
117 addEndHandler("small",this,&MarkupHandler::endSmallFont);
118
119 addStartHandler("subscript",this,&MarkupHandler::startSubscript);
120 addEndHandler("subscript",this,&MarkupHandler::endSubscript);
121
122 addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
123 addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
124
125 addStartHandler("preformatted",this,&MarkupHandler::startPreformatted);
126 addEndHandler("preformatted",this,&MarkupHandler::endPreformatted);
127
128 addStartHandler("heading1",this,&MarkupHandler::startHeading1);
129 addEndHandler("heading1",this,&MarkupHandler::endHeading1);
130
131 addStartHandler("heading2",this,&MarkupHandler::startHeading2);
132 addEndHandler("heading2",this,&MarkupHandler::endHeading2);
133
134 addStartHandler("heading3",this,&MarkupHandler::startHeading3);
135 addEndHandler("heading3",this,&MarkupHandler::endHeading3);
136
137 addStartHandler("heading4",this,&MarkupHandler::startHeading4);
138 addEndHandler("heading4",this,&MarkupHandler::endHeading4);
139
140 addStartHandler("heading5",this,&MarkupHandler::startHeading5);
141 addEndHandler("heading5",this,&MarkupHandler::endHeading5);
142
143 addStartHandler("heading6",this,&MarkupHandler::startHeading6);
144 addEndHandler("heading6",this,&MarkupHandler::endHeading6);
145}
146
147MarkupHandler::~MarkupHandler()
148{
149}
150
151void MarkupHandler::addTextNode()
152{
153 if (!m_curString.isEmpty())
154 {
155 m_children.append(new TextNode(m_curString,m_curMarkup,m_headingLevel));
156 debug(2,"addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup);
157 m_curString="";
158 }
159}
160
161void MarkupHandler::startBold(const QXmlAttributes & /*attrib*/)
162{
163 addTextNode();
164 m_children.append(new MarkupModifierNode(IDocMarkup::Bold,TRUE));
165 m_curMarkup |= IDocMarkup::Bold;
166}
167
168void MarkupHandler::endBold()
169{
170 addTextNode();
171 m_children.append(new MarkupModifierNode(IDocMarkup::Bold,FALSE));
172 m_curMarkup &= ~IDocMarkup::Bold;
173}
174
175void MarkupHandler::startEmphasis(const QXmlAttributes & /*attrib*/)
176{
177 addTextNode();
178 m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,TRUE));
179 m_curMarkup |= IDocMarkup::Emphasis;
180}
181
182void MarkupHandler::endEmphasis()
183{
184 addTextNode();
185 m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,FALSE));
186 m_curMarkup &= ~IDocMarkup::Emphasis;
187}
188
189void MarkupHandler::startComputerOutput(const QXmlAttributes & /*attrib*/)
190{
191 addTextNode();
192 m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,TRUE));
193 m_curMarkup |= IDocMarkup::ComputerOutput;
194}
195
196void MarkupHandler::endComputerOutput()
197{
198 addTextNode();
199 m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,FALSE));
200 m_curMarkup &= ~IDocMarkup::ComputerOutput;
201}
202
203void MarkupHandler::startCenter(const QXmlAttributes & /*attrib*/)
204{
205 addTextNode();
206 m_children.append(new MarkupModifierNode(IDocMarkup::Center,TRUE));
207 m_curMarkup |= IDocMarkup::Center;
208}
209
210void MarkupHandler::endCenter()
211{
212 addTextNode();
213 m_children.append(new MarkupModifierNode(IDocMarkup::Center,FALSE));
214 m_curMarkup &= ~IDocMarkup::Center;
215}
216
217void MarkupHandler::startSmallFont(const QXmlAttributes & /*attrib*/)
218{
219 addTextNode();
220 m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,TRUE));
221 m_curMarkup |= IDocMarkup::SmallFont;
222}
223
224void MarkupHandler::endSmallFont()
225{
226 addTextNode();
227 m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,FALSE));
228 m_curMarkup &= ~IDocMarkup::SmallFont;
229}
230
231void MarkupHandler::startSubscript(const QXmlAttributes & /*attrib*/)
232{
233 addTextNode();
234 m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,TRUE));
235 m_curMarkup |= IDocMarkup::Subscript;
236}
237
238void MarkupHandler::endSubscript()
239{
240 addTextNode();
241 m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,FALSE));
242 m_curMarkup &= ~IDocMarkup::Subscript;
243}
244
245void MarkupHandler::startSuperscript(const QXmlAttributes & /*attrib*/)
246{
247 addTextNode();
248 m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,TRUE));
249 m_curMarkup |= IDocMarkup::Superscript;
250}
251
252void MarkupHandler::endSuperscript()
253{
254 addTextNode();
255 m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,FALSE));
256 m_curMarkup &= ~IDocMarkup::Superscript;
257}
258
259void MarkupHandler::startPreformatted(const QXmlAttributes & /*attrib*/)
260{
261 addTextNode();
262 m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,TRUE));
263 m_curMarkup |= IDocMarkup::Preformatted;
264}
265
266void MarkupHandler::endPreformatted()
267{
268 addTextNode();
269 m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,FALSE));
270 m_curMarkup &= ~IDocMarkup::Preformatted;
271}
272
273void MarkupHandler::startHeading1(const QXmlAttributes & /*attrib*/)
274{
275 addTextNode();
276 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,1));
277 m_curMarkup |= IDocMarkup::Heading;
278 m_headingLevel=1;
279}
280
281void MarkupHandler::endHeading1()
282{
283 addTextNode();
284 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,1));
285 m_curMarkup &= ~IDocMarkup::Heading;
286 m_headingLevel=0;
287}
288
289void MarkupHandler::startHeading2(const QXmlAttributes & /*attrib*/)
290{
291 addTextNode();
292 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,2));
293 m_curMarkup |= IDocMarkup::Heading;
294 m_headingLevel=2;
295}
296
297void MarkupHandler::endHeading2()
298{
299 addTextNode();
300 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,2));
301 m_curMarkup &= ~IDocMarkup::Heading;
302 m_headingLevel=0;
303}
304
305void MarkupHandler::startHeading3(const QXmlAttributes & /*attrib*/)
306{
307 addTextNode();
308 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,3));
309 m_curMarkup |= IDocMarkup::Heading;
310 m_headingLevel=3;
311}
312
313void MarkupHandler::endHeading3()
314{
315 addTextNode();
316 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,3));
317 m_curMarkup &= ~IDocMarkup::Heading;
318 m_headingLevel=0;
319}
320
321void MarkupHandler::startHeading4(const QXmlAttributes & /*attrib*/)
322{
323 addTextNode();
324 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,4));
325 m_curMarkup |= IDocMarkup::Heading;
326 m_headingLevel=4;
327}
328
329void MarkupHandler::endHeading4()
330{
331 addTextNode();
332 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,4));
333 m_curMarkup &= ~IDocMarkup::Heading;
334 m_headingLevel=0;
335}
336
337void MarkupHandler::startHeading5(const QXmlAttributes & /*attrib*/)
338{
339 addTextNode();
340 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,5));
341 m_curMarkup |= IDocMarkup::Heading;
342 m_headingLevel=5;
343}
344
345void MarkupHandler::endHeading5()
346{
347 addTextNode();
348 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,5));
349 m_curMarkup &= ~IDocMarkup::Heading;
350 m_headingLevel=0;
351}
352
353void MarkupHandler::startHeading6(const QXmlAttributes & /*attrib*/)
354{
355 addTextNode();
356 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,6));
357 m_curMarkup |= IDocMarkup::Heading;
358 m_headingLevel=6;
359}
360
361void MarkupHandler::endHeading6()
362{
363 addTextNode();
364 m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,6));
365 m_curMarkup &= ~IDocMarkup::Heading;
366 m_headingLevel=0;
367}
368
369
370//----------------------------------------------------------------------
371// ListItemHandler
372//----------------------------------------------------------------------
373
374ListItemHandler::ListItemHandler(IBaseHandler *parent)
375 : m_parent(parent)
376{
377 m_children.setAutoDelete(TRUE);
378
379 addEndHandler("listitem",this,&ListItemHandler::endListItem);
380
381 addStartHandler("para",this,&ListItemHandler::startParagraph);
382}
383
384ListItemHandler::~ListItemHandler()
385{
386}
387
388void ListItemHandler::startListItem(const QXmlAttributes& /*attrib*/)
389{
390 m_parent->setDelegate(this);
391 debug(2,"start list item handler\n");
392}
393
394void ListItemHandler::endListItem()
395{
396 debug(2,"end list item handler\n");
397 m_parent->setDelegate(0);
398}
399
400void ListItemHandler::startParagraph(const QXmlAttributes& attrib)
401{
402 ParagraphHandler *parHandler = new ParagraphHandler(this);
403 parHandler->startParagraph(attrib);
404 m_children.append(parHandler);
405}
406
407IDocIterator *ListItemHandler::contents() const
408{
409 return new ListItemIterator(*this);
410}
411
412//----------------------------------------------------------------------
413// OrderedListHandler
414//----------------------------------------------------------------------
415
416OrderedListHandler::OrderedListHandler(IBaseHandler *parent) : m_parent(parent)
417{
418 m_children.setAutoDelete(TRUE);
419 addEndHandler("orderedlist",this,&OrderedListHandler::endOrderedList);
420 addStartHandler("listitem",this,&OrderedListHandler::startOrderedListItem);
421}
422
423OrderedListHandler::~OrderedListHandler()
424{
425}
426
427void OrderedListHandler::startOrderedList(const QXmlAttributes& /*attrib*/)
428{
429 m_parent->setDelegate(this);
430}
431
432void OrderedListHandler::endOrderedList()
433{
434 m_parent->setDelegate(0);
435}
436
437void OrderedListHandler::startOrderedListItem(const QXmlAttributes& attrib)
438{
439 ListItemHandler *liHandler = new ListItemHandler(this);
440 liHandler->startListItem(attrib);
441 m_children.append(liHandler);
442}
443
444IDocIterator *OrderedListHandler::elements() const
445{
446 return new OrderedListIterator(*this);
447}
448
449//----------------------------------------------------------------------
450// ItemizedListHandler
451//----------------------------------------------------------------------
452
453ItemizedListHandler::ItemizedListHandler(IBaseHandler *parent) : m_parent(parent)
454{
455 m_children.setAutoDelete(TRUE);
456 addEndHandler("itemizedlist",this,&ItemizedListHandler::endItemizedList);
457 addStartHandler("listitem",this,&ItemizedListHandler::startItemizedListItem);
458}
459
460ItemizedListHandler::~ItemizedListHandler()
461{
462}
463
464void ItemizedListHandler::startItemizedList(const QXmlAttributes& /*attrib*/)
465{
466 m_parent->setDelegate(this);
467}
468
469void ItemizedListHandler::endItemizedList()
470{
471 m_parent->setDelegate(0);
472}
473
474void ItemizedListHandler::startItemizedListItem(const QXmlAttributes& attrib)
475{
476 ListItemHandler *liHandler = new ListItemHandler(this);
477 liHandler->startListItem(attrib);
478 m_children.append(liHandler);
479}
480
481IDocIterator *ItemizedListHandler::elements() const
482{
483 return new ItemizedListIterator(*this);
484}
485
486//----------------------------------------------------------------------
487// TocListHandler
488//----------------------------------------------------------------------
489
490TocListHandler::TocListHandler(IBaseHandler *parent) : m_parent(parent)
491{
492 m_children.setAutoDelete(TRUE);
493 addEndHandler("toclist",this,&TocListHandler::endTocList);
494 addStartHandler("tocitem",this,&TocListHandler::startTocItem);
495}
496
497TocListHandler::~TocListHandler()
498{
499}
500
501void TocListHandler::startTocList(const QXmlAttributes& /*attrib*/)
502{
503 m_parent->setDelegate(this);
504}
505
506void TocListHandler::endTocList()
507{
508 m_parent->setDelegate(0);
509}
510
511void TocListHandler::startTocItem(const QXmlAttributes& attrib)
512{
513 TocItemHandler *tiHandler = new TocItemHandler(this);
514 tiHandler->startTocItem(attrib);
515 m_children.append(tiHandler);
516}
517
518IDocIterator *TocListHandler::elements() const
519{
520 return new TocListIterator(*this);
521}
522
523//----------------------------------------------------------------------
524// TocItemHandler
525//----------------------------------------------------------------------
526
527TocItemHandler::TocItemHandler(IBaseHandler *parent) : m_parent(parent)
528{
529 addEndHandler("tocitem",this,&TocItemHandler::endTocItem);
530}
531
532TocItemHandler::~TocItemHandler()
533{
534}
535
536void TocItemHandler::startTocItem(const QXmlAttributes& attrib)
537{
538 m_parent->setDelegate(this);
539 m_id = attrib.value("id");
540 m_curString="";
541}
542
543void TocItemHandler::endTocItem()
544{
545 m_title = m_curString;
546 m_parent->setDelegate(0);
547}
548
549//----------------------------------------------------------------------
550// ParameterHandler
551//----------------------------------------------------------------------
552
553ParameterHandler::ParameterHandler(IBaseHandler *parent) :
554 m_parent(parent)
555{
556 addEndHandler("parametername",this,&ParameterHandler::endParameterName);
557}
558
559ParameterHandler::~ParameterHandler()
560{
561}
562
563void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/)
564{
565 m_parent->setDelegate(this);
566}
567
568void ParameterHandler::endParameterName()
569{
570 m_name = m_curString;
571 debug(2,"parameter %s\n",m_name.data());
572 m_curString="";
573 m_parent->setDelegate(0);
574}
575
576//----------------------------------------------------------------------
577// ParameterListHandler
578//----------------------------------------------------------------------
579
580ParameterItemHandler::ParameterItemHandler(IBaseHandler *parent)
581 : m_parent(parent)
582{
583 addEndHandler("parameteritem",this,&ParameterItemHandler::endParameterItem);
584 addStartHandler("parameternamelist");
585 addEndHandler("parameternamelist");
586 addStartHandler("parametername",this,&ParameterItemHandler::startParameterName);
587 addStartHandler("parameterdescription");
588 addEndHandler("parameterdescription");
589 addStartHandler("para",this,&ParameterItemHandler::startParagraph);
590 m_parameters.setAutoDelete(TRUE);
591 m_description = 0;
592}
593
594ParameterItemHandler::~ParameterItemHandler()
595{
596 delete m_description;
597}
598
599void ParameterItemHandler::startParameterItem(const QXmlAttributes&)
600{
601 m_parent->setDelegate(this);
602}
603
604void ParameterItemHandler::endParameterItem()
605{
606 m_parent->setDelegate(0);
607}
608
609void ParameterItemHandler::startParameterName(const QXmlAttributes& attrib)
610{
611 ParameterHandler *param = new ParameterHandler(this);
612 m_parameters.append(param);
613 param->startParameterName(attrib);
614}
615
616void ParameterItemHandler::startParagraph(const QXmlAttributes& attrib)
617{
618 m_description = new ParagraphHandler(this);
619 m_description->startParagraph(attrib);
620}
621
622IDocIterator *ParameterItemHandler::paramNames() const
623{
624 return new ParameterItemIterator(*this);
625}
626
627//----------------------------------------------------------------------
628// ParameterListHandler
629//----------------------------------------------------------------------
630
631ParameterListHandler::ParameterListHandler(IBaseHandler *parent)
632 : m_parent(parent)
633{
634 addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList);
635 addStartHandler("parameteritem",this,&ParameterListHandler::startParameterItem);
636 m_paramItems.setAutoDelete(TRUE);
637}
638
639ParameterListHandler::~ParameterListHandler()
640{
641}
642
643void ParameterListHandler::startParameterList(const QXmlAttributes& attrib)
644{
645 QString kind = attrib.value("kind");
646 if (kind=="retval") m_type=RetVal;
647 else if (kind=="exception") m_type=Exception;
648 else if (kind=="param") m_type=Param;
649 else
650 {
651 debug(1,"Error: invalid parameterlist type: %s\n",kind.data());
652 }
653 debug(2,"parameterlist kind=%s\n",kind.data());
654 m_parent->setDelegate(this);
655}
656
657void ParameterListHandler::endParameterList()
658{
659 m_parent->setDelegate(0);
660}
661
662void ParameterListHandler::startParameterItem(const QXmlAttributes& attrib)
663{
664 ParameterItemHandler *paramItem = new ParameterItemHandler(this);
665 m_paramItems.append(paramItem);
666 paramItem->startParameterItem(attrib);
667}
668
669IDocIterator *ParameterListHandler::params() const
670{
671 return new ParameterListIterator(*this);
672}
673
674//----------------------------------------------------------------------
675// LinkHandler
676//----------------------------------------------------------------------
677
678LinkHandler::LinkHandler(IBaseHandler *parent)
679 : m_parent(parent)
680{
681 addEndHandler("link",this,&LinkHandler::endLink);
682}
683
684LinkHandler::~LinkHandler()
685{
686}
687
688void LinkHandler::startLink(const QXmlAttributes& attrib)
689{
690 m_parent->setDelegate(this);
691 debug(2,"Start link\n");
692 m_ref = attrib.value("linkend");
693 m_curString="";
694}
695
696void LinkHandler::endLink()
697{
698 m_text = m_curString;
699 m_curString="";
700 m_parent->setDelegate(0);
701 debug(2,"End link\n");
702}
703
704//----------------------------------------------------------------------
705// EMailHandler
706//----------------------------------------------------------------------
707
708EMailHandler::EMailHandler(IBaseHandler *parent)
709 : m_parent(parent)
710{
711 addEndHandler("email",this,&EMailHandler::endEMail);
712}
713
714EMailHandler::~EMailHandler()
715{
716}
717
718void EMailHandler::startEMail(const QXmlAttributes& /*attrib*/)
719{
720 m_parent->setDelegate(this);
721 debug(2,"Start email\n");
722 m_curString="";
723}
724
725void EMailHandler::endEMail()
726{
727 m_address = m_curString;
728 m_curString="";
729 m_parent->setDelegate(0);
730 debug(2,"End email\n");
731}
732
733//----------------------------------------------------------------------
734// ULinkHandler
735//----------------------------------------------------------------------
736
737ULinkHandler::ULinkHandler(IBaseHandler *parent)
738 : m_parent(parent)
739{
740 addEndHandler("ulink",this,&ULinkHandler::endULink);
741}
742
743ULinkHandler::~ULinkHandler()
744{
745}
746
747void ULinkHandler::startULink(const QXmlAttributes& attrib)
748{
749 m_parent->setDelegate(this);
750 debug(2,"Start ulink\n");
751 m_url = attrib.value("url");
752 m_curString="";
753}
754
755void ULinkHandler::endULink()
756{
757 m_text = m_curString;
758 m_curString="";
759 m_parent->setDelegate(0);
760 debug(2,"End ulink\n");
761}
762
763//----------------------------------------------------------------------
764// LineBreakHandler
765//----------------------------------------------------------------------
766
767LineBreakHandler::LineBreakHandler(IBaseHandler *parent)
768 : m_parent(parent)
769{
770 addEndHandler("linebreak",this,&LineBreakHandler::endLineBreak);
771}
772
773LineBreakHandler::~LineBreakHandler()
774{
775}
776
777void LineBreakHandler::startLineBreak(const QXmlAttributes& /*attrib*/)
778{
779 m_parent->setDelegate(this);
780 debug(2,"Start linebreak\n");
781}
782
783void LineBreakHandler::endLineBreak()
784{
785 m_parent->setDelegate(0);
786 debug(2,"End linebreak\n");
787}
788
789//----------------------------------------------------------------------
790// HRulerHandler
791//----------------------------------------------------------------------
792
793HRulerHandler::HRulerHandler(IBaseHandler *parent)
794 : m_parent(parent)
795{
796 addEndHandler("hruler",this,&HRulerHandler::endHRuler);
797}
798
799HRulerHandler::~HRulerHandler()
800{
801}
802
803void HRulerHandler::startHRuler(const QXmlAttributes& /*attrib*/)
804{
805 m_parent->setDelegate(this);
806 debug(2,"Start hruler\n");
807}
808
809void HRulerHandler::endHRuler()
810{
811 m_parent->setDelegate(0);
812 debug(2,"End hruler\n");
813}
814
815//----------------------------------------------------------------------
816// RefHandler
817//----------------------------------------------------------------------
818
819RefHandler::RefHandler(IBaseHandler *parent)
820 : m_parent(parent)
821{
822 addEndHandler("ref",this,&RefHandler::endRef);
823}
824
825RefHandler::~RefHandler()
826{
827}
828
829void RefHandler::startRef(const QXmlAttributes& attrib)
830{
831 m_parent->setDelegate(this);
832 m_refId = attrib.value("refid");
833 m_extId = attrib.value("external");
834 ASSERT(attrib.value("kindref")=="compound" ||
835 attrib.value("kindref")=="member");
836 m_targetKind = attrib.value("kindref")=="compound" ? Compound : Member;
837 debug(2,"Start ref refId=%s\n",m_refId.data());
838 m_curString="";
839}
840
841void RefHandler::endRef()
842{
843 m_linkText = m_curString;
844 m_parent->setDelegate(0);
845 debug(2,"End ref: text=`%s'\n",m_linkText.data());
846}
847
848
849//----------------------------------------------------------------------
850// TitleHandler
851//----------------------------------------------------------------------
852
853TitleHandler::TitleHandler(IBaseHandler *parent)
854 : m_parent(parent)
855{
856 m_children.setAutoDelete(TRUE);
857 m_markupHandler = new MarkupHandler(m_children,m_curString);
858 setFallBackHandler(m_markupHandler);
859 addStartHandler("ref",this,&TitleHandler::startRef);
860 addEndHandler("title",this,&TitleHandler::endTitle);
861}
862
863TitleHandler::~TitleHandler()
864{
865 delete m_markupHandler;
866}
867
868void TitleHandler::startTitle(const QXmlAttributes& /*attrib*/)
869{
870 m_parent->setDelegate(this);
871 debug(2,"Start title\n");
872 m_curString="";
873}
874
875void TitleHandler::endTitle()
876{
877 addTextNode();
878 m_parent->setDelegate(0);
879 debug(2,"End title\n");
880}
881
882void TitleHandler::addTextNode()
883{
884 if (!m_curString.isEmpty())
885 {
886 m_children.append(
887 new TextNode(
888 m_curString,
889 m_markupHandler->markup(),
890 m_markupHandler->headingLevel()
891 )
892 );
893 debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
894 m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
895 m_curString="";
896 }
897}
898
899void TitleHandler::startRef(const QXmlAttributes& attrib)
900{
901 RefHandler *ref = new RefHandler(this);
902 ref->startRef(attrib);
903 m_children.append(ref);
904}
905
906IDocIterator *TitleHandler::title() const
907{
908 return new TitleIterator(*this);
909}
910
911//----------------------------------------------------------------------
912// SimpleSectHandler
913//----------------------------------------------------------------------
914
915SimpleSectHandler::SimpleSectHandler(IBaseHandler *parent)
916 : m_parent(parent), m_paragraph(0), m_title(0)
917{
918 addStartHandler("title",this,&SimpleSectHandler::startTitle);
919 addStartHandler("para",this,&SimpleSectHandler::startParagraph);
920 addEndHandler("simplesect",this,&SimpleSectHandler::endSimpleSect);
921}
922
923SimpleSectHandler::~SimpleSectHandler()
924{
925}
926
927void SimpleSectHandler::startSimpleSect(const QXmlAttributes& attrib)
928{
929 m_typeString = attrib.value("kind");
930 m_type = s_typeMapper->stringToType(m_typeString);
931 debug(2,"start simple section %s\n",m_typeString.data());
932 m_parent->setDelegate(this);
933}
934
935void SimpleSectHandler::endSimpleSect()
936{
937 debug(2,"end simple section\n");
938 m_parent->setDelegate(0);
939}
940
941void SimpleSectHandler::startTitle(const QXmlAttributes& attrib)
942{
943 ASSERT(m_title==0);
944 m_title = new TitleHandler(this);
945 m_title->startTitle(attrib);
946}
947
948void SimpleSectHandler::startParagraph(const QXmlAttributes& attrib)
949{
950 ASSERT(m_paragraph==0);
951 m_paragraph = new ParagraphHandler(this);
952 m_paragraph->startParagraph(attrib);
953}
954
955//----------------------------------------------------------------------
956// VariableListEntryHandler
957//----------------------------------------------------------------------
958
959VariableListEntryHandler::VariableListEntryHandler(IBaseHandler *parent)
960 : m_parent(parent), m_description(0), m_linkedTextHandler(0)
961{
962 addStartHandler("term",this,&VariableListEntryHandler::startTerm);
963 addEndHandler("term",this,&VariableListEntryHandler::endTerm);
964 addStartHandler("para",this,&VariableListEntryHandler::startParagraph);
965 addEndHandler("varlistentry",this,&VariableListEntryHandler::endVarListEntry);
966 addEndHandler("listitem",this,&VariableListEntryHandler::endListItem);
967}
968
969VariableListEntryHandler::~VariableListEntryHandler()
970{
971 delete m_description;
972}
973
974void VariableListEntryHandler::startVarListEntry(const QXmlAttributes& /*attrib*/)
975{
976 m_parent->setDelegate(this);
977 debug(2,"start varlistentry\n");
978}
979
980void VariableListEntryHandler::endVarListEntry()
981{
982 m_parent->setDelegate(0);
983 debug(2,"end varlistentry\n");
984}
985
986void VariableListEntryHandler::startListItem(const QXmlAttributes& /*attrib*/)
987{
988 m_parent->setDelegate(this);
989 debug(2,"start listitem\n");
990}
991
992void VariableListEntryHandler::endListItem()
993{
994 m_parent->setDelegate(0);
995 debug(2,"end listitem\n");
996}
997
998void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/)
999{
1000 m_curString="";
1001 m_linkedTextHandler = new LinkedTextHandler(this,m_term);
1002 m_linkedTextHandler->start("term");
1003}
1004
1005void VariableListEntryHandler::endTerm()
1006{
1007 delete m_linkedTextHandler;
1008}
1009
1010void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib)
1011{
1012 ASSERT(m_description==0);
1013 m_description = new ParagraphHandler(this);
1014 m_description->startParagraph(attrib);
1015}
1016
1017ILinkedTextIterator *VariableListEntryHandler::term() const
1018{
1019 return new LinkedTextIterator(m_term);
1020}
1021
1022
1023//----------------------------------------------------------------------
1024// VariableListHandler
1025//----------------------------------------------------------------------
1026
1027VariableListHandler::VariableListHandler(IBaseHandler *parent)
1028 : m_parent(parent)
1029{
1030 m_entries.setAutoDelete(TRUE);
1031 addStartHandler("varlistentry",this,&VariableListHandler::startVarListEntry);
1032 addStartHandler("listitem",this,&VariableListHandler::startListItem);
1033 addEndHandler("variablelist",this,&VariableListHandler::endVariableList);
1034}
1035
1036VariableListHandler::~VariableListHandler()
1037{
1038}
1039
1040void VariableListHandler::startVariableList(const QXmlAttributes& /*attrib*/)
1041{
1042 m_parent->setDelegate(this);
1043 debug(2,"start variablelist\n");
1044}
1045
1046void VariableListHandler::endVariableList()
1047{
1048 debug(2,"end variablelist\n");
1049 m_parent->setDelegate(0);
1050}
1051
1052void VariableListHandler::startVarListEntry(const QXmlAttributes& attrib)
1053{
1054 VariableListEntryHandler *vle = new VariableListEntryHandler(this);
1055 vle->startVarListEntry(attrib);
1056 m_curEntry = vle;
1057 m_entries.append(vle);
1058}
1059
1060void VariableListHandler::startListItem(const QXmlAttributes& attrib)
1061{
1062 ASSERT(m_curEntry!=0);
1063 m_curEntry->startListItem(attrib);
1064}
1065
1066IDocIterator *VariableListHandler::entries() const
1067{
1068 return new VariableListIterator(*this);
1069}
1070
1071//----------------------------------------------------------------------
1072// HighlightHandler
1073//----------------------------------------------------------------------
1074
1075HighlightHandler::HighlightHandler(IBaseHandler *parent)
1076 : m_parent(parent)
1077{
1078 m_children.setAutoDelete(TRUE);
1079 addEndHandler("highlight",this,&HighlightHandler::endHighlight);
1080 addStartHandler("ref",this,&HighlightHandler::startRef);
1081 addStartHandler("sp",this,&HighlightHandler::startSpace);
1082 m_hl = IDocHighlight::Invalid;
1083}
1084
1085HighlightHandler::~HighlightHandler()
1086{
1087}
1088
1089void HighlightHandler::startHighlight(const QXmlAttributes& attrib)
1090{
1091 m_hlString = attrib.value("class");
1092 m_hl = s_highlightMapper->stringToKind(m_hlString);
1093 m_curString="";
1094 m_parent->setDelegate(this);
1095 debug(2,"start highlight\n");
1096}
1097
1098void HighlightHandler::endHighlight()
1099{
1100 addTextNode();
1101 debug(2,"end highlight class=`%s'\n",m_hlString.data());
1102 m_parent->setDelegate(0);
1103}
1104
1105void HighlightHandler::startRef(const QXmlAttributes& attrib)
1106{
1107 addTextNode();
1108 RefHandler *rh = new RefHandler(this);
1109 m_children.append(rh);
1110 rh->startRef(attrib);
1111}
1112
1113void HighlightHandler::startSpace(const QXmlAttributes&)
1114{
1115 m_curString=" ";
1116 addTextNode();
1117}
1118
1119void HighlightHandler::addTextNode()
1120{
1121 if (!m_curString.isEmpty())
1122 {
1123 m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
1124 debug(2,"addTextNode() text=\"%s\"\n",
1125 m_curString.data());
1126 m_curString="";
1127 }
1128}
1129
1130IDocIterator *HighlightHandler::codeElements() const
1131{
1132 return new HighlightIterator(*this);
1133}
1134
1135//----------------------------------------------------------------------
1136// CodeLineHandler
1137//----------------------------------------------------------------------
1138
1139CodeLineHandler::CodeLineHandler(IBaseHandler *parent)
1140 : m_parent(parent)
1141{
1142 m_children.setAutoDelete(TRUE);
1143 addEndHandler("codeline",this,&CodeLineHandler::endCodeLine);
1144 addEndHandler("linenumber",this,&CodeLineHandler::endLineNumber);
1145 addStartHandler("highlight",this,&CodeLineHandler::startHighlight);
1146 addStartHandler("ref",this,&CodeLineHandler::startRef);
1147 m_lineNumber = 0;
1148}
1149
1150CodeLineHandler::~CodeLineHandler()
1151{
1152}
1153
1154void CodeLineHandler::startCodeLine(const QXmlAttributes& /*attrib*/)
1155{
1156 m_parent->setDelegate(this);
1157 debug(2,"start codeline\n");
1158}
1159
1160void CodeLineHandler::endCodeLine()
1161{
1162 addTextNode();
1163 debug(2,"end codeline\n");
1164 m_parent->setDelegate(0);
1165}
1166
1167void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib)
1168{
1169 m_parent->setDelegate(this);
1170 debug(2,"start linenumber\n");
1171 m_lineNumber = attrib.value("line").toInt();
1172 m_refId = attrib.value("refid");
1173}
1174
1175void CodeLineHandler::endLineNumber()
1176{
1177 m_parent->setDelegate(0);
1178}
1179
1180void CodeLineHandler::startHighlight(const QXmlAttributes& attrib)
1181{
1182 addTextNode();
1183 HighlightHandler *hlh = new HighlightHandler(this);
1184 m_children.append(hlh);
1185 hlh->startHighlight(attrib);
1186}
1187
1188void CodeLineHandler::startRef(const QXmlAttributes& attrib)
1189{
1190 addTextNode();
1191 RefHandler *rh = new RefHandler(this);
1192 m_children.append(rh);
1193 rh->startRef(attrib);
1194}
1195
1196void CodeLineHandler::addTextNode()
1197{
1198 if (!m_curString.isEmpty())
1199 {
1200 m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
1201 debug(2,"addTextNode() text=\"%s\"\n",
1202 m_curString.data());
1203 m_curString="";
1204 }
1205}
1206
1207IDocIterator *CodeLineHandler::codeElements() const
1208{
1209 return new CodeLineIterator(*this);
1210}
1211
1212
1213//----------------------------------------------------------------------
1214// ProgramListingHandler
1215//----------------------------------------------------------------------
1216
1217ProgramListingHandler::ProgramListingHandler(IBaseHandler *parent)
1218 : m_parent(parent)
1219{
1220 m_children.setAutoDelete(TRUE);
1221 m_hasLineNumber=FALSE;
1222 addEndHandler("programlisting",this,&ProgramListingHandler::endProgramListing);
1223
1224 addStartHandler("linenumber",this,&ProgramListingHandler::startLineNumber);
1225 addStartHandler("codeline",this,&ProgramListingHandler::startCodeLine);
1226}
1227
1228ProgramListingHandler::~ProgramListingHandler()
1229{
1230}
1231
1232void ProgramListingHandler::startProgramListing(const QXmlAttributes& /*attrib*/)
1233{
1234 m_parent->setDelegate(this);
1235 debug(2,"start programlisting\n");
1236}
1237
1238void ProgramListingHandler::endProgramListing()
1239{
1240 debug(2,"end programlisting\n");
1241 m_parent->setDelegate(0);
1242}
1243
1244void ProgramListingHandler::startLineNumber(const QXmlAttributes& attrib)
1245{
1246 CodeLineHandler *clh = new CodeLineHandler(this);
1247 m_children.append(clh);
1248 m_hasLineNumber=TRUE;
1249 clh->startLineNumber(attrib);
1250}
1251
1252void ProgramListingHandler::startCodeLine(const QXmlAttributes& attrib)
1253{
1254 CodeLineHandler *clh = 0;
1255 if (!m_hasLineNumber)
1256 {
1257 clh = new CodeLineHandler(this);
1258 m_children.append(clh);
1259 }
1260 else
1261 {
1262 clh = m_children.getLast();
1263 }
1264 ASSERT(clh!=0);
1265 clh->startCodeLine(attrib);
1266 m_hasLineNumber=FALSE;
1267}
1268
1269IDocIterator *ProgramListingHandler::codeLines() const
1270{
1271 return new ProgramListingIterator(*this);
1272}
1273
1274
1275
1276//----------------------------------------------------------------------
1277// FormulaHandler
1278//----------------------------------------------------------------------
1279
1280FormulaHandler::FormulaHandler(IBaseHandler *parent)
1281 : m_parent(parent)
1282{
1283 addEndHandler("formula",this,&FormulaHandler::endFormula);
1284}
1285
1286FormulaHandler::~FormulaHandler()
1287{
1288}
1289
1290void FormulaHandler::startFormula(const QXmlAttributes& attrib)
1291{
1292 m_id = attrib.value("id");
1293 m_curString="";
1294 m_parent->setDelegate(this);
1295}
1296
1297void FormulaHandler::endFormula()
1298{
1299 m_text = m_curString;
1300 debug(2,"formula id=`%s' text=`%s'\n",m_id.data(),m_text.data());
1301 m_parent->setDelegate(0);
1302}
1303
1304//----------------------------------------------------------------------
1305// AnchorHandler
1306//----------------------------------------------------------------------
1307
1308AnchorHandler::AnchorHandler(IBaseHandler *parent)
1309 : m_parent(parent)
1310{
1311 addEndHandler("anchor",this,&AnchorHandler::endAnchor);
1312}
1313
1314AnchorHandler::~AnchorHandler()
1315{
1316}
1317
1318void AnchorHandler::startAnchor(const QXmlAttributes& attrib)
1319{
1320 m_id = attrib.value("id");
1321 m_parent->setDelegate(this);
1322}
1323
1324void AnchorHandler::endAnchor()
1325{
1326 debug(2,"anchor id=`%s'\n",m_id.data());
1327 m_parent->setDelegate(0);
1328}
1329
1330//----------------------------------------------------------------------
1331// ImageHandler
1332//----------------------------------------------------------------------
1333
1334ImageHandler::ImageHandler(IBaseHandler *parent)
1335 : m_parent(parent)
1336{
1337 addEndHandler("image",this,&ImageHandler::endImage);
1338}
1339
1340ImageHandler::~ImageHandler()
1341{
1342}
1343
1344void ImageHandler::startImage(const QXmlAttributes& attrib)
1345{
1346 m_name = attrib.value("name");
1347 m_curString="";
1348 m_parent->setDelegate(this);
1349}
1350
1351void ImageHandler::endImage()
1352{
1353 m_caption = m_curString;
1354 debug(2,"image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data());
1355 m_parent->setDelegate(0);
1356}
1357
1358//----------------------------------------------------------------------
1359// DotFileHandler
1360//----------------------------------------------------------------------
1361
1362DotFileHandler::DotFileHandler(IBaseHandler *parent)
1363 : m_parent(parent)
1364{
1365 addEndHandler("dotfile",this,&DotFileHandler::endDotFile);
1366}
1367
1368DotFileHandler::~DotFileHandler()
1369{
1370}
1371
1372void DotFileHandler::startDotFile(const QXmlAttributes& attrib)
1373{
1374 m_name = attrib.value("name");
1375 m_curString="";
1376 m_parent->setDelegate(this);
1377}
1378
1379void DotFileHandler::endDotFile()
1380{
1381 m_caption = m_curString;
1382 debug(2,"image name=`%s' caption=`%s'\n",m_name.data(),m_caption.data());
1383 m_parent->setDelegate(0);
1384}
1385
1386//----------------------------------------------------------------------
1387// IndexEntryHandler
1388//----------------------------------------------------------------------
1389
1390IndexEntryHandler::IndexEntryHandler(IBaseHandler *parent)
1391 : m_parent(parent)
1392{
1393 addEndHandler("indexentry",this,&IndexEntryHandler::endIndexEntry);
1394 addStartHandler("primaryie",this,&IndexEntryHandler::startPrimaryIE);
1395 addEndHandler("primaryie",this,&IndexEntryHandler::endPrimaryIE);
1396 addStartHandler("secondaryie",this,&IndexEntryHandler::startSecondaryIE);
1397 addEndHandler("secondaryie",this,&IndexEntryHandler::endSecondaryIE);
1398}
1399
1400IndexEntryHandler::~IndexEntryHandler()
1401{
1402}
1403
1404void IndexEntryHandler::startIndexEntry(const QXmlAttributes& /*attrib*/)
1405{
1406 debug(2,"start index entry\n");
1407 m_parent->setDelegate(this);
1408}
1409
1410void IndexEntryHandler::endIndexEntry()
1411{
1412 debug(2,"index entry primary=`%s' secondary=`%s'\n",
1413 m_primary.data(),m_secondary.data());
1414 m_parent->setDelegate(0);
1415}
1416
1417void IndexEntryHandler::startPrimaryIE(const QXmlAttributes& /*attrib*/)
1418{
1419 m_curString="";
1420}
1421
1422void IndexEntryHandler::endPrimaryIE()
1423{
1424 m_primary = m_curString;
1425}
1426
1427void IndexEntryHandler::startSecondaryIE(const QXmlAttributes& /*attrib*/)
1428{
1429 m_curString="";
1430}
1431
1432void IndexEntryHandler::endSecondaryIE()
1433{
1434 m_secondary = m_curString;
1435}
1436
1437//----------------------------------------------------------------------
1438// EntryHandler
1439//----------------------------------------------------------------------
1440
1441EntryHandler::EntryHandler(IBaseHandler *parent)
1442 : m_parent(parent)
1443{
1444 m_children.setAutoDelete(TRUE);
1445 addEndHandler("entry",this,&EntryHandler::endEntry);
1446 addStartHandler("para",this,&EntryHandler::startParagraph);
1447}
1448
1449EntryHandler::~EntryHandler()
1450{
1451}
1452
1453void EntryHandler::startEntry(const QXmlAttributes&)
1454{
1455 m_parent->setDelegate(this);
1456}
1457
1458void EntryHandler::endEntry()
1459{
1460 m_parent->setDelegate(0);
1461}
1462
1463void EntryHandler::startParagraph(const QXmlAttributes& attrib)
1464{
1465 ParagraphHandler *ph = new ParagraphHandler(this);
1466 ph->startParagraph(attrib);
1467 m_children.append(ph);
1468}
1469
1470IDocIterator *EntryHandler::contents() const
1471{
1472 return new EntryIterator(*this);
1473}
1474
1475//----------------------------------------------------------------------
1476// RowHandler
1477//----------------------------------------------------------------------
1478
1479RowHandler::RowHandler(IBaseHandler *parent)
1480 : m_parent(parent)
1481{
1482 m_children.setAutoDelete(TRUE);
1483 addEndHandler("row",this,&RowHandler::endRow);
1484 addStartHandler("entry",this,&RowHandler::startEntry);
1485}
1486
1487RowHandler::~RowHandler()
1488{
1489}
1490
1491void RowHandler::startRow(const QXmlAttributes&)
1492{
1493 m_parent->setDelegate(this);
1494}
1495
1496void RowHandler::endRow()
1497{
1498 m_parent->setDelegate(0);
1499}
1500
1501void RowHandler::startEntry(const QXmlAttributes& attrib)
1502{
1503 EntryHandler *eh = new EntryHandler(this);
1504 eh->startEntry(attrib);
1505 m_children.append(eh);
1506}
1507
1508IDocIterator *RowHandler::entries() const
1509{
1510 return new RowIterator(*this);
1511}
1512
1513//----------------------------------------------------------------------
1514// TableHandler
1515//----------------------------------------------------------------------
1516
1517TableHandler::TableHandler(IBaseHandler *parent)
1518 : m_parent(parent)
1519{
1520 m_children.setAutoDelete(TRUE);
1521 addEndHandler("table",this,&TableHandler::endTable);
1522 addStartHandler("row",this,&TableHandler::startRow);
1523 addStartHandler("caption",this,&TableHandler::startCaption);
1524 addEndHandler("caption",this,&TableHandler::endCaption);
1525}
1526
1527TableHandler::~TableHandler()
1528{
1529}
1530
1531void TableHandler::startTable(const QXmlAttributes& attrib)
1532{
1533 m_parent->setDelegate(this);
1534 m_numColumns = attrib.value("cols").toInt();
1535 debug(2,"table cols=%d\n",m_numColumns);
1536}
1537
1538void TableHandler::endTable()
1539{
1540 m_parent->setDelegate(0);
1541}
1542
1543void TableHandler::startRow(const QXmlAttributes& attrib)
1544{
1545 RowHandler *rh = new RowHandler(this);
1546 rh->startRow(attrib);
1547 m_children.append(rh);
1548}
1549
1550void TableHandler::startCaption(const QXmlAttributes& /*attrib*/)
1551{
1552 m_curString="";
1553}
1554
1555void TableHandler::endCaption()
1556{
1557 m_caption = m_curString;
1558}
1559
1560IDocIterator *TableHandler::rows() const
1561{
1562 return new TableIterator(*this);
1563}
1564
1565//----------------------------------------------------------------------
1566// CopyHandler
1567//----------------------------------------------------------------------
1568
1569CopyHandler::CopyHandler(IBaseHandler *parent)
1570 : m_parent(parent)
1571{
1572 m_children.setAutoDelete(TRUE);
1573
1574 addEndHandler("copydoc",this,&CopyHandler::endCopy);
1575
1576 addStartHandler("para",this,&CopyHandler::startParagraph);
1577}
1578
1579CopyHandler::~CopyHandler()
1580{
1581}
1582
1583void CopyHandler::startCopy(const QXmlAttributes& /*attrib*/)
1584{
1585 m_parent->setDelegate(this);
1586 debug(2,"start copy handler\n");
1587}
1588
1589void CopyHandler::endCopy()
1590{
1591 debug(2,"end copy handler\n");
1592 m_parent->setDelegate(0);
1593}
1594
1595void CopyHandler::startParagraph(const QXmlAttributes& attrib)
1596{
1597 ParagraphHandler *parHandler = new ParagraphHandler(this);
1598 parHandler->startParagraph(attrib);
1599 m_children.append(parHandler);
1600}
1601
1602IDocIterator *CopyHandler::contents() const
1603{
1604 return new CopyIterator(*this);
1605}
1606
1607//----------------------------------------------------------------------
1608// VerbatimHandler
1609//----------------------------------------------------------------------
1610
1611VerbatimHandler::VerbatimHandler(IBaseHandler *parent)
1612 : m_parent(parent), m_type(IDocVerbatim::Invalid)
1613{
1614 addEndHandler("verbatim",this,&VerbatimHandler::endVerbatim);
1615 addEndHandler("latexonly",this,&VerbatimHandler::endVerbatim);
1616 addEndHandler("htmlonly",this,&VerbatimHandler::endVerbatim);
1617}
1618
1619VerbatimHandler::~VerbatimHandler()
1620{
1621}
1622
1623void VerbatimHandler::startVerbatim(const QXmlAttributes&,Types type)
1624{
1625 m_type = type;
1626 m_parent->setDelegate(this);
1627 m_curString="";
1628}
1629
1630void VerbatimHandler::endVerbatim()
1631{
1632 m_text = m_curString;
1633 m_parent->setDelegate(0);
1634}
1635
1636
1637//----------------------------------------------------------------------
1638// SymbolHandler
1639//----------------------------------------------------------------------
1640
1641SymbolHandler::SymbolHandler(IBaseHandler *parent,Types type)
1642 : m_parent(parent), m_letter('\0'), m_type(type)
1643{
1644 addEndHandler("symbol");
1645 switch (type)
1646 {
1647 case IDocSymbol::Invalid: m_typeString="invalid"; break;
1648 case IDocSymbol::Umlaut: m_typeString="umlaut"; break;
1649 case IDocSymbol::Acute: m_typeString="acute"; break;
1650 case IDocSymbol::Grave: m_typeString="grave"; break;
1651 case IDocSymbol::Circ: m_typeString="circ"; break;
1652 case IDocSymbol::Tilde: m_typeString="tilde"; break;
1653 case IDocSymbol::Szlig: m_typeString="szlig"; break;
1654 case IDocSymbol::Cedil: m_typeString="cedil"; break;
1655 case IDocSymbol::Ring: m_typeString="ring"; break;
1656 case IDocSymbol::Nbsp: m_typeString="nbsp"; break;
1657 case IDocSymbol::Copy: m_typeString="copy"; break;
1658 }
1659}
1660
1661SymbolHandler::~SymbolHandler()
1662{
1663}
1664
1665void SymbolHandler::startSymbol(const QXmlAttributes& attrib)
1666{
1667 QString ls = attrib.value("char");
1668 if (!ls.isEmpty()) m_letter = ls.latin1()[0];
1669}
1670
1671//----------------------------------------------------------------------
1672// ParagraphHandler
1673//----------------------------------------------------------------------
1674
1675ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
1676 : m_parent(parent)
1677{
1678 m_children.setAutoDelete(TRUE);
1679
1680 m_markupHandler = new MarkupHandler(m_children,m_curString);
1681
1682 // preformatted
1683 setFallBackHandler(m_markupHandler);
1684
1685 addEndHandler("para",this,&ParagraphHandler::endParagraph);
1686
1687 addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak);
1688 addStartHandler("hruler",this,&ParagraphHandler::startHRuler);
1689 addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing);
1690 addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim);
1691 addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
1692 addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList);
1693 addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList);
1694 addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect);
1695 // TODO: title
1696 addStartHandler("variablelist",this,&ParagraphHandler::startVariableList);
1697 addStartHandler("table",this,&ParagraphHandler::startTable);
1698 // TODO: heading
1699 addStartHandler("image",this,&ParagraphHandler::startImage);
1700 addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
1701 addStartHandler("toclist",this,&ParagraphHandler::startTocList);
1702 // TODO: language???
1703 addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList);
1704 // TODO: xrefsect
1705 addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc);
1706
1707 addStartHandler("ref",this,&ParagraphHandler::startRef);
1708 addStartHandler("ulink",this,&ParagraphHandler::startULink);
1709 addStartHandler("email",this,&ParagraphHandler::startEMail);
1710 addStartHandler("link",this,&ParagraphHandler::startLink);
1711 addStartHandler("formula",this,&ParagraphHandler::startFormula);
1712 addStartHandler("latexonly",this,&ParagraphHandler::startHtmlOnly);
1713 addStartHandler("htmlonly",this,&ParagraphHandler::startLatexOnly);
1714 addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut);
1715 addStartHandler("acute",this,&ParagraphHandler::startAcute);
1716 addStartHandler("grave",this,&ParagraphHandler::startGrave);
1717 addStartHandler("circ",this,&ParagraphHandler::startCirc);
1718 addStartHandler("tilde",this,&ParagraphHandler::startTilde);
1719 addStartHandler("szlig",this,&ParagraphHandler::startSzlig);
1720 addStartHandler("cedil",this,&ParagraphHandler::startCedil);
1721 addStartHandler("ring",this,&ParagraphHandler::startRing);
1722 addStartHandler("nbsp",this,&ParagraphHandler::startNbsp);
1723 addStartHandler("copy",this,&ParagraphHandler::startCopy);
1724 addStartHandler("anchor",this,&ParagraphHandler::startAnchor);
1725}
1726
1727ParagraphHandler::~ParagraphHandler()
1728{
1729 delete m_markupHandler;
1730}
1731
1732void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/)
1733{
1734 m_parent->setDelegate(this);
1735 debug(2,"para\n");
1736}
1737
1738void ParagraphHandler::endParagraph()
1739{
1740 addTextNode();
1741 debug(2,"end para\n");
1742 m_parent->setDelegate(0);
1743}
1744
1745void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib)
1746{
1747 addTextNode();
1748 ItemizedListHandler *listHandler = new ItemizedListHandler(this);
1749 listHandler->startItemizedList(attrib);
1750 m_children.append(listHandler);
1751}
1752
1753void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib)
1754{
1755 addTextNode();
1756 OrderedListHandler *listHandler = new OrderedListHandler(this);
1757 listHandler->startOrderedList(attrib);
1758 m_children.append(listHandler);
1759}
1760
1761void ParagraphHandler::startParameterList(const QXmlAttributes& attrib)
1762{
1763 addTextNode();
1764 ParameterListHandler *listHandler = new ParameterListHandler(this);
1765 listHandler->startParameterList(attrib);
1766 m_children.append(listHandler);
1767}
1768
1769void ParagraphHandler::startSimpleSect(const QXmlAttributes& attrib)
1770{
1771 addTextNode();
1772 SimpleSectHandler *sectHandler = new SimpleSectHandler(this);
1773 sectHandler->startSimpleSect(attrib);
1774 m_children.append(sectHandler);
1775}
1776
1777void ParagraphHandler::startRef(const QXmlAttributes& attrib)
1778{
1779 addTextNode();
1780 RefHandler *ref = new RefHandler(this);
1781 ref->startRef(attrib);
1782 m_children.append(ref);
1783}
1784
1785void ParagraphHandler::startVariableList(const QXmlAttributes& attrib)
1786{
1787 addTextNode();
1788 VariableListHandler *vl = new VariableListHandler(this);
1789 vl->startVariableList(attrib);
1790 m_children.append(vl);
1791}
1792
1793void ParagraphHandler::startHRuler(const QXmlAttributes& attrib)
1794{
1795 addTextNode();
1796 HRulerHandler *hr = new HRulerHandler(this);
1797 hr->startHRuler(attrib);
1798 m_children.append(hr);
1799}
1800
1801void ParagraphHandler::startLineBreak(const QXmlAttributes& attrib)
1802{
1803 addTextNode();
1804 LineBreakHandler *lb = new LineBreakHandler(this);
1805 lb->startLineBreak(attrib);
1806 m_children.append(lb);
1807}
1808
1809void ParagraphHandler::startULink(const QXmlAttributes& attrib)
1810{
1811 addTextNode();
1812 ULinkHandler *uh = new ULinkHandler(this);
1813 uh->startULink(attrib);
1814 m_children.append(uh);
1815}
1816
1817void ParagraphHandler::startEMail(const QXmlAttributes& attrib)
1818{
1819 addTextNode();
1820 EMailHandler *eh = new EMailHandler(this);
1821 eh->startEMail(attrib);
1822 m_children.append(eh);
1823}
1824
1825void ParagraphHandler::startLink(const QXmlAttributes& attrib)
1826{
1827 addTextNode();
1828 LinkHandler *lh = new LinkHandler(this);
1829 lh->startLink(attrib);
1830 m_children.append(lh);
1831}
1832
1833void ParagraphHandler::startProgramListing(const QXmlAttributes& attrib)
1834{
1835 addTextNode();
1836 ProgramListingHandler *pl = new ProgramListingHandler(this);
1837 pl->startProgramListing(attrib);
1838 m_children.append(pl);
1839}
1840
1841void ParagraphHandler::startFormula(const QXmlAttributes& attrib)
1842{
1843 addTextNode();
1844 FormulaHandler *fh = new FormulaHandler(this);
1845 fh->startFormula(attrib);
1846 m_children.append(fh);
1847}
1848
1849void ParagraphHandler::startImage(const QXmlAttributes& attrib)
1850{
1851 addTextNode();
1852 ImageHandler *ih = new ImageHandler(this);
1853 ih->startImage(attrib);
1854 m_children.append(ih);
1855}
1856
1857void ParagraphHandler::startDotFile(const QXmlAttributes& attrib)
1858{
1859 addTextNode();
1860 DotFileHandler *df = new DotFileHandler(this);
1861 df->startDotFile(attrib);
1862 m_children.append(df);
1863}
1864
1865void ParagraphHandler::startIndexEntry(const QXmlAttributes& attrib)
1866{
1867 addTextNode();
1868 IndexEntryHandler *df = new IndexEntryHandler(this);
1869 df->startIndexEntry(attrib);
1870 m_children.append(df);
1871}
1872
1873void ParagraphHandler::startTable(const QXmlAttributes& attrib)
1874{
1875 addTextNode();
1876 TableHandler *th = new TableHandler(this);
1877 th->startTable(attrib);
1878 m_children.append(th);
1879}
1880
1881void ParagraphHandler::startVerbatim(const QXmlAttributes& attrib)
1882{
1883 addTextNode();
1884 VerbatimHandler *vh = new VerbatimHandler(this);
1885 vh->startVerbatim(attrib,IDocVerbatim::Verbatim);
1886 m_children.append(vh);
1887}
1888
1889void ParagraphHandler::startHtmlOnly(const QXmlAttributes& attrib)
1890{
1891 addTextNode();
1892 VerbatimHandler *vh = new VerbatimHandler(this);
1893 vh->startVerbatim(attrib,IDocVerbatim::HtmlOnly);
1894 m_children.append(vh);
1895}
1896
1897void ParagraphHandler::startLatexOnly(const QXmlAttributes& attrib)
1898{
1899 addTextNode();
1900 VerbatimHandler *vh = new VerbatimHandler(this);
1901 vh->startVerbatim(attrib,IDocVerbatim::LatexOnly);
1902 m_children.append(vh);
1903}
1904
1905void ParagraphHandler::startUmlaut(const QXmlAttributes& attrib)
1906{
1907 addTextNode();
1908 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Umlaut);
1909 sh->startSymbol(attrib);
1910 m_children.append(sh);
1911}
1912
1913void ParagraphHandler::startAcute(const QXmlAttributes& attrib)
1914{
1915 addTextNode();
1916 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Acute);
1917 sh->startSymbol(attrib);
1918 m_children.append(sh);
1919}
1920
1921void ParagraphHandler::startGrave(const QXmlAttributes& attrib)
1922{
1923 addTextNode();
1924 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Grave);
1925 sh->startSymbol(attrib);
1926 m_children.append(sh);
1927}
1928
1929void ParagraphHandler::startCirc(const QXmlAttributes& attrib)
1930{
1931 addTextNode();
1932 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Circ);
1933 sh->startSymbol(attrib);
1934 m_children.append(sh);
1935}
1936
1937void ParagraphHandler::startTilde(const QXmlAttributes& attrib)
1938{
1939 addTextNode();
1940 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Tilde);
1941 sh->startSymbol(attrib);
1942 m_children.append(sh);
1943}
1944
1945void ParagraphHandler::startSzlig(const QXmlAttributes& attrib)
1946{
1947 addTextNode();
1948 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Szlig);
1949 sh->startSymbol(attrib);
1950 m_children.append(sh);
1951}
1952
1953void ParagraphHandler::startCedil(const QXmlAttributes& attrib)
1954{
1955 addTextNode();
1956 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Cedil);
1957 sh->startSymbol(attrib);
1958 m_children.append(sh);
1959}
1960
1961void ParagraphHandler::startRing(const QXmlAttributes& attrib)
1962{
1963 addTextNode();
1964 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Ring);
1965 sh->startSymbol(attrib);
1966 m_children.append(sh);
1967}
1968
1969void ParagraphHandler::startNbsp(const QXmlAttributes& attrib)
1970{
1971 addTextNode();
1972 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Nbsp);
1973 sh->startSymbol(attrib);
1974 m_children.append(sh);
1975}
1976
1977void ParagraphHandler::startCopy(const QXmlAttributes& attrib)
1978{
1979 addTextNode();
1980 SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Copy);
1981 sh->startSymbol(attrib);
1982 m_children.append(sh);
1983}
1984
1985void ParagraphHandler::startAnchor(const QXmlAttributes& attrib)
1986{
1987 addTextNode();
1988 AnchorHandler *ah = new AnchorHandler(this);
1989 ah->startAnchor(attrib);
1990 m_children.append(ah);
1991}
1992
1993void ParagraphHandler::startCopyDoc(const QXmlAttributes& attrib)
1994{
1995 addTextNode();
1996 CopyHandler *ch = new CopyHandler(this);
1997 ch->startCopy(attrib);
1998 m_children.append(ch);
1999}
2000
2001void ParagraphHandler::startTocList(const QXmlAttributes& attrib)
2002{
2003 addTextNode();
2004 TocListHandler *th = new TocListHandler(this);
2005 th->startTocList(attrib);
2006 m_children.append(th);
2007}
2008
2009void ParagraphHandler::addTextNode()
2010{
2011 if (!m_curString.isEmpty())
2012 {
2013 m_children.append(
2014 new TextNode(
2015 m_curString,
2016 m_markupHandler->markup(),
2017 m_markupHandler->headingLevel()
2018 )
2019 );
2020 debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
2021 m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
2022 m_curString="";
2023 }
2024}
2025
2026IDocIterator *ParagraphHandler::contents() const
2027{
2028 return new ParagraphIterator(*this);
2029}
2030
2031//----------------------------------------------------------------------
2032// DocSectionHandler
2033//----------------------------------------------------------------------
2034
2035DocSectionHandler::DocSectionHandler(IBaseHandler *parent,int level)
2036 : m_parent(parent), m_internal(0), m_level(level), m_title(0)
2037{
2038 QString sectionKey;
2039 m_paragraphs.setAutoDelete(TRUE);
2040 m_subsections.setAutoDelete(TRUE);
2041 addStartHandler("title",this,&DocSectionHandler::startTitle);
2042 addStartHandler("para",this,&DocSectionHandler::startParagraph);
2043 if (level<6)
2044 {
2045 sectionKey.sprintf("sect%d",level+1);
2046 addStartHandler(sectionKey,this,&DocSectionHandler::startSubSection);
2047 }
2048 addStartHandler("internal",this,&DocSectionHandler::startInternal);
2049 sectionKey.sprintf("sect%d",level);
2050 addEndHandler(sectionKey,this,&DocSectionHandler::endDocSection);
2051}
2052
2053DocSectionHandler::~DocSectionHandler()
2054{
2055}
2056
2057void DocSectionHandler::startDocSection(const QXmlAttributes& attrib)
2058{
2059 m_parent->setDelegate(this);
2060 debug(2,"Start docsection\n");
2061 m_id = attrib.value("id");
2062}
2063
2064void DocSectionHandler::endDocSection()
2065{
2066 m_parent->setDelegate(0);
2067 debug(2,"End docsection\n");
2068}
2069
2070void DocSectionHandler::startSubSection(const QXmlAttributes& attrib)
2071{
2072 DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
2073 secHandler->startDocSection(attrib);
2074 m_subsections.append(secHandler);
2075}
2076
2077void DocSectionHandler::startParagraph(const QXmlAttributes& attrib)
2078{
2079 ParagraphHandler *parHandler = new ParagraphHandler(this);
2080 parHandler->startParagraph(attrib);
2081 m_paragraphs.append(parHandler);
2082}
2083
2084void DocSectionHandler::startInternal(const QXmlAttributes& attrib)
2085{
2086 m_internal = new DocInternalHandler(this,m_level);
2087 m_internal->startInternal(attrib);
2088}
2089
2090void DocSectionHandler::startTitle(const QXmlAttributes& attrib)
2091{
2092 m_title = new TitleHandler(this);
2093 m_title->startTitle(attrib);
2094}
2095
2096IDocIterator *DocSectionHandler::paragraphs() const
2097{
2098 return new DocSectionParaIterator(*this);
2099}
2100
2101IDocIterator *DocSectionHandler::subSections() const
2102{
2103 return new DocSectionSubIterator(*this);
2104}
2105
2106IDocInternal *DocSectionHandler::internal() const
2107{
2108 return m_internal;
2109}
2110
2111//----------------------------------------------------------------------
2112// DocInternal
2113//----------------------------------------------------------------------
2114
2115DocInternalHandler::DocInternalHandler(IBaseHandler *parent,int level)
2116 : m_parent(parent), m_level(level)
2117{
2118 m_paragraphs.setAutoDelete(TRUE);
2119 m_subsections.setAutoDelete(TRUE);
2120 addStartHandler("para",this,&DocInternalHandler::startParagraph);
2121 QString sectionKey;
2122 sectionKey.sprintf("sect%d",level+1);
2123 addStartHandler(sectionKey,this,&DocInternalHandler::startSubSection);
2124 addEndHandler("internal",this,&DocInternalHandler::endInternal);
2125}
2126
2127DocInternalHandler::~DocInternalHandler()
2128{
2129}
2130
2131void DocInternalHandler::startInternal(const QXmlAttributes&)
2132{
2133 m_parent->setDelegate(this);
2134 debug(2,"Start internal\n");
2135}
2136
2137void DocInternalHandler::endInternal()
2138{
2139 m_parent->setDelegate(0);
2140 debug(2,"End internal\n");
2141}
2142
2143void DocInternalHandler::startSubSection(const QXmlAttributes& attrib)
2144{
2145 DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
2146 secHandler->startDocSection(attrib);
2147 m_subsections.append(secHandler);
2148}
2149
2150void DocInternalHandler::startParagraph(const QXmlAttributes& attrib)
2151{
2152 ParagraphHandler *parHandler = new ParagraphHandler(this);
2153 parHandler->startParagraph(attrib);
2154 m_paragraphs.append(parHandler);
2155}
2156
2157IDocIterator *DocInternalHandler::paragraphs() const
2158{
2159 return new DocInternalParaIterator(*this);
2160}
2161
2162IDocIterator *DocInternalHandler::subSections() const
2163{
2164 return new DocInternalSubIterator(*this);
2165}
2166
2167
2168//----------------------------------------------------------------------
2169// DocHandler
2170//----------------------------------------------------------------------
2171
2172DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent)
2173{
2174 m_children.setAutoDelete(TRUE);
2175
2176 addEndHandler("briefdescription",this,&DocHandler::endDoc);
2177 addEndHandler("detaileddescription",this,&DocHandler::endDoc);
2178 addEndHandler("inbodydescription",this,&DocHandler::endDoc);
2179 //addEndHandler("internal"); // TODO: implement this as a section
2180 addStartHandler("internal",this,&DocHandler::startInternal);
2181
2182 addStartHandler("para",this,&DocHandler::startParagraph);
2183 addStartHandler("sect1",this,&DocHandler::startSect1);
2184 addStartHandler("title",this,&DocHandler::startTitle);
2185 //addStartHandler("internal");
2186}
2187
2188DocHandler::~DocHandler()
2189{
2190}
2191
2192void DocHandler::startDoc(const QXmlAttributes& /*attrib*/)
2193{
2194 m_parent->setDelegate(this);
2195 debug(2,"start dochandler\n");
2196}
2197
2198void DocHandler::endDoc()
2199{
2200 debug(2,"end dochandler\n");
2201 m_parent->setDelegate(0);
2202}
2203
2204void DocHandler::startParagraph(const QXmlAttributes& attrib)
2205{
2206 ParagraphHandler *parHandler = new ParagraphHandler(this);
2207 parHandler->startParagraph(attrib);
2208 m_children.append(parHandler);
2209}
2210
2211void DocHandler::startSect1(const QXmlAttributes& attrib)
2212{
2213 DocSectionHandler *secHandler = new DocSectionHandler(this,1);
2214 secHandler->startDocSection(attrib);
2215 m_children.append(secHandler);
2216}
2217
2218void DocHandler::startTitle(const QXmlAttributes& attrib)
2219{
2220 TitleHandler *titleHandler = new TitleHandler(this);
2221 titleHandler->startTitle(attrib);
2222 m_children.append(titleHandler);
2223}
2224
2225void DocHandler::startInternal(const QXmlAttributes& attrib)
2226{
2227 m_internal = new DocInternalHandler(this,1);
2228 m_internal->startInternal(attrib);
2229}
2230
2231IDocIterator *DocHandler::contents() const
2232{
2233 return new DocIterator(*this);
2234}
2235
2236IDocInternal *DocHandler::internal() const
2237{
2238 return m_internal;
2239}
2240
2241

Archive Download this file

Revision: 1322