Update ooo320-m1
[ooovba.git] / svx / inc / unopool.hxx
blob447b2941118773f6806f46381dca22fdfd86e804
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.8 $
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 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <comphelper/propertysethelper.hxx>
36 #include <cppuhelper/implbase4.hxx>
37 #include "svx/svxdllapi.h"
39 class SdrModel;
40 class SfxItemPool;
42 /** This class implements the service com.sun.star.drawing.Defaults.
43 It works on the SfxItemPool from the given model and the global
44 draw object item pool.
45 The class can work in a read only mode without a model. Derivated
46 classes can set a model on demand by overiding getModelPool().
48 class SVX_DLLPUBLIC SvxUnoDrawPool : public ::cppu::OWeakAggObject,
49 public ::com::sun::star::lang::XServiceInfo,
50 public ::com::sun::star::lang::XTypeProvider,
51 public comphelper::PropertySetHelper
53 public:
54 SvxUnoDrawPool( SdrModel* pModel, sal_Int32 nServiceId ) throw();
56 /** deprecated */
57 SvxUnoDrawPool( SdrModel* pModel ) throw();
58 virtual ~SvxUnoDrawPool() throw();
60 /** This returns the item pool from the given model, or the default pool if there is no model and bReadOnly is true.
61 If bReadOnly is false and there is no model the default implementation returns NULL.
63 virtual SfxItemPool* getModelPool( sal_Bool bReadOnly ) throw();
65 // overiden helpers from comphelper::PropertySetHelper
66 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 );
67 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
69 virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException );
70 virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException );
71 virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
73 // XInterface
74 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
75 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
76 virtual void SAL_CALL acquire() throw();
77 virtual void SAL_CALL release() throw();
79 // XTypeProvider
80 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
81 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
83 // XServiceInfo
84 virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
85 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
86 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
88 protected:
89 void init();
91 virtual void getAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException);
92 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);
94 protected:
95 SdrModel* mpModel;
96 SfxItemPool* mpDefaultsPool;
99 #endif