LibreOffice Module chart2 (master) 1
FillProperties.cxx
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
20#include <FillProperties.hxx>
21#include <com/sun/star/beans/PropertyAttribute.hpp>
22#include <com/sun/star/drawing/BitmapMode.hpp>
23#include <com/sun/star/drawing/FillStyle.hpp>
24#include <com/sun/star/drawing/RectanglePoint.hpp>
25
26#include <tools/color.hxx>
27
28using namespace ::com::sun::star;
29
30using ::com::sun::star::beans::Property;
31
32namespace chart
33{
34
35namespace
36{
37
38void lcl_AddPropertiesToVector_without_BitmapProperties( std::vector< css::beans::Property > & rOutProperties )
39{
40 rOutProperties.emplace_back( "FillStyle",
43 beans::PropertyAttribute::BOUND
44 | beans::PropertyAttribute::MAYBEDEFAULT );
45
46 rOutProperties.emplace_back( "FillColor",
49 beans::PropertyAttribute::BOUND
50 | beans::PropertyAttribute::MAYBEVOID // "maybe auto"
51 | beans::PropertyAttribute::MAYBEDEFAULT );
52
53 rOutProperties.emplace_back( "FillTransparence",
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::MAYBEDEFAULT );
58
59 rOutProperties.emplace_back( "FillTransparenceGradientName",
62 beans::PropertyAttribute::BOUND
63 | beans::PropertyAttribute::MAYBEVOID
64 | beans::PropertyAttribute::MAYBEDEFAULT );
65
66 rOutProperties.emplace_back( "FillGradientName",
69 beans::PropertyAttribute::BOUND
70 | beans::PropertyAttribute::MAYBEVOID
71 | beans::PropertyAttribute::MAYBEDEFAULT );
72
73 rOutProperties.emplace_back( "FillGradientStepCount",
76 beans::PropertyAttribute::BOUND
77 | beans::PropertyAttribute::MAYBEVOID );
78
79 rOutProperties.emplace_back( "FillHatchName",
82 beans::PropertyAttribute::BOUND
83 | beans::PropertyAttribute::MAYBEVOID
84 | beans::PropertyAttribute::MAYBEDEFAULT );
85
86 //bitmap properties see lcl_AddPropertiesToVector_only_BitmapProperties()
87
88 rOutProperties.emplace_back( "FillBackground",
91 beans::PropertyAttribute::BOUND
92 | beans::PropertyAttribute::MAYBEDEFAULT );
93}
94
95void lcl_AddPropertiesToVector_only_BitmapProperties( std::vector< css::beans::Property > & rOutProperties )
96{
97 rOutProperties.emplace_back( "FillBitmapName",
100 beans::PropertyAttribute::BOUND
101 | beans::PropertyAttribute::MAYBEVOID
102 | beans::PropertyAttribute::MAYBEDEFAULT );
103
104 rOutProperties.emplace_back( "FillBitmapOffsetX",
107 beans::PropertyAttribute::BOUND
108 | beans::PropertyAttribute::MAYBEDEFAULT );
109
110 rOutProperties.emplace_back( "FillBitmapOffsetY",
113 beans::PropertyAttribute::BOUND
114 | beans::PropertyAttribute::MAYBEDEFAULT );
115
116 rOutProperties.emplace_back( "FillBitmapPositionOffsetX",
119 beans::PropertyAttribute::BOUND
120 | beans::PropertyAttribute::MAYBEDEFAULT );
121
122 rOutProperties.emplace_back( "FillBitmapPositionOffsetY",
125 beans::PropertyAttribute::BOUND
126 | beans::PropertyAttribute::MAYBEDEFAULT );
127
128 rOutProperties.emplace_back( "FillBitmapRectanglePoint",
131 beans::PropertyAttribute::BOUND
132 | beans::PropertyAttribute::MAYBEDEFAULT );
133
134 rOutProperties.emplace_back( "FillBitmapLogicalSize",
137 beans::PropertyAttribute::BOUND
138 | beans::PropertyAttribute::MAYBEDEFAULT );
139
140 rOutProperties.emplace_back( "FillBitmapSizeX",
143 beans::PropertyAttribute::BOUND
144 | beans::PropertyAttribute::MAYBEDEFAULT );
145
146 rOutProperties.emplace_back( "FillBitmapSizeY",
149 beans::PropertyAttribute::BOUND
150 | beans::PropertyAttribute::MAYBEDEFAULT );
151
152 rOutProperties.emplace_back( "FillBitmapMode",
155 beans::PropertyAttribute::BOUND
156 | beans::PropertyAttribute::MAYBEDEFAULT );
157}
158
159void lcl_AddDefaultsToMap_without_BitmapProperties(
161{
166}
167
168void lcl_AddDefaultsToMap_only_BitmapProperties(
170{
175
181}
182
183}//end anonymous namespace
184
186 std::vector< Property > & rOutProperties )
187{
188 // Fill Properties see service drawing::FillProperties
189 lcl_AddPropertiesToVector_without_BitmapProperties( rOutProperties );
190 lcl_AddPropertiesToVector_only_BitmapProperties( rOutProperties );
191}
192
195{
196 lcl_AddDefaultsToMap_without_BitmapProperties( rOutMap );
197 lcl_AddDefaultsToMap_only_BitmapProperties( rOutMap );
198}
199
200} // namespace chart
201
202/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap(::chart::tPropertyValueMap &rOutMap)
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap