fix build
[LibreOffice.git] / include / svx / unomodel.hxx
blob87ccd82b08847623fb6de74fae53cb3828a3d4b6
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 #ifndef INCLUDED_SVX_UNOMODEL_HXX
21 #define INCLUDED_SVX_UNOMODEL_HXX
23 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
26 #include <com/sun/star/io/XOutputStream.hpp>
27 #include <com/sun/star/io/XInputStream.hpp>
28 #include <sfx2/sfxbasemodel.hxx>
29 #include <svx/fmdmod.hxx>
30 #include <svx/svxdllapi.h>
31 #include <cppuhelper/weakref.hxx>
33 class SdrModel;
35 class SVXCORE_DLLPUBLIC SvxUnoDrawingModel
36 : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
37 public SvxFmMSFactory,
38 public css::drawing::XDrawPagesSupplier,
39 public css::lang::XServiceInfo,
40 public css::ucb::XAnyCompareFactory
42 friend class SvxUnoDrawPagesAccess;
44 private:
45 SdrModel* mpDoc;
47 css::uno::WeakReference< css::drawing::XDrawPages > mxDrawPagesAccess;
49 css::uno::Reference< css::uno::XInterface > mxDashTable;
50 css::uno::Reference< css::uno::XInterface > mxGradientTable;
51 css::uno::Reference< css::uno::XInterface > mxHatchTable;
52 css::uno::Reference< css::uno::XInterface > mxBitmapTable;
53 css::uno::Reference< css::uno::XInterface > mxTransGradientTable;
54 css::uno::Reference< css::uno::XInterface > mxMarkerTable;
56 css::uno::Sequence< css::uno::Type > maTypeSequence;
58 protected:
59 // SvxUnoDrawMSFactory
60 virtual SdrModel& getSdrModelFromUnoModel() const override;
62 public:
63 SvxUnoDrawingModel( SdrModel* pDoc ) noexcept;
64 virtual ~SvxUnoDrawingModel() noexcept override;
66 SdrModel* GetDoc() const { return mpDoc; }
68 // XInterface
69 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
70 virtual void SAL_CALL acquire() noexcept override
71 { SfxBaseModel::acquire(); }
72 virtual void SAL_CALL release() noexcept override
73 { SfxBaseModel::release(); }
75 // XModel
76 virtual void SAL_CALL lockControllers( ) override;
77 virtual void SAL_CALL unlockControllers( ) override;
78 virtual sal_Bool SAL_CALL hasControllersLocked( ) override;
80 // XTypeProvider
81 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
82 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
84 // XDrawPagesSupplier
85 virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getDrawPages( ) override;
87 // XMultiServiceFactory ( SvxFmMSFactory )
88 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override;
89 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) override;
91 // XServiceInfo
92 virtual OUString SAL_CALL getImplementationName() override;
93 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
94 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
96 // XAnyCompareFactory
97 virtual css::uno::Reference< css::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const OUString& PropertyName ) override;
100 SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference<css::io::XOutputStream>& xOut );
101 extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference<css::io::XOutputStream>& xOut, const css::uno::Reference< css::lang::XComponent >& xComponent );
102 SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerExport( SdrModel* pModel, const css::uno::Reference<css::io::XOutputStream>& xOut, const css::uno::Reference< css::lang::XComponent >& xComponent, const char* pExportService );
103 SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference<css::io::XInputStream>& xInputStream );
104 extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference<css::io::XInputStream>& xInputStream, const css::uno::Reference< css::lang::XComponent >& xComponent );
105 SVXCORE_DLLPUBLIC extern bool SvxDrawingLayerImport( SdrModel* pModel, const css::uno::Reference<css::io::XInputStream>& xInputStream, const css::uno::Reference< css::lang::XComponent >& xComponent, const char* pImportService );
107 #endif
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */