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