1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 #include "DataSeriesProperties.hxx"
27 #include "DataPointProperties.hxx"
28 #include "DataPoint.hxx"
29 #include "macros.hxx"
30 #include <com/sun/star/beans/PropertyAttribute.hpp>
31 #include <com/sun/star/style/XStyle.hpp>
32 #include <com/sun/star/chart2/StackingDirection.hpp>
33
34 #include <algorithm>
35
36 using namespace ::com::sun::star;
37
38 using ::rtl::OUString;
39 using ::com::sun::star::beans::Property;
40 using ::com::sun::star::uno::Reference;
41
42 namespace chart
43 {
44
AddPropertiesToVector(::std::vector<Property> & rOutProperties)45 void DataSeriesProperties::AddPropertiesToVector(
46 ::std::vector< Property > & rOutProperties )
47 {
48 rOutProperties.push_back(
49 Property( C2U( "AttributedDataPoints" ),
50 PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
51 ::getCppuType( reinterpret_cast< const uno::Sequence< sal_Int32 > * >(0)),
52 beans::PropertyAttribute::BOUND
53 | beans::PropertyAttribute::MAYBEVOID ));
54
55 rOutProperties.push_back(
56 Property( C2U( "StackingDirection" ),
57 PROP_DATASERIES_STACKING_DIRECTION,
58 ::getCppuType( reinterpret_cast< const chart2::StackingDirection * >(0)),
59 beans::PropertyAttribute::BOUND
60 | beans::PropertyAttribute::MAYBEDEFAULT ));
61
62 rOutProperties.push_back(
63 Property( C2U( "VaryColorsByPoint" ),
64 PROP_DATASERIES_VARY_COLORS_BY_POINT,
65 ::getBooleanCppuType(),
66 beans::PropertyAttribute::BOUND
67 | beans::PropertyAttribute::MAYBEDEFAULT ));
68
69 rOutProperties.push_back(
70 Property( C2U( "AttachedAxisIndex" ),
71 PROP_DATASERIES_ATTACHED_AXIS_INDEX,
72 ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
73 beans::PropertyAttribute::BOUND
74 | beans::PropertyAttribute::MAYBEVOID
75 | beans::PropertyAttribute::MAYBEDEFAULT ));
76
77 // add properties of service DataPointProperties
78 DataPointProperties::AddPropertiesToVector( rOutProperties );
79 }
80
AddDefaultsToMap(tPropertyValueMap & rOutMap)81 void DataSeriesProperties::AddDefaultsToMap(
82 tPropertyValueMap & rOutMap )
83 {
84 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
85 PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
86 PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
87
88 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
89
90 // add properties of service DataPointProperties
91 DataPointProperties::AddDefaultsToMap( rOutMap );
92 }
93
94 } // namespace chart
95