1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <DataSeriesProperties.hxx>
21 #include "DataPointProperties.hxx"
22 #include <com/sun/star/beans/PropertyAttribute.hpp>
23 #include <com/sun/star/chart2/StackingDirection.hpp>
25 using namespace ::com::sun::star
;
27 using ::com::sun::star::beans::Property
;
32 void DataSeriesProperties::AddPropertiesToVector(
33 std::vector
< Property
> & rOutProperties
)
35 rOutProperties
.emplace_back( "AttributedDataPoints",
36 PROP_DATASERIES_ATTRIBUTED_DATA_POINTS
,
37 cppu::UnoType
<uno::Sequence
< sal_Int32
>>::get(),
38 beans::PropertyAttribute::BOUND
39 | beans::PropertyAttribute::MAYBEVOID
);
41 rOutProperties
.emplace_back( "StackingDirection",
42 PROP_DATASERIES_STACKING_DIRECTION
,
43 cppu::UnoType
<chart2::StackingDirection
>::get(),
44 beans::PropertyAttribute::BOUND
45 | beans::PropertyAttribute::MAYBEDEFAULT
);
47 rOutProperties
.emplace_back( "VaryColorsByPoint",
48 PROP_DATASERIES_VARY_COLORS_BY_POINT
,
49 cppu::UnoType
<bool>::get(),
50 beans::PropertyAttribute::BOUND
51 | beans::PropertyAttribute::MAYBEDEFAULT
);
53 rOutProperties
.emplace_back( "AttachedAxisIndex",
54 PROP_DATASERIES_ATTACHED_AXIS_INDEX
,
55 cppu::UnoType
<sal_Int32
>::get(),
56 beans::PropertyAttribute::BOUND
57 | beans::PropertyAttribute::MAYBEVOID
58 | beans::PropertyAttribute::MAYBEDEFAULT
);
60 rOutProperties
.emplace_back( "ShowLegendEntry",
61 PROP_DATASERIES_SHOW_LEGEND_ENTRY
,
62 cppu::UnoType
<sal_Bool
>::get(),
63 beans::PropertyAttribute::BOUND
64 | beans::PropertyAttribute::MAYBEDEFAULT
);
66 rOutProperties
.emplace_back( "DeletedLegendEntries",
67 PROP_DATASERIES_DELETED_LEGEND_ENTRIES
,
68 cppu::UnoType
<uno::Sequence
<sal_Int32
>>::get(),
69 beans::PropertyAttribute::BOUND
70 | beans::PropertyAttribute::MAYBEVOID
);
72 rOutProperties
.emplace_back( "ShowCustomLeaderLines",
73 PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES
,
74 cppu::UnoType
<sal_Bool
>::get(),
75 beans::PropertyAttribute::BOUND
76 | beans::PropertyAttribute::MAYBEDEFAULT
);
78 rOutProperties
.emplace_back( "InvertNegative",
79 PROP_DATASERIES_INVERT_NEGATIVE
,
80 cppu::UnoType
<sal_Bool
>::get(),
81 beans::PropertyAttribute::BOUND
82 | beans::PropertyAttribute::MAYBEDEFAULT
);
84 // add properties of service DataPointProperties
85 DataPointProperties::AddPropertiesToVector( rOutProperties
);
88 void DataSeriesProperties::AddDefaultsToMap(
89 tPropertyValueMap
& rOutMap
)
91 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_STACKING_DIRECTION
, chart2::StackingDirection_NO_STACKING
);
92 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_VARY_COLORS_BY_POINT
, false );
93 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_ATTACHED_AXIS_INDEX
, sal_Int32(0) );
94 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_SHOW_LEGEND_ENTRY
, true );
95 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES
, true );
96 PropertyHelper::setPropertyValueDefault( rOutMap
, PROP_DATASERIES_INVERT_NEGATIVE
, false );
98 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
100 // add properties of service DataPointProperties
101 DataPointProperties::AddDefaultsToMap( rOutMap
);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */