Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / starmath / inc / unomodel.hxx
blob4bf5a463b3969c7c5d5e4e871979e87da034c42f
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 .
19 #ifndef INCLUDED_STARMATH_INC_UNOMODEL_HXX
20 #define INCLUDED_STARMATH_INC_UNOMODEL_HXX
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <com/sun/star/beans/XMultiPropertySet.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/view/XRenderable.hpp>
27 #include <sfx2/sfxbasemodel.hxx>
28 #include <comphelper/propertysethelper.hxx>
29 #include <vcl/print.hxx>
30 #include <oox/mathml/export.hxx>
31 #include <oox/mathml/import.hxx>
32 #include <memory>
35 #define PRTUIOPT_TITLE_ROW "TitleRow"
36 #define PRTUIOPT_FORMULA_TEXT "FormulaText"
37 #define PRTUIOPT_BORDER "Border"
38 #define PRTUIOPT_PRINT_FORMAT "PrintFormat"
39 #define PRTUIOPT_PRINT_SCALE "PrintScale"
41 class SmPrintUIOptions : public vcl::PrinterOptionsHelper
43 public:
44 SmPrintUIOptions();
48 class SmModel : public SfxBaseModel,
49 public comphelper::PropertySetHelper,
50 public css::lang::XServiceInfo,
51 public css::view::XRenderable,
52 public oox::FormulaExportBase,
53 public oox::FormulaImportBase
55 std::unique_ptr<SmPrintUIOptions> m_pPrintUIOptions;
56 protected:
57 virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) override;
58 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) override;
59 public:
60 explicit SmModel( SfxObjectShell *pObjSh );
61 virtual ~SmModel() throw () override;
63 //XInterface
64 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
65 virtual void SAL_CALL acquire( ) throw() override;
66 virtual void SAL_CALL release( ) throw() override;
68 //XTypeProvider
69 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
71 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
73 //XUnoTunnel
74 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
76 //XRenderable
77 virtual sal_Int32 SAL_CALL getRendererCount( const css::uno::Any& rSelection, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions ) override;
78 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer( sal_Int32 nRenderer, const css::uno::Any& rSelection, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions ) override;
79 virtual void SAL_CALL render( sal_Int32 nRenderer, const css::uno::Any& rSelection, const css::uno::Sequence< css::beans::PropertyValue >& rxOptions ) override;
81 //XServiceInfo
82 virtual OUString SAL_CALL getImplementationName() override;
83 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
84 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
86 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& xParent ) override;
88 // oox::FormulaExportBase
89 virtual void writeFormulaOoxml(::sax_fastparser::FSHelperPtr pSerializer,
90 oox::core::OoxmlVersion version,
91 oox::drawingml::DocumentType documentType) override;
92 virtual void writeFormulaRtf(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding) override;
93 // oox::FormulaImportBase
94 virtual void readFormulaOoxml( oox::formulaimport::XmlStream& stream ) override;
95 virtual Size getFormulaSize() const override;
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */