1*ecfe53c5SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ecfe53c5SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ecfe53c5SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ecfe53c5SAndrew Rist  * distributed with this work for additional information
6*ecfe53c5SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ecfe53c5SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ecfe53c5SAndrew Rist  * "License"); you may not use this file except in compliance
9*ecfe53c5SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*ecfe53c5SAndrew Rist  *
11*ecfe53c5SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*ecfe53c5SAndrew Rist  *
13*ecfe53c5SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ecfe53c5SAndrew Rist  * software distributed under the License is distributed on an
15*ecfe53c5SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ecfe53c5SAndrew Rist  * KIND, either express or implied.  See the License for the
17*ecfe53c5SAndrew Rist  * specific language governing permissions and limitations
18*ecfe53c5SAndrew Rist  * under the License.
19*ecfe53c5SAndrew Rist  *
20*ecfe53c5SAndrew Rist  *************************************************************/
21*ecfe53c5SAndrew Rist 
22*ecfe53c5SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _XMLOFF_XMLTEXTNUMRULEINFO_HXX
25cdf0e10cSrcweir #define _XMLOFF_XMLTEXTNUMRULEINFO_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
28cdf0e10cSrcweir #include <com/sun/star/container/XIndexReplace.hpp>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace com { namespace sun { namespace star {
31cdf0e10cSrcweir 	namespace text { class XTextContent; }
32cdf0e10cSrcweir } } }
33cdf0e10cSrcweir #include <sal/types.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class XMLTextListAutoStylePool;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir /** information about list and list style for a certain paragraph
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     OD 2008-04-24 #refactorlists#
40cdf0e10cSrcweir     Complete refactoring of the class and enhancement of the class for lists.
41cdf0e10cSrcweir     These changes are considered by method <XMLTextParagraphExport::exportListChange(..)>
42cdf0e10cSrcweir */
43cdf0e10cSrcweir class XMLTextNumRuleInfo
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     const ::rtl::OUString msNumberingRules;
46cdf0e10cSrcweir     const ::rtl::OUString msNumberingLevel;
47cdf0e10cSrcweir     const ::rtl::OUString msNumberingStartValue;
48cdf0e10cSrcweir     const ::rtl::OUString msParaIsNumberingRestart;
49cdf0e10cSrcweir     const ::rtl::OUString msNumberingIsNumber;
50cdf0e10cSrcweir     const ::rtl::OUString msNumberingIsOutline;
51cdf0e10cSrcweir     const ::rtl::OUString msPropNameListId;
52cdf0e10cSrcweir     const ::rtl::OUString msPropNameStartWith;
53cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
54cdf0e10cSrcweir     const ::rtl::OUString msContinueingPreviousSubTree;
55cdf0e10cSrcweir     const ::rtl::OUString msListLabelStringProp;
56cdf0e10cSrcweir     // <--
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     // numbering rules instance and its name
59cdf0e10cSrcweir     ::com::sun::star::uno::Reference <
60cdf0e10cSrcweir                         ::com::sun::star::container::XIndexReplace > mxNumRules;
61cdf0e10cSrcweir     ::rtl::OUString     msNumRulesName;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // paragraph's list attributes
64cdf0e10cSrcweir     ::rtl::OUString     msListId;
65cdf0e10cSrcweir     sal_Int16           mnListStartValue;
66cdf0e10cSrcweir     sal_Int16           mnListLevel;
67cdf0e10cSrcweir     sal_Bool            mbIsNumbered;
68cdf0e10cSrcweir     sal_Bool            mbIsRestart;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir     // numbering rules' attributes
71cdf0e10cSrcweir     // --> OD 2008-05-07 #refactorlists#
72cdf0e10cSrcweir     sal_Int16           mnListLevelStartValue;
73cdf0e10cSrcweir     // <--
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     // --> OD 2006-09-27 #i69627#
76cdf0e10cSrcweir     sal_Bool mbOutlineStyleAsNormalListStyle;
77cdf0e10cSrcweir     // <--
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
80cdf0e10cSrcweir     sal_Bool mbContinueingPreviousSubTree;
81cdf0e10cSrcweir     ::rtl::OUString msListLabelString;
82cdf0e10cSrcweir     // <--
83cdf0e10cSrcweir public:
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	XMLTextNumRuleInfo();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo );
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
90cdf0e10cSrcweir     void Set( const ::com::sun::star::uno::Reference <
91cdf0e10cSrcweir                         ::com::sun::star::text::XTextContent > & rTextContnt,
92cdf0e10cSrcweir               const sal_Bool bOutlineStyleAsNormalListStyle,
93cdf0e10cSrcweir               const XMLTextListAutoStylePool& rListAutoPool,
94cdf0e10cSrcweir               const sal_Bool bExportTextNumberElement );
95cdf0e10cSrcweir     // <--
96cdf0e10cSrcweir 	inline void Reset();
97cdf0e10cSrcweir 
GetNumRulesName() const98cdf0e10cSrcweir     inline const ::rtl::OUString& GetNumRulesName() const
99cdf0e10cSrcweir     {
100cdf0e10cSrcweir         return msNumRulesName;
101cdf0e10cSrcweir     }
102cdf0e10cSrcweir     inline const ::com::sun::star::uno::Reference <
GetNumRules() const103cdf0e10cSrcweir 		::com::sun::star::container::XIndexReplace >& GetNumRules() const
104cdf0e10cSrcweir     {
105cdf0e10cSrcweir         return mxNumRules;
106cdf0e10cSrcweir     }
GetListLevelStartValue() const107cdf0e10cSrcweir     inline sal_Int16 GetListLevelStartValue() const
108cdf0e10cSrcweir     {
109cdf0e10cSrcweir         return mnListLevelStartValue;
110cdf0e10cSrcweir     }
111cdf0e10cSrcweir 
GetListId() const112cdf0e10cSrcweir     inline const ::rtl::OUString& GetListId() const
113cdf0e10cSrcweir     {
114cdf0e10cSrcweir         return msListId;
115cdf0e10cSrcweir     }
116cdf0e10cSrcweir 
GetLevel() const117cdf0e10cSrcweir     inline sal_Int16 GetLevel() const
118cdf0e10cSrcweir     {
119cdf0e10cSrcweir         return mnListLevel;
120cdf0e10cSrcweir     }
121cdf0e10cSrcweir 
HasStartValue() const122cdf0e10cSrcweir     inline sal_Bool HasStartValue() const
123cdf0e10cSrcweir     {
124cdf0e10cSrcweir         return mnListStartValue != -1;
125cdf0e10cSrcweir     }
GetStartValue() const126cdf0e10cSrcweir     inline sal_uInt32 GetStartValue() const
127cdf0e10cSrcweir     {
128cdf0e10cSrcweir         return mnListStartValue;
129cdf0e10cSrcweir     }
130cdf0e10cSrcweir 
IsNumbered() const131cdf0e10cSrcweir     inline sal_Bool IsNumbered() const
132cdf0e10cSrcweir     {
133cdf0e10cSrcweir         return mbIsNumbered;
134cdf0e10cSrcweir     }
IsRestart() const135cdf0e10cSrcweir     inline sal_Bool IsRestart() const
136cdf0e10cSrcweir     {
137cdf0e10cSrcweir         return mbIsRestart;
138cdf0e10cSrcweir     }
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     sal_Bool BelongsToSameList( const XMLTextNumRuleInfo& rCmp ) const;
141cdf0e10cSrcweir 
HasSameNumRules(const XMLTextNumRuleInfo & rCmp) const142cdf0e10cSrcweir     inline sal_Bool HasSameNumRules( const XMLTextNumRuleInfo& rCmp ) const
143cdf0e10cSrcweir     {
144cdf0e10cSrcweir         return rCmp.msNumRulesName == msNumRulesName;
145cdf0e10cSrcweir     }
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
IsContinueingPreviousSubTree() const148cdf0e10cSrcweir     inline sal_Bool IsContinueingPreviousSubTree() const
149cdf0e10cSrcweir     {
150cdf0e10cSrcweir         return mbContinueingPreviousSubTree;
151cdf0e10cSrcweir     }
ListLabelString() const152cdf0e10cSrcweir     inline const ::rtl::OUString& ListLabelString() const
153cdf0e10cSrcweir     {
154cdf0e10cSrcweir         return msListLabelString;
155cdf0e10cSrcweir     }
156cdf0e10cSrcweir     // <--
157cdf0e10cSrcweir };
158cdf0e10cSrcweir 
operator =(const XMLTextNumRuleInfo & rInfo)159cdf0e10cSrcweir inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
160cdf0e10cSrcweir 		const XMLTextNumRuleInfo& rInfo )
161cdf0e10cSrcweir {
162cdf0e10cSrcweir     msNumRulesName = rInfo.msNumRulesName;
163cdf0e10cSrcweir     mxNumRules = rInfo.mxNumRules;
164cdf0e10cSrcweir     msListId = rInfo.msListId;
165cdf0e10cSrcweir     mnListStartValue = rInfo.mnListStartValue;
166cdf0e10cSrcweir     mnListLevel = rInfo.mnListLevel;
167cdf0e10cSrcweir     mbIsNumbered = rInfo.mbIsNumbered;
168cdf0e10cSrcweir     mbIsRestart = rInfo.mbIsRestart;
169cdf0e10cSrcweir     // --> OD 2006-09-27 #i69627#
170cdf0e10cSrcweir     mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle;
171cdf0e10cSrcweir     // <--
172cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
173cdf0e10cSrcweir     mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree;
174cdf0e10cSrcweir     msListLabelString = rInfo.msListLabelString;
175cdf0e10cSrcweir     // <--
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	return *this;
178cdf0e10cSrcweir }
179cdf0e10cSrcweir 
Reset()180cdf0e10cSrcweir inline void XMLTextNumRuleInfo::Reset()
181cdf0e10cSrcweir {
182cdf0e10cSrcweir     mxNumRules = 0;
183cdf0e10cSrcweir     msNumRulesName = ::rtl::OUString();
184cdf0e10cSrcweir     msListId = ::rtl::OUString();
185cdf0e10cSrcweir     mnListStartValue = -1;
186cdf0e10cSrcweir     mnListLevel = 0;
187cdf0e10cSrcweir     // --> OD 2006-09-27 #i69627#
188cdf0e10cSrcweir     mbIsNumbered = mbIsRestart =
189cdf0e10cSrcweir     mbOutlineStyleAsNormalListStyle = sal_False;
190cdf0e10cSrcweir     // <--
191cdf0e10cSrcweir     // --> OD 2008-11-26 #158694#
192cdf0e10cSrcweir     mbContinueingPreviousSubTree = sal_False;
193cdf0e10cSrcweir     msListLabelString = ::rtl::OUString();
194cdf0e10cSrcweir     // <--
195cdf0e10cSrcweir }
196cdf0e10cSrcweir #endif	//  _XMLOFF_XMLTEXTNUMRULEINFO_HXX
197