bump product version to 5.0.4.1
[LibreOffice.git] / starmath / source / mathmlexport.hxx
blob9d63eaa1791138b457cca56d3a2320f2df6ce194
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_STARMATH_SOURCE_MATHMLEXPORT_HXX
21 #define INCLUDED_STARMATH_SOURCE_MATHMLEXPORT_HXX
23 #include <xmloff/xmlimp.hxx>
24 #include <xmloff/xmlexp.hxx>
25 #include <xmloff/DocumentSettingsContext.hxx>
26 #include <xmloff/xmltoken.hxx>
28 #include <node.hxx>
30 class SfxMedium;
31 namespace com { namespace sun { namespace star {
32 namespace io {
33 class XOutputStream; }
34 namespace beans {
35 class XPropertySet; }
36 } } }
41 class SmXMLExportWrapper
43 com::sun::star::uno::Reference<com::sun::star::frame::XModel> xModel;
44 bool bFlat; //set true for export to flat .mml, set false for
45 //export to a .sxm (or whatever) package
46 public:
47 explicit SmXMLExportWrapper(com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rRef)
48 : xModel(rRef), bFlat(true) {}
50 bool Export(SfxMedium &rMedium);
51 void SetFlat(bool bIn) {bFlat = bIn;}
53 static bool WriteThroughComponent(
54 ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >
55 xOutputStream,
56 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
57 xComponent,
58 ::com::sun::star::uno::Reference<
59 ::com::sun::star::uno::XComponentContext > & rxContext,
60 ::com::sun::star::uno::Reference<
61 ::com::sun::star::beans::XPropertySet > & rPropSet,
62 const sal_Char* pComponentName );
64 static bool WriteThroughComponent(
65 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStor,
66 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComponent,
67 const sal_Char* pStreamName,
68 ::com::sun::star::uno::Reference<
69 ::com::sun::star::uno::XComponentContext > & rxContext,
70 ::com::sun::star::uno::Reference<
71 ::com::sun::star::beans::XPropertySet > & rPropSet,
72 const sal_Char* pComponentName );
77 class SmXMLExport : public SvXMLExport
79 const SmNode * pTree;
80 OUString aText;
81 bool bSuccess;
83 protected:
84 void ExportNodes(const SmNode *pNode, int nLevel);
85 void ExportTable(const SmNode *pNode, int nLevel);
86 void ExportLine(const SmNode *pNode, int nLevel);
87 void ExportExpression(const SmNode *pNode, int nLevel,
88 bool bNoMrowContainer = false);
89 void ExportText(const SmNode *pNode, int nLevel);
90 void ExportMath(const SmNode *pNode, int nLevel);
91 void ExportPolygon(const SmNode *pNode, int nLevel);
92 void ExportBinaryHorizontal(const SmNode *pNode, int nLevel);
93 void ExportUnaryHorizontal(const SmNode *pNode, int nLevel);
94 void ExportBrace(const SmNode *pNode, int nLevel);
95 void ExportBinaryVertical(const SmNode *pNode, int nLevel);
96 void ExportBinaryDiagonal(const SmNode *pNode, int nLevel);
97 void ExportSubSupScript(const SmNode *pNode, int nLevel);
98 void ExportRoot(const SmNode *pNode, int nLevel);
99 void ExportOperator(const SmNode *pNode, int nLevel);
100 void ExportAttributes(const SmNode *pNode, int nLevel);
101 void ExportFont(const SmNode *pNode, int nLevel);
102 void ExportVerticalBrace(const SmNode *pNode, int nLevel);
103 void ExportMatrix(const SmNode *pNode, int nLevel);
104 void ExportBlank(const SmNode *pNode, int nLevel);
106 public:
107 SmXMLExport(
108 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rContext,
109 OUString const & implementationName, SvXMLExportFlags nExportFlags);
110 virtual ~SmXMLExport() {};
112 // XUnoTunnel
113 sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
116 void _ExportAutoStyles() SAL_OVERRIDE {}
117 void _ExportMasterStyles() SAL_OVERRIDE {}
118 void _ExportContent() SAL_OVERRIDE;
119 sal_uInt32 exportDoc(enum ::xmloff::token::XMLTokenEnum eClass) SAL_OVERRIDE;
121 virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps) SAL_OVERRIDE;
122 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps) SAL_OVERRIDE;
124 bool GetSuccess() {return bSuccess;}
129 #endif
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */