1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
21 #define INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/container/XIndexReplace.hpp>
26 namespace com
{ namespace sun
{ namespace star
{
27 namespace text
{ class XTextContent
; }
29 #include <sal/types.h>
31 class XMLTextListAutoStylePool
;
33 /** information about list and list style for a certain paragraph
35 OD 2008-04-24 #refactorlists#
36 Complete refactoring of the class and enhancement of the class for lists.
37 These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
39 class XMLTextNumRuleInfo
41 const OUString msNumberingRules
;
42 const OUString msNumberingLevel
;
43 const OUString msNumberingStartValue
;
44 const OUString msParaIsNumberingRestart
;
45 const OUString msNumberingIsNumber
;
46 const OUString msNumberingIsOutline
;
47 const OUString msPropNameListId
;
48 const OUString msPropNameStartWith
;
49 const OUString msContinueingPreviousSubTree
;
50 const OUString msListLabelStringProp
;
52 // numbering rules instance and its name
53 ::com::sun::star::uno::Reference
<
54 ::com::sun::star::container::XIndexReplace
> mxNumRules
;
55 OUString msNumRulesName
;
57 // paragraph's list attributes
59 sal_Int16 mnListStartValue
;
60 sal_Int16 mnListLevel
;
64 // numbering rules' attributes
65 sal_Int16 mnListLevelStartValue
;
67 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
68 bool mbOutlineStyleAsNormalListStyle
;
70 bool mbContinueingPreviousSubTree
;
71 OUString msListLabelString
;
77 inline XMLTextNumRuleInfo
& operator=( const XMLTextNumRuleInfo
& rInfo
);
79 void Set( const ::com::sun::star::uno::Reference
<
80 ::com::sun::star::text::XTextContent
> & rTextContnt
,
81 const bool bOutlineStyleAsNormalListStyle
,
82 const XMLTextListAutoStylePool
& rListAutoPool
,
83 const bool bExportTextNumberElement
);
86 inline const OUString
& GetNumRulesName() const
88 return msNumRulesName
;
90 inline const ::com::sun::star::uno::Reference
<
91 ::com::sun::star::container::XIndexReplace
>& GetNumRules() const
95 inline sal_Int16
GetListLevelStartValue() const
97 return mnListLevelStartValue
;
100 inline const OUString
& GetListId() const
105 inline sal_Int16
GetLevel() const
110 inline bool HasStartValue() const
112 return mnListStartValue
!= -1;
114 inline sal_uInt32
GetStartValue() const
116 return mnListStartValue
;
119 inline bool IsNumbered() const
123 inline bool IsRestart() const
128 bool BelongsToSameList( const XMLTextNumRuleInfo
& rCmp
) const;
130 inline bool HasSameNumRules( const XMLTextNumRuleInfo
& rCmp
) const
132 return rCmp
.msNumRulesName
== msNumRulesName
;
135 inline bool IsContinueingPreviousSubTree() const
137 return mbContinueingPreviousSubTree
;
139 inline const OUString
& ListLabelString() const
141 return msListLabelString
;
145 inline XMLTextNumRuleInfo
& XMLTextNumRuleInfo::operator=(
146 const XMLTextNumRuleInfo
& rInfo
)
148 msNumRulesName
= rInfo
.msNumRulesName
;
149 mxNumRules
= rInfo
.mxNumRules
;
150 msListId
= rInfo
.msListId
;
151 mnListStartValue
= rInfo
.mnListStartValue
;
152 mnListLevel
= rInfo
.mnListLevel
;
153 mbIsNumbered
= rInfo
.mbIsNumbered
;
154 mbIsRestart
= rInfo
.mbIsRestart
;
155 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
156 mbOutlineStyleAsNormalListStyle
= rInfo
.mbOutlineStyleAsNormalListStyle
;
157 mbContinueingPreviousSubTree
= rInfo
.mbContinueingPreviousSubTree
;
158 msListLabelString
= rInfo
.msListLabelString
;
163 inline void XMLTextNumRuleInfo::Reset()
166 msNumRulesName
.clear();
168 mnListStartValue
= -1;
170 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
171 mbIsNumbered
= mbIsRestart
=
172 mbOutlineStyleAsNormalListStyle
= false;
173 mbContinueingPreviousSubTree
= false;
174 msListLabelString
.clear();
176 #endif // INCLUDED_XMLOFF_SOURCE_TEXT_XMLTEXTNUMRULEINFO_HXX
178 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */