summaryrefslogtreecommitdiff
path: root/src/xmlcomposehelpers.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2003-09-17 18:34:42 +0000
committerStef Walter <stef@memberwebs.com>2003-09-17 18:34:42 +0000
commit69aa93c828303dcc44253fe88ff3d6024d10817b (patch)
tree63d14dacbd3d81363fcbea1036c47a0210b0f397 /src/xmlcomposehelpers.h
parent15f3015d2e8305b729d7996faad410b3378497da (diff)
Initial Import
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