From 7f776ee854b84c51b471c69a702152feb5672bdb Mon Sep 17 00:00:00 2001 From: Stef Date: Sun, 11 Jul 2004 21:19:53 +0000 Subject: - Footnote support - Support for super and sub script --- src/xmlcomposer.h | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'src/xmlcomposer.h') diff --git a/src/xmlcomposer.h b/src/xmlcomposer.h index fd9fd7a..fc40496 100644 --- a/src/xmlcomposer.h +++ b/src/xmlcomposer.h @@ -68,12 +68,24 @@ public: void replaceElement(const DOM::Element& element); DOM::Element popElement(); void setAttribute(const string& name, const wstring& value, DOM::Element el = DOM::Element()); + void setAttribute(const string& name, int value, DOM::Element el = DOM::Element()); // Changing the current parser functions void setAnalyser(AnalyserPtr analy); void setDestination(DestinationPtr dest); DestinationPtr replaceDestination(DestinationPtr dest); + // The types of auto counters + enum + { + AUTOCOUNT_FOOTNOTE, + AUTOCOUNT_MAX + }; + + // Functions for auto numbering + int getAutoCount(int type); + void incrementAutoCount(int type); + // Current status functions RtfFormatting& getTextFormatting(); AnalyserPtr getAnalyser(); @@ -92,9 +104,11 @@ protected: // Data protected: - DOM::DOMImplementation m_impl; - DOM::Document m_document; - RtfParserOptions m_options; + DOM::DOMImplementation m_impl; // For creating the document + DOM::Document m_document; // The current document + RtfParserOptions m_options; // Configurable options for parsing + int m_autocount[AUTOCOUNT_MAX]; // Auto counters for the document + // Sub classes @@ -149,6 +163,7 @@ protected: bool processTextFormatting(const string& cw, int flags, int param, RtfFormatting& format); bool processTextContent(const string& cw, int flags, int param); bool processTextFormatting(const string& cw, int flags, int param); + bool processTextAutoContent(const string& cw, int flags, int param); DOM::Element getCurrentBlock(); void applyParaFormatting(RtfFormatting* format, DOM::Element& el); @@ -160,16 +175,6 @@ protected: GROUPSTART END_ANALYSER -#if 0 - ANALYSER(Table) - INITIALIZE - CONTROLWORD - DATA_PORTION - int stack; - LevelPtr level; - END_ANALYSER -#endif - ANALYSER(Upr) Upr(AnalyserPtr prv); GROUPSTART @@ -226,6 +231,13 @@ protected: CONTROLWORD END_ANALYSER + ANALYSER(FootNote) + INITIALIZE + CONTROLWORD + GROUPSTART + GROUPEND + DONE + END_ANALYSER }; #endif // __RTFPARSER_H__ -- cgit v1.2.3