1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
57 * For LWP filter architecture prototype
58 ************************************************************************/
59 /*************************************************************************
62 ************************************************************************/
64 #ifndef _LWPOVERRIDE_HXX
65 #define _LWPOVERRIDE_HXX
67 #include "lwpobjid.hxx"
68 #include "lwptools.hxx"
70 class LwpObjectStream
;
82 LwpOverride() : m_nValues(0), m_nOverride(0), m_nApply(0) {};
84 virtual ~LwpOverride(){}
86 virtual void Read(LwpObjectStream
* pStrm
) = 0;
88 virtual void operator=(const LwpOverride
& rOther
);
90 void ReadCommon(LwpObjectStream
* pStrm
);
94 void Override(sal_uInt16 nBits
, STATE eState
);
98 sal_uInt16 m_nOverride
;
102 /////////////////////////////////////////////////////////////////
103 class LwpTextLanguageOverride
: public LwpOverride
106 LwpTextLanguageOverride() : m_nLanguage(0) {};
108 void Read(LwpObjectStream
* pStrm
);
111 sal_uInt16 m_nLanguage
;
114 /////////////////////////////////////////////////////////////////
115 class LwpTextAttributeOverride
: public LwpOverride
118 LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {};
120 void Read(LwpObjectStream
* pStrm
);
122 inline sal_uInt16
GetHideLevels() const;
124 sal_Bool
IsHighLight();
128 TAO_HIGHLIGHT
= 0x08,
130 sal_uInt16 m_nHideLevels
;
131 sal_uInt32 m_nBaseLineOffset
;
134 inline sal_uInt16
LwpTextAttributeOverride::GetHideLevels() const
136 return m_nHideLevels
;
138 /////////////////////////////////////////////////////////////////
139 class LwpKinsokuOptsOverride
: public LwpOverride
142 LwpKinsokuOptsOverride() : m_nLevels(0) {};
144 void Read(LwpObjectStream
* pStrm
);
147 sal_uInt16 m_nLevels
;
150 /////////////////////////////////////////////////////////////////
151 class LwpBulletOverride
: public LwpOverride
154 LwpBulletOverride() {m_bIsNull
= sal_True
;}
156 void Read(LwpObjectStream
* pStrm
);
158 inline LwpObjectID
GetSilverBullet() const;
160 void operator=(const LwpOverride
& rOther
);
162 void Override(LwpBulletOverride
* pOther
);
164 inline sal_Bool
IsSilverBulletOverridden();
165 inline sal_Bool
IsSkipOverridden();
166 inline sal_Bool
IsRightAlignedOverridden();
167 inline sal_Bool
IsSkip();
168 inline sal_Bool
IsRightAligned();
169 inline sal_Bool
IsEditable();
172 void OverrideSilverBullet(LwpObjectID aID
);
173 void OverrideSkip(sal_Bool bOver
);
174 void OverrideRightAligned(sal_Bool bOver
);
176 inline void RevertSilverBullet();
177 inline void RevertSkip();
178 inline void RevertRightAligned();
180 sal_Bool
IsInValid(){return m_bIsNull
;}
184 BO_SILVERBULLET
= 0x01,
186 BO_RIGHTALIGN
= 0x04,
191 LwpObjectID m_SilverBullet
;
194 inline LwpObjectID
LwpBulletOverride::GetSilverBullet() const
196 return m_SilverBullet
;
199 inline sal_Bool
LwpBulletOverride::IsSilverBulletOverridden()
201 return (sal_Bool
)((m_nOverride
& BO_SILVERBULLET
) != 0);
204 inline sal_Bool
LwpBulletOverride::IsSkipOverridden()
206 return (sal_Bool
)((m_nOverride
& BO_SKIP
) != 0);
209 inline sal_Bool
LwpBulletOverride::IsRightAlignedOverridden()
211 return (sal_Bool
)((m_nOverride
& BO_RIGHTALIGN
) != 0);
214 inline sal_Bool
LwpBulletOverride::IsSkip()
216 return (sal_Bool
)((m_nValues
& BO_SKIP
) != 0);
219 inline sal_Bool
LwpBulletOverride::IsEditable()
221 return (sal_Bool
)((m_nValues
& BO_EDITABLE
) != 0);
224 inline sal_Bool
LwpBulletOverride::IsRightAligned()
226 return (sal_Bool
)((m_nValues
& BO_RIGHTALIGN
) != 0);
229 inline void LwpBulletOverride::RevertSilverBullet()
231 LwpOverride::Override(BO_SILVERBULLET
, STATE_STYLE
);
234 inline void LwpBulletOverride::RevertSkip()
236 LwpOverride::Override(BO_SKIP
, STATE_STYLE
);
239 inline void LwpBulletOverride::RevertRightAligned()
241 LwpOverride::Override(BO_RIGHTALIGN
, STATE_STYLE
);
244 /////////////////////////////////////////////////////////////////
245 class LwpAlignmentOverride
: public LwpOverride
248 LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT
), m_nPosition(0), m_nAlignChar(0){};
250 void Read(LwpObjectStream
* pStrm
);
258 ALIGN_JUSTIFYALL
= 4,
259 ALIGN_NUMERICLEFT
= 5,
260 ALIGN_NUMERICRIGHT
= 6,
264 AlignType
GetAlignType(){ return m_nAlignType
; }
265 void Override(LwpAlignmentOverride
* other
);//add by 1-24
266 void OverrideAlignment(AlignType val
);//add by 1-24
275 AlignType m_nAlignType
;
276 sal_uInt32 m_nPosition
;
277 sal_uInt16 m_nAlignChar
;
280 /////////////////////////////////////////////////////////////////
281 class LwpSpacingCommonOverride
: public LwpOverride
284 LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE
), m_nAmount(0), m_nMultiple(65536){};
286 void Read(LwpObjectStream
* pStrm
);
296 SpacingType
GetType() const {return m_nSpacingType
;};
297 sal_Int32
GetAmount() const {return m_nAmount
;};
298 sal_Int32
GetMultiple() const {return m_nMultiple
;};
300 void Override(LwpSpacingCommonOverride
* other
);
301 void OverrideType(SpacingType val
);
302 void OverrideAmount(sal_Int32 val
);
303 void OverrideMultiple(sal_Int32 val
);
312 SpacingType m_nSpacingType
;//sal_uInt16
314 sal_Int32 m_nMultiple
;
318 /////////////////////////////////////////////////////////////////
319 class LwpSpacingOverride
: public LwpOverride
322 LwpSpacingOverride();
323 LwpSpacingOverride
& operator=(LwpSpacingOverride
& other
);
324 virtual ~LwpSpacingOverride();
326 void Read(LwpObjectStream
* pStrm
);
328 void Override(LwpSpacingOverride
* other
);
330 LwpSpacingCommonOverride
* GetSpacing(){return m_pSpacing
;};
331 LwpSpacingCommonOverride
* GetAboveLineSpacing(){return m_pAboveLineSpacing
;};
332 LwpSpacingCommonOverride
* GetAboveSpacing(){return m_pParaSpacingAbove
;};
333 LwpSpacingCommonOverride
* GetBelowSpacing(){return m_pParaSpacingBelow
;};
335 LwpSpacingCommonOverride
* m_pSpacing
;
336 LwpSpacingCommonOverride
* m_pAboveLineSpacing
;
337 LwpSpacingCommonOverride
* m_pParaSpacingAbove
;
338 LwpSpacingCommonOverride
* m_pParaSpacingBelow
;
341 /////////////////////////////////////////////////////////////////
342 class LwpIndentOverride
: public LwpOverride
345 LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {};
346 LwpIndentOverride
& operator=(LwpIndentOverride
& other
);
347 void Read(LwpObjectStream
* pStrm
);
351 RELATIVE_FIRST
, RELATIVE_REST
, RELATIVE_ALL
354 inline double GetFirst() const;
355 inline double GetLeft() const;
356 inline double GetRight() const;
358 sal_uInt16
GetRelative();
359 sal_Bool
IsUseRelative();
360 void Override(LwpIndentOverride
* other
);
361 void OverrideIndentAll(sal_Int32 val
);
362 void OverrideIndentFirst(sal_Int32 val
);
363 void OverrideIndentRight(sal_Int32 val
);
364 void OverrideIndentRest(sal_Int32 val
);
365 void OverrideUseRelative(sal_Bool use
);
366 void OverrideRelative(sal_uInt16 relative
);
367 sal_Int32
GetMAll() const {return m_nAll
;}
368 sal_Int32
GetMFirst() const {return m_nFirst
;}
369 sal_Int32
GetMRest() const {return m_nRest
;}
370 sal_Int32
GetMRight() const {return m_nRight
;}
371 void SetMAll(sal_Int32 val
){m_nAll
=val
;}
372 void SetMFirst(sal_Int32 val
){m_nFirst
=val
;}
373 void SetMRest(sal_Int32 val
){m_nRest
=val
;}
374 void SetMRight(sal_Int32 val
){m_nRight
=val
;}
386 IO_REL_FIRST
= 0x0100,
387 IO_REL_REST
= 0x0200,
388 IO_REL_FLAGS
= (IO_REL_ALL
| IO_REL_FIRST
| IO_REL_REST
),
389 #ifdef JAPANESE_ENABLED // 96/4/8 ueda for indentation by char width
390 IO_USE_RELATIVE
= 0x0400,
393 IO_USE_RELATIVE
= 0x0400
402 inline double LwpIndentOverride::GetFirst() const
404 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nFirst
-m_nRest
));
406 inline double LwpIndentOverride::GetLeft() const
408 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nAll
+m_nRest
));
410 inline double LwpIndentOverride::GetRight() const
412 return LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits(m_nRight
));
415 /////////////////////////////////////////////////////////////////
416 class LwpBackgroundStuff
;
417 class LwpAmikakeOverride
: public LwpOverride
420 LwpAmikakeOverride();
422 virtual ~LwpAmikakeOverride();
424 void Read(LwpObjectStream
* pStrm
);
428 AMIKAKE_BACKGROUND
= 1,
429 AMIKAKE_CHARACTER
= 2
433 LwpBackgroundStuff
* m_pBackgroundStuff
;