1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 #ifndef CHART_AXISITEMCONVERTER_HXX
28 #define CHART_AXISITEMCONVERTER_HXX
29 
30 #include <chartview/ExplicitScaleValues.hxx>
31 #include <com/sun/star/chart2/XAxis.hpp>
32 #include <com/sun/star/chart2/XChartDocument.hpp>
33 #include <com/sun/star/awt/Size.hpp>
34 
35 #include "ItemConverter.hxx"
36 
37 #include <vector>
38 #include <memory>
39 
40 class SdrModel;
41 
42 namespace chart
43 {
44 namespace wrapper
45 {
46 
47 class AxisItemConverter : public ::comphelper::ItemConverter
48 {
49 public:
50 	AxisItemConverter(
51         const ::com::sun::star::uno::Reference<
52             ::com::sun::star::beans::XPropertySet > & rPropertySet,
53         SfxItemPool& rItemPool,
54         SdrModel& rDrawModel,
55         const ::com::sun::star::uno::Reference<
56             ::com::sun::star::chart2::XChartDocument > & xChartDoc,
57         ExplicitScaleData * pScale = NULL,
58         ExplicitIncrementData * pIncrement = NULL,
59         ::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
60             ::std::auto_ptr< ::com::sun::star::awt::Size >() );
61     virtual ~AxisItemConverter();
62 
63     virtual void FillItemSet( SfxItemSet & rOutItemSet ) const;
64     virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
65 
66 protected:
67     virtual const sal_uInt16 * GetWhichPairs() const;
68     virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
69 
70     virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
71         throw( ::com::sun::star::uno::Exception );
72     virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
73         throw( ::com::sun::star::uno::Exception );
74 
75 private:
76     ::std::vector< ItemConverter * >               m_aConverters;
77     ::com::sun::star::uno::Reference<
78         ::com::sun::star::chart2::XAxis >  m_xAxis;
79 
80     ::com::sun::star::uno::Reference<
81         ::com::sun::star::chart2::XChartDocument >      m_xChartDoc;
82 
83     ExplicitScaleData*      m_pExplicitScale;
84     ExplicitIncrementData*  m_pExplicitIncrement;
85 };
86 
87 } //  namespace wrapper
88 } //  namespace chart
89 
90 // CHART_AXISITEMCONVERTER_HXX
91 #endif
92