summaryrefslogtreecommitdiff
path: root/oox/inc/oox/export/starmathimport.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/inc/oox/export/starmathimport.hxx')
-rw-r--r--oox/inc/oox/export/starmathimport.hxx57
1 files changed, 56 insertions, 1 deletions
diff --git a/oox/inc/oox/export/starmathimport.hxx b/oox/inc/oox/export/starmathimport.hxx
index 712efc94845a..a348ac8a3566 100644
--- a/oox/inc/oox/export/starmathimport.hxx
+++ b/oox/inc/oox/export/starmathimport.hxx
@@ -29,16 +29,71 @@
#define _STARMATHIMPORT_HXX
#include <com/sun/star/embed/XEmbeddedObject.hpp>
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include <oox/helper/attributelist.hxx>
+#include <vector>
#include <oox/dllapi.h>
+namespace ooxmlformulaimport
+{
+
+const int TAG_OPENING = 1 << 29;
+const int TAG_CLOSING = 1 << 30;
+
+// used to differentiate between tags that open or close
+// TODO
+//inline int OPENING( int token ) { return TAG_OPENING | token; }
+//inline int CLOSING( int token ) { return TAG_CLOSING | token; }
+#define OPENING( token ) ( TAG_OPENING | token )
+#define CLOSING( token ) ( TAG_CLOSING | token )
+
+class OOX_DLLPUBLIC XmlStream
+{
+public:
+ XmlStream();
+ bool nextIsEnd() const;
+ int peekNextToken() const;
+ int getNextToken();
+ oox::AttributeList getAttributes();
+ rtl::OUString getCharacters();
+protected:
+ // TODO one list containing all 3?
+ std::vector< int > tokens;
+ std::vector< oox::AttributeList > attributes;
+ std::vector< rtl::OUString > characters;
+ int pos;
+};
+
+// use this to create the data and then cast to the base class for reading
+class OOX_DLLPUBLIC XmlStreamBuilder
+: public XmlStream
+{
+public:
+ void appendOpeningTag( int token,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XFastAttributeList >& attributes );
+ void appendClosingTag( int token );
+ // appends the characters after the last appended token
+ void appendCharacters( const rtl::OUString& characters );
+};
+
+} // namespace
+
+class OOX_DLLPUBLIC OoxmlFormulaImportHelper
+{
+public:
+ OoxmlFormulaImportHelper();
+ virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > ) = 0;
+};
+
class OOX_DLLPUBLIC OoxmlFormulaImportBase
{
public:
OoxmlFormulaImportBase();
- virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > ) = 0;
+ virtual void readFormulaOoxml( ooxmlformulaimport::XmlStream& stream ) = 0;
};
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */