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 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOVERRIDE_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPOVERRIDE_HXX
64 #include "lwpobjid.hxx"
65 #include "lwptools.hxx"
67 class LwpObjectStream
;
79 LwpOverride() : m_nValues(0), m_nOverride(0), m_nApply(0) {}
81 virtual ~LwpOverride(){}
83 virtual LwpOverride
* clone() const = 0;
85 virtual void Read(LwpObjectStream
* pStrm
) = 0;
87 void ReadCommon(LwpObjectStream
* pStrm
);
91 void Override(sal_uInt16 nBits
, STATE eState
);
94 explicit LwpOverride(LwpOverride
const& rOther
);
97 LwpOverride
& operator=(LwpOverride
const& rOther
) = delete;
100 sal_uInt16 m_nValues
;
101 sal_uInt16 m_nOverride
;
105 class LwpTextLanguageOverride
: public LwpOverride
108 LwpTextLanguageOverride() : m_nLanguage(0) {}
110 virtual LwpTextLanguageOverride
* clone() const override
;
112 void Read(LwpObjectStream
* pStrm
) override
;
115 LwpTextLanguageOverride(LwpTextLanguageOverride
const& rOther
);
118 LwpTextLanguageOverride
& operator=(LwpTextLanguageOverride
const& rOther
) = delete;
121 sal_uInt16 m_nLanguage
;
124 class LwpTextAttributeOverride
: public LwpOverride
127 LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {}
129 virtual LwpTextAttributeOverride
* clone() const override
;
131 void Read(LwpObjectStream
* pStrm
) override
;
133 inline sal_uInt16
GetHideLevels() const;
138 LwpTextAttributeOverride(LwpTextAttributeOverride
const& rOther
);
141 LwpTextAttributeOverride
& operator=(LwpTextAttributeOverride
const& rOther
) = delete;
145 TAO_HIGHLIGHT
= 0x08,
147 sal_uInt16 m_nHideLevels
;
148 sal_uInt32 m_nBaseLineOffset
;
151 inline sal_uInt16
LwpTextAttributeOverride::GetHideLevels() const
153 return m_nHideLevels
;
156 class LwpKinsokuOptsOverride
: public LwpOverride
159 LwpKinsokuOptsOverride() : m_nLevels(0) {}
161 virtual LwpKinsokuOptsOverride
* clone() const override
;
163 void Read(LwpObjectStream
* pStrm
) override
;
166 LwpKinsokuOptsOverride(LwpKinsokuOptsOverride
const& rOther
);
169 LwpKinsokuOptsOverride
& operator=(LwpKinsokuOptsOverride
const& rOther
) = delete;
172 sal_uInt16 m_nLevels
;
175 class LwpBulletOverride
: public LwpOverride
178 LwpBulletOverride() {m_bIsNull
= true;}
180 virtual LwpBulletOverride
* clone() const override
;
182 void Read(LwpObjectStream
* pStrm
) override
;
184 inline const LwpObjectID
& GetSilverBullet() const;
186 void Override(LwpBulletOverride
* pOther
);
188 inline bool IsSilverBulletOverridden();
189 inline bool IsSkipOverridden();
190 inline bool IsRightAlignedOverridden();
191 inline bool IsSkip();
192 inline bool IsRightAligned();
193 inline bool IsEditable();
195 void OverrideSilverBullet(LwpObjectID aID
);
196 void OverrideSkip(bool bOver
);
197 void OverrideRightAligned(bool bOver
);
199 inline void RevertSilverBullet();
200 inline void RevertSkip();
201 inline void RevertRightAligned();
203 bool IsInValid(){return m_bIsNull
;}
206 LwpBulletOverride(LwpBulletOverride
const& rOther
);
209 LwpBulletOverride
& operator=(LwpBulletOverride
const& rOther
) = delete;
214 BO_SILVERBULLET
= 0x01,
216 BO_RIGHTALIGN
= 0x04,
221 LwpObjectID m_SilverBullet
;
225 inline const LwpObjectID
& LwpBulletOverride::GetSilverBullet() const
227 return m_SilverBullet
;
230 inline bool LwpBulletOverride::IsSilverBulletOverridden()
232 return ((m_nOverride
& BO_SILVERBULLET
) != 0);
235 inline bool LwpBulletOverride::IsSkipOverridden()
237 return ((m_nOverride
& BO_SKIP
) != 0);
240 inline bool LwpBulletOverride::IsRightAlignedOverridden()
242 return ((m_nOverride
& BO_RIGHTALIGN
) != 0);
245 inline bool LwpBulletOverride::IsSkip()
247 return ((m_nValues
& BO_SKIP
) != 0);
250 inline bool LwpBulletOverride::IsEditable()
252 return ((m_nValues
& BO_EDITABLE
) != 0);
255 inline bool LwpBulletOverride::IsRightAligned()
257 return ((m_nValues
& BO_RIGHTALIGN
) != 0);
260 inline void LwpBulletOverride::RevertSilverBullet()
262 LwpOverride::Override(BO_SILVERBULLET
, STATE_STYLE
);
265 inline void LwpBulletOverride::RevertSkip()
267 LwpOverride::Override(BO_SKIP
, STATE_STYLE
);
270 inline void LwpBulletOverride::RevertRightAligned()
272 LwpOverride::Override(BO_RIGHTALIGN
, STATE_STYLE
);
275 class LwpAlignmentOverride
: public LwpOverride
278 LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT
), m_nPosition(0), m_nAlignChar(0){}
280 virtual LwpAlignmentOverride
* clone() const override
;
282 void Read(LwpObjectStream
* pStrm
) override
;
290 ALIGN_JUSTIFYALL
= 4,
291 ALIGN_NUMERICLEFT
= 5,
292 ALIGN_NUMERICRIGHT
= 6,
296 AlignType
GetAlignType(){ return m_nAlignType
; }
297 void Override(LwpAlignmentOverride
* other
);
298 void OverrideAlignment(AlignType val
);
301 LwpAlignmentOverride(LwpAlignmentOverride
const& rOther
);
304 LwpAlignmentOverride
& operator=(LwpAlignmentOverride
const& rOther
) = delete;
314 AlignType m_nAlignType
;
315 sal_uInt32 m_nPosition
;
316 sal_uInt16 m_nAlignChar
;
319 class LwpSpacingCommonOverride
: public LwpOverride
322 LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE
), m_nAmount(0), m_nMultiple(65536){}
324 virtual LwpSpacingCommonOverride
* clone() const override
;
326 void Read(LwpObjectStream
* pStrm
) override
;
336 SpacingType
GetType() const {return m_nSpacingType
;}
337 sal_Int32
GetAmount() const {return m_nAmount
;}
338 sal_Int32
GetMultiple() const {return m_nMultiple
;}
340 void Override(LwpSpacingCommonOverride
* other
);
341 void OverrideType(SpacingType val
);
342 void OverrideAmount(sal_Int32 val
);
343 void OverrideMultiple(sal_Int32 val
);
346 LwpSpacingCommonOverride(LwpSpacingCommonOverride
const& rOther
);
349 LwpSpacingCommonOverride
& operator=(LwpSpacingCommonOverride
const& rOther
) = delete;
358 SpacingType m_nSpacingType
;//sal_uInt16
360 sal_Int32 m_nMultiple
;
363 class LwpSpacingOverride
: public LwpOverride
366 LwpSpacingOverride();
367 virtual ~LwpSpacingOverride();
369 virtual LwpSpacingOverride
* clone() const override
;
371 void Read(LwpObjectStream
* pStrm
) override
;
373 void Override(LwpSpacingOverride
* other
);
375 LwpSpacingCommonOverride
* GetSpacing(){return m_pSpacing
;}
376 LwpSpacingCommonOverride
* GetAboveLineSpacing(){return m_pAboveLineSpacing
;}
377 LwpSpacingCommonOverride
* GetAboveSpacing(){return m_pParaSpacingAbove
;}
378 LwpSpacingCommonOverride
* GetBelowSpacing(){return m_pParaSpacingBelow
;}
381 LwpSpacingOverride(LwpSpacingOverride
const& rOther
);
384 LwpSpacingOverride
& operator=(LwpSpacingOverride
const& rOther
) = delete;
387 LwpSpacingCommonOverride
* m_pSpacing
;
388 LwpSpacingCommonOverride
* m_pAboveLineSpacing
;
389 LwpSpacingCommonOverride
* m_pParaSpacingAbove
;
390 LwpSpacingCommonOverride
* m_pParaSpacingBelow
;
393 class LwpIndentOverride
: public LwpOverride
396 LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {}
398 virtual LwpIndentOverride
* clone() const override
;
400 void Read(LwpObjectStream
* pStrm
) override
;
404 RELATIVE_FIRST
, RELATIVE_REST
, RELATIVE_ALL
407 inline double GetFirst() const;
408 inline double GetLeft() const;
409 inline double GetRight() const;
411 sal_uInt16
GetRelative();
412 bool IsUseRelative();
413 void Override(LwpIndentOverride
* other
);
414 void OverrideIndentAll(sal_Int32 val
);
415 void OverrideIndentFirst(sal_Int32 val
);
416 void OverrideIndentRight(sal_Int32 val
);
417 void OverrideIndentRest(sal_Int32 val
);
418 void OverrideUseRelative(bool use
);
419 void OverrideRelative(sal_uInt16 relative
);
420 sal_Int32
GetMAll() const {return m_nAll
;}
421 sal_Int32
GetMFirst() const {return m_nFirst
;}
422 sal_Int32
GetMRest() const {return m_nRest
;}
423 sal_Int32
GetMRight() const {return m_nRight
;}
424 void SetMAll(sal_Int32 val
){m_nAll
=val
;}
425 void SetMFirst(sal_Int32 val
){m_nFirst
=val
;}
426 void SetMRest(sal_Int32 val
){m_nRest
=val
;}
427 void SetMRight(sal_Int32 val
){m_nRight
=val
;}
430 LwpIndentOverride(LwpIndentOverride
const& rOther
);
433 LwpIndentOverride
& operator=(LwpIndentOverride
const& rOther
) = delete;
446 IO_REL_FIRST
= 0x0100,
447 IO_REL_REST
= 0x0200,
448 IO_REL_FLAGS
= (IO_REL_ALL
| IO_REL_FIRST
| IO_REL_REST
),
449 IO_USE_RELATIVE
= 0x0400
458 inline double LwpIndentOverride::GetFirst() const
460 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nFirst
-m_nRest
));
462 inline double LwpIndentOverride::GetLeft() const
464 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nAll
+m_nRest
));
466 inline double LwpIndentOverride::GetRight() const
468 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight
));
471 class LwpBackgroundStuff
;
472 class LwpAmikakeOverride
: public LwpOverride
475 LwpAmikakeOverride();
477 virtual ~LwpAmikakeOverride();
479 virtual LwpAmikakeOverride
* clone() const override
;
481 void Read(LwpObjectStream
* pStrm
) override
;
485 AMIKAKE_BACKGROUND
= 1,
486 AMIKAKE_CHARACTER
= 2
490 LwpAmikakeOverride(LwpAmikakeOverride
const& rOther
);
493 LwpAmikakeOverride
& operator=(LwpAmikakeOverride
const& rOther
) = delete;
496 LwpBackgroundStuff
* m_pBackgroundStuff
;
503 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */