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 .
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/container/XIndexReplace.hpp>
24 #include <sal/types.h>
26 namespace com::sun::star
{
27 namespace text
{ class XTextContent
; }
30 class XMLTextListAutoStylePool
;
32 /** information about list and list style for a certain paragraph
34 OD 2008-04-24 #refactorlists#
35 Complete refactoring of the class and enhancement of the class for lists.
36 These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
38 class XMLTextNumRuleInfo
40 // numbering rules instance and its name
41 css::uno::Reference
< css::container::XIndexReplace
> mxNumRules
;
42 OUString msNumRulesName
;
44 // paragraph's list attributes
46 sal_Int16 mnListStartValue
;
47 sal_Int16 mnListLevel
;
51 // numbering rules' attributes
52 sal_Int16 mnListLevelStartValue
;
54 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
55 bool mbOutlineStyleAsNormalListStyle
;
57 bool mbContinueingPreviousSubTree
;
58 OUString msListLabelString
;
64 inline XMLTextNumRuleInfo
& operator=( const XMLTextNumRuleInfo
& rInfo
);
66 void Set( const css::uno::Reference
< css::text::XTextContent
> & rTextContent
,
67 const bool bOutlineStyleAsNormalListStyle
,
68 const XMLTextListAutoStylePool
& rListAutoPool
,
69 const bool bExportTextNumberElement
);
72 const OUString
& GetNumRulesName() const
74 return msNumRulesName
;
76 sal_Int16
GetListLevelStartValue() const
78 return mnListLevelStartValue
;
81 const OUString
& GetListId() const
86 sal_Int16
GetLevel() const
91 bool HasStartValue() const
93 return mnListStartValue
!= -1;
95 sal_uInt32
GetStartValue() const
97 return mnListStartValue
;
100 bool IsNumbered() const
104 bool IsRestart() const
109 bool BelongsToSameList( const XMLTextNumRuleInfo
& rCmp
) const;
111 bool IsContinueingPreviousSubTree() const
113 return mbContinueingPreviousSubTree
;
115 const OUString
& ListLabelString() const
117 return msListLabelString
;
121 inline XMLTextNumRuleInfo
& XMLTextNumRuleInfo::operator=(
122 const XMLTextNumRuleInfo
& rInfo
)
124 msNumRulesName
= rInfo
.msNumRulesName
;
125 mxNumRules
= rInfo
.mxNumRules
;
126 msListId
= rInfo
.msListId
;
127 mnListStartValue
= rInfo
.mnListStartValue
;
128 mnListLevel
= rInfo
.mnListLevel
;
129 mbIsNumbered
= rInfo
.mbIsNumbered
;
130 mbIsRestart
= rInfo
.mbIsRestart
;
131 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
132 mbOutlineStyleAsNormalListStyle
= rInfo
.mbOutlineStyleAsNormalListStyle
;
133 mbContinueingPreviousSubTree
= rInfo
.mbContinueingPreviousSubTree
;
134 msListLabelString
= rInfo
.msListLabelString
;
139 inline void XMLTextNumRuleInfo::Reset()
141 mxNumRules
= nullptr;
142 msNumRulesName
.clear();
144 mnListStartValue
= -1;
146 // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
147 mbIsNumbered
= mbIsRestart
=
148 mbOutlineStyleAsNormalListStyle
= false;
149 mbContinueingPreviousSubTree
= false;
150 msListLabelString
.clear();
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */