DocbookWalker Class Reference

A class designed for traversing and transforming Docbook Documents. More...

#include <docbookwalker.h>

Collaboration diagram for DocbookWalker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DocbookWalker (DocbookDoc doc)
virtual QDomDocument transform ()
 Traverses whole tree.
virtual ~DocbookWalker ()
virtual int visited () const
 
Returns:
number of nodes visited


Protected Member Functions

virtual bool visit (int depth, Element e)
 Visits the current Element.
QString currentHeading () const
 
Returns:
For the current chapter/section/appendix, returns the element name followed by its number, and its title, as a QString.

QString heading (Element sect) const
 
Parameters:
sect a chapter, section or appendix

QDomNode walkTree (int depth, QDomNode current)
void newChapter (Element e)
void newSection (Element e, int depth)
void newAppendix (Element e)
Element & currentChapter ()
Element & currentSection ()

Protected Attributes

DocbookDoc m_document

Detailed Description

A class designed for traversing and transforming Docbook Documents.

Keeps track of section::s and chapter::s.

Author:
Alan Ezust

Definition at line 12 of file docbookwalker.h.


Member Function Documentation

bool DocbookWalker::visit ( int  depth,
Element  e 
) [protected, virtual]

Visits the current Element.

Handles elements like <chapter> <section> nd <appendix> for numbering purposes.

Called from walkTree from transform. Not to be called pubclicly.

You can override this, handle specific elements, and call the base class version for elements you do not handle.

Parameters:
e the Element to visit
depth the current depth of the tree
Returns:
false if we should not check the children after handling this object.

Definition at line 63 of file docbookwalker.cpp.

References newAppendix(), newChapter(), and newSection().

Referenced by walkTree().

Here is the call graph for this function:

QString DocbookWalker::heading ( Element  sect  )  const [protected]

Parameters:
sect a chapter, section or appendix

Returns:
the heading string of sect.

Definition at line 18 of file docbookwalker.cpp.

References DocbookDoc::getTitle(), and m_document.

Referenced by currentHeading().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Sep 30 01:15:44 2009 for oopapidocs by  doxygen 1.5.1