Line data Source code
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 "DataSeriesProperties.hxx"
21 : #include "DataPointProperties.hxx"
22 : #include "DataPoint.hxx"
23 : #include "macros.hxx"
24 : #include <com/sun/star/beans/PropertyAttribute.hpp>
25 : #include <com/sun/star/style/XStyle.hpp>
26 : #include <com/sun/star/chart2/StackingDirection.hpp>
27 :
28 : #include <algorithm>
29 :
30 : using namespace ::com::sun::star;
31 :
32 : using ::com::sun::star::beans::Property;
33 : using ::com::sun::star::uno::Reference;
34 :
35 : namespace chart
36 : {
37 :
38 26 : void DataSeriesProperties::AddPropertiesToVector(
39 : ::std::vector< Property > & rOutProperties )
40 : {
41 : rOutProperties.push_back(
42 : Property( "AttributedDataPoints",
43 : PROP_DATASERIES_ATTRIBUTED_DATA_POINTS,
44 26 : ::getCppuType( reinterpret_cast< const uno::Sequence< sal_Int32 > * >(0)),
45 : beans::PropertyAttribute::BOUND
46 52 : | beans::PropertyAttribute::MAYBEVOID ));
47 :
48 : rOutProperties.push_back(
49 : Property( "StackingDirection",
50 : PROP_DATASERIES_STACKING_DIRECTION,
51 26 : cppu::UnoType<chart2::StackingDirection>::get(),
52 : beans::PropertyAttribute::BOUND
53 52 : | beans::PropertyAttribute::MAYBEDEFAULT ));
54 :
55 : rOutProperties.push_back(
56 : Property( "VaryColorsByPoint",
57 : PROP_DATASERIES_VARY_COLORS_BY_POINT,
58 26 : ::getBooleanCppuType(),
59 : beans::PropertyAttribute::BOUND
60 52 : | beans::PropertyAttribute::MAYBEDEFAULT ));
61 :
62 : rOutProperties.push_back(
63 : Property( "AttachedAxisIndex",
64 : PROP_DATASERIES_ATTACHED_AXIS_INDEX,
65 26 : cppu::UnoType<sal_Int32>::get(),
66 : beans::PropertyAttribute::BOUND
67 : | beans::PropertyAttribute::MAYBEVOID
68 52 : | beans::PropertyAttribute::MAYBEDEFAULT ));
69 :
70 : // add properties of service DataPointProperties
71 26 : DataPointProperties::AddPropertiesToVector( rOutProperties );
72 26 : }
73 :
74 26 : void DataSeriesProperties::AddDefaultsToMap(
75 : tPropertyValueMap & rOutMap )
76 : {
77 26 : PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING );
78 26 : PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false );
79 26 : PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, 0 );
80 :
81 : // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
82 :
83 : // add properties of service DataPointProperties
84 26 : DataPointProperties::AddDefaultsToMap( rOutMap );
85 26 : }
86 :
87 : } // namespace chart
88 :
89 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|