xref: /aoo42x/main/editeng/inc/editeng/unoipset.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SVX_UNOIPSET_HXX_
29 #define _SVX_UNOIPSET_HXX_
30 
31 #include <com/sun/star/beans/XPropertySetInfo.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include "editeng/editengdllapi.h"
34 #include <svl/itemprop.hxx>
35 
36 class SvxIDPropertyCombineList;
37 class SdrItemPool;
38 class SfxItemSet;
39 class SvxShape;
40 
41 #define SFX_METRIC_ITEM                         (0x40)
42 
43 class EDITENG_DLLPUBLIC SvxItemPropertySet
44 {
45     SfxItemPropertyMap          m_aPropertyMap;
46     mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
47     const SfxItemPropertyMapEntry*  _pMap;
48 	SvxIDPropertyCombineList*	pCombiList;
49 	sal_Bool					mbConvertTwips;
50 	SfxItemPool&				mrItemPool;
51 
52 public:
53     SvxItemPropertySet( const SfxItemPropertyMapEntry *pMap, SfxItemPool& rPool, sal_Bool bConvertTwips = sal_False );
54 	~SvxItemPropertySet();
55 
56 	// Methoden, die direkt mit dem ItemSet arbeiten
57     ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) const;
58     void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) const;
59 
60 	// Methoden, die stattdessen Any benutzen
61     ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const;
62     void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal ) const;
63 
64 	sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); }
65 	::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const;
66 	void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID);
67 	void ClearAllUsrAny();
68 
69 	com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
70     const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;}
71     const SfxItemPropertyMap* getPropertyMap()const { return &m_aPropertyMap;}
72     const SfxItemPropertySimpleEntry* getPropertyMapEntry(const ::rtl::OUString &rName) const;
73 
74     static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > getPropertySetInfo( const SfxItemPropertyMapEntry* pMap );
75 };
76 
77 /** converts the given any with a metric to 100th/mm if needed */
78 EDITENG_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
79 
80 /** converts the given any with a metric from 100th/mm to the given metric if needed */
81 EDITENG_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
82 
83 #endif // _SVX_UNOIPSET_HXX_
84 
85