summaryrefslogtreecommitdiff
path: root/oox/inc/oox/mathml
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-18 21:06:54 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-24 18:43:58 +0100
commitf8f1ccbaf942adf9a6b16b13a9cddb1b96a6774b (patch)
tree7b09f783a476f12ebbc42fba81b8ac73d3d05dec /oox/inc/oox/mathml
parent0ac48a4a0673ac71e06aa588b524a60367e2ad19 (diff)
rename and move mathml oox support classes in oox to better places
Diffstat (limited to 'oox/inc/oox/mathml')
-rw-r--r--oox/inc/oox/mathml/export.hxx53
-rw-r--r--oox/inc/oox/mathml/import.hxx61
-rw-r--r--oox/inc/oox/mathml/importutils.hxx87
3 files changed, 201 insertions, 0 deletions
diff --git a/oox/inc/oox/mathml/export.hxx b/oox/inc/oox/mathml/export.hxx
new file mode 100644
index 000000000000..f4e05633e1e6
--- /dev/null
+++ b/oox/inc/oox/mathml/export.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Lubos Lunak <l.lunak@suse.cz> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _OOXMLEXPORT_HXX
+#define _OOXMLEXPORT_HXX
+
+#include <sax/fshelper.hxx>
+#include <oox/core/filterbase.hxx>
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+/**
+ Interface class, StarMath will implement writeFormulaOoxml() to write out OOXML
+ representing the formula.
+ */
+class OOX_DLLPUBLIC FormulaExportBase
+{
+public:
+ FormulaExportBase();
+ virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oox::core::OoxmlVersion version ) = 0;
+};
+
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/mathml/import.hxx b/oox/inc/oox/mathml/import.hxx
new file mode 100644
index 000000000000..961a4f6bcd4e
--- /dev/null
+++ b/oox/inc/oox/mathml/import.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Lubos Lunak <l.lunak@suse.cz> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _STARMATHIMPORT_HXX
+#define _STARMATHIMPORT_HXX
+
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
+
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+namespace formulaimport
+{
+class XmlStream;
+}
+
+class OOX_DLLPUBLIC FormulaImportHelper
+{
+public:
+ FormulaImportHelper();
+ virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > ) = 0;
+};
+
+class OOX_DLLPUBLIC FormulaImportBase
+{
+public:
+ FormulaImportBase();
+ virtual void readFormulaOoxml( oox::formulaimport::XmlStream& stream ) = 0;
+};
+
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/mathml/importutils.hxx b/oox/inc/oox/mathml/importutils.hxx
new file mode 100644
index 000000000000..01baf981eb1f
--- /dev/null
+++ b/oox/inc/oox/mathml/importutils.hxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 Lubos Lunak <l.lunak@suse.cz> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef _STARMATHIMPORTUTILS_HXX
+#define _STARMATHIMPORTUTILS_HXX
+
+#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
+#include <oox/helper/attributelist.hxx>
+#include <vector>
+
+#include <oox/dllapi.h>
+
+namespace oox
+{
+
+namespace formulaimport
+{
+
+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
+} // namespace
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */