1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataSeriesProperties.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
33 #include "DataSeriesProperties.hxx"
34 #include "DataPointProperties.hxx"
35 #include "DataPoint.hxx"
37 #include <com/sun/star/beans/PropertyAttribute.hpp>
38 #include <com/sun/star/style/XStyle.hpp>
39 #include <com/sun/star/chart2/StackingDirection.hpp>
43 using namespace ::com::sun::star
;
45 using ::rtl::OUString
;
46 using ::com::sun::star::beans::Property
;
47 using ::com::sun::star::uno::Reference
;
52 void DataSeriesProperties::AddPropertiesToVector(
53 ::std::vector
< Property
> & rOutProperties
)
55 rOutProperties
.push_back(
56 Property( C2U( "AttributedDataPoints" ),
57 PROP_DATASERIES_ATTRIBUTED_DATA_POINTS
,
58 ::getCppuType( reinterpret_cast< const uno::Sequence
< sal_Int32
> * >(0)),
59 beans::PropertyAttribute::BOUND
60 | beans::PropertyAttribute::MAYBEVOID
));
62 rOutProperties
.push_back(
63 Property( C2U( "StackingDirection" ),
64 PROP_DATASERIES_STACKING_DIRECTION
,
65 ::getCppuType( reinterpret_cast< const chart2::StackingDirection
* >(0)),
66 beans::PropertyAttribute::BOUND
67 | beans::PropertyAttribute::MAYBEDEFAULT
));
69 rOutProperties
.push_back(
70 Property( C2U( "VaryColorsByPoint" ),
71 PROP_DATASERIES_VARY_COLORS_BY_POINT
,
72 ::getBooleanCppuType(),
73 beans::PropertyAttribute::BOUND
74 | beans::PropertyAttribute::MAYBEDEFAULT
));
76 rOutProperties
.push_back(
77 Property( C2U( "AttachedAxisIndex" ),
78 PROP_DATASERIES_ATTACHED_AXIS_INDEX
,
79 ::getCppuType( reinterpret_cast< const sal_Int32
* >(0)),
80 beans::PropertyAttribute::BOUND
81 | beans::PropertyAttribute::MAYBEVOID
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
< sal_Int32
>( rOutMap
, PROP_DATASERIES_ATTACHED_AXIS_INDEX
, 0 );
95 // PROP_DATASERIES_ATTRIBUTED_DATA_POINTS has no default
97 // add properties of service DataPointProperties
98 DataPointProperties::AddDefaultsToMap( rOutMap
);