1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
31 namespace com
{ namespace sun
{ namespace star
{
33 class XOutputStream
; }
39 class SmXMLExportWrapper
41 css::uno::Reference
<css::frame::XModel
> xModel
;
42 bool bFlat
; //set true for export to flat .mml, set false for
43 //export to a .sxm (or whatever) package
45 explicit SmXMLExportWrapper(css::uno::Reference
<css::frame::XModel
> &rRef
)
46 : xModel(rRef
), bFlat(true) {}
48 bool Export(SfxMedium
&rMedium
);
49 void SetFlat(bool bIn
) {bFlat
= bIn
;}
51 static bool WriteThroughComponent(
52 const css::uno::Reference
< css::io::XOutputStream
>& xOutputStream
,
53 const css::uno::Reference
< css::lang::XComponent
>& xComponent
,
54 css::uno::Reference
< css::uno::XComponentContext
> & rxContext
,
55 css::uno::Reference
< css::beans::XPropertySet
> & rPropSet
,
56 const sal_Char
* pComponentName
);
58 static bool WriteThroughComponent(
59 const css::uno::Reference
< css::embed::XStorage
>& xStor
,
60 const css::uno::Reference
< css::lang::XComponent
>& xComponent
,
61 const sal_Char
* pStreamName
,
62 css::uno::Reference
< css::uno::XComponentContext
> & rxContext
,
63 css::uno::Reference
< css::beans::XPropertySet
> & rPropSet
,
64 const sal_Char
* pComponentName
);
68 class SmXMLExport
: public SvXMLExport
75 void ExportNodes(const SmNode
*pNode
, int nLevel
);
76 void ExportTable(const SmNode
*pNode
, int nLevel
);
77 void ExportLine(const SmNode
*pNode
, int nLevel
);
78 void ExportExpression(const SmNode
*pNode
, int nLevel
,
79 bool bNoMrowContainer
= false);
80 void ExportText(const SmNode
*pNode
, int nLevel
);
81 void ExportMath(const SmNode
*pNode
, int nLevel
);
82 void ExportBinaryHorizontal(const SmNode
*pNode
, int nLevel
);
83 void ExportUnaryHorizontal(const SmNode
*pNode
, int nLevel
);
84 void ExportBrace(const SmNode
*pNode
, int nLevel
);
85 void ExportBinaryVertical(const SmNode
*pNode
, int nLevel
);
86 void ExportBinaryDiagonal(const SmNode
*pNode
, int nLevel
);
87 void ExportSubSupScript(const SmNode
*pNode
, int nLevel
);
88 void ExportRoot(const SmNode
*pNode
, int nLevel
);
89 void ExportOperator(const SmNode
*pNode
, int nLevel
);
90 void ExportAttributes(const SmNode
*pNode
, int nLevel
);
91 void ExportFont(const SmNode
*pNode
, int nLevel
);
92 void ExportVerticalBrace(const SmVerticalBraceNode
*pNode
, int nLevel
);
93 void ExportMatrix(const SmNode
*pNode
, int nLevel
);
94 void ExportBlank(const SmNode
*pNode
, int nLevel
);
98 const css::uno::Reference
< css::uno::XComponentContext
>& rContext
,
99 OUString
const & implementationName
, SvXMLExportFlags nExportFlags
);
100 virtual ~SmXMLExport() override
{};
103 sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& rId
) throw(css::uno::RuntimeException
, std::exception
) override
;
104 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
106 void ExportAutoStyles_() override
{}
107 void ExportMasterStyles_() override
{}
108 void ExportContent_() override
;
109 sal_uInt32
exportDoc(enum ::xmloff::token::XMLTokenEnum eClass
= ::xmloff::token::XML_TOKEN_INVALID
) override
;
111 virtual void GetViewSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
) override
;
112 virtual void GetConfigurationSettings(css::uno::Sequence
<css::beans::PropertyValue
>& aProps
) override
;
114 bool GetSuccess() {return bSuccess
;}
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */