From 53914f770f1e1dc1ab4342c64846fd995825b7e6 Mon Sep 17 00:00:00 2001 From: Stef Date: Wed, 17 Sep 2003 18:34:42 +0000 Subject: Initial Import --- src/xmlcomposehelpers.h | 84 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 src/xmlcomposehelpers.h (limited to 'src/xmlcomposehelpers.h') diff --git a/src/xmlcomposehelpers.h b/src/xmlcomposehelpers.h new file mode 100644 index 0000000..f6c06e7 --- /dev/null +++ b/src/xmlcomposehelpers.h @@ -0,0 +1,84 @@ +#ifndef __RTFPARSEHELPERS_H__ +#define __RTFPARSEHELPERS_H__ + +#include "Reference.h" +#include +#include "sablo.h" +#include "RtfFormatting.h" + +class RtfParser; + +class Destination : + public Instance +{ +public: + // This is called when the Destination is first used + virtual void initialize() {}; + // Called when data arrives at destination + virtual void charData(wstring data) {}; + // Called when the Destination goes out of scope + virtual void done() {}; + +protected: + RtfParser* m_parser; + friend class RtfParser; +}; + + +class Analyser : + public Instance +{ +public: + // This is called when the Analyser is first used + virtual void initialize() {}; + // Called when a control word is seen + virtual void controlWord(const string& cw, int flags, int param) {}; + // Called when a group is seen within this scope + virtual void groupStart() {}; + // Called when a group ends within this scope + virtual void groupEnd() {}; + // Called when when this analyser goes out of scope + virtual void done() {}; + +protected: + RtfParser* m_parser; + friend class RtfParser; +}; + +class Level; + +typedef Reference DestinationPtr; +typedef Reference AnalyserPtr; +typedef Reference LevelPtr; + +class Level : + public Instance +{ +public: + Level(); + virtual ~Level(); + + LevelPtr getPrevious(); + LevelPtr pushLevel(); + + DOM::Element getElement(); + void setElement(DOM::Element element, bool deep = false); + AnalyserPtr getAnalyser(); + void setAnalyser(AnalyserPtr analyser, bool deep = false); + DestinationPtr getDestination(); + void setDestination(DestinationPtr destination, bool deep = false); + RtfFormatting& getFormatting(); + void setTextProperties(RtfFormatting& textProperties); + +protected: + Level(const Level& level); + + LevelPtr m_previous; + DOM::Element m_element; + RtfFormatting m_text; + DestinationPtr m_destination; + AnalyserPtr m_analyser; +}; + + +#endif //__RTFPARSEHELPERS_H__ \ No newline at end of file -- cgit v1.2.3