1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _MATHMLEXPORT_HXX_
32 #define _MATHMLEXPORT_HXX_
34 #include <xmloff/xmlimp.hxx>
35 #include <xmloff/xmlexp.hxx>
36 #include <xmloff/DocumentSettingsContext.hxx>
37 #include <xmloff/xmltoken.hxx>
42 namespace com
{ namespace sun
{ namespace star
{
45 class XOutputStream
; }
51 ////////////////////////////////////////////////////////////
53 class SmXMLExportWrapper
55 com::sun::star::uno::Reference
<com::sun::star::frame::XModel
> xModel
;
56 sal_Bool bFlat
; //set true for export to flat .mml, set false for
57 //export to a .sxm (or whatever) package
59 SmXMLExportWrapper(com::sun::star::uno::Reference
<com::sun::star::frame::XModel
> &rRef
)
60 : xModel(rRef
), bFlat(sal_True
) {}
62 sal_Bool
Export(SfxMedium
&rMedium
);
63 void SetFlat(sal_Bool bIn
) {bFlat
= bIn
;}
65 sal_Bool
WriteThroughComponent(
66 ::com::sun::star::uno::Reference
< ::com::sun::star::io::XOutputStream
>
68 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
70 ::com::sun::star::uno::Reference
<
71 ::com::sun::star::lang::XMultiServiceFactory
> & rFactory
,
72 ::com::sun::star::uno::Reference
<
73 ::com::sun::star::beans::XPropertySet
> & rPropSet
,
74 const sal_Char
* pComponentName
);
76 sal_Bool
WriteThroughComponent(
77 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& xStor
,
78 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
80 const sal_Char
* pStreamName
,
81 ::com::sun::star::uno::Reference
<
82 ::com::sun::star::lang::XMultiServiceFactory
> & rFactory
,
83 ::com::sun::star::uno::Reference
<
84 ::com::sun::star::beans::XPropertySet
> & rPropSet
,
85 const sal_Char
* pComponentName
,
86 sal_Bool bCompress
=sal_True
);
89 ////////////////////////////////////////////////////////////
91 class SmXMLExport
: public SvXMLExport
98 void ExportNodes(const SmNode
*pNode
, int nLevel
);
99 void ExportTable(const SmNode
*pNode
, int nLevel
);
100 void ExportLine(const SmNode
*pNode
, int nLevel
);
101 void ExportExpression(const SmNode
*pNode
, int nLevel
);
102 void ExportText(const SmNode
*pNode
, int nLevel
);
103 void ExportMath(const SmNode
*pNode
, int nLevel
);
104 void ExportPolygon(const SmNode
*pNode
, int nLevel
);
105 void ExportBinaryHorizontal(const SmNode
*pNode
, int nLevel
);
106 void ExportUnaryHorizontal(const SmNode
*pNode
, int nLevel
);
107 void ExportBrace(const SmNode
*pNode
, int nLevel
);
108 void ExportBinaryVertical(const SmNode
*pNode
, int nLevel
);
109 void ExportSubSupScript(const SmNode
*pNode
, int nLevel
);
110 void ExportRoot(const SmNode
*pNode
, int nLevel
);
111 void ExportOperator(const SmNode
*pNode
, int nLevel
);
112 void ExportAttributes(const SmNode
*pNode
, int nLevel
);
113 void ExportFont(const SmNode
*pNode
, int nLevel
);
114 void ExportVerticalBrace(const SmNode
*pNode
, int nLevel
);
115 void ExportMatrix(const SmNode
*pNode
, int nLevel
);
116 void ExportBlank(const SmNode
*pNode
, int nLevel
);
121 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> xServiceFactory
,
122 sal_uInt16 nExportFlags
=EXPORT_ALL
);
123 virtual ~SmXMLExport() {};
125 // XServiceInfo (override parent method)
126 ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
);
129 sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& rId
) throw(::com::sun::star::uno::RuntimeException
);
130 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
132 void _ExportAutoStyles() {}
133 void _ExportMasterStyles() {}
134 void _ExportContent();
135 sal_uInt32
exportDoc(enum ::xmloff::token::XMLTokenEnum eClass
);
137 virtual void GetViewSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
138 virtual void GetConfigurationSettings(com::sun::star::uno::Sequence
<com::sun::star::beans::PropertyValue
>& aProps
);
140 sal_Bool
GetSuccess() {return bSuccess
;}
143 ////////////////////////////////////////////////////////////