bump product version to 4.1.6.2
[LibreOffice.git] / lotuswordpro / source / filter / lwppara.hxx
blob37dab63f6b9c29cd251bbc6fe37d03ba6368876f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
12 * GNU Lesser General Public License Version 2.1
13 * =============================================
14 * Copyright 2000 by Sun Microsystems, Inc.
15 * 901 San Antonio Road, Palo Alto, CA 94303, USA
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License version 2.1, as published by the Free Software Foundation.
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
26 * You should have received a copy of the GNU Lesser General Public
27 * License along with this library; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
32 * Sun Industry Standards Source License Version 1.1
33 * =================================================
34 * The contents of this file are subject to the Sun Industry Standards
35 * Source License Version 1.1 (the "License"); You may not use this file
36 * except in compliance with the License. You may obtain a copy of the
37 * License at http://www.openoffice.org/license.html.
39 * Software provided under this License is provided on an "AS IS" basis,
40 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 * See the License for the specific provisions governing your rights and
44 * obligations concerning the Software.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /*************************************************************************
57 * @file
58 * LwpPara: Word Pro object for paragraph
59 ************************************************************************/
60 /*************************************************************************
61 * Change History
62 Jan 2005 Created
63 ************************************************************************/
66 #ifndef _LWPPARAGRAPH_HXX_
67 #define _LWPPARAGRAPH_HXX_
69 #include <boost/scoped_ptr.hpp>
71 #include "lwpfribheader.hxx"
72 #include "lwpobj.hxx"
73 #include "lwpobjstrm.hxx"
75 #include <vector>
76 #include "lwpheader.hxx"
77 #include "lwpdlvlist.hxx"
78 #include "lwpbasetype.hxx"
79 #include "lwpoverride.hxx"
80 #include "lwpfoundry.hxx"
81 #include "lwplayout.hxx"
82 #include "lwpfrib.hxx"
83 #include "lwpfribptr.hxx"
84 #include "lwpfribtext.hxx"
85 #include "xfilter/xfparagraph.hxx"
86 #include "xfilter/xfdefs.hxx"
87 #include "xfilter/xfparastyle.hxx"
88 #include "xfilter/xfsection.hxx"
90 class LwpParaProperty;
91 class LwpPara;
92 class LwpBreaksOverride;
93 class LwpBulletStyleMgr;
94 class LwpNotifyListPersistent
96 public:
97 LwpNotifyListPersistent(){}
98 void Read(LwpObjectStream* pObjStrm);
99 protected:
100 LwpObjectID m_Head;
103 class LwpForked3NotifyList
105 public:
106 LwpForked3NotifyList(){}
107 protected:
108 LwpNotifyListPersistent m_ExtraList;
109 LwpNotifyListPersistent m_PersistentList;
110 public:
111 LwpNotifyListPersistent* GetExtraList(){return &m_ExtraList;}
112 void Read(LwpObjectStream* pObjStrm);
115 class LwpParaStyle;
116 class LwpTabOverride;
117 class LwpNumberingOverride;
118 class LwpSilverBullet;
119 class LwpPageLayout;
121 struct ParaNumbering
123 LwpFribText* pPrefix;
124 LwpFribParaNumber* pParaNumber;
125 LwpFribText* pSuffix;
127 sal_uInt16 nPrefixLevel;//hidelevels of prefix text frib
128 sal_uInt16 nNumLevel;//hidelevels of paranumber frib
129 sal_uInt16 nSuffixLevel;//hidelevels of suffix text frib
131 ParaNumbering()
133 clear();
136 void clear()
138 pPrefix = NULL;
139 pParaNumber = NULL;
140 pSuffix = NULL;
141 nPrefixLevel = 0;
142 nNumLevel = 0;
143 nSuffixLevel = 0;
147 class LwpDropcapLayout;
148 class LwpPara : public LwpDLVList
150 public:
151 LwpPara(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
152 ~LwpPara();
153 public:
154 void Read();
155 void RegisterStyle();
156 void Parse(IXFStream* pOutputStream);
157 void XFConvert(XFContentContainer* pCont);
158 void Release();
160 LwpPara* GetParent();
161 LwpObjectID* GetStoryID();
162 LwpStory* GetStory();
163 LwpBreaksOverride* GetBreaks();
165 LwpParaStyle* GetParaStyle();
166 XFParaStyle* GetXFParaStyle();
167 LwpIndentOverride* GetIndent();
168 LwpTabOverride* GetLocalTabOverride();
169 LwpNumberingOverride* GetParaNumbering();
171 inline LwpSilverBullet* GetSilverBullet();
172 inline LwpObjectID GetSilverBulletID();
173 OUString GetBulletChar() const;
174 sal_uInt32 GetBulletFontID() const;
175 sal_uInt16 GetLevel() const;
176 sal_Bool GetBulletFlag() const;
178 void GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering);
179 LwpFribPtr* GetFribs();
180 double GetBelowSpacing();
181 LwpParaProperty* GetProperty(sal_uInt32 nPropType);
182 void GatherDropcapInfo();
183 OUString GetBulletStyleName() const;
184 void SetBelowSpacing(double value);
185 void SetBulletStyleName(const OUString& rNewName);
186 void SetBulletFlag(sal_Bool bFlag);
187 void SetIndent(LwpIndentOverride* pIndentOverride);
188 void SetFirstFrib(OUString Content,sal_uInt32 FontID);
189 OUString GetContentText(sal_Bool bAllText = sal_False);
191 void SetParaDropcap(sal_Bool bFlag);
192 void SetDropcapLines(sal_uInt16 number);
193 void SetDropcapChars(sal_uInt32 chars);
194 void SetDropcapLayout(LwpDropcapLayout* pLayout);
195 sal_Bool IsHasDropcap();
197 XFContentContainer* GetXFContainer();
198 void AddXFContent(XFContent* pCont);
199 void SetXFContainer(XFContentContainer* pCont);
200 void FindLayouts();// for register pagelayout, add by , 02/20/2005
201 void RegisterTabStyle(XFParaStyle* pXFParaStyle);
203 LwpBulletStyleMgr* GetBulletStyleMgr();
204 sal_uInt32 GetOrdinal(){ return m_nOrdinal;}
205 sal_Bool operator <(LwpPara& Other);
206 sal_Bool ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLayout* pNextLayout);
208 sal_Bool IsInCell();
210 void SetAllText(OUString sText);
211 OUString GetStyleName(){return m_StyleName;}
213 protected:
214 sal_uInt32 m_nOrdinal; // Ordinal number of this paragraph
215 LwpObjectID m_ParaStyle; // handle of paragraph style
216 LwpPoint m_Hint; // Paragraph hint - width & height
217 LwpObjectID m_Story; // Story the paragraph is part of
219 sal_uInt16 m_nFlags;
220 sal_uInt16 m_nLevel;
221 LwpFribPtr m_Fribs;
222 LwpParaProperty* m_pProps;
223 //LwpForked3NotifyList* m_NotifyList; //not saved
225 OUString m_StyleName;
226 OUString m_ParentStyleName;//Add to support toc
227 LwpBreaksOverride* m_pBreaks;
228 OUString m_AftPageBreakName;
229 OUString m_BefPageBreakName;
230 OUString m_AftColumnBreakName;
232 OUString m_BefColumnBreakName;
233 LwpIndentOverride* m_pIndentOverride;
234 OUString m_Content;//for silver bullet,get text of first frib, add by 2/1
235 sal_uInt32 m_FontID;//for silver bullet
236 OUString m_AllText;//get all text in this paragraph
238 sal_Bool m_bHasBullet;
239 LwpObjectID m_aSilverBulletID;
240 LwpSilverBullet* m_pSilverBullet;
241 LwpBulletOverride* m_pBullOver;
242 boost::scoped_ptr<LwpNumberingOverride> m_pParaNumbering;
243 OUString m_aBulletStyleName;
244 sal_Bool m_bBullContinue;
245 //end add
247 OUString m_SectionStyleName;
248 sal_Bool m_bHasDropcap;
249 sal_uInt16 m_nLines;
250 sal_uInt32 m_nChars;
251 LwpDropcapLayout* m_pDropcapLayout;
252 double m_BelowSpacing;
254 XFContentContainer* m_pXFContainer; //Current container for VO_PARA
256 OUString m_TabStyleName;
257 enum
259 /* bit definitions for the paragraph object flags */
260 DEMAND_LOAD = 0x0001, // need to demand load this para
261 DATA_DIRTY = 0x0002, // paragraph data is dirty
262 SPELLSTARTOVER = 0x0004, // need to recheck paragraph
263 SPELLDIRTY = 0x0008, // has misspelled word in para
264 SPELLCHECKING = 0x0010, // started checking paragraph
265 READING = 0x0020, // We're loading this para from disk
266 DISKCHANGED = 0x0040, // Read size different from write size
267 USEFLOWBREAKS = 0x0080, // Use line breaks provided by filter
268 VALID_LEVEL = 0x0100, // cLevel is valid
269 NOUSECOUNT = 0x0200, // Don't change the style's use count
270 CHANGED = 0x0400, // This para has been edited
271 SPREADBULLET = 0x0800, // Para's bullet is in edit-on-page mode
272 NEWBULLET = 0x1000, // Bullets should have new font behavior
274 // Don't write these flags out to disk
275 NOWRITEFLAGS = (READING | DISKCHANGED | CHANGED),
277 MAX_INDENT_LEVELS = 10
279 private:
280 void OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle);//add by 1-24
281 void OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle);
282 void OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle);
283 void OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
284 void OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
286 void OverrideParaBullet(LwpParaProperty* pProps);
287 void OverrideParaNumbering(LwpParaProperty* pProps);
288 sal_Bool IsBadHintsInFile();
290 sal_Bool RegisterMasterPage(XFParaStyle* pBaseStyle);
291 void RegisterNewSectionStyle(LwpPageLayout* pLayout);
293 void ParseDropcapContent();
294 XFContentContainer* AddBulletList(XFContentContainer* pCont);
295 void AddBreakAfter(XFContentContainer* pCont);
296 void AddBreakBefore(XFContentContainer* pCont);
297 XFSection* CreateXFSection();
300 inline LwpSilverBullet* LwpPara::GetSilverBullet()
302 return m_pSilverBullet;
304 inline LwpObjectID LwpPara::GetSilverBulletID()
306 return m_aSilverBulletID;
308 inline OUString LwpPara::GetBulletChar() const
310 return m_Content;
312 inline sal_uInt32 LwpPara::GetBulletFontID() const
314 return m_FontID;
316 inline sal_uInt16 LwpPara::GetLevel() const
318 return m_nLevel;
320 inline void LwpPara::SetBulletStyleName(const OUString& rNewName)
322 m_aBulletStyleName = rNewName;
324 inline void LwpPara::SetBulletFlag(sal_Bool bFlag)
326 m_bHasBullet = bFlag;
328 inline sal_Bool LwpPara::GetBulletFlag() const
330 return m_bHasBullet;
332 inline LwpFribPtr* LwpPara::GetFribs()
334 return &m_Fribs;
336 inline LwpBreaksOverride* LwpPara::GetBreaks()
338 return m_pBreaks;
340 inline XFContentContainer* LwpPara::GetXFContainer()
342 return m_pXFContainer;
344 inline OUString LwpPara::GetBulletStyleName() const
346 return m_aBulletStyleName;
348 inline void LwpPara::AddXFContent(XFContent* pCont)
350 m_pXFContainer->Add(pCont);
352 inline void LwpPara::SetXFContainer(XFContentContainer* pCont)
354 m_pXFContainer = pCont;
356 inline LwpIndentOverride* LwpPara::GetIndent()
358 return m_pIndentOverride;
360 inline void LwpPara::SetIndent(LwpIndentOverride* pIndentOverride)
362 if (m_pIndentOverride)
363 delete m_pIndentOverride;
364 m_pIndentOverride = pIndentOverride;
366 inline LwpObjectID* LwpPara::GetStoryID()
368 return &m_Story;
370 inline LwpStory* LwpPara::GetStory()
372 if (m_Story.obj())
373 return dynamic_cast<LwpStory*>(m_Story.obj());
374 return NULL;
377 inline sal_Bool LwpPara::IsHasDropcap()
379 return m_bHasDropcap;
381 inline void LwpPara::SetParaDropcap(sal_Bool bFlag)
383 m_bHasDropcap = bFlag;
385 inline void LwpPara::SetDropcapLines(sal_uInt16 number)
387 m_nLines = number;
389 inline void LwpPara::SetDropcapChars(sal_uInt32 chars)
391 m_nChars = chars;
393 inline void LwpPara::SetDropcapLayout(LwpDropcapLayout* pLayout)
395 m_pDropcapLayout = pLayout;
397 inline sal_Bool LwpPara::IsBadHintsInFile()
399 return (sal_Bool) ((m_nFlags & DOC_BADFILEPARAHINTS) != 0);
401 inline double LwpPara::GetBelowSpacing()
403 return m_BelowSpacing;
405 inline void LwpPara::SetBelowSpacing(double value)
407 m_BelowSpacing = value;
409 #endif
411 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */