Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / unopool.hxx
blob3491fdfa3f315022d97650b8e6b47115a7e85336
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unopool.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_UNOPOOL_HXX_
32 #define _SVX_UNOPOOL_HXX_
34 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #endif
38 #ifndef _COMPHELPER_PROPERTYSETHELPER_HXX_
39 #include <comphelper/propertysethelper.hxx>
40 #endif
42 #ifndef _CPPUHELPER_IMPLBASE4_HXX_
43 #include <cppuhelper/implbase4.hxx>
44 #endif
45 namespace binfilter {
47 class SfxItemPool;
48 class SdrModel;
50 /** This class implements the service com.sun.star.drawing.Defaults.
51 It works on the SfxItemPool from the given model and the global
52 draw object item pool.
53 The class can work in a read only mode without a model. Derivated
54 classes can set a model on demand by overiding getModelPool().
56 class SvxUnoDrawPool : public ::cppu::OWeakAggObject,
57 public ::com::sun::star::lang::XServiceInfo,
58 public ::com::sun::star::lang::XTypeProvider,
59 public comphelper::PropertySetHelper
61 public:
62 SvxUnoDrawPool( SdrModel* pModel, sal_Int32 nServiceId ) throw();
64 /** deprecated */
65 SvxUnoDrawPool( SdrModel* pModel ) throw();
66 virtual ~SvxUnoDrawPool() throw();
68 /** This returns the item pool from the given model, or the default pool if there is no model and bReadOnly is true.
69 If bReadOnly is false and there is no model the default implementation returns NULL.
71 virtual SfxItemPool* getModelPool( sal_Bool bReadOnly ) throw();
73 // overiden helpers from comphelper::PropertySetHelper
74 virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
75 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
77 virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException );
78 virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException );
79 virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
81 // XInterface
82 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL acquire() throw();
85 virtual void SAL_CALL release() throw();
87 // XTypeProvider
88 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
89 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
91 // XServiceInfo
92 virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
93 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
94 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
96 protected:
97 void init();
99 virtual void getAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException);
100 virtual void putAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, const ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException);
102 protected:
103 SdrModel* mpModel;
104 SfxItemPool* mpDefaultsPool;
107 }//end of namespace binfilter
108 #endif