merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / controller / inc / DataPointItemConverter.hxx
blobd738cf8f62450cc4a3ddd8046a73d6e48f006805
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART_DATAPOINTITEMCONVERTER_HXX
28 #define CHART_DATAPOINTITEMCONVERTER_HXX
30 #include "ItemConverter.hxx"
31 #include "GraphicPropertyItemConverter.hxx"
32 #include "chartview/NumberFormatterWrapper.hxx"
34 #include <com/sun/star/chart2/XDataSeries.hpp>
35 #include <com/sun/star/awt/Size.hpp>
36 #include <com/sun/star/frame/XModel.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <memory>
40 #include <vector>
42 class SdrModel;
44 namespace chart
46 namespace wrapper
49 class DataPointItemConverter :
50 public ::comphelper::ItemConverter
52 public:
53 DataPointItemConverter(
54 const ::com::sun::star::uno::Reference<
55 ::com::sun::star::frame::XModel > & xChartModel,
56 const ::com::sun::star::uno::Reference<
57 ::com::sun::star::uno::XComponentContext > & xContext,
58 const ::com::sun::star::uno::Reference<
59 ::com::sun::star::beans::XPropertySet > & rPropertySet,
60 const ::com::sun::star::uno::Reference<
61 ::com::sun::star::chart2::XDataSeries > & xSeries,
62 SfxItemPool& rItemPool,
63 SdrModel& rDrawModel,
64 NumberFormatterWrapper * pNumFormatter,
65 const ::com::sun::star::uno::Reference<
66 ::com::sun::star::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
67 GraphicPropertyItemConverter::eGraphicObjectType eMapTo =
68 GraphicPropertyItemConverter::FILLED_DATA_POINT,
69 ::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
70 ::std::auto_ptr< ::com::sun::star::awt::Size >(),
71 bool bDataSeries = false,
72 bool bUseSpecialFillColor = false,
73 sal_Int32 nSpecialFillColor = 0,
74 bool bOverwriteLabelsForAttributedDataPointsAlso=false,
75 sal_Int32 nNumberFormat=0,
76 sal_Int32 nPercentNumberFormat=0);
78 virtual ~DataPointItemConverter();
80 virtual void FillItemSet( SfxItemSet & rOutItemSet ) const;
81 virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
83 protected:
84 virtual const USHORT * GetWhichPairs() const;
85 virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
87 virtual void FillSpecialItem( USHORT nWhichId, SfxItemSet & rOutItemSet ) const
88 throw( ::com::sun::star::uno::Exception );
89 virtual bool ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rItemSet )
90 throw( ::com::sun::star::uno::Exception );
92 private:
93 ::std::vector< ItemConverter * > m_aConverters;
94 NumberFormatterWrapper * m_pNumberFormatterWrapper;
95 bool m_bDataSeries;
96 bool m_bOverwriteLabelsForAttributedDataPointsAlso;
97 bool m_bColorPerPoint;
98 bool m_bUseSpecialFillColor;
99 sal_Int32 m_nSpecialFillColor;
100 sal_Int32 m_nNumberFormat;
101 sal_Int32 m_nPercentNumberFormat;
102 ::com::sun::star::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements;
103 bool m_bForbidPercentValue;
106 } // namespace wrapper
107 } // namespace chart
109 // CHART_DATAPOINTITEMCONVERTER_HXX
110 #endif