xref: /AOO42X/main/xmloff/inc/xmloff/txtimppr.hxx (revision 9bce9b0d387299c68bd81d539e1478357a103de5)
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 _XMLOFF_TXTIMPPR_HXX
24 #define _XMLOFF_TXTIMPPR_HXX
25 
26 #include "xmloff/dllapi.h"
27 #include <xmloff/xmlimppr.hxx>
28 
29 class XMLFontStylesContext;
30 
31 class XMLOFF_DLLPUBLIC XMLTextImportPropertyMapper : public SvXMLImportPropertyMapper
32 {
33     sal_Int32 nSizeTypeIndex;
34     sal_Int32 nWidthTypeIndex;
35     SvXMLImportContextRef xFontDecls;
36 
37     void FontFinished(
38                 XMLPropertyState *pFontFamilyNameState,
39                 XMLPropertyState *pFontStyleNameState,
40                 XMLPropertyState *pFontFamilyState,
41                 XMLPropertyState *pFontPitchState,
42                 XMLPropertyState *pFontCharsetState ) const;
43 
44     void FontDefaultsCheck(
45                 XMLPropertyState*pFontFamilyName,
46                 XMLPropertyState* pFontStyleName,
47                 XMLPropertyState* pFontFamily,
48                 XMLPropertyState* pFontPitch,
49                 XMLPropertyState* pFontCharSet,
50                 XMLPropertyState** ppNewFontStyleName,
51                 XMLPropertyState** ppNewFontFamily,
52                 XMLPropertyState** ppNewFontPitch,
53                 XMLPropertyState** ppNewFontCharSet ) const;
54 
55 protected:
56     virtual sal_Bool handleSpecialItem(
57             XMLPropertyState& rProperty,
58             ::std::vector< XMLPropertyState >& rProperties,
59             const ::rtl::OUString& rValue,
60             const SvXMLUnitConverter& rUnitConverter,
61             const SvXMLNamespaceMap& rNamespaceMap ) const;
62 public:
63     XMLTextImportPropertyMapper(
64             const UniReference< XMLPropertySetMapper >& rMapper,
65             SvXMLImport& rImport,
66             XMLFontStylesContext *pFontDecls = 0 );
67     virtual ~XMLTextImportPropertyMapper();
68 
69     void SetFontDecls( XMLFontStylesContext *pFontDecls );
70 
71     /** This method is called when all attributes have benn processed. It may be used to remove items that are incomplete */
72     virtual void finished(
73             ::std::vector< XMLPropertyState >& rProperties,
74             sal_Int32 nStartIndex, sal_Int32 nEndIndex ) const;
75 };
76 
77 #endif  //  _XMLOFF_XMLIMPPR_HXX
78