sw: clean up Start/EndAction in SwViewShell hierarchy
[LibreOffice.git] / starmath / inc / mathml / mathmlexport.hxx
blob74a655174089965e9bffe69030d6c38ea7225244
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 #pragma once
22 #include <utility>
23 #include <xmloff/xmlexp.hxx>
24 #include <xmloff/xmltoken.hxx>
26 class SfxMedium;
27 class SmNode;
28 class SmVerticalBraceNode;
29 namespace com::sun::star
31 namespace io
33 class XOutputStream;
35 namespace beans
37 class XPropertySet;
41 class SmXMLExportWrapper
43 css::uno::Reference<css::frame::XModel> xModel;
44 bool bFlat; //set true for export to flat .mml, set false for
45 //export to a .sxm (or whatever) package
47 private:
48 // Use customized entities
49 bool m_bUseHTMLMLEntities;
51 public:
52 explicit SmXMLExportWrapper(css::uno::Reference<css::frame::XModel> xRef)
53 : xModel(std::move(xRef))
54 , bFlat(true)
55 , m_bUseHTMLMLEntities(false)
59 bool Export(SfxMedium& rMedium);
60 void SetFlat(bool bIn) { bFlat = bIn; }
62 bool IsUseHTMLMLEntities() const { return m_bUseHTMLMLEntities; }
63 void SetUseHTMLMLEntities(bool bUseHTMLMLEntities)
65 m_bUseHTMLMLEntities = bUseHTMLMLEntities;
68 bool WriteThroughComponent(const css::uno::Reference<css::io::XOutputStream>& xOutputStream,
69 const css::uno::Reference<css::lang::XComponent>& xComponent,
70 css::uno::Reference<css::uno::XComponentContext> const& rxContext,
71 css::uno::Reference<css::beans::XPropertySet> const& rPropSet,
72 const char* pComponentName);
74 bool WriteThroughComponent(const css::uno::Reference<css::embed::XStorage>& xStor,
75 const css::uno::Reference<css::lang::XComponent>& xComponent,
76 const char* pStreamName,
77 css::uno::Reference<css::uno::XComponentContext> const& rxContext,
78 css::uno::Reference<css::beans::XPropertySet> const& rPropSet,
79 const char* pComponentName);
82 class SmXMLExport final : public SvXMLExport
84 const SmNode* pTree;
85 OUString aText;
86 bool bSuccess;
88 void ExportNodes(const SmNode* pNode, int nLevel);
89 void ExportTable(const SmNode* pNode, int nLevel);
90 void ExportLine(const SmNode* pNode, int nLevel);
91 void ExportExpression(const SmNode* pNode, int nLevel, bool bNoMrowContainer = false);
92 void ExportText(const SmNode* pNode);
93 void ExportMath(const SmNode* pNode);
94 void ExportBinaryHorizontal(const SmNode* pNode, int nLevel);
95 void ExportUnaryHorizontal(const SmNode* pNode, int nLevel);
96 void ExportBrace(const SmNode* pNode, int nLevel);
97 void ExportBinaryVertical(const SmNode* pNode, int nLevel);
98 void ExportBinaryDiagonal(const SmNode* pNode, int nLevel);
99 void ExportSubSupScript(const SmNode* pNode, int nLevel);
100 void ExportRoot(const SmNode* pNode, int nLevel);
101 void ExportOperator(const SmNode* pNode, int nLevel);
102 void ExportAttributes(const SmNode* pNode, int nLevel);
103 void ExportFont(const SmNode* pNode, int nLevel);
104 void ExportVerticalBrace(const SmVerticalBraceNode* pNode, int nLevel);
105 void ExportMatrix(const SmNode* pNode, int nLevel);
106 void ExportBlank(const SmNode* pNode);
108 public:
109 SmXMLExport(const css::uno::Reference<css::uno::XComponentContext>& rContext,
110 OUString const& implementationName, SvXMLExportFlags nExportFlags);
112 void ExportAutoStyles_() override {}
113 void ExportMasterStyles_() override {}
114 void ExportContent_() override;
115 ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass
116 = ::xmloff::token::XML_TOKEN_INVALID) override;
118 virtual void GetViewSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
119 virtual void
120 GetConfigurationSettings(css::uno::Sequence<css::beans::PropertyValue>& aProps) override;
122 bool GetSuccess() const { return bSuccess; }
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */