xref: /aoo42x/main/xmloff/inc/xmloff/xmlnumi.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XMLOFF_XMLNUMI_HXX
29 #define _XMLOFF_XMLNUMI_HXX
30 
31 #include <com/sun/star/container/XIndexReplace.hpp>
32 
33 #include <xmloff/xmlstyle.hxx>
34 #include <com/sun/star/style/NumberingType.hpp>
35 
36 namespace com { namespace sun { namespace star { namespace frame { class XModel; } } } }
37 class SvI18NMap;
38 class SvxXMLListStyle_Impl;
39 
40 class SvxXMLListStyleContext : public SvXMLStyleContext
41 {
42 	const ::rtl::OUString		sIsPhysical;
43 	const ::rtl::OUString		sNumberingRules;
44 	const ::rtl::OUString		sName;
45 	const ::rtl::OUString		sIsContinuousNumbering;
46 
47 	::com::sun::star::uno::Reference <
48 		::com::sun::star::container::XIndexReplace > xNumRules;
49 
50 	SvxXMLListStyle_Impl		*pLevelStyles;
51 
52 	sal_Int32					nLevels;
53 	sal_Bool					bConsecutive : 1;
54 	sal_Bool					bOutline : 1;
55 
56 protected:
57 
58 	virtual void SetAttribute( sal_uInt16 nPrefixKey,
59 							   const ::rtl::OUString& rLocalName,
60 							   const ::rtl::OUString& rValue );
61 
62 public:
63 
64 	TYPEINFO();
65 
66 	SvxXMLListStyleContext(
67 			SvXMLImport& rImport, sal_uInt16 nPrfx,
68 			const ::rtl::OUString& rLName,
69 			const ::com::sun::star::uno::Reference<
70 					::com::sun::star::xml::sax::XAttributeList >& xAttrList,
71 			sal_Bool bOutl=sal_False );
72 
73 	virtual ~SvxXMLListStyleContext();
74 
75 	virtual SvXMLImportContext *CreateChildContext(
76 			sal_uInt16 nPrefix,
77 			const ::rtl::OUString& rLocalName,
78 			const ::com::sun::star::uno::Reference<
79 					::com::sun::star::xml::sax::XAttributeList >& xAttrList );
80 
81 	void FillUnoNumRule(
82 			const ::com::sun::star::uno::Reference<
83 					::com::sun::star::container::XIndexReplace > & rNumRule,
84 			const SvI18NMap *pI18NMap ) const;
85 
86 	const ::com::sun::star::uno::Reference <
87 		::com::sun::star::container::XIndexReplace >& GetNumRules() const
88 		{ return xNumRules; }
89 	sal_Bool IsOutline() const { return bOutline; }
90 	sal_Bool IsConsecutive() const { return bConsecutive; }
91 	sal_Int32 GetLevels() const { return nLevels; }
92 
93 	static ::com::sun::star::uno::Reference <
94 		::com::sun::star::container::XIndexReplace >
95 	CreateNumRule(
96 		const ::com::sun::star::uno::Reference <
97 			::com::sun::star::frame::XModel > & rModel );
98 
99 	static void SetDefaultStyle(
100 		const ::com::sun::star::uno::Reference <
101 			::com::sun::star::container::XIndexReplace > & rNumRule,
102 		sal_Int16 nLevel,
103 		sal_Bool bOrdered );
104 
105 	virtual void CreateAndInsertLate( sal_Bool bOverwrite );
106 
107 	void CreateAndInsertAuto() const;
108 };
109 
110 #endif	//  _XMLOFF_XMLNUMI_HXX
111 
112