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 _XMLTEXTLISTBLOCKCONTEXT_HXX
25 #define _XMLTEXTLISTBLOCKCONTEXT_HXX
26 
27 #include <com/sun/star/container/XIndexReplace.hpp>
28 #include <xmloff/xmlictxt.hxx>
29 
30 class XMLTextImportHelper;
31 
32 class XMLTextListBlockContext : public SvXMLImportContext
33 {
34     XMLTextImportHelper&    mrTxtImport;
35 
36 	::com::sun::star::uno::Reference<
37                 ::com::sun::star::container::XIndexReplace > mxNumRules;
38 
39     // text:style-name property of <list> element
40     ::rtl::OUString         msListStyleName;
41 	::rtl::OUString			sXmlId;
42 
43     SvXMLImportContextRef   mxParentListBlock;
44 
45     sal_Int16               mnLevel;
46     sal_Bool                mbRestartNumbering;
47     sal_Bool                mbSetDefaults;
48 
49     // --> OD 2008-04-22 #refactorlists#
50     // text:id property of <list> element, only valid for root <list> element
51     ::rtl::OUString msListId;
52     // text:continue-list property of <list> element, only valid for root <list> element
53     ::rtl::OUString msContinueListId;
54     // <--
55 
56 public:
57 
58 	TYPEINFO();
59 
60     // --> OD 2008-05-07 #refactorlists#
61     // add optional parameter <bRestartNumberingAtSubList>
62     XMLTextListBlockContext(
63                 SvXMLImport& rImport,
64                 XMLTextImportHelper& rTxtImp,
65                 sal_uInt16 nPrfx,
66                 const ::rtl::OUString& rLName,
67                 const ::com::sun::star::uno::Reference<
68                     ::com::sun::star::xml::sax::XAttributeList > & xAttrList,
69                 const sal_Bool bRestartNumberingAtSubList = sal_False );
70     // <--
71 	virtual ~XMLTextListBlockContext();
72 
73 	virtual void EndElement();
74 
75 	SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
76 				const ::rtl::OUString& rLocalName,
77 			 	const ::com::sun::star::uno::Reference<
78 					::com::sun::star::xml::sax::XAttributeList > & xAttrList );
79 
GetListStyleName() const80     const ::rtl::OUString& GetListStyleName() const { return msListStyleName; }
GetLevel() const81     sal_Int16 GetLevel() const { return mnLevel; }
IsRestartNumbering() const82     sal_Bool IsRestartNumbering() const { return mbRestartNumbering; }
ResetRestartNumbering()83     void ResetRestartNumbering() { mbRestartNumbering = sal_False; }
84 
85 	const ::com::sun::star::uno::Reference <
GetNumRules() const86 		::com::sun::star::container::XIndexReplace >& GetNumRules() const
87         { return mxNumRules; }
88 
89     // --> OD 2008-04-22 #refactorlists#
90     const ::rtl::OUString& GetListId() const;
91     const ::rtl::OUString& GetContinueListId() const;
92     // <--
93 
94 };
95 
96 
97 #endif
98