Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _MATHMLEXPORT_HXX_
21 : : #define _MATHMLEXPORT_HXX_
22 : :
23 : : #include <xmloff/xmlimp.hxx>
24 : : #include <xmloff/xmlexp.hxx>
25 : : #include <xmloff/DocumentSettingsContext.hxx>
26 : : #include <xmloff/xmltoken.hxx>
27 : :
28 : : #include <node.hxx>
29 : :
30 : : class SfxMedium;
31 : : namespace com { namespace sun { namespace star {
32 : : namespace io {
33 : : class XOutputStream; }
34 : : namespace beans {
35 : : class XPropertySet; }
36 : : } } }
37 : :
38 : :
39 : : ////////////////////////////////////////////////////////////
40 : :
41 : 852 : class SmXMLExportWrapper
42 : : {
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
46 : : public:
47 : 852 : SmXMLExportWrapper(com::sun::star::uno::Reference<com::sun::star::frame::XModel> &rRef)
48 : 852 : : xModel(rRef), bFlat(sal_True) {}
49 : :
50 : : sal_Bool Export(SfxMedium &rMedium);
51 : 852 : void SetFlat(sal_Bool bIn) {bFlat = bIn;}
52 : :
53 : : sal_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::lang::XMultiServiceFactory > & rFactory,
60 : : ::com::sun::star::uno::Reference<
61 : : ::com::sun::star::beans::XPropertySet > & rPropSet,
62 : : const sal_Char* pComponentName );
63 : :
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 >
67 : : xComponent,
68 : : const sal_Char* pStreamName,
69 : : ::com::sun::star::uno::Reference<
70 : : ::com::sun::star::lang::XMultiServiceFactory > & rFactory,
71 : : ::com::sun::star::uno::Reference<
72 : : ::com::sun::star::beans::XPropertySet > & rPropSet,
73 : : const sal_Char* pComponentName,
74 : : sal_Bool bCompress=sal_True );
75 : : };
76 : :
77 : : ////////////////////////////////////////////////////////////
78 : :
79 : : class SmXMLExport : public SvXMLExport
80 : : {
81 : : const SmNode * pTree;
82 : : String aText;
83 : : sal_Bool bSuccess;
84 : :
85 : : protected:
86 : : void ExportNodes(const SmNode *pNode, int nLevel);
87 : : void ExportTable(const SmNode *pNode, int nLevel);
88 : : void ExportLine(const SmNode *pNode, int nLevel);
89 : : void ExportExpression(const SmNode *pNode, int nLevel);
90 : : void ExportText(const SmNode *pNode, int nLevel);
91 : : void ExportMath(const SmNode *pNode, int nLevel);
92 : : void ExportPolygon(const SmNode *pNode, int nLevel);
93 : : void ExportBinaryHorizontal(const SmNode *pNode, int nLevel);
94 : : void ExportUnaryHorizontal(const SmNode *pNode, int nLevel);
95 : : void ExportBrace(const SmNode *pNode, int nLevel);
96 : : void ExportBinaryVertical(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);
105 : :
106 : : public:
107 : : SmXMLExport(
108 : : const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
109 : : sal_uInt16 nExportFlags=EXPORT_ALL);
110 [ + - ][ - + ]: 3432 : virtual ~SmXMLExport() {};
111 : :
112 : : // XServiceInfo (override parent method)
113 : : ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
114 : :
115 : : // XUnoTunnel
116 : : sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException);
117 : : static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw();
118 : :
119 : 0 : void _ExportAutoStyles() {}
120 : 0 : void _ExportMasterStyles() {}
121 : : void _ExportContent();
122 : : sal_uInt32 exportDoc(enum ::xmloff::token::XMLTokenEnum eClass);
123 : :
124 : : virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
125 : : virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
126 : :
127 : 1704 : sal_Bool GetSuccess() {return bSuccess;}
128 : : };
129 : :
130 : : ////////////////////////////////////////////////////////////
131 : :
132 : : #endif
133 : :
134 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|