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_XMLFONTSTYLESCONTEXT_HXX_
24 #define _XMLOFF_XMLFONTSTYLESCONTEXT_HXX_
25 
26 #include "sal/config.h"
27 #include "xmloff/dllapi.h"
28 
29 #ifndef __SGI_STL_VECTOR
30 #include <vector>
31 #endif
32 
33 #ifndef _XMLOFF_XMLSTYLE_HXX_
34 #include <xmloff/xmlstyle.hxx>
35 #endif
36 
37 struct XMLPropertyState;
38 class SvXMLTokenMap;
39 class XMLFontFamilyNamePropHdl;
40 class XMLFontFamilyPropHdl;
41 class XMLFontPitchPropHdl;
42 class XMLFontEncodingPropHdl;
43 
44 class XMLOFF_DLLPUBLIC XMLFontStylesContext : public SvXMLStylesContext
45 {
46 	XMLFontFamilyNamePropHdl 	*pFamilyNameHdl;
47 	XMLFontFamilyPropHdl 		*pFamilyHdl;
48 	XMLFontPitchPropHdl 		*pPitchHdl;
49 	XMLFontEncodingPropHdl 		*pEncHdl;
50 
51 	SvXMLTokenMap			*pFontStyleAttrTokenMap;
52 
53 	rtl_TextEncoding		eDfltEncoding;
54 
55 protected:
56 
57 	virtual SvXMLStyleContext *CreateStyleChildContext( sal_uInt16 nPrefix,
58 		const ::rtl::OUString& rLocalName,
59 		const ::com::sun::star::uno::Reference<
60 			::com::sun::star::xml::sax::XAttributeList > & xAttrList );
61 
62 public:
63 
64 	TYPEINFO();
65 
66 	XMLFontStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
67 			const ::rtl::OUString& rLName,
68 			const ::com::sun::star::uno::Reference<
69 				::com::sun::star::xml::sax::XAttributeList > & xAttrList,
70 			rtl_TextEncoding eDfltEnc );
71 	virtual ~XMLFontStylesContext();
72 
GetFontStyleAttrTokenMap() const73 	const SvXMLTokenMap& GetFontStyleAttrTokenMap() const
74 	{
75 		return *pFontStyleAttrTokenMap;
76 	}
77 
78 	sal_Bool FillProperties( const ::rtl::OUString& rName,
79 						 ::std::vector< XMLPropertyState > &rProps,
80 						 sal_Int32 nFamilyNameIdx,
81 						 sal_Int32 nStyleNameIdx,
82 						 sal_Int32 nFamilyIdx,
83 						 sal_Int32 nPitchIdx,
84 						 sal_Int32 nCharsetIdx ) const;
85 
GetDfltCharset() const86 	rtl_TextEncoding GetDfltCharset() const { return eDfltEncoding; }
87 
GetFamilyNameHdl() const88 	XMLFontFamilyNamePropHdl& GetFamilyNameHdl() const { return *pFamilyNameHdl; }
GetFamilyHdl() const89 	XMLFontFamilyPropHdl& GetFamilyHdl() const { return *pFamilyHdl; }
GetPitchHdl() const90 	XMLFontPitchPropHdl& GetPitchHdl() const { return *pPitchHdl; }
GetEncodingHdl() const91 	XMLFontEncodingPropHdl& GetEncodingHdl() const { return *pEncHdl; }
92 
93 };
94 
95 #endif
96