bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / unopool.hxx
blob7db02b2a85dd087bec2eb230b5600d68e00d370d
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 _SVX_UNOPOOL_HXX_
21 #define _SVX_UNOPOOL_HXX_
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <comphelper/propertysethelper.hxx>
25 #include <cppuhelper/implbase4.hxx>
26 #include "svx/svxdllapi.h"
28 class SdrModel;
29 class SfxItemPool;
31 /** This class implements the service com.sun.star.drawing.Defaults.
32 It works on the SfxItemPool from the given model and the global
33 draw object item pool.
34 The class can work in a read only mode without a model. Derivated
35 classes can set a model on demand by overiding getModelPool().
37 class SVX_DLLPUBLIC SvxUnoDrawPool : public ::cppu::OWeakAggObject,
38 public ::com::sun::star::lang::XServiceInfo,
39 public ::com::sun::star::lang::XTypeProvider,
40 public comphelper::PropertySetHelper
42 public:
43 SvxUnoDrawPool( SdrModel* pModel, sal_Int32 nServiceId ) throw();
45 /** deprecated */
46 SvxUnoDrawPool( SdrModel* pModel ) throw();
47 virtual ~SvxUnoDrawPool() throw();
49 /** This returns the item pool from the given model, or the default pool if there is no model and bReadOnly is true.
50 If bReadOnly is false and there is no model the default implementation returns NULL.
52 virtual SfxItemPool* getModelPool( sal_Bool bReadOnly ) throw();
54 // overiden helpers from comphelper::PropertySetHelper
55 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 );
56 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
58 virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::beans::PropertyState* pStates ) throw(::com::sun::star::beans::UnknownPropertyException );
59 virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException );
60 virtual ::com::sun::star::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
62 // XInterface
63 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
64 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
65 virtual void SAL_CALL acquire() throw();
66 virtual void SAL_CALL release() throw();
68 // XTypeProvider
69 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
70 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
72 // XServiceInfo
73 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
74 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
75 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
77 protected:
78 void init();
80 virtual void getAny( SfxItemPool* pPool, const comphelper::PropertyMapEntry* pEntry, ::com::sun::star::uno::Any& rValue ) throw(::com::sun::star::beans::UnknownPropertyException);
81 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);
83 protected:
84 SdrModel* mpModel;
85 SfxItemPool* mpDefaultsPool;
88 #endif
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */