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 .
22 #include <com/sun/star/lang/XServiceInfo.hpp>
23 #include <com/sun/star/view/XRenderable.hpp>
25 #include <sfx2/sfxbasemodel.hxx>
26 #include <comphelper/propertysethelper.hxx>
27 #include <vcl/print.hxx>
28 #include <oox/mathml/export.hxx>
29 #include <oox/mathml/import.hxx>
31 inline constexpr OUStringLiteral PRTUIOPT_TITLE_ROW
= u
"TitleRow";
32 inline constexpr OUStringLiteral PRTUIOPT_FORMULA_TEXT
= u
"FormulaText";
33 inline constexpr OUStringLiteral PRTUIOPT_BORDER
= u
"Border";
34 inline constexpr OUStringLiteral PRTUIOPT_PRINT_FORMAT
= u
"PrintFormat";
35 inline constexpr OUStringLiteral PRTUIOPT_PRINT_SCALE
= u
"PrintScale";
37 class SmPrintUIOptions
: public vcl::PrinterOptionsHelper
44 class SmModel final
: public SfxBaseModel
,
45 public comphelper::PropertySetHelper
,
46 public css::lang::XServiceInfo
,
47 public css::view::XRenderable
,
48 public oox::FormulaExportBase
,
49 public oox::FormulaImportBase
51 std::unique_ptr
<SmPrintUIOptions
> m_pPrintUIOptions
;
53 virtual void _setPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, const css::uno::Any
* pValues
) override
;
54 virtual void _getPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, css::uno::Any
* pValue
) override
;
56 explicit SmModel( SfxObjectShell
*pObjSh
);
57 virtual ~SmModel() noexcept override
;
60 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& aType
) override
;
61 virtual void SAL_CALL
acquire( ) noexcept override
;
62 virtual void SAL_CALL
release( ) noexcept override
;
65 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) override
;
67 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
70 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
73 virtual sal_Int32 SAL_CALL
getRendererCount( const css::uno::Any
& rSelection
, const css::uno::Sequence
< css::beans::PropertyValue
>& rxOptions
) override
;
74 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
;
75 virtual void SAL_CALL
render( sal_Int32 nRenderer
, const css::uno::Any
& rSelection
, const css::uno::Sequence
< css::beans::PropertyValue
>& rxOptions
) override
;
78 virtual OUString SAL_CALL
getImplementationName() override
;
79 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
80 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
82 virtual void SAL_CALL
setParent( const css::uno::Reference
< css::uno::XInterface
>& xParent
) override
;
84 // oox::FormulaExportBase
85 virtual void writeFormulaOoxml(::sax_fastparser::FSHelperPtr pSerializer
,
86 oox::core::OoxmlVersion version
,
87 oox::drawingml::DocumentType documentType
, sal_Int8 nAlign
) override
;
88 virtual void writeFormulaRtf(OStringBuffer
& rBuffer
, rtl_TextEncoding nEncoding
) override
;
89 // oox::FormulaImportBase
90 virtual void readFormulaOoxml( oox::formulaimport::XmlStream
& stream
) override
;
91 virtual Size
getFormulaSize() const override
;
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */