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 <editeng/editengdllapi.h>
24 #include <rtl/ref.hxx>
25 #include <svl/itemprop.hxx>
28 namespace com::sun::star::beans
{ class XPropertySetInfo
; }
31 class SvxItemPropertySetUsrAnys
;
33 class EDITENG_DLLPUBLIC SvxItemPropertySet
35 SfxItemPropertyMap m_aPropertyMap
;
36 mutable rtl::Reference
<SfxItemPropertySetInfo
> m_xInfo
;
37 SfxItemPool
& mrItemPool
;
40 SvxItemPropertySet( std::span
<const SfxItemPropertyMapEntry
> pMap
, SfxItemPool
& rPool
);
41 ~SvxItemPropertySet();
43 SvxItemPropertySet
& operator=( SvxItemPropertySet
const & ) = delete; // MSVC2015 workaround
44 SvxItemPropertySet( SvxItemPropertySet
const & ) = delete; // MSVC2015 workaround
46 // Methods, which work directly with the ItemSet
47 static css::uno::Any
getPropertyValue( const SfxItemPropertyMapEntry
* pMap
, const SfxItemSet
& rSet
, bool bSearchInParent
, bool bDontConvertNegativeValues
);
48 static void setPropertyValue( const SfxItemPropertyMapEntry
* pMap
, const css::uno::Any
& rVal
, SfxItemSet
& rSet
, bool bDontConvertNegativeValues
);
50 // Methods that use Any instead
51 css::uno::Any
getPropertyValue( const SfxItemPropertyMapEntry
* pMap
, SvxItemPropertySetUsrAnys
& rAnys
) const;
52 static void setPropertyValue( const SfxItemPropertyMapEntry
* pMap
, const css::uno::Any
& rVal
, SvxItemPropertySetUsrAnys
& rAnys
);
54 rtl::Reference
< SfxItemPropertySetInfo
> const & getPropertySetInfo() const;
55 const SfxItemPropertyMap
& getPropertyMap() const { return m_aPropertyMap
;}
56 const SfxItemPropertyMapEntry
* getPropertyMapEntry(const OUString
& rName
) const;
59 struct SvxIDPropertyCombine
67 class EDITENG_DLLPUBLIC SvxItemPropertySetUsrAnys
69 ::std::vector
< SvxIDPropertyCombine
> aCombineList
;
72 SvxItemPropertySetUsrAnys();
73 ~SvxItemPropertySetUsrAnys();
74 bool AreThereOwnUsrAnys() const { return ! aCombineList
.empty(); }
75 css::uno::Any
* GetUsrAnyForID(SfxItemPropertyMapEntry
const & entry
) const;
76 void AddUsrAnyForID(const css::uno::Any
& rAny
, SfxItemPropertyMapEntry
const & entry
);
77 void ClearAllUsrAny();
80 /** converts the given any with a metric to 100th/mm if needed */
81 EDITENG_DLLPUBLIC
void SvxUnoConvertToMM( const MapUnit eSourceMapUnit
, css::uno::Any
& rMetric
) noexcept
;
83 /** converts the given any with a metric from 100th/mm to the given metric if needed */
84 EDITENG_DLLPUBLIC
void SvxUnoConvertFromMM( const MapUnit eDestinationMapUnit
, css::uno::Any
& rMetric
) noexcept
;
86 #endif // INCLUDED_EDITENG_UNOIPSET_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */