bump product version to 4.1.6.2
[LibreOffice.git] / lotuswordpro / source / filter / lwpoverride.hxx
blob71a9385d6349fb3e063def0d6cd9b16429d63b5b
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 * For LWP filter architecture prototype
59 ************************************************************************/
60 /*************************************************************************
61 * Change History
62 Jan 2005 Created
63 ************************************************************************/
65 #ifndef _LWPOVERRIDE_HXX
66 #define _LWPOVERRIDE_HXX
68 #include "lwpobjid.hxx"
69 #include "lwptools.hxx"
71 class LwpObjectStream;
73 enum STATE
75 STATE_OFF = 0,
76 STATE_ON = 1,
77 STATE_STYLE = 2
80 class LwpOverride
82 public:
83 LwpOverride() : m_nValues(0), m_nOverride(0), m_nApply(0) {}
85 virtual ~LwpOverride(){}
87 virtual LwpOverride* clone() const = 0;
89 virtual void Read(LwpObjectStream* pStrm) = 0;
91 void ReadCommon(LwpObjectStream* pStrm);
93 void Clear();
95 void Override(sal_uInt16 nBits, STATE eState);
97 protected:
98 LwpOverride(LwpOverride const& rOther);
100 private:
101 LwpOverride& operator=(LwpOverride const& rOther); // not implemented
103 protected:
104 sal_uInt16 m_nValues;
105 sal_uInt16 m_nOverride;
106 sal_uInt16 m_nApply;
109 /////////////////////////////////////////////////////////////////
110 class LwpTextLanguageOverride : public LwpOverride
112 public:
113 LwpTextLanguageOverride() : m_nLanguage(0) {}
115 virtual LwpTextLanguageOverride* clone() const;
117 void Read(LwpObjectStream* pStrm);
119 protected:
120 LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther);
122 private:
123 LwpTextLanguageOverride& operator=(LwpTextLanguageOverride const& rOther); // not implemented
125 private:
126 sal_uInt16 m_nLanguage;
129 /////////////////////////////////////////////////////////////////
130 class LwpTextAttributeOverride : public LwpOverride
132 public:
133 LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {}
135 virtual LwpTextAttributeOverride* clone() const;
137 void Read(LwpObjectStream* pStrm);
139 inline sal_uInt16 GetHideLevels() const;
141 sal_Bool IsHighLight();
143 protected:
144 LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther);
146 private:
147 LwpTextAttributeOverride& operator=(LwpTextAttributeOverride const& rOther); // not implemented
149 private:
150 enum{
151 TAO_HIGHLIGHT = 0x08,
153 sal_uInt16 m_nHideLevels;
154 sal_uInt32 m_nBaseLineOffset;
157 inline sal_uInt16 LwpTextAttributeOverride::GetHideLevels() const
159 return m_nHideLevels;
161 /////////////////////////////////////////////////////////////////
162 class LwpKinsokuOptsOverride : public LwpOverride
164 public:
165 LwpKinsokuOptsOverride() : m_nLevels(0) {}
167 virtual LwpKinsokuOptsOverride* clone() const;
169 void Read(LwpObjectStream* pStrm);
171 protected:
172 LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther);
174 private:
175 LwpKinsokuOptsOverride& operator=(LwpKinsokuOptsOverride const& rOther); // not implemented
177 private:
178 sal_uInt16 m_nLevels;
181 /////////////////////////////////////////////////////////////////
182 class LwpBulletOverride : public LwpOverride
184 public:
185 LwpBulletOverride() {m_bIsNull = sal_True;}
187 virtual LwpBulletOverride* clone() const;
189 void Read(LwpObjectStream* pStrm);
191 inline LwpObjectID GetSilverBullet() const;
193 void Override(LwpBulletOverride* pOther);
195 inline sal_Bool IsSilverBulletOverridden();
196 inline sal_Bool IsSkipOverridden();
197 inline sal_Bool IsRightAlignedOverridden();
198 inline sal_Bool IsSkip();
199 inline sal_Bool IsRightAligned();
200 inline sal_Bool IsEditable();
203 void OverrideSilverBullet(LwpObjectID aID);
204 void OverrideSkip(sal_Bool bOver);
205 void OverrideRightAligned(sal_Bool bOver);
207 inline void RevertSilverBullet();
208 inline void RevertSkip();
209 inline void RevertRightAligned();
211 sal_Bool IsInValid(){return m_bIsNull;}
213 protected:
214 LwpBulletOverride(LwpBulletOverride const& rOther);
216 private:
217 LwpBulletOverride& operator=(LwpBulletOverride const& rOther); // not implemented
219 private:
220 enum
222 BO_SILVERBULLET = 0x01,
223 // 0x02 is free
224 BO_RIGHTALIGN = 0x04,
225 BO_EDITABLE = 0x08,
226 BO_SKIP = 0x10
229 LwpObjectID m_SilverBullet;
230 sal_Bool m_bIsNull;
233 inline LwpObjectID LwpBulletOverride::GetSilverBullet() const
235 return m_SilverBullet;
238 inline sal_Bool LwpBulletOverride::IsSilverBulletOverridden()
240 return (sal_Bool)((m_nOverride & BO_SILVERBULLET) != 0);
243 inline sal_Bool LwpBulletOverride::IsSkipOverridden()
245 return (sal_Bool)((m_nOverride & BO_SKIP) != 0);
248 inline sal_Bool LwpBulletOverride::IsRightAlignedOverridden()
250 return (sal_Bool)((m_nOverride & BO_RIGHTALIGN) != 0);
253 inline sal_Bool LwpBulletOverride::IsSkip()
255 return (sal_Bool)((m_nValues & BO_SKIP) != 0);
258 inline sal_Bool LwpBulletOverride::IsEditable()
260 return (sal_Bool)((m_nValues & BO_EDITABLE) != 0);
263 inline sal_Bool LwpBulletOverride::IsRightAligned()
265 return (sal_Bool)((m_nValues & BO_RIGHTALIGN) != 0);
268 inline void LwpBulletOverride::RevertSilverBullet()
270 LwpOverride::Override(BO_SILVERBULLET, STATE_STYLE);
273 inline void LwpBulletOverride::RevertSkip()
275 LwpOverride::Override(BO_SKIP, STATE_STYLE);
278 inline void LwpBulletOverride::RevertRightAligned()
280 LwpOverride::Override(BO_RIGHTALIGN, STATE_STYLE);
283 /////////////////////////////////////////////////////////////////
284 class LwpAlignmentOverride : public LwpOverride
286 public:
287 LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT), m_nPosition(0), m_nAlignChar(0){}
289 virtual LwpAlignmentOverride* clone() const;
291 void Read(LwpObjectStream* pStrm);
293 enum AlignType
295 ALIGN_LEFT = 0,
296 ALIGN_RIGHT = 1,
297 ALIGN_CENTER = 2,
298 ALIGN_JUSTIFY = 3,
299 ALIGN_JUSTIFYALL = 4,
300 ALIGN_NUMERICLEFT = 5,
301 ALIGN_NUMERICRIGHT = 6,
302 ALIGN_SQUEEZE = 7
305 AlignType GetAlignType(){ return m_nAlignType; }
306 void Override(LwpAlignmentOverride* other);//add by 1-24
307 void OverrideAlignment(AlignType val);//add by 1-24
309 protected:
310 LwpAlignmentOverride(LwpAlignmentOverride const& rOther);
312 private:
313 LwpAlignmentOverride& operator=(LwpAlignmentOverride const& rOther); // not implemented
315 private:
316 enum
318 AO_TYPE = 0x01,
319 AO_POSITION = 0x02,
320 AO_CHAR = 0x04
323 AlignType m_nAlignType;
324 sal_uInt32 m_nPosition;
325 sal_uInt16 m_nAlignChar;
328 /////////////////////////////////////////////////////////////////
329 class LwpSpacingCommonOverride : public LwpOverride
331 public:
332 LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE), m_nAmount(0), m_nMultiple(65536){}
334 virtual LwpSpacingCommonOverride* clone() const;
336 void Read(LwpObjectStream* pStrm);
338 enum SpacingType
340 SPACING_DYNAMIC = 0,
341 SPACING_LEADING = 1,
342 SPACING_CUSTOM = 2,
343 SPACING_NONE = 3
346 SpacingType GetType() const {return m_nSpacingType;}
347 sal_Int32 GetAmount() const {return m_nAmount;}
348 sal_Int32 GetMultiple() const {return m_nMultiple;}
350 void Override(LwpSpacingCommonOverride* other);
351 void OverrideType(SpacingType val);
352 void OverrideAmount(sal_Int32 val);
353 void OverrideMultiple(sal_Int32 val);
355 protected:
356 LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther);
358 private:
359 LwpSpacingCommonOverride& operator=(LwpSpacingCommonOverride const& rOther); // not implemented
361 protected:
362 enum
364 SPO_TYPE = 0x01,
365 SPO_AMOUNT = 0x02,
366 SPO_MULTIPLE= 0x04
368 SpacingType m_nSpacingType;//sal_uInt16
369 sal_Int32 m_nAmount;
370 sal_Int32 m_nMultiple;
373 /////////////////////////////////////////////////////////////////
374 class LwpSpacingOverride : public LwpOverride
376 public:
377 LwpSpacingOverride();
378 virtual ~LwpSpacingOverride();
380 virtual LwpSpacingOverride* clone() const;
382 void Read(LwpObjectStream* pStrm);
384 void Override(LwpSpacingOverride* other);
386 LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing;}
387 LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing;}
388 LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove;}
389 LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow;}
391 protected:
392 LwpSpacingOverride(LwpSpacingOverride const& rOther);
394 private:
395 LwpSpacingOverride& operator=(LwpSpacingOverride const& rOther); // not implemented
397 private:
398 LwpSpacingCommonOverride* m_pSpacing;
399 LwpSpacingCommonOverride* m_pAboveLineSpacing;
400 LwpSpacingCommonOverride* m_pParaSpacingAbove;
401 LwpSpacingCommonOverride* m_pParaSpacingBelow;
404 /////////////////////////////////////////////////////////////////
405 class LwpIndentOverride : public LwpOverride
407 public:
408 LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {}
410 virtual LwpIndentOverride* clone() const;
412 void Read(LwpObjectStream* pStrm);
414 enum
416 RELATIVE_FIRST, RELATIVE_REST, RELATIVE_ALL
419 inline double GetFirst() const;
420 inline double GetLeft() const;
421 inline double GetRight() const;
423 sal_uInt16 GetRelative();
424 sal_Bool IsUseRelative();
425 void Override(LwpIndentOverride* other);
426 void OverrideIndentAll(sal_Int32 val);
427 void OverrideIndentFirst(sal_Int32 val);
428 void OverrideIndentRight(sal_Int32 val);
429 void OverrideIndentRest(sal_Int32 val);
430 void OverrideUseRelative(sal_Bool use);
431 void OverrideRelative(sal_uInt16 relative);
432 sal_Int32 GetMAll() const {return m_nAll;}
433 sal_Int32 GetMFirst() const {return m_nFirst;}
434 sal_Int32 GetMRest() const {return m_nRest;}
435 sal_Int32 GetMRight() const {return m_nRight;}
436 void SetMAll(sal_Int32 val){m_nAll=val;}
437 void SetMFirst(sal_Int32 val){m_nFirst=val;}
438 void SetMRest(sal_Int32 val){m_nRest=val;}
439 void SetMRight(sal_Int32 val){m_nRight=val;}
441 protected:
442 LwpIndentOverride(LwpIndentOverride const& rOther);
444 private:
445 LwpIndentOverride& operator=(LwpIndentOverride const& rOther); // not implemented
447 private:
448 enum
450 IO_ALL = 0x0001,
451 IO_FIRST = 0x0002,
452 IO_REST = 0x0004,
453 IO_RIGHT = 0x0008,
454 IO_HANGING = 0x0010,
455 IO_EQUAL = 0x0020,
456 IO_BODY = 0x0040,
457 IO_REL_ALL = 0x0080,
458 IO_REL_FIRST = 0x0100,
459 IO_REL_REST = 0x0200,
460 IO_REL_FLAGS = (IO_REL_ALL | IO_REL_FIRST | IO_REL_REST),
461 IO_USE_RELATIVE = 0x0400
464 sal_Int32 m_nAll;
465 sal_Int32 m_nFirst;
466 sal_Int32 m_nRest;
467 sal_Int32 m_nRight;
470 inline double LwpIndentOverride::GetFirst() const
472 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nFirst-m_nRest));
474 inline double LwpIndentOverride::GetLeft() const
476 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nAll+m_nRest));
478 inline double LwpIndentOverride::GetRight() const
480 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight));
483 /////////////////////////////////////////////////////////////////
484 class LwpBackgroundStuff;
485 class LwpAmikakeOverride : public LwpOverride
487 public:
488 LwpAmikakeOverride();
490 virtual ~LwpAmikakeOverride();
492 virtual LwpAmikakeOverride* clone() const;
494 void Read(LwpObjectStream* pStrm);
495 enum
497 AMIKAKE_NONE = 0,
498 AMIKAKE_BACKGROUND = 1,
499 AMIKAKE_CHARACTER = 2
502 protected:
503 LwpAmikakeOverride(LwpAmikakeOverride const& rOther);
505 private:
506 LwpAmikakeOverride& operator=(LwpAmikakeOverride const& rOther); // not implemented
508 private:
509 LwpBackgroundStuff* m_pBackgroundStuff;
510 sal_uInt16 m_nType;
514 #endif
516 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */