1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 INCLUDED_EDITENG_UNOIPSET_HXX
21 #define INCLUDED_EDITENG_UNOIPSET_HXX
23 #include <com/sun/star/beans/XPropertySetInfo.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <editeng/editengdllapi.h>
26 #include <svl/itemprop.hxx>
32 struct SvxIDPropertyCombine
;
34 #define SFX_METRIC_ITEM (0x40)
36 class EDITENG_DLLPUBLIC SvxItemPropertySet
38 SfxItemPropertyMap m_aPropertyMap
;
39 mutable css::uno::Reference
<css::beans::XPropertySetInfo
> m_xInfo
;
40 ::std::vector
< SvxIDPropertyCombine
* > aCombineList
;
41 SfxItemPool
& mrItemPool
;
44 SvxItemPropertySet( const SfxItemPropertyMapEntry
*pMap
, SfxItemPool
& rPool
);
45 ~SvxItemPropertySet();
47 // Methods, which work directly with the ItemSet
48 static css::uno::Any
getPropertyValue( const SfxItemPropertySimpleEntry
* pMap
, const SfxItemSet
& rSet
, bool bSearchInParent
, bool bDontConvertNegativeValues
);
49 static void setPropertyValue( const SfxItemPropertySimpleEntry
* pMap
, const css::uno::Any
& rVal
, SfxItemSet
& rSet
, bool bDontConvertNegativeValues
);
51 // Methods that use Any instead
52 css::uno::Any
getPropertyValue( const SfxItemPropertySimpleEntry
* pMap
) const;
53 void setPropertyValue( const SfxItemPropertySimpleEntry
* pMap
, const css::uno::Any
& rVal
) const;
55 bool AreThereOwnUsrAnys() const { return ! aCombineList
.empty(); }
56 css::uno::Any
* GetUsrAnyForID(sal_uInt16 nWID
) const;
57 void AddUsrAnyForID(const css::uno::Any
& rAny
, sal_uInt16 nWID
);
58 void ClearAllUsrAny();
60 css::uno::Reference
< css::beans::XPropertySetInfo
> const & getPropertySetInfo() const;
61 const SfxItemPropertyMap
& getPropertyMap() const { return m_aPropertyMap
;}
62 const SfxItemPropertySimpleEntry
* getPropertyMapEntry(const OUString
&rName
) const;
65 /** converts the given any with a metric to 100th/mm if needed */
66 EDITENG_DLLPUBLIC
void SvxUnoConvertToMM( const MapUnit eSourceMapUnit
, css::uno::Any
& rMetric
) throw();
68 /** converts the given any with a metric from 100th/mm to the given metric if needed */
69 EDITENG_DLLPUBLIC
void SvxUnoConvertFromMM( const MapUnit eDestinationMapUnit
, css::uno::Any
& rMetric
) throw();
71 #endif // INCLUDED_EDITENG_UNOIPSET_HXX
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */