LibreOffice Module chart2 (master) 1
PropertyMapper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <sal/config.h>
22
23#include <unordered_map>
24
25#include <com/sun/star/uno/Sequence.h>
26#include <com/sun/star/uno/Reference.h>
27
28namespace com::sun::star::beans { class XPropertySet; }
29class SvxShape;
30
31namespace chart
32{
33
34typedef std::unordered_map<OUString, OUString> tPropertyNameMap;
35typedef std::unordered_map<OUString, css::uno::Any> tPropertyNameValueMap;
36typedef css::uno::Sequence< OUString > tNameSequence;
37typedef css::uno::Sequence< css::uno::Any > tAnySequence;
38
46{
47public:
49 const css::uno::Reference< css::beans::XPropertySet >& xTarget
50 , const css::uno::Reference< css::beans::XPropertySet >& xSource
51 , const tPropertyNameMap& rMap );
52
54 SvxShape& xTarget
55 , const css::uno::Reference< css::beans::XPropertySet >& xSource
56 , const tPropertyNameMap& rMap );
57
68 static void getValueMap(
69 tPropertyNameValueMap& rValueMap
70 , const tPropertyNameMap& rNameMap
71 , const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
72 );
73
75 tNameSequence& rNames
76 , tAnySequence& rValues
77 , const tPropertyNameValueMap& rValueMap
78 );
79
80 static css::uno::Any*
81 getValuePointer( tAnySequence& rPropValues
82 , const tNameSequence& rPropNames
83 , std::u16string_view rPropName );
84
85 static css::uno::Any*
87 , const tNameSequence& rPropNames
88 , bool bLimitedHeight );
89
90 static void setMultiProperties(
91 const tNameSequence& rNames
92 , const tAnySequence& rValues
93 , SvxShape& xTarget );
94
101
105
107 const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
108 , tNameSequence& rPropNames, tAnySequence& rPropValues
109 , bool bName=true
110 , sal_Int32 nLimitedSpace=-1
111 , bool bLimitedHeight=false
112 , bool bSupportsLabelBorder = true);
113
118 const css::uno::Reference< css::beans::XPropertySet >& xSourceProp
119 , tNameSequence& rPropNames
120 , tAnySequence& rPropValues );
121};
122
123} //namespace chart
124
125/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertyMapper provides easy mapping of the property names of various objects in the chart model,...
static const tPropertyNameMap & getPropertyNameMapForFillAndLineProperties()
static css::uno::Any * getValuePointerForLimitedSpace(tAnySequence &rPropValues, const tNameSequence &rPropNames, bool bLimitedHeight)
static const tPropertyNameMap & getPropertyNameMapForTextShapeProperties()
static css::uno::Any * getValuePointer(tAnySequence &rPropValues, const tNameSequence &rPropNames, std::u16string_view rPropName)
static void setMultiProperties(const tNameSequence &rNames, const tAnySequence &rValues, SvxShape &xTarget)
static const tPropertyNameMap & getPropertyNameMapForLineProperties()
static void setMappedProperties(SvxShape &xTarget, const css::uno::Reference< css::beans::XPropertySet > &xSource, const tPropertyNameMap &rMap)
static const tPropertyNameMap & getPropertyNameMapForFilledSeriesProperties()
static const tPropertyNameMap & getPropertyNameMapForTextLabelProperties()
static const tPropertyNameMap & getPropertyNameMapForCharacterProperties()
static void getMultiPropertyListsFromValueMap(tNameSequence &rNames, tAnySequence &rValues, const tPropertyNameValueMap &rValueMap)
static const tPropertyNameMap & getPropertyNameMapForFillProperties()
static const tPropertyNameMap & getPropertyNameMapForLineSeriesProperties()
static void getPreparedTextShapePropertyLists(const css::uno::Reference< css::beans::XPropertySet > &xSourceProp, tNameSequence &rPropNames, tAnySequence &rPropValues)
adds line-, fill- and character properties and sets some suitable defaults for auto-grow properties
static void getTextLabelMultiPropertyLists(const css::uno::Reference< css::beans::XPropertySet > &xSourceProp, tNameSequence &rPropNames, tAnySequence &rPropValues, bool bName=true, sal_Int32 nLimitedSpace=-1, bool bLimitedHeight=false, bool bSupportsLabelBorder=true)
static void getValueMap(tPropertyNameValueMap &rValueMap, const tPropertyNameMap &rNameMap, const css::uno::Reference< css::beans::XPropertySet > &xSourceProp)
Fetch property values from the source object and map it to the destination container.
static const tPropertyNameMap & getPropertyNameMapForParagraphProperties()
static void setMappedProperties(const css::uno::Reference< css::beans::XPropertySet > &xTarget, const css::uno::Reference< css::beans::XPropertySet > &xSource, const tPropertyNameMap &rMap)
css::uno::Sequence< OUString > tNameSequence
std::unordered_map< OUString, OUString > tPropertyNameMap
css::uno::Sequence< css::uno::Any > tAnySequence
std::unordered_map< OUString, css::uno::Any > tPropertyNameValueMap
class SAL_NO_VTABLE XPropertySet