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_TITLEITEMCONVERTER_HXX
24 #define CHART_TITLEITEMCONVERTER_HXX
25 
26 #include "ItemConverter.hxx"
27 #include <com/sun/star/awt/Size.hpp>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 
30 #include <vector>
31 #include <memory>
32 
33 class SdrModel;
34 
35 namespace chart
36 {
37 namespace wrapper
38 {
39 
40 class TitleItemConverter :
41         public ::comphelper::ItemConverter
42 {
43 public:
44     TitleItemConverter(
45         const ::com::sun::star::uno::Reference<
46         ::com::sun::star::beans::XPropertySet > & rPropertySet,
47         SfxItemPool& rItemPool,
48         SdrModel& rDrawModel,
49         const ::com::sun::star::uno::Reference<
50             ::com::sun::star::lang::XMultiServiceFactory > & xNamedPropertyContainerFactory,
51         ::std::auto_ptr< ::com::sun::star::awt::Size > pRefSize =
52             ::std::auto_ptr< ::com::sun::star::awt::Size >() );
53 
54     virtual ~TitleItemConverter();
55 
56     virtual void FillItemSet( SfxItemSet & rOutItemSet ) const;
57     virtual bool ApplyItemSet( const SfxItemSet & rItemSet );
58 
59 protected:
60     virtual const sal_uInt16 * GetWhichPairs() const;
61     virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const;
62 
63     virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const
64         throw( ::com::sun::star::uno::Exception );
65     virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet )
66         throw( ::com::sun::star::uno::Exception );
67 
68 private:
69     ::std::vector< ItemConverter * >    m_aConverters;
70 };
71 
72 } //  namespace wrapper
73 } //  namespace chart
74 
75 // CHART_TITLEITEMCONVERTER_HXX
76 #endif
77