1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XMLTextNumRuleInfo.hxx,v $
10 * $Revision: 1.10.64.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLOFF_XMLTEXTNUMRULEINFO_HXX
32 #define _XMLOFF_XMLTEXTNUMRULEINFO_HXX
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <com/sun/star/container/XIndexReplace.hpp>
36 #include <com/sun/star/style/NumberingType.hpp>
38 namespace com
{ namespace sun
{ namespace star
{
39 namespace text
{ class XTextContent
; }
41 #include <sal/types.h>
43 class XMLTextListAutoStylePool
;
45 /** information about list and list style for a certain paragraph
47 OD 2008-04-24 #refactorlists#
48 Complete refactoring of the class and enhancement of the class for lists.
49 These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
51 class XMLTextNumRuleInfo
53 const ::rtl::OUString msNumberingRules
;
54 const ::rtl::OUString msNumberingLevel
;
55 const ::rtl::OUString msNumberingStartValue
;
56 const ::rtl::OUString msNumberingType
;
57 const ::rtl::OUString msParaIsNumberingRestart
;
58 const ::rtl::OUString msNumberingIsNumber
;
59 const ::rtl::OUString msNumberingIsOutline
;
60 const ::rtl::OUString msPropNameListId
;
61 const ::rtl::OUString msPropNameStartWith
;
62 // --> OD 2008-11-26 #158694#
63 const ::rtl::OUString msContinueingPreviousSubTree
;
64 const ::rtl::OUString msListLabelStringProp
;
67 // numbering rules instance and its name
68 ::com::sun::star::uno::Reference
<
69 ::com::sun::star::container::XIndexReplace
> mxNumRules
;
70 ::rtl::OUString msNumRulesName
;
72 // paragraph's list attributes
73 ::rtl::OUString msListId
;
74 sal_Int16 mnListStartValue
;
75 sal_Int16 mnNumberingType
;
76 sal_Int16 mnListLevel
;
77 sal_Bool mbIsNumbered
;
80 // numbering rules' attributes
81 // --> OD 2008-05-07 #refactorlists#
82 sal_Int16 mnListLevelStartValue
;
85 // --> OD 2006-09-27 #i69627#
86 sal_Bool mbOutlineStyleAsNormalListStyle
;
89 // --> OD 2008-11-26 #158694#
90 sal_Bool mbContinueingPreviousSubTree
;
91 ::rtl::OUString msListLabelString
;
97 inline XMLTextNumRuleInfo
& operator=( const XMLTextNumRuleInfo
& rInfo
);
99 // --> OD 2008-11-26 #158694#
100 void Set( const ::com::sun::star::uno::Reference
<
101 ::com::sun::star::text::XTextContent
> & rTextContnt
,
102 const sal_Bool bOutlineStyleAsNormalListStyle
,
103 const XMLTextListAutoStylePool
& rListAutoPool
,
104 const sal_Bool bExportTextNumberElement
);
108 inline const ::rtl::OUString
& GetNumRulesName() const
110 return msNumRulesName
;
112 inline const ::com::sun::star::uno::Reference
<
113 ::com::sun::star::container::XIndexReplace
>& GetNumRules() const
117 inline sal_Int16
GetListLevelStartValue() const
119 return mnListLevelStartValue
;
122 inline const ::rtl::OUString
& GetListId() const
127 inline sal_Int16
GetLevel() const
132 inline sal_Bool
HasStartValue() const
134 return mnListStartValue
!= -1;
136 inline sal_uInt32
GetStartValue() const
138 return mnListStartValue
;
141 inline sal_Bool
IsNumbered() const
145 inline sal_Bool
IsRestart() const
150 /** Compare num rules
152 @param rCmp other numrule to compare with
153 @param bIgnoreFormatting when true, different list styles still compare equal
155 sal_Bool
BelongsToSameList( const XMLTextNumRuleInfo
& rCmp
, bool bIgnoreFormatting
) const;
157 inline sal_Bool
HasSameNumRules( const XMLTextNumRuleInfo
& rCmp
) const
159 return rCmp
.msNumRulesName
== msNumRulesName
;
162 // --> OD 2008-11-26 #158694#
163 inline sal_Bool
IsContinueingPreviousSubTree() const
165 return mbContinueingPreviousSubTree
;
167 inline const ::rtl::OUString
& ListLabelString() const
169 return msListLabelString
;
174 inline XMLTextNumRuleInfo
& XMLTextNumRuleInfo::operator=(
175 const XMLTextNumRuleInfo
& rInfo
)
177 msNumRulesName
= rInfo
.msNumRulesName
;
178 mxNumRules
= rInfo
.mxNumRules
;
179 msListId
= rInfo
.msListId
;
180 mnListStartValue
= rInfo
.mnListStartValue
;
181 mnNumberingType
= rInfo
.mnNumberingType
;
182 mnListLevel
= rInfo
.mnListLevel
;
183 mbIsNumbered
= rInfo
.mbIsNumbered
;
184 mbIsRestart
= rInfo
.mbIsRestart
;
185 // --> OD 2006-09-27 #i69627#
186 mbOutlineStyleAsNormalListStyle
= rInfo
.mbOutlineStyleAsNormalListStyle
;
188 // --> OD 2008-11-26 #158694#
189 mbContinueingPreviousSubTree
= rInfo
.mbContinueingPreviousSubTree
;
190 msListLabelString
= rInfo
.msListLabelString
;
196 inline void XMLTextNumRuleInfo::Reset()
199 msNumRulesName
= ::rtl::OUString();
200 msListId
= ::rtl::OUString();
201 mnListStartValue
= -1;
202 mnNumberingType
= ::com::sun::star::style::NumberingType::CHAR_SPECIAL
;
204 // --> OD 2006-09-27 #i69627#
205 mbIsNumbered
= mbIsRestart
=
206 mbOutlineStyleAsNormalListStyle
= sal_False
;
208 // --> OD 2008-11-26 #158694#
209 mbContinueingPreviousSubTree
= sal_False
;
210 msListLabelString
= ::rtl::OUString();
213 #endif // _XMLOFF_XMLTEXTNUMRULEINFO_HXX