1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART_AXISITEMCONVERTER_HXX
24 #define CHART_AXISITEMCONVERTER_HXX
25 
26 #include <chartview/ExplicitScaleValues.hxx>
27 #include <com/sun/star/chart2/XAxis.hpp>
28 #include <com/sun/star/chart2/XChartDocument.hpp>
29 #include <com/sun/star/awt/Size.hpp>
30 
31 #include "ItemConverter.hxx"
32 
33 #include <vector>
34 #include <memory>
35 
36 class SdrModel;
37 
38 namespace chart
39 {
40 namespace wrapper
41 {
42 
43 class AxisItemConverter : public ::comphelper::ItemConverter
44 {
45 public:
46 	AxisItemConverter(
47         const ::com::sun::star::uno::Reference<
48             ::com::sun::star::beans::XPropertySet > & rPropertySet,
49         SfxItemPool& rItemPool,
50         SdrModel& rDrawModel,
51         const ::com::sun::star::uno::Reference<
52             ::com::sun::star::chart2::XChartDocument > & xChartDoc,
53         ExplicitScaleData * pScale = NULL,
54         ExplicitIncrementData * pIncrement = NULL,
55         ::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
56             ::std::auto_ptr< ::com::sun::star::awt::Size >() );
57     virtual ~AxisItemConverter();
58 
59     virtual void FillItemSet( SfxItemSet & rOutItemSet ) const;
60     virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
61 
62 protected:
63     virtual const sal_uInt16 * GetWhichPairs() const;
64     virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
65 
66     virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
67         throw( ::com::sun::star::uno::Exception );
68     virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
69         throw( ::com::sun::star::uno::Exception );
70 
71 private:
72     ::std::vector< ItemConverter * >               m_aConverters;
73     ::com::sun::star::uno::Reference<
74         ::com::sun::star::chart2::XAxis >  m_xAxis;
75 
76     ::com::sun::star::uno::Reference<
77         ::com::sun::star::chart2::XChartDocument >      m_xChartDoc;
78 
79     ExplicitScaleData*      m_pExplicitScale;
80     ExplicitIncrementData*  m_pExplicitIncrement;
81 };
82 
83 } //  namespace wrapper
84 } //  namespace chart
85 
86 // CHART_AXISITEMCONVERTER_HXX
87 #endif
88