LibreOffice Module chart2 (master) 1
PropertyHelper.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 <com/sun/star/beans/Property.hpp>
22#include <com/sun/star/uno/Any.hxx>
23#include "charttoolsdllapi.hxx"
24
25#include <unordered_map>
26
27namespace com::sun::star::lang { class XMultiServiceFactory; }
28
29namespace chart
30{
31
33
34typedef std::unordered_map<tPropertyValueMapKey, css::uno::Any> tPropertyValueMap;
35
36namespace PropertyHelper
37{
38
45 const css::uno::Any & rValue,
46 const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
47 const OUString & rPreferredName );
48
55 const css::uno::Any & rValue,
56 const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
57 const OUString & rPreferredName );
58
66 const css::uno::Any & rValue,
67 const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
68 const OUString & rPreferredName );
69
76 const css::uno::Any & rValue,
77 const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
78 const OUString & rPreferredName );
79
86 const css::uno::Any & rValue,
87 const css::uno::Reference< css::lang::XMultiServiceFactory > & xFact,
88 const OUString & rPreferredName );
89
97 const css::uno::Any & rAny );
98
105template< typename Value >
106 void setPropertyValue( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const Value & value )
107{
108 setPropertyValueAny( rOutMap, key, css::uno::Any( value ));
109}
110
111template<>
112 void setPropertyValue< css::uno::Any >( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const css::uno::Any & rAny );
113
115
119template< typename Value >
120 void setPropertyValueDefault( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const Value & value )
121{
122 setPropertyValueDefaultAny( rOutMap, key, css::uno::Any( value ));
123}
124
128template<>
129 void setPropertyValueDefault< css::uno::Any >( tPropertyValueMap & rOutMap, tPropertyValueMapKey key, const css::uno::Any & rAny );
130
134
135} // namespace PropertyHelper
136
138{
139 bool operator() ( const css::beans::Property & first,
140 const css::beans::Property & second )
141 {
142 return ( first.Name.compareTo( second.Name ) < 0 );
143 }
144};
145
146} // namespace chart
147
148/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define OOO_DLLPUBLIC_CHARTTOOLS
Any value
OOO_DLLPUBLIC_CHARTTOOLS OUString addGradientUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a gradient with a unique name to the gradient obtained by the given factory.
OOO_DLLPUBLIC_CHARTTOOLS OUString addLineDashUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a line dash with a unique name to the gradient obtained by the given factory.
OOO_DLLPUBLIC_CHARTTOOLS void setPropertyValueDefaultAny(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const css::uno::Any &rAny)
OOO_DLLPUBLIC_CHARTTOOLS void setPropertyValueAny(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const css::uno::Any &rAny)
Set a property to a certain value in the given map.
OOO_DLLPUBLIC_CHARTTOOLS OUString addBitmapUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a bitmap with a unique name to the gradient obtained by the given factory.
OOO_DLLPUBLIC_CHARTTOOLS OUString addTransparencyGradientUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a transparency gradient with a unique name to the gradient obtained by the given factory.
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
OOO_DLLPUBLIC_CHARTTOOLS void setEmptyPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key)
Calls setPropertyValueDefault() with an empty Any as value.
void setPropertyValue(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Set a property to a certain value in the given map.
OOO_DLLPUBLIC_CHARTTOOLS OUString addHatchUniqueNameToTable(const css::uno::Any &rValue, const css::uno::Reference< css::lang::XMultiServiceFactory > &xFact, const OUString &rPreferredName)
adds a hatch with a unique name to the gradient obtained by the given factory.
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
int tPropertyValueMapKey
constexpr OUStringLiteral first