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 _LWPOVERRIDE_HXX
66 #define _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
); // not implemented
104 sal_uInt16 m_nValues
;
105 sal_uInt16 m_nOverride
;
109 /////////////////////////////////////////////////////////////////
110 class LwpTextLanguageOverride
: public LwpOverride
113 LwpTextLanguageOverride() : m_nLanguage(0) {}
115 virtual LwpTextLanguageOverride
* clone() const;
117 void Read(LwpObjectStream
* pStrm
);
120 LwpTextLanguageOverride(LwpTextLanguageOverride
const& rOther
);
123 LwpTextLanguageOverride
& operator=(LwpTextLanguageOverride
const& rOther
); // not implemented
126 sal_uInt16 m_nLanguage
;
129 /////////////////////////////////////////////////////////////////
130 class LwpTextAttributeOverride
: public LwpOverride
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();
144 LwpTextAttributeOverride(LwpTextAttributeOverride
const& rOther
);
147 LwpTextAttributeOverride
& operator=(LwpTextAttributeOverride
const& rOther
); // not implemented
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
165 LwpKinsokuOptsOverride() : m_nLevels(0) {}
167 virtual LwpKinsokuOptsOverride
* clone() const;
169 void Read(LwpObjectStream
* pStrm
);
172 LwpKinsokuOptsOverride(LwpKinsokuOptsOverride
const& rOther
);
175 LwpKinsokuOptsOverride
& operator=(LwpKinsokuOptsOverride
const& rOther
); // not implemented
178 sal_uInt16 m_nLevels
;
181 /////////////////////////////////////////////////////////////////
182 class LwpBulletOverride
: public LwpOverride
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
;}
214 LwpBulletOverride(LwpBulletOverride
const& rOther
);
217 LwpBulletOverride
& operator=(LwpBulletOverride
const& rOther
); // not implemented
222 BO_SILVERBULLET
= 0x01,
224 BO_RIGHTALIGN
= 0x04,
229 LwpObjectID m_SilverBullet
;
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
287 LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT
), m_nPosition(0), m_nAlignChar(0){}
289 virtual LwpAlignmentOverride
* clone() const;
291 void Read(LwpObjectStream
* pStrm
);
299 ALIGN_JUSTIFYALL
= 4,
300 ALIGN_NUMERICLEFT
= 5,
301 ALIGN_NUMERICRIGHT
= 6,
305 AlignType
GetAlignType(){ return m_nAlignType
; }
306 void Override(LwpAlignmentOverride
* other
);//add by 1-24
307 void OverrideAlignment(AlignType val
);//add by 1-24
310 LwpAlignmentOverride(LwpAlignmentOverride
const& rOther
);
313 LwpAlignmentOverride
& operator=(LwpAlignmentOverride
const& rOther
); // not implemented
323 AlignType m_nAlignType
;
324 sal_uInt32 m_nPosition
;
325 sal_uInt16 m_nAlignChar
;
328 /////////////////////////////////////////////////////////////////
329 class LwpSpacingCommonOverride
: public LwpOverride
332 LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE
), m_nAmount(0), m_nMultiple(65536){}
334 virtual LwpSpacingCommonOverride
* clone() const;
336 void Read(LwpObjectStream
* pStrm
);
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
);
356 LwpSpacingCommonOverride(LwpSpacingCommonOverride
const& rOther
);
359 LwpSpacingCommonOverride
& operator=(LwpSpacingCommonOverride
const& rOther
); // not implemented
368 SpacingType m_nSpacingType
;//sal_uInt16
370 sal_Int32 m_nMultiple
;
373 /////////////////////////////////////////////////////////////////
374 class LwpSpacingOverride
: public LwpOverride
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
;}
392 LwpSpacingOverride(LwpSpacingOverride
const& rOther
);
395 LwpSpacingOverride
& operator=(LwpSpacingOverride
const& rOther
); // not implemented
398 LwpSpacingCommonOverride
* m_pSpacing
;
399 LwpSpacingCommonOverride
* m_pAboveLineSpacing
;
400 LwpSpacingCommonOverride
* m_pParaSpacingAbove
;
401 LwpSpacingCommonOverride
* m_pParaSpacingBelow
;
404 /////////////////////////////////////////////////////////////////
405 class LwpIndentOverride
: public LwpOverride
408 LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {}
410 virtual LwpIndentOverride
* clone() const;
412 void Read(LwpObjectStream
* pStrm
);
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
;}
442 LwpIndentOverride(LwpIndentOverride
const& rOther
);
445 LwpIndentOverride
& operator=(LwpIndentOverride
const& rOther
); // not implemented
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
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
488 LwpAmikakeOverride();
490 virtual ~LwpAmikakeOverride();
492 virtual LwpAmikakeOverride
* clone() const;
494 void Read(LwpObjectStream
* pStrm
);
498 AMIKAKE_BACKGROUND
= 1,
499 AMIKAKE_CHARACTER
= 2
503 LwpAmikakeOverride(LwpAmikakeOverride
const& rOther
);
506 LwpAmikakeOverride
& operator=(LwpAmikakeOverride
const& rOther
); // not implemented
509 LwpBackgroundStuff
* m_pBackgroundStuff
;
516 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */