Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / chart2 / source / view / inc / PropertyMapper.hxx
blob94b3a1c6b60b8cbcafa3218c87603cad55520b44
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_VIEW_INC_PROPERTYMAPPER_HXX
20 #define INCLUDED_CHART2_SOURCE_VIEW_INC_PROPERTYMAPPER_HXX
22 #include <sal/config.h>
24 #include <map>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <com/sun/star/uno/Reference.h>
29 #include <charttoolsdllapi.hxx>
31 namespace com { namespace sun { namespace star { namespace beans { class XPropertySet; } } } }
33 namespace chart
36 typedef std::map< OUString, OUString > tPropertyNameMap;
37 typedef std::map< OUString, css::uno::Any > tPropertyNameValueMap;
38 typedef css::uno::Sequence< OUString > tNameSequence;
39 typedef css::uno::Sequence< css::uno::Any > tAnySequence;
41 /**
42 * PropertyMapper provides easy mapping of the property names of various
43 * objects in the chart model, to the property names of the destination
44 * shape objects (those whose service names begin with
45 * com.sun.star.drawing.).
47 class OOO_DLLPUBLIC_CHARTTOOLS PropertyMapper
49 public:
50 static void setMappedProperties(
51 const css::uno::Reference< css::beans::XPropertySet >& xTarget
52 , const css::uno::Reference< css::beans::XPropertySet >& xSource
53 , const tPropertyNameMap& rMap
54 , tPropertyNameValueMap const * pOverwriteMap=nullptr );
56 /**
57 * Fetch property values from the source object and map it to the
58 * destination container. Only those properties that are explicitly set
59 * will be inserted into the destination container.
61 * @param rValueMap destination container
62 * @param rNameMap property name mapping rule
63 * @param xSourceProp source object from which the property values are
64 * pulled.
66 static void getValueMap(
67 tPropertyNameValueMap& rValueMap
68 , const tPropertyNameMap& rNameMap
69 , const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
72 static void getMultiPropertyLists(
73 tNameSequence& rNames
74 , tAnySequence& rValues
75 , const css::uno::Reference< css::beans::XPropertySet >& xProp
76 , const tPropertyNameMap& rMap
79 static void getMultiPropertyListsFromValueMap(
80 tNameSequence& rNames
81 , tAnySequence& rValues
82 , const tPropertyNameValueMap& rValueMap
85 static css::uno::Any*
86 getValuePointer( tAnySequence& rPropValues
87 , const tNameSequence& rPropNames
88 , const OUString& rPropName );
90 static css::uno::Any*
91 getValuePointerForLimitedSpace( tAnySequence& rPropValues
92 , const tNameSequence& rPropNames
93 , bool bLimitedHeight );
95 static void setMultiProperties(
96 const tNameSequence& rNames
97 , const tAnySequence& rValues
98 , const css::uno::Reference< css::beans::XPropertySet >& xTarget );
100 static const tPropertyNameMap& getPropertyNameMapForCharacterProperties();
101 static const tPropertyNameMap& getPropertyNameMapForParagraphProperties();
102 static const tPropertyNameMap& getPropertyNameMapForFillProperties();
103 static const tPropertyNameMap& getPropertyNameMapForLineProperties();
104 static const tPropertyNameMap& getPropertyNameMapForFillAndLineProperties();
105 static const tPropertyNameMap& getPropertyNameMapForTextShapeProperties();
107 static const tPropertyNameMap& getPropertyNameMapForFilledSeriesProperties();
108 static const tPropertyNameMap& getPropertyNameMapForLineSeriesProperties();
109 static const tPropertyNameMap& getPropertyNameMapForTextLabelProperties();
111 static void getTextLabelMultiPropertyLists(
112 const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
113 , tNameSequence& rPropNames, tAnySequence& rPropValues
114 , bool bName=true
115 , sal_Int32 nLimitedSpace=-1
116 , bool bLimitedHeight=false
117 , bool bSupportsLabelBorder = true);
119 /** adds line-, fill- and character properties and sets some suitable
120 defaults for auto-grow properties
122 static void getPreparedTextShapePropertyLists(
123 const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
124 , tNameSequence& rPropNames
125 , tAnySequence& rPropValues );
128 } //namespace chart
129 #endif
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */