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