fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / lotuswordpro / source / filter / lwpoverride.hxx
blob4d0b9d37bfbae80c52811e089f5ac78a85164a23
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 INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOVERRIDE_HXX
66 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_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) SAL_DELETED_FUNCTION;
103 protected:
104 sal_uInt16 m_nValues;
105 sal_uInt16 m_nOverride;
106 sal_uInt16 m_nApply;
109 class LwpTextLanguageOverride : public LwpOverride
111 public:
112 LwpTextLanguageOverride() : m_nLanguage(0) {}
114 virtual LwpTextLanguageOverride* clone() const SAL_OVERRIDE;
116 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
118 protected:
119 LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther);
121 private:
122 LwpTextLanguageOverride& operator=(LwpTextLanguageOverride const& rOther) SAL_DELETED_FUNCTION;
124 private:
125 sal_uInt16 m_nLanguage;
128 class LwpTextAttributeOverride : public LwpOverride
130 public:
131 LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {}
133 virtual LwpTextAttributeOverride* clone() const SAL_OVERRIDE;
135 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
137 inline sal_uInt16 GetHideLevels() const;
139 bool IsHighlight();
141 protected:
142 LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther);
144 private:
145 LwpTextAttributeOverride& operator=(LwpTextAttributeOverride const& rOther) SAL_DELETED_FUNCTION;
147 private:
148 enum{
149 TAO_HIGHLIGHT = 0x08,
151 sal_uInt16 m_nHideLevels;
152 sal_uInt32 m_nBaseLineOffset;
155 inline sal_uInt16 LwpTextAttributeOverride::GetHideLevels() const
157 return m_nHideLevels;
160 class LwpKinsokuOptsOverride : public LwpOverride
162 public:
163 LwpKinsokuOptsOverride() : m_nLevels(0) {}
165 virtual LwpKinsokuOptsOverride* clone() const SAL_OVERRIDE;
167 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
169 protected:
170 LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther);
172 private:
173 LwpKinsokuOptsOverride& operator=(LwpKinsokuOptsOverride const& rOther) SAL_DELETED_FUNCTION;
175 private:
176 sal_uInt16 m_nLevels;
179 class LwpBulletOverride : public LwpOverride
181 public:
182 LwpBulletOverride() {m_bIsNull = true;}
184 virtual LwpBulletOverride* clone() const SAL_OVERRIDE;
186 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
188 inline LwpObjectID GetSilverBullet() const;
190 void Override(LwpBulletOverride* pOther);
192 inline bool IsSilverBulletOverridden();
193 inline bool IsSkipOverridden();
194 inline bool IsRightAlignedOverridden();
195 inline bool IsSkip();
196 inline bool IsRightAligned();
197 inline bool IsEditable();
199 void OverrideSilverBullet(LwpObjectID aID);
200 void OverrideSkip(bool bOver);
201 void OverrideRightAligned(bool bOver);
203 inline void RevertSilverBullet();
204 inline void RevertSkip();
205 inline void RevertRightAligned();
207 bool IsInValid(){return m_bIsNull;}
209 protected:
210 LwpBulletOverride(LwpBulletOverride const& rOther);
212 private:
213 LwpBulletOverride& operator=(LwpBulletOverride const& rOther) SAL_DELETED_FUNCTION;
215 private:
216 enum
218 BO_SILVERBULLET = 0x01,
219 // 0x02 is free
220 BO_RIGHTALIGN = 0x04,
221 BO_EDITABLE = 0x08,
222 BO_SKIP = 0x10
225 LwpObjectID m_SilverBullet;
226 bool m_bIsNull;
229 inline LwpObjectID LwpBulletOverride::GetSilverBullet() const
231 return m_SilverBullet;
234 inline bool LwpBulletOverride::IsSilverBulletOverridden()
236 return ((m_nOverride & BO_SILVERBULLET) != 0);
239 inline bool LwpBulletOverride::IsSkipOverridden()
241 return ((m_nOverride & BO_SKIP) != 0);
244 inline bool LwpBulletOverride::IsRightAlignedOverridden()
246 return ((m_nOverride & BO_RIGHTALIGN) != 0);
249 inline bool LwpBulletOverride::IsSkip()
251 return ((m_nValues & BO_SKIP) != 0);
254 inline bool LwpBulletOverride::IsEditable()
256 return ((m_nValues & BO_EDITABLE) != 0);
259 inline bool LwpBulletOverride::IsRightAligned()
261 return ((m_nValues & BO_RIGHTALIGN) != 0);
264 inline void LwpBulletOverride::RevertSilverBullet()
266 LwpOverride::Override(BO_SILVERBULLET, STATE_STYLE);
269 inline void LwpBulletOverride::RevertSkip()
271 LwpOverride::Override(BO_SKIP, STATE_STYLE);
274 inline void LwpBulletOverride::RevertRightAligned()
276 LwpOverride::Override(BO_RIGHTALIGN, STATE_STYLE);
279 class LwpAlignmentOverride : public LwpOverride
281 public:
282 LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT), m_nPosition(0), m_nAlignChar(0){}
284 virtual LwpAlignmentOverride* clone() const SAL_OVERRIDE;
286 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
288 enum AlignType
290 ALIGN_LEFT = 0,
291 ALIGN_RIGHT = 1,
292 ALIGN_CENTER = 2,
293 ALIGN_JUSTIFY = 3,
294 ALIGN_JUSTIFYALL = 4,
295 ALIGN_NUMERICLEFT = 5,
296 ALIGN_NUMERICRIGHT = 6,
297 ALIGN_SQUEEZE = 7
300 AlignType GetAlignType(){ return m_nAlignType; }
301 void Override(LwpAlignmentOverride* other);//add by 1-24
302 void OverrideAlignment(AlignType val);//add by 1-24
304 protected:
305 LwpAlignmentOverride(LwpAlignmentOverride const& rOther);
307 private:
308 LwpAlignmentOverride& operator=(LwpAlignmentOverride const& rOther) SAL_DELETED_FUNCTION;
310 private:
311 enum
313 AO_TYPE = 0x01,
314 AO_POSITION = 0x02,
315 AO_CHAR = 0x04
318 AlignType m_nAlignType;
319 sal_uInt32 m_nPosition;
320 sal_uInt16 m_nAlignChar;
323 class LwpSpacingCommonOverride : public LwpOverride
325 public:
326 LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE), m_nAmount(0), m_nMultiple(65536){}
328 virtual LwpSpacingCommonOverride* clone() const SAL_OVERRIDE;
330 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
332 enum SpacingType
334 SPACING_DYNAMIC = 0,
335 SPACING_LEADING = 1,
336 SPACING_CUSTOM = 2,
337 SPACING_NONE = 3
340 SpacingType GetType() const {return m_nSpacingType;}
341 sal_Int32 GetAmount() const {return m_nAmount;}
342 sal_Int32 GetMultiple() const {return m_nMultiple;}
344 void Override(LwpSpacingCommonOverride* other);
345 void OverrideType(SpacingType val);
346 void OverrideAmount(sal_Int32 val);
347 void OverrideMultiple(sal_Int32 val);
349 protected:
350 LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther);
352 private:
353 LwpSpacingCommonOverride& operator=(LwpSpacingCommonOverride const& rOther) SAL_DELETED_FUNCTION;
355 protected:
356 enum
358 SPO_TYPE = 0x01,
359 SPO_AMOUNT = 0x02,
360 SPO_MULTIPLE= 0x04
362 SpacingType m_nSpacingType;//sal_uInt16
363 sal_Int32 m_nAmount;
364 sal_Int32 m_nMultiple;
367 class LwpSpacingOverride : public LwpOverride
369 public:
370 LwpSpacingOverride();
371 virtual ~LwpSpacingOverride();
373 virtual LwpSpacingOverride* clone() const SAL_OVERRIDE;
375 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
377 void Override(LwpSpacingOverride* other);
379 LwpSpacingCommonOverride* GetSpacing(){return m_pSpacing;}
380 LwpSpacingCommonOverride* GetAboveLineSpacing(){return m_pAboveLineSpacing;}
381 LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove;}
382 LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow;}
384 protected:
385 LwpSpacingOverride(LwpSpacingOverride const& rOther);
387 private:
388 LwpSpacingOverride& operator=(LwpSpacingOverride const& rOther) SAL_DELETED_FUNCTION;
390 private:
391 LwpSpacingCommonOverride* m_pSpacing;
392 LwpSpacingCommonOverride* m_pAboveLineSpacing;
393 LwpSpacingCommonOverride* m_pParaSpacingAbove;
394 LwpSpacingCommonOverride* m_pParaSpacingBelow;
397 class LwpIndentOverride : public LwpOverride
399 public:
400 LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {}
402 virtual LwpIndentOverride* clone() const SAL_OVERRIDE;
404 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
406 enum
408 RELATIVE_FIRST, RELATIVE_REST, RELATIVE_ALL
411 inline double GetFirst() const;
412 inline double GetLeft() const;
413 inline double GetRight() const;
415 sal_uInt16 GetRelative();
416 bool IsUseRelative();
417 void Override(LwpIndentOverride* other);
418 void OverrideIndentAll(sal_Int32 val);
419 void OverrideIndentFirst(sal_Int32 val);
420 void OverrideIndentRight(sal_Int32 val);
421 void OverrideIndentRest(sal_Int32 val);
422 void OverrideUseRelative(bool use);
423 void OverrideRelative(sal_uInt16 relative);
424 sal_Int32 GetMAll() const {return m_nAll;}
425 sal_Int32 GetMFirst() const {return m_nFirst;}
426 sal_Int32 GetMRest() const {return m_nRest;}
427 sal_Int32 GetMRight() const {return m_nRight;}
428 void SetMAll(sal_Int32 val){m_nAll=val;}
429 void SetMFirst(sal_Int32 val){m_nFirst=val;}
430 void SetMRest(sal_Int32 val){m_nRest=val;}
431 void SetMRight(sal_Int32 val){m_nRight=val;}
433 protected:
434 LwpIndentOverride(LwpIndentOverride const& rOther);
436 private:
437 LwpIndentOverride& operator=(LwpIndentOverride const& rOther) SAL_DELETED_FUNCTION;
439 private:
440 enum
442 IO_ALL = 0x0001,
443 IO_FIRST = 0x0002,
444 IO_REST = 0x0004,
445 IO_RIGHT = 0x0008,
446 IO_HANGING = 0x0010,
447 IO_EQUAL = 0x0020,
448 IO_BODY = 0x0040,
449 IO_REL_ALL = 0x0080,
450 IO_REL_FIRST = 0x0100,
451 IO_REL_REST = 0x0200,
452 IO_REL_FLAGS = (IO_REL_ALL | IO_REL_FIRST | IO_REL_REST),
453 IO_USE_RELATIVE = 0x0400
456 sal_Int32 m_nAll;
457 sal_Int32 m_nFirst;
458 sal_Int32 m_nRest;
459 sal_Int32 m_nRight;
462 inline double LwpIndentOverride::GetFirst() const
464 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nFirst-m_nRest));
466 inline double LwpIndentOverride::GetLeft() const
468 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nAll+m_nRest));
470 inline double LwpIndentOverride::GetRight() const
472 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight));
475 class LwpBackgroundStuff;
476 class LwpAmikakeOverride : public LwpOverride
478 public:
479 LwpAmikakeOverride();
481 virtual ~LwpAmikakeOverride();
483 virtual LwpAmikakeOverride* clone() const SAL_OVERRIDE;
485 void Read(LwpObjectStream* pStrm) SAL_OVERRIDE;
486 enum
488 AMIKAKE_NONE = 0,
489 AMIKAKE_BACKGROUND = 1,
490 AMIKAKE_CHARACTER = 2
493 protected:
494 LwpAmikakeOverride(LwpAmikakeOverride const& rOther);
496 private:
497 LwpAmikakeOverride& operator=(LwpAmikakeOverride const& rOther) SAL_DELETED_FUNCTION;
499 private:
500 LwpBackgroundStuff* m_pBackgroundStuff;
501 sal_uInt16 m_nType;
505 #endif
507 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */