1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PropertyMapper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _CHART2_PROPERTYMAPPER_HXX
31 #define _CHART2_PROPERTYMAPPER_HXX
33 #include <comphelper/InlineContainer.hxx>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/drawing/XShape.hpp>
37 //.............................................................................
40 //.............................................................................
42 //-----------------------------------------------------------------------------
46 typedef ::std::map
< ::rtl::OUString
, ::rtl::OUString
> tPropertyNameMap
;
47 typedef ::comphelper::MakeMap
< ::rtl::OUString
, ::rtl::OUString
> tMakePropertyNameMap
;
49 typedef ::std::map
< ::rtl::OUString
, ::com::sun::star::uno::Any
> tPropertyNameValueMap
;
50 typedef ::comphelper::MakeMap
< ::rtl::OUString
, ::com::sun::star::uno::Any
> tMakePropertyNameValueMap
;
52 typedef ::com::sun::star::uno::Sequence
< rtl::OUString
> tNameSequence
;
53 typedef ::comphelper::MakeSequence
< rtl::OUString
> tMakeNameSequence
;
55 typedef ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> tAnySequence
;
56 typedef ::comphelper::MakeSequence
< ::com::sun::star::uno::Any
> tMakeAnySequence
;
61 static void setMappedProperties(
62 const ::com::sun::star::uno::Reference
<
63 ::com::sun::star::beans::XPropertySet
>& xTarget
64 , const ::com::sun::star::uno::Reference
<
65 ::com::sun::star::beans::XPropertySet
>& xSource
66 , const tPropertyNameMap
& rMap
67 , tPropertyNameValueMap
* pOverwriteMap
=0 );
69 static void getValueMap(
70 tPropertyNameValueMap
& rValueMap
71 , const tPropertyNameMap
& rNameMap
72 , const ::com::sun::star::uno::Reference
<
73 ::com::sun::star::beans::XPropertySet
>& xSourceProp
76 static void getMultiPropertyLists(
78 , tAnySequence
& rValues
79 , const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
>& xProp
80 , const tPropertyNameMap
& rMap
83 static void getMultiPropertyListsFromValueMap(
85 , tAnySequence
& rValues
86 , const tPropertyNameValueMap
& rValueMap
89 static ::com::sun::star::uno::Any
*
90 getValuePointer( tAnySequence
& rPropValues
91 , const tNameSequence
& rPropNames
92 , const rtl::OUString
& rPropName
);
94 static void setMultiProperties(
95 const tNameSequence
& rNames
96 , const tAnySequence
& rValues
97 , const ::com::sun::star::uno::Reference
<
98 ::com::sun::star::beans::XPropertySet
>& xTarget
);
100 static const tMakePropertyNameMap
& getPropertyNameMapForCharacterProperties();
101 static const tMakePropertyNameMap
& getPropertyNameMapForParagraphProperties();
102 static const tMakePropertyNameMap
& getPropertyNameMapForFillProperties();
103 static const tMakePropertyNameMap
& getPropertyNameMapForLineProperties();
104 static const tMakePropertyNameMap
& getPropertyNameMapForFillAndLineProperties();
105 static const tMakePropertyNameMap
& getPropertyNameMapForTextShapeProperties();
107 static const tMakePropertyNameMap
& getPropertyNameMapForFilledSeriesProperties();
108 static const tMakePropertyNameMap
& getPropertyNameMapForLineSeriesProperties();
110 static void getTextLabelMultiPropertyLists(
111 const ::com::sun::star::uno::Reference
<
112 ::com::sun::star::beans::XPropertySet
>& xSourceProp
113 , tNameSequence
& rPropNames
, tAnySequence
& rPropValues
115 , sal_Int32 nLimitedSpace
=-1
116 , bool bLimitedHeight
=false );
118 /** adds line-, fill- and character properties and sets some suitable
119 defaults for auto-grow properties
121 static void getPreparedTextShapePropertyLists(
122 const ::com::sun::star::uno::Reference
<
123 ::com::sun::star::beans::XPropertySet
>& xSourceProp
124 , tNameSequence
& rPropNames
125 , tAnySequence
& rPropValues
);
128 //.............................................................................
130 //.............................................................................