xref: /aoo4110/main/svx/inc/svx/unomodel.hxx (revision b1cdbd2c)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SVX_UNOMODEL_HXX
25 #define SVX_UNOMODEL_HXX
26 
27 #ifndef SVX_LIGHT
28 
29 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
32 #include <com/sun/star/io/XOutputStream.hpp>
33 #include <com/sun/star/io/XInputStream.hpp>
34 #include <sfx2/sfxbasemodel.hxx>
35 #include <svx/fmdmod.hxx>
36 #include "svx/svxdllapi.h"
37 
38 class SdrModel;
39 
40 class SVX_DLLPUBLIC SvxUnoDrawingModel : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
41 						   public SvxFmMSFactory,
42 						   public ::com::sun::star::drawing::XDrawPagesSupplier,
43 						   public ::com::sun::star::lang::XServiceInfo,
44 						   public ::com::sun::star::ucb::XAnyCompareFactory
45 {
46 	friend class SvxUnoDrawPagesAccess;
47 
48 private:
49 	SdrModel* mpDoc;
50 
51 	::com::sun::star::uno::WeakReference< ::com::sun::star::drawing::XDrawPages > mxDrawPagesAccess;
52 
53 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDashTable;
54 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxGradientTable;
55 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxHatchTable;
56 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxBitmapTable;
57 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxTransGradientTable;
58 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxMarkerTable;
59 
60 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence;
61 
62 public:
63 	SvxUnoDrawingModel( SdrModel* pDoc ) throw();
64 	virtual ~SvxUnoDrawingModel() throw();
65 
GetDoc() const66 	SdrModel* GetDoc() const { return mpDoc; }
67 
68 	// XInterface
69 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
70 	virtual void SAL_CALL acquire() throw();
71 	virtual void SAL_CALL release() throw();
72 
73 	// XModel
74     virtual void SAL_CALL lockControllers(  ) throw(::com::sun::star::uno::RuntimeException);
75     virtual void SAL_CALL unlockControllers(  ) throw(::com::sun::star::uno::RuntimeException);
76     virtual sal_Bool SAL_CALL hasControllersLocked(  ) throw(::com::sun::star::uno::RuntimeException);
77 
78 	// XTypeProvider
79     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
80     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
81 
82 	// XDrawPagesSupplier
83     virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPages > SAL_CALL getDrawPages(  ) throw(::com::sun::star::uno::RuntimeException);
84 
85 	// XMultiServiceFactory ( SvxFmMSFactory )
86     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
87     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
88 
89 	// XServiceInfo
90     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
91     virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
92     virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
93 
94 	// XAnyCompareFactory
95     virtual ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XAnyCompare > SAL_CALL createAnyCompareByName( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException);
96 };
97 
98 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut );
99 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent );
100 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerExport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>& xOut, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pExportService  );
101 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream );
102 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent  );
103 SVX_DLLPUBLIC extern sal_Bool SvxDrawingLayerImport( SdrModel* pModel, const com::sun::star::uno::Reference<com::sun::star::io::XInputStream>& xInputStream, const com::sun::star::uno::Reference< com::sun::star::lang::XComponent >& xComponent, const char* pImportService );
104 
105 #endif
106 
107 #endif
108 
109