Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / starmath / source / mathmlexport.hxx
blobba7abf51d0ce78123583ef80f26c4f7ebdafb09e
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/xmlexp.hxx>
24 #include <xmloff/xmltoken.hxx>
26 class SfxMedium;
27 class SmNode;
28 class SmVerticalBraceNode;
29 namespace com { namespace sun { namespace star {
30 namespace io {
31 class XOutputStream; }
32 namespace beans {
33 class XPropertySet; }
34 } } }
37 class SmXMLExportWrapper
39 css::uno::Reference<css::frame::XModel> xModel;
40 bool bFlat; //set true for export to flat .mml, set false for
41 //export to a .sxm (or whatever) package
42 public:
43 explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> const &rRef)
44 : xModel(rRef), bFlat(true) {}
46 bool Export(SfxMedium &rMedium);
47 void SetFlat(bool bIn) {bFlat = bIn;}
49 static bool WriteThroughComponent(
50 const css::uno::Reference< css::io::XOutputStream >& xOutputStream,
51 const css::uno::Reference< css::lang::XComponent >& xComponent,
52 css::uno::Reference< css::uno::XComponentContext > const & rxContext,
53 css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
54 const sal_Char* pComponentName );
56 static bool WriteThroughComponent(
57 const css::uno::Reference< css::embed::XStorage >& xStor,
58 const css::uno::Reference< css::lang::XComponent >& xComponent,
59 const sal_Char* pStreamName,
60 css::uno::Reference< css::uno::XComponentContext > const & rxContext,
61 css::uno::Reference< css::beans::XPropertySet > const & rPropSet,
62 const sal_Char* pComponentName );
66 class SmXMLExport final : public SvXMLExport
68 const SmNode * pTree;
69 OUString aText;
70 bool bSuccess;
72 void ExportNodes(const SmNode *pNode, int nLevel);
73 void ExportTable(const SmNode *pNode, int nLevel);
74 void ExportLine(const SmNode *pNode, int nLevel);
75 void ExportExpression(const SmNode *pNode, int nLevel,
76 bool bNoMrowContainer = false);
77 void ExportText(const SmNode *pNode);
78 void ExportMath(const SmNode *pNode);
79 void ExportBinaryHorizontal(const SmNode *pNode, int nLevel);
80 void ExportUnaryHorizontal(const SmNode *pNode, int nLevel);
81 void ExportBrace(const SmNode *pNode, int nLevel);
82 void ExportBinaryVertical(const SmNode *pNode, int nLevel);
83 void ExportBinaryDiagonal(const SmNode *pNode, int nLevel);
84 void ExportSubSupScript(const SmNode *pNode, int nLevel);
85 void ExportRoot(const SmNode *pNode, int nLevel);
86 void ExportOperator(const SmNode *pNode, int nLevel);
87 void ExportAttributes(const SmNode *pNode, int nLevel);
88 void ExportFont(const SmNode *pNode, int nLevel);
89 void ExportVerticalBrace(const SmVerticalBraceNode *pNode, int nLevel);
90 void ExportMatrix(const SmNode *pNode, int nLevel);
91 void ExportBlank(const SmNode *pNode);
93 public:
94 SmXMLExport(
95 const css::uno::Reference< css::uno::XComponentContext >& rContext,
96 OUString const & implementationName, SvXMLExportFlags nExportFlags);
98 // XUnoTunnel
99 sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override;
100 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
102 void ExportAutoStyles_() override {}
103 void ExportMasterStyles_() override {}
104 void ExportContent_() override;
105 ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID) override;
107 virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
108 virtual void GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
110 bool GetSuccess() {return bSuccess;}
114 #endif
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */