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 
24 #ifndef _XMLOFF_XMLINDEXTOCSTYLESCONTEXT_HXX_
25 #define _XMLOFF_XMLINDEXTOCSTYLESCONTEXT_HXX_
26 
27 #include <xmloff/xmlictxt.hxx>
28 #include <com/sun/star/uno/Reference.h>
29 
30 #ifndef __SGI_STL_VECTOR
31 #include <vector>
32 #endif
33 
34 
35 namespace com { namespace sun { namespace star {
36 	namespace xml { namespace sax { class XAttributeList; } }
37 	namespace beans { class XPropertySet; }
38 } } }
39 namespace rtl {	class OUString; }
40 
41 
42 /**
43  * Import <test:index-source-styles> elements and their children
44  *
45  * (Small hackery here: Because there's only one type of child
46  * elements with only one interesting attribute, we completely handle
47  * them inside the CreateChildContext method, rather than creating a
48  * new import class for them. This must be changed if children become
49  * more complex in future versions.)
50  */
51 class XMLIndexTOCStylesContext : public SvXMLImportContext
52 {
53 	const ::rtl::OUString sLevelParagraphStyles;
54 
55 	/// XPropertySet of the index
56 	::com::sun::star::uno::Reference<
57 		::com::sun::star::beans::XPropertySet> & rTOCPropertySet;
58 
59 	/// style names for this level
60 	::std::vector< ::rtl::OUString > aStyleNames;
61 
62 	/// outline level
63 	sal_Int32 nOutlineLevel;
64 
65 public:
66 
67 	TYPEINFO();
68 
69 	XMLIndexTOCStylesContext(
70 		SvXMLImport& rImport,
71 		::com::sun::star::uno::Reference<
72 			::com::sun::star::beans::XPropertySet> & rPropSet,
73 		sal_uInt16 nPrfx,
74 		const ::rtl::OUString& rLocalName );
75 
76 	~XMLIndexTOCStylesContext();
77 
78 protected:
79 
80 	virtual void StartElement(
81 		const ::com::sun::star::uno::Reference<
82 			::com::sun::star::xml::sax::XAttributeList> & xAttrList);
83 
84 	virtual void EndElement();
85 
86 	virtual SvXMLImportContext *CreateChildContext(
87 		sal_uInt16 nPrefix,
88 		const ::rtl::OUString& rLocalName,
89 		const ::com::sun::star::uno::Reference<
90 			::com::sun::star::xml::sax::XAttributeList> & xAttrList );
91 };
92 
93 #endif
94