oopapidocs  2.0
docbookwalker.h
00001 #ifndef DOCBOOKWALKER_H
00002 #define DOCBOOKWALKER_H
00003 #include <QChar>
00004 #include <QStringList>
00005 #include "docbookdoc.h"
00006 #include "docbook_export.h"
00007 
00012 class DOCBOOK_EXPORT DocbookWalker {
00013  public:
00014     DocbookWalker(DocbookDoc doc);
00016     virtual QDomDocument transform();
00017     virtual ~DocbookWalker() {}
00021     virtual int visited() const { 
00022         return m_visited; 
00023     } 
00024  protected:
00025 
00041     virtual bool visit(int depth, Element e) ;
00042 
00044     QString currentHeading() const;
00045     
00049     QString heading(Element sect) const;
00050 
00051     QDomNode walkTree(int depth, QDomNode current);
00052 
00053     void newChapter(Element e);
00054     void newSection(Element e, int depth);
00055     void newAppendix(Element e) ;
00056     
00057     Element& currentChapter() {
00058         return m_currentChapter;
00059     }
00060     Element& currentSection() {
00061         return m_currentSection;
00062     }
00063     
00064     
00065  protected:
00066     mutable DocbookDoc m_document;
00067 
00068 
00069  private:
00070     Element m_currentChapter;
00071     Element m_currentSection;
00072     int m_chapt;
00073     int m_appendix;
00074     int m_visited;
00075     QList<int> m_sectNum;
00076 };
00077 #endif        //  #ifndef DOCBOOKWALKER_H
 All Classes Namespaces Functions Enumerations