summaryrefslogtreecommitdiff
path: root/src/xmlcomposehelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmlcomposehelpers.h')
-rw-r--r--src/xmlcomposehelpers.h84
1 files changed, 84 insertions, 0 deletions
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 <mystring.h>
+#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<Destination> DestinationPtr;
+typedef Reference<Analyser> AnalyserPtr;
+typedef Reference<Level> 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