/src/libreoffice/chart2/source/model/main/DataSeriesProperties.cxx
Line | Count | Source |
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 <com/sun/star/beans/PropertyAttribute.hpp> |
23 | | #include <com/sun/star/chart2/StackingDirection.hpp> |
24 | | |
25 | | using namespace ::com::sun::star; |
26 | | |
27 | | using ::com::sun::star::beans::Property; |
28 | | |
29 | | namespace chart |
30 | | { |
31 | | |
32 | | void DataSeriesProperties::AddPropertiesToVector( |
33 | | std::vector< Property > & rOutProperties ) |
34 | 0 | { |
35 | 0 | rOutProperties.emplace_back( "AttributedDataPoints", |
36 | 0 | PROP_DATASERIES_ATTRIBUTED_DATA_POINTS, |
37 | 0 | cppu::UnoType<uno::Sequence< sal_Int32 >>::get(), |
38 | 0 | beans::PropertyAttribute::BOUND |
39 | 0 | | beans::PropertyAttribute::MAYBEVOID ); |
40 | |
|
41 | 0 | rOutProperties.emplace_back( "StackingDirection", |
42 | 0 | PROP_DATASERIES_STACKING_DIRECTION, |
43 | 0 | cppu::UnoType<chart2::StackingDirection>::get(), |
44 | 0 | beans::PropertyAttribute::BOUND |
45 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
46 | |
|
47 | 0 | rOutProperties.emplace_back( "VaryColorsByPoint", |
48 | 0 | PROP_DATASERIES_VARY_COLORS_BY_POINT, |
49 | 0 | cppu::UnoType<bool>::get(), |
50 | 0 | beans::PropertyAttribute::BOUND |
51 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
52 | |
|
53 | 0 | rOutProperties.emplace_back( "AttachedAxisIndex", |
54 | 0 | PROP_DATASERIES_ATTACHED_AXIS_INDEX, |
55 | 0 | cppu::UnoType<sal_Int32>::get(), |
56 | 0 | beans::PropertyAttribute::BOUND |
57 | 0 | | beans::PropertyAttribute::MAYBEVOID |
58 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
59 | |
|
60 | 0 | rOutProperties.emplace_back( "ShowLegendEntry", |
61 | 0 | PROP_DATASERIES_SHOW_LEGEND_ENTRY, |
62 | 0 | cppu::UnoType<sal_Bool>::get(), |
63 | 0 | beans::PropertyAttribute::BOUND |
64 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
65 | |
|
66 | 0 | rOutProperties.emplace_back( "DeletedLegendEntries", |
67 | 0 | PROP_DATASERIES_DELETED_LEGEND_ENTRIES, |
68 | 0 | cppu::UnoType<uno::Sequence<sal_Int32>>::get(), |
69 | 0 | beans::PropertyAttribute::BOUND |
70 | 0 | | beans::PropertyAttribute::MAYBEVOID ); |
71 | |
|
72 | 0 | rOutProperties.emplace_back( "ShowCustomLeaderLines", |
73 | 0 | PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, |
74 | 0 | cppu::UnoType<sal_Bool>::get(), |
75 | 0 | beans::PropertyAttribute::BOUND |
76 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
77 | |
|
78 | 0 | rOutProperties.emplace_back( "InvertNegative", |
79 | 0 | PROP_DATASERIES_INVERT_NEGATIVE, |
80 | 0 | cppu::UnoType<sal_Bool>::get(), |
81 | 0 | beans::PropertyAttribute::BOUND |
82 | 0 | | beans::PropertyAttribute::MAYBEDEFAULT ); |
83 | | |
84 | | // add properties of service DataPointProperties |
85 | 0 | DataPointProperties::AddPropertiesToVector( rOutProperties ); |
86 | 0 | } |
87 | | |
88 | | void DataSeriesProperties::AddDefaultsToMap( |
89 | | tPropertyValueMap & rOutMap ) |
90 | 0 | { |
91 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_STACKING_DIRECTION, chart2::StackingDirection_NO_STACKING ); |
92 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_VARY_COLORS_BY_POINT, false ); |
93 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_ATTACHED_AXIS_INDEX, sal_Int32(0) ); |
94 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_SHOW_LEGEND_ENTRY, true ); |
95 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_SHOW_CUSTOM_LEADERLINES, true ); |
96 | 0 | PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DATASERIES_INVERT_NEGATIVE, false ); |
97 | | |
98 | | // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default |
99 | | |
100 | | // add properties of service DataPointProperties |
101 | 0 | DataPointProperties::AddDefaultsToMap( rOutMap ); |
102 | 0 | } |
103 | | |
104 | | } // namespace chart |
105 | | |
106 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |