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 _MATHMLEXPORT_HXX_
21 #define _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 ////////////////////////////////////////////////////////////
41 class SmXMLExportWrapper
43 com::sun::star::uno::Reference
<com::sun::star::frame::XModel
> xModel
;
44 sal_Bool bFlat
; //set true for export to flat .mml, set false for
45 //export to a .sxm (or whatever) package
47 SmXMLExportWrapper(com::sun::star::uno::Reference
<com::sun::star::frame::XModel
> &rRef
)
48 : xModel(rRef
), bFlat(sal_True
) {}
50 sal_Bool
Export(SfxMedium
&rMedium
);
51 void SetFlat(sal_Bool bIn
) {bFlat
= bIn
;}
53 sal_Bool
WriteThroughComponent(
54 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>
56 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::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 sal_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
);
75 ////////////////////////////////////////////////////////////
77 class SmXMLExport
: public SvXMLExport
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 void ExportText(const SmNode
*pNode
, int nLevel
);
89 void ExportMath(const SmNode
*pNode
, int nLevel
);
90 void ExportPolygon(const SmNode
*pNode
, int nLevel
);
91 void ExportBinaryHorizontal(const SmNode
*pNode
, int nLevel
);
92 void ExportUnaryHorizontal(const SmNode
*pNode
, int nLevel
);
93 void ExportBrace(const SmNode
*pNode
, int nLevel
);
94 void ExportBinaryVertical(const SmNode
*pNode
, int nLevel
);
95 void ExportSubSupScript(const SmNode
*pNode
, int nLevel
);
96 void ExportRoot(const SmNode
*pNode
, int nLevel
);
97 void ExportOperator(const SmNode
*pNode
, int nLevel
);
98 void ExportAttributes(const SmNode
*pNode
, int nLevel
);
99 void ExportFont(const SmNode
*pNode
, int nLevel
);
100 void ExportVerticalBrace(const SmNode
*pNode
, int nLevel
);
101 void ExportMatrix(const SmNode
*pNode
, int nLevel
);
102 void ExportBlank(const SmNode
*pNode
, int nLevel
);
106 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> xContext
,
107 sal_uInt16 nExportFlags
=EXPORT_ALL
);
108 virtual ~SmXMLExport() {};
110 // XServiceInfo (override parent method)
111 OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
114 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rId
) throw(::com::sun::star::uno::RuntimeException
);
115 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
117 void _ExportAutoStyles() {}
118 void _ExportMasterStyles() {}
119 void _ExportContent();
120 sal_uInt32
exportDoc(enum ::xmloff::token::XMLTokenEnum eClass
);
122 virtual void GetViewSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
123 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
125 sal_Bool
GetSuccess() {return bSuccess
;}
128 ////////////////////////////////////////////////////////////
132 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */