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