lok: re-load UNO bootstrap pieces and set UserInstallation on second init.
[LibreOffice.git] / lotuswordpro / source / filter / lwppara.hxx
blob59b4799330941a0f07b646b893dc7848427d1c13
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 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARA_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPPARA_HXX
64 #include <memory>
66 #include "lwpfribheader.hxx"
67 #include "lwpobj.hxx"
68 #include "lwpobjstrm.hxx"
70 #include <vector>
71 #include "lwpheader.hxx"
72 #include "lwpdlvlist.hxx"
73 #include "lwpbasetype.hxx"
74 #include "lwpoverride.hxx"
75 #include "lwpfoundry.hxx"
76 #include "lwplayout.hxx"
77 #include "lwpfrib.hxx"
78 #include "lwpfribptr.hxx"
79 #include "lwpfribtext.hxx"
80 #include "xfilter/xfparagraph.hxx"
81 #include "xfilter/xfdefs.hxx"
82 #include "xfilter/xfparastyle.hxx"
83 #include "xfilter/xfsection.hxx"
85 class LwpParaProperty;
86 class LwpPara;
87 class LwpBreaksOverride;
88 class LwpBulletStyleMgr;
89 class LwpNotifyListPersistent
91 public:
92 LwpNotifyListPersistent(){}
93 void Read(LwpObjectStream* pObjStrm);
94 protected:
95 LwpObjectID m_Head;
98 class LwpForked3NotifyList
100 public:
101 LwpForked3NotifyList(){}
102 protected:
103 LwpNotifyListPersistent m_ExtraList;
104 LwpNotifyListPersistent m_PersistentList;
105 public:
106 LwpNotifyListPersistent& GetExtraList() { return m_ExtraList; }
107 void Read(LwpObjectStream* pObjStrm);
110 class LwpParaStyle;
111 class LwpTabOverride;
112 class LwpNumberingOverride;
113 class LwpSilverBullet;
114 class LwpPageLayout;
116 struct ParaNumbering
118 LwpFribText* pPrefix;
119 LwpFribParaNumber* pParaNumber;
120 LwpFribText* pSuffix;
122 sal_uInt16 nPrefixLevel;//hidelevels of prefix text frib
123 sal_uInt16 nNumLevel;//hidelevels of paranumber frib
124 sal_uInt16 nSuffixLevel;//hidelevels of suffix text frib
126 ParaNumbering()
128 clear();
131 void clear()
133 pPrefix = nullptr;
134 pParaNumber = nullptr;
135 pSuffix = nullptr;
136 nPrefixLevel = 0;
137 nNumLevel = 0;
138 nSuffixLevel = 0;
142 class LwpDropcapLayout;
143 class LwpPara : public LwpDLVList
145 public:
146 LwpPara(LwpObjectHeader& objHdr, LwpSvStream* pStrm);
148 void Read() override;
149 void RegisterStyle() override;
150 void Parse(IXFStream* pOutputStream) override;
151 void XFConvert(XFContentContainer* pCont) override;
153 LwpPara* GetParent();
154 LwpObjectID& GetStoryID();
155 LwpStory* GetStory();
157 LwpParaStyle* GetParaStyle();
158 XFParaStyle* GetXFParaStyle();
159 LwpIndentOverride* GetIndent();
160 LwpTabOverride* GetLocalTabOverride();
161 LwpNumberingOverride* GetParaNumbering();
163 inline LwpSilverBullet* GetSilverBullet();
164 const OUString& GetBulletChar() const;
165 sal_uInt32 GetBulletFontID() const;
166 sal_uInt16 GetLevel() const;
167 bool GetBulletFlag() const;
169 void GetParaNumber(sal_uInt16 nPosition, ParaNumbering* pParaNumbering);
170 LwpFribPtr& GetFribs();
171 double GetBelowSpacing();
172 LwpParaProperty* GetProperty(sal_uInt32 nPropType);
173 void GatherDropcapInfo();
174 const OUString& GetBulletStyleName() const;
175 void SetBelowSpacing(double value);
176 void SetBulletFlag(bool bFlag);
177 void SetIndent(LwpIndentOverride* pIndentOverride);
178 void SetFirstFrib(const OUString& Content,sal_uInt32 FontID);
179 OUString const & GetContentText(bool bAllText = false);
181 void SetParaDropcap(bool bFlag);
182 void SetDropcapLines(sal_uInt16 number);
183 void SetDropcapChars(sal_uInt32 chars);
184 void SetDropcapLayout(LwpDropcapLayout* pLayout);
186 XFContentContainer* GetXFContainer();
187 void AddXFContent(XFContent* pCont);
188 void SetXFContainer(XFContentContainer* pCont);
189 void FindLayouts();// for register pagelayout
190 void RegisterTabStyle(XFParaStyle* pXFParaStyle);
192 LwpBulletStyleMgr* GetBulletStyleMgr();
193 sal_uInt32 GetOrdinal(){ return m_nOrdinal;}
194 bool operator <(LwpPara& Other);
195 bool ComparePagePosition(LwpVirtualLayout* pPreLayout, LwpVirtualLayout* pNextLayout);
197 bool IsInCell();
199 void SetAllText(const OUString& sText);
201 protected:
202 sal_uInt32 m_nOrdinal; // Ordinal number of this paragraph
203 LwpObjectID m_ParaStyle; // handle of paragraph style
204 LwpPoint m_Hint; // Paragraph hint - width & height
205 LwpObjectID m_Story; // Story the paragraph is part of
207 sal_uInt16 m_nFlags;
208 sal_uInt16 m_nLevel;
209 LwpFribPtr m_Fribs;
210 LwpParaProperty* m_pProps;
211 //LwpForked3NotifyList* m_NotifyList; //not saved
213 OUString m_StyleName;
214 OUString m_ParentStyleName;//Add to support toc
215 LwpBreaksOverride* m_pBreaks;
216 OUString m_AftPageBreakName;
217 OUString m_BefPageBreakName;
218 OUString m_AftColumnBreakName;
220 OUString m_BefColumnBreakName;
221 LwpIndentOverride* m_pIndentOverride;
222 OUString m_Content;//for silver bullet,get text of first frib
223 sal_uInt32 m_FontID;//for silver bullet
224 OUString m_AllText;//get all text in this paragraph
226 bool m_bHasBullet;
227 LwpObjectID m_aSilverBulletID;
228 LwpSilverBullet* m_pSilverBullet;
229 LwpBulletOverride* m_pBullOver;
230 std::unique_ptr<LwpNumberingOverride> m_pParaNumbering;
231 OUString m_aBulletStyleName;
232 bool m_bBullContinue;
233 //end add
235 OUString m_SectionStyleName;
236 bool m_bHasDropcap;
237 sal_uInt16 m_nLines;
238 sal_uInt32 m_nChars;
239 LwpDropcapLayout* m_pDropcapLayout;
240 double m_BelowSpacing;
242 XFContentContainer* m_pXFContainer; //Current container for VO_PARA
244 enum
246 /* bit definitions for the paragraph object flags */
247 DEMAND_LOAD = 0x0001, // need to demand load this para
248 DATA_DIRTY = 0x0002, // paragraph data is dirty
249 SPELLSTARTOVER = 0x0004, // need to recheck paragraph
250 SPELLDIRTY = 0x0008, // has misspelled word in para
251 SPELLCHECKING = 0x0010, // started checking paragraph
252 READING = 0x0020, // We're loading this para from disk
253 DISKCHANGED = 0x0040, // Read size different from write size
254 USEFLOWBREAKS = 0x0080, // Use line breaks provided by filter
255 VALID_LEVEL = 0x0100, // cLevel is valid
256 NOUSECOUNT = 0x0200, // Don't change the style's use count
257 CHANGED = 0x0400, // This para has been edited
258 SPREADBULLET = 0x0800, // Para's bullet is in edit-on-page mode
259 NEWBULLET = 0x1000, // Bullets should have new font behavior
261 // Don't write these flags out to disk
262 NOWRITEFLAGS = (READING | DISKCHANGED | CHANGED),
264 MAX_INDENT_LEVELS = 10
266 private:
267 virtual ~LwpPara();
269 static void OverrideAlignment(LwpAlignmentOverride* base,LwpAlignmentOverride* over,XFParaStyle* pOverStyle);
270 void OverrideIndent(LwpIndentOverride* base,LwpIndentOverride* over,XFParaStyle* pOverStyle);
271 void OverrideSpacing(LwpSpacingOverride* base,LwpSpacingOverride* over,XFParaStyle* pOverStyle);
272 void OverrideParaBorder(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
273 void OverrideParaBreaks(LwpParaProperty* pProps, XFParaStyle* pOverStyle);
275 void OverrideParaBullet(LwpParaProperty* pProps);
276 void OverrideParaNumbering(LwpParaProperty* pProps);
278 void RegisterMasterPage(XFParaStyle* pBaseStyle);
279 void RegisterNewSectionStyle(LwpPageLayout* pLayout);
281 void ParseDropcapContent();
282 XFContentContainer* AddBulletList(XFContentContainer* pCont);
283 void AddBreakAfter(XFContentContainer* pCont);
284 void AddBreakBefore(XFContentContainer* pCont);
285 XFSection* CreateXFSection();
288 inline LwpSilverBullet* LwpPara::GetSilverBullet()
290 return m_pSilverBullet;
292 inline const OUString& LwpPara::GetBulletChar() const
294 return m_Content;
296 inline sal_uInt32 LwpPara::GetBulletFontID() const
298 return m_FontID;
300 inline sal_uInt16 LwpPara::GetLevel() const
302 return m_nLevel;
304 inline void LwpPara::SetBulletFlag(bool bFlag)
306 m_bHasBullet = bFlag;
308 inline bool LwpPara::GetBulletFlag() const
310 return m_bHasBullet;
312 inline LwpFribPtr& LwpPara::GetFribs()
314 return m_Fribs;
316 inline XFContentContainer* LwpPara::GetXFContainer()
318 return m_pXFContainer;
320 inline const OUString& LwpPara::GetBulletStyleName() const
322 return m_aBulletStyleName;
324 inline void LwpPara::AddXFContent(XFContent* pCont)
326 if (!m_pXFContainer)
327 throw std::runtime_error("paragraph lacks container");
328 m_pXFContainer->Add(pCont);
330 inline void LwpPara::SetXFContainer(XFContentContainer* pCont)
332 m_pXFContainer = pCont;
334 inline LwpIndentOverride* LwpPara::GetIndent()
336 return m_pIndentOverride;
338 inline void LwpPara::SetIndent(LwpIndentOverride* pIndentOverride)
340 if (m_pIndentOverride)
341 delete m_pIndentOverride;
342 m_pIndentOverride = pIndentOverride;
344 inline LwpObjectID& LwpPara::GetStoryID()
346 return m_Story;
348 inline LwpStory* LwpPara::GetStory()
350 if (m_Story.obj().is())
351 return dynamic_cast<LwpStory*>(m_Story.obj().get());
352 return nullptr;
354 inline void LwpPara::SetParaDropcap(bool bFlag)
356 m_bHasDropcap = bFlag;
358 inline void LwpPara::SetDropcapLines(sal_uInt16 number)
360 m_nLines = number;
362 inline void LwpPara::SetDropcapChars(sal_uInt32 chars)
364 m_nChars = chars;
366 inline void LwpPara::SetDropcapLayout(LwpDropcapLayout* pLayout)
368 m_pDropcapLayout = pLayout;
370 inline double LwpPara::GetBelowSpacing()
372 return m_BelowSpacing;
374 inline void LwpPara::SetBelowSpacing(double value)
376 m_BelowSpacing = value;
378 #endif
380 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */