Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : : #ifndef _XMLOFF_XMLTEXTNUMRULEINFO_HXX
21 : : #define _XMLOFF_XMLTEXTNUMRULEINFO_HXX
22 : :
23 : : #include <com/sun/star/uno/Reference.hxx>
24 : : #include <com/sun/star/container/XIndexReplace.hpp>
25 : :
26 : : namespace com { namespace sun { namespace star {
27 : : namespace text { class XTextContent; }
28 : : } } }
29 : : #include <sal/types.h>
30 : :
31 : : class XMLTextListAutoStylePool;
32 : :
33 : : /** information about list and list style for a certain paragraph
34 : :
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(..)>
38 : : */
39 : 502 : class XMLTextNumRuleInfo
40 : : {
41 : : const ::rtl::OUString msNumberingRules;
42 : : const ::rtl::OUString msNumberingLevel;
43 : : const ::rtl::OUString msNumberingStartValue;
44 : : const ::rtl::OUString msParaIsNumberingRestart;
45 : : const ::rtl::OUString msNumberingIsNumber;
46 : : const ::rtl::OUString msNumberingIsOutline;
47 : : const ::rtl::OUString msPropNameListId;
48 : : const ::rtl::OUString msPropNameStartWith;
49 : : const ::rtl::OUString msContinueingPreviousSubTree;
50 : : const ::rtl::OUString msListLabelStringProp;
51 : :
52 : : // numbering rules instance and its name
53 : : ::com::sun::star::uno::Reference <
54 : : ::com::sun::star::container::XIndexReplace > mxNumRules;
55 : : ::rtl::OUString msNumRulesName;
56 : :
57 : : // paragraph's list attributes
58 : : ::rtl::OUString msListId;
59 : : sal_Int16 mnListStartValue;
60 : : sal_Int16 mnListLevel;
61 : : sal_Bool mbIsNumbered;
62 : : sal_Bool mbIsRestart;
63 : :
64 : : // numbering rules' attributes
65 : : sal_Int16 mnListLevelStartValue;
66 : :
67 : : // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
68 : : sal_Bool mbOutlineStyleAsNormalListStyle;
69 : :
70 : : sal_Bool mbContinueingPreviousSubTree;
71 : : ::rtl::OUString msListLabelString;
72 : :
73 : : public:
74 : :
75 : : XMLTextNumRuleInfo();
76 : :
77 : : inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
78 : :
79 : : void Set( const ::com::sun::star::uno::Reference <
80 : : ::com::sun::star::text::XTextContent > & rTextContnt,
81 : : const sal_Bool bOutlineStyleAsNormalListStyle,
82 : : const XMLTextListAutoStylePool& rListAutoPool,
83 : : const sal_Bool bExportTextNumberElement );
84 : : inline void Reset();
85 : :
86 : 0 : inline const ::rtl::OUString& GetNumRulesName() const
87 : : {
88 : 0 : return msNumRulesName;
89 : : }
90 : : inline const ::com::sun::star::uno::Reference <
91 : : ::com::sun::star::container::XIndexReplace >& GetNumRules() const
92 : : {
93 : : return mxNumRules;
94 : : }
95 : 0 : inline sal_Int16 GetListLevelStartValue() const
96 : : {
97 : 0 : return mnListLevelStartValue;
98 : : }
99 : :
100 : 0 : inline const ::rtl::OUString& GetListId() const
101 : : {
102 : 0 : return msListId;
103 : : }
104 : :
105 : 1098 : inline sal_Int16 GetLevel() const
106 : : {
107 : 1098 : return mnListLevel;
108 : : }
109 : :
110 : 0 : inline sal_Bool HasStartValue() const
111 : : {
112 : 0 : return mnListStartValue != -1;
113 : : }
114 : 0 : inline sal_uInt32 GetStartValue() const
115 : : {
116 : 0 : return mnListStartValue;
117 : : }
118 : :
119 : 0 : inline sal_Bool IsNumbered() const
120 : : {
121 : 0 : return mbIsNumbered;
122 : : }
123 : 0 : inline sal_Bool IsRestart() const
124 : : {
125 : 0 : return mbIsRestart;
126 : : }
127 : :
128 : : sal_Bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
129 : :
130 : 0 : inline sal_Bool HasSameNumRules( const XMLTextNumRuleInfo& rCmp ) const
131 : : {
132 : 0 : return rCmp.msNumRulesName == msNumRulesName;
133 : : }
134 : :
135 : 0 : inline sal_Bool IsContinueingPreviousSubTree() const
136 : : {
137 : 0 : return mbContinueingPreviousSubTree;
138 : : }
139 : 0 : inline const ::rtl::OUString& ListLabelString() const
140 : : {
141 : 0 : return msListLabelString;
142 : : }
143 : : };
144 : :
145 : 244 : inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
146 : : const XMLTextNumRuleInfo& rInfo )
147 : : {
148 : 244 : msNumRulesName = rInfo.msNumRulesName;
149 : 244 : mxNumRules = rInfo.mxNumRules;
150 : 244 : msListId = rInfo.msListId;
151 : 244 : mnListStartValue = rInfo.mnListStartValue;
152 : 244 : mnListLevel = rInfo.mnListLevel;
153 : 244 : mbIsNumbered = rInfo.mbIsNumbered;
154 : 244 : mbIsRestart = rInfo.mbIsRestart;
155 : : // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
156 : 244 : mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle;
157 : 244 : mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree;
158 : 244 : msListLabelString = rInfo.msListLabelString;
159 : :
160 : 244 : return *this;
161 : : }
162 : :
163 : 837 : inline void XMLTextNumRuleInfo::Reset()
164 : : {
165 : 837 : mxNumRules = 0;
166 : 837 : msNumRulesName = ::rtl::OUString();
167 : 837 : msListId = ::rtl::OUString();
168 : 837 : mnListStartValue = -1;
169 : 837 : mnListLevel = 0;
170 : : // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
171 : : mbIsNumbered = mbIsRestart =
172 : 837 : mbOutlineStyleAsNormalListStyle = sal_False;
173 : 837 : mbContinueingPreviousSubTree = sal_False;
174 : 837 : msListLabelString = ::rtl::OUString();
175 : 837 : }
176 : : #endif // _XMLOFF_XMLTEXTNUMRULEINFO_HXX
177 : :
178 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|