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,
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 /*************************************************************************
58 * For LWP filter architecture prototype
59 ************************************************************************/
60 /*************************************************************************
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
;
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
);
95 void Override(sal_uInt16 nBits
, STATE eState
);
98 LwpOverride(LwpOverride
const& rOther
);
101 LwpOverride
& operator=(LwpOverride
const& rOther
) SAL_DELETED_FUNCTION
;
104 sal_uInt16 m_nValues
;
105 sal_uInt16 m_nOverride
;
109 class LwpTextLanguageOverride
: public LwpOverride
112 LwpTextLanguageOverride() : m_nLanguage(0) {}
114 virtual LwpTextLanguageOverride
* clone() const SAL_OVERRIDE
;
116 void Read(LwpObjectStream
* pStrm
) SAL_OVERRIDE
;
119 LwpTextLanguageOverride(LwpTextLanguageOverride
const& rOther
);
122 LwpTextLanguageOverride
& operator=(LwpTextLanguageOverride
const& rOther
) SAL_DELETED_FUNCTION
;
125 sal_uInt16 m_nLanguage
;
128 class LwpTextAttributeOverride
: public LwpOverride
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;
142 LwpTextAttributeOverride(LwpTextAttributeOverride
const& rOther
);
145 LwpTextAttributeOverride
& operator=(LwpTextAttributeOverride
const& rOther
) SAL_DELETED_FUNCTION
;
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
163 LwpKinsokuOptsOverride() : m_nLevels(0) {}
165 virtual LwpKinsokuOptsOverride
* clone() const SAL_OVERRIDE
;
167 void Read(LwpObjectStream
* pStrm
) SAL_OVERRIDE
;
170 LwpKinsokuOptsOverride(LwpKinsokuOptsOverride
const& rOther
);
173 LwpKinsokuOptsOverride
& operator=(LwpKinsokuOptsOverride
const& rOther
) SAL_DELETED_FUNCTION
;
176 sal_uInt16 m_nLevels
;
179 class LwpBulletOverride
: public LwpOverride
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
;}
210 LwpBulletOverride(LwpBulletOverride
const& rOther
);
213 LwpBulletOverride
& operator=(LwpBulletOverride
const& rOther
) SAL_DELETED_FUNCTION
;
218 BO_SILVERBULLET
= 0x01,
220 BO_RIGHTALIGN
= 0x04,
225 LwpObjectID m_SilverBullet
;
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
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
;
294 ALIGN_JUSTIFYALL
= 4,
295 ALIGN_NUMERICLEFT
= 5,
296 ALIGN_NUMERICRIGHT
= 6,
300 AlignType
GetAlignType(){ return m_nAlignType
; }
301 void Override(LwpAlignmentOverride
* other
);//add by 1-24
302 void OverrideAlignment(AlignType val
);//add by 1-24
305 LwpAlignmentOverride(LwpAlignmentOverride
const& rOther
);
308 LwpAlignmentOverride
& operator=(LwpAlignmentOverride
const& rOther
) SAL_DELETED_FUNCTION
;
318 AlignType m_nAlignType
;
319 sal_uInt32 m_nPosition
;
320 sal_uInt16 m_nAlignChar
;
323 class LwpSpacingCommonOverride
: public LwpOverride
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
;
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
);
350 LwpSpacingCommonOverride(LwpSpacingCommonOverride
const& rOther
);
353 LwpSpacingCommonOverride
& operator=(LwpSpacingCommonOverride
const& rOther
) SAL_DELETED_FUNCTION
;
362 SpacingType m_nSpacingType
;//sal_uInt16
364 sal_Int32 m_nMultiple
;
367 class LwpSpacingOverride
: public LwpOverride
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
;}
385 LwpSpacingOverride(LwpSpacingOverride
const& rOther
);
388 LwpSpacingOverride
& operator=(LwpSpacingOverride
const& rOther
) SAL_DELETED_FUNCTION
;
391 LwpSpacingCommonOverride
* m_pSpacing
;
392 LwpSpacingCommonOverride
* m_pAboveLineSpacing
;
393 LwpSpacingCommonOverride
* m_pParaSpacingAbove
;
394 LwpSpacingCommonOverride
* m_pParaSpacingBelow
;
397 class LwpIndentOverride
: public LwpOverride
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
;
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
;}
434 LwpIndentOverride(LwpIndentOverride
const& rOther
);
437 LwpIndentOverride
& operator=(LwpIndentOverride
const& rOther
) SAL_DELETED_FUNCTION
;
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
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
479 LwpAmikakeOverride();
481 virtual ~LwpAmikakeOverride();
483 virtual LwpAmikakeOverride
* clone() const SAL_OVERRIDE
;
485 void Read(LwpObjectStream
* pStrm
) SAL_OVERRIDE
;
489 AMIKAKE_BACKGROUND
= 1,
490 AMIKAKE_CHARACTER
= 2
494 LwpAmikakeOverride(LwpAmikakeOverride
const& rOther
);
497 LwpAmikakeOverride
& operator=(LwpAmikakeOverride
const& rOther
) SAL_DELETED_FUNCTION
;
500 LwpBackgroundStuff
* m_pBackgroundStuff
;
507 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */