Update ooo320-m1
[ooovba.git] / chart2 / source / controller / inc / DataPointItemConverter.hxx
blob42e54356a85aa09df0519be5d05435a46b43d6a3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataPointItemConverter.hxx,v $
10 * $Revision: 1.13 $
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 ************************************************************************/
30 #ifndef CHART_DATAPOINTITEMCONVERTER_HXX
31 #define CHART_DATAPOINTITEMCONVERTER_HXX
33 #include "ItemConverter.hxx"
34 #include "GraphicPropertyItemConverter.hxx"
35 #include "chartview/NumberFormatterWrapper.hxx"
37 #include <com/sun/star/chart2/XDataSeries.hpp>
38 #include <com/sun/star/awt/Size.hpp>
39 #include <com/sun/star/frame/XModel.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
42 #include <memory>
43 #include <vector>
45 class SdrModel;
47 namespace chart
49 namespace wrapper
52 class DataPointItemConverter :
53 public ::comphelper::ItemConverter
55 public:
56 DataPointItemConverter(
57 const ::com::sun::star::uno::Reference<
58 ::com::sun::star::frame::XModel > & xChartModel,
59 const ::com::sun::star::uno::Reference<
60 ::com::sun::star::uno::XComponentContext > & xContext,
61 const ::com::sun::star::uno::Reference<
62 ::com::sun::star::beans::XPropertySet > & rPropertySet,
63 const ::com::sun::star::uno::Reference<
64 ::com::sun::star::chart2::XDataSeries > & xSeries,
65 SfxItemPool& rItemPool,
66 SdrModel& rDrawModel,
67 NumberFormatterWrapper * pNumFormatter,
68 const ::com::sun::star::uno::Reference<
69 ::com::sun::star::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
70 GraphicPropertyItemConverter::eGraphicObjectType eMapTo =
71 GraphicPropertyItemConverter::FILLED_DATA_POINT,
72 ::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
73 ::std::auto_ptr< ::com::sun::star::awt::Size >(),
74 bool bDataSeries = false,
75 bool bUseSpecialFillColor = false,
76 sal_Int32 nSpecialFillColor = 0,
77 bool bOverwriteLabelsForAttributedDataPointsAlso=false,
78 sal_Int32 nNumberFormat=0,
79 sal_Int32 nPercentNumberFormat=0);
81 virtual ~DataPointItemConverter();
83 virtual void FillItemSet( SfxItemSet & rOutItemSet ) const;
84 virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
86 protected:
87 virtual const USHORT * GetWhichPairs() const;
88 virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
90 virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
91 throw( ::com::sun::star::uno::Exception );
92 virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
93 throw( ::com::sun::star::uno::Exception );
95 private:
96 ::std::vector< ItemConverter * > m_aConverters;
97 NumberFormatterWrapper * m_pNumberFormatterWrapper;
98 bool m_bDataSeries;
99 bool m_bOverwriteLabelsForAttributedDataPointsAlso;
100 bool m_bColorPerPoint;
101 bool m_bUseSpecialFillColor;
102 sal_Int32 m_nSpecialFillColor;
103 sal_Int32 m_nNumberFormat;
104 sal_Int32 m_nPercentNumberFormat;
105 ::com::sun::star::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements;
106 bool m_bForbidPercentValue;
109 } // namespace wrapper
110 } // namespace chart
112 // CHART_DATAPOINTITEMCONVERTER_HXX
113 #endif