diff options
Diffstat (limited to 'src/levelhandler.h')
-rw-r--r-- | src/levelhandler.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/levelhandler.h b/src/levelhandler.h index 3077c13..bee1a8e 100644 --- a/src/levelhandler.h +++ b/src/levelhandler.h @@ -44,36 +44,49 @@ #define __LEVELHANDLER_H__ #include "rtfreader.h" -#include "basehandler.h" -#include "rtfparsehelpers.h" #include "reference.h" +#include "rtfparsehelpers.h" +/* + * LevelHandler + * + * A base class that manages a set of Levels (see XMLComposeHelpers.cpp) + * based on the RTF groups seen. + */ class LevelHandler - : public BaseHandler + : public RTFHandler { public: LevelHandler(); virtual ~LevelHandler(); - virtual void startDocument(RtfReader* reader); + // Overrides + virtual void startDocument(RtfParser* parser); virtual void endDocument(); virtual void groupStart(); virtual void groupEnd(); + // Convenience function to get XML element from current level virtual DOM::Element getElement(); + // Create a new level on top of stack void pushLevel(); + + // Pop top level and discard void popLevel(); + + // Back out all the way past a given level void rewindLevel(LevelPtr ptr); - LevelPtr getLevel(); + // Get the current level + LevelPtr getLevel(); protected: virtual void clear(); - LevelPtr m_topLevel; - LevelPtr m_curLevel; + LevelPtr m_topLevel; // First level + LevelPtr m_curLevel; // The current level + RtfParser* m_parser; // The parser we're listening to }; - #endif // __LEVELHANDLER_H__ |