xref: /aoo41x/main/editeng/inc/editeng/unoipset.hxx (revision 4c5491ea)
1*4c5491eaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*4c5491eaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*4c5491eaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*4c5491eaSAndrew Rist  * distributed with this work for additional information
6*4c5491eaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*4c5491eaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*4c5491eaSAndrew Rist  * "License"); you may not use this file except in compliance
9*4c5491eaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*4c5491eaSAndrew Rist  *
11*4c5491eaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*4c5491eaSAndrew Rist  *
13*4c5491eaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*4c5491eaSAndrew Rist  * software distributed under the License is distributed on an
15*4c5491eaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*4c5491eaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*4c5491eaSAndrew Rist  * specific language governing permissions and limitations
18*4c5491eaSAndrew Rist  * under the License.
19*4c5491eaSAndrew Rist  *
20*4c5491eaSAndrew Rist  *************************************************************/
21*4c5491eaSAndrew Rist 
22*4c5491eaSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_UNOIPSET_HXX_
25cdf0e10cSrcweir #define _SVX_UNOIPSET_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySetInfo.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
29cdf0e10cSrcweir #include "editeng/editengdllapi.h"
30cdf0e10cSrcweir #include <svl/itemprop.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir class SvxIDPropertyCombineList;
33cdf0e10cSrcweir class SdrItemPool;
34cdf0e10cSrcweir class SfxItemSet;
35cdf0e10cSrcweir class SvxShape;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir #define SFX_METRIC_ITEM                         (0x40)
38cdf0e10cSrcweir 
39cdf0e10cSrcweir class EDITENG_DLLPUBLIC SvxItemPropertySet
40cdf0e10cSrcweir {
41cdf0e10cSrcweir     SfxItemPropertyMap          m_aPropertyMap;
42cdf0e10cSrcweir     mutable com::sun::star::uno::Reference<com::sun::star::beans::XPropertySetInfo> m_xInfo;
43cdf0e10cSrcweir     const SfxItemPropertyMapEntry*  _pMap;
44cdf0e10cSrcweir 	SvxIDPropertyCombineList*	pCombiList;
45cdf0e10cSrcweir 	sal_Bool					mbConvertTwips;
46cdf0e10cSrcweir 	SfxItemPool&				mrItemPool;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir public:
49cdf0e10cSrcweir     SvxItemPropertySet( const SfxItemPropertyMapEntry *pMap, SfxItemPool& rPool, sal_Bool bConvertTwips = sal_False );
50cdf0e10cSrcweir 	~SvxItemPropertySet();
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 	// Methoden, die direkt mit dem ItemSet arbeiten
53cdf0e10cSrcweir     ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap, const SfxItemSet& rSet, bool bSearchInParent, bool bDontConvertNegativeValues ) const;
54cdf0e10cSrcweir     void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal, SfxItemSet& rSet, bool bDontConvertNegativeValues ) const;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	// Methoden, die stattdessen Any benutzen
57cdf0e10cSrcweir     ::com::sun::star::uno::Any getPropertyValue( const SfxItemPropertySimpleEntry* pMap ) const;
58cdf0e10cSrcweir     void setPropertyValue( const SfxItemPropertySimpleEntry* pMap, const ::com::sun::star::uno::Any& rVal ) const;
59cdf0e10cSrcweir 
AreThereOwnUsrAnys() const60cdf0e10cSrcweir 	sal_Bool AreThereOwnUsrAnys() const { return (pCombiList ? sal_True : sal_False); }
61cdf0e10cSrcweir 	::com::sun::star::uno::Any* GetUsrAnyForID(sal_uInt16 nWID) const;
62cdf0e10cSrcweir 	void AddUsrAnyForID(const ::com::sun::star::uno::Any& rAny, sal_uInt16 nWID);
63cdf0e10cSrcweir 	void ClearAllUsrAny();
64cdf0e10cSrcweir 
65cdf0e10cSrcweir 	com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const;
getPropertyMapEntries() const66cdf0e10cSrcweir     const SfxItemPropertyMapEntry* getPropertyMapEntries() const {return _pMap;}
getPropertyMap() const67cdf0e10cSrcweir     const SfxItemPropertyMap* getPropertyMap()const { return &m_aPropertyMap;}
68cdf0e10cSrcweir     const SfxItemPropertySimpleEntry* getPropertyMapEntry(const ::rtl::OUString &rName) const;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     static com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > getPropertySetInfo( const SfxItemPropertyMapEntry* pMap );
71cdf0e10cSrcweir };
72cdf0e10cSrcweir 
73cdf0e10cSrcweir /** converts the given any with a metric to 100th/mm if needed */
74cdf0e10cSrcweir EDITENG_DLLPUBLIC void SvxUnoConvertToMM( const SfxMapUnit eSourceMapUnit, com::sun::star::uno::Any & rMetric ) throw();
75cdf0e10cSrcweir 
76cdf0e10cSrcweir /** converts the given any with a metric from 100th/mm to the given metric if needed */
77cdf0e10cSrcweir EDITENG_DLLPUBLIC void SvxUnoConvertFromMM( const SfxMapUnit eDestinationMapUnit, com::sun::star::uno::Any & rMetric ) throw();
78cdf0e10cSrcweir 
79cdf0e10cSrcweir #endif // _SVX_UNOIPSET_HXX_
80cdf0e10cSrcweir 
81