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 ************************************************************************/
64 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
65 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
67 #include "lwppiece.hxx"
68 #include "lwpbasetype.hxx"
75 void Read(LwpObjectStream
*pStrm
);
77 sal_Int16 m_nRotation
; //angle
80 class LwpLayoutGeometry
: public LwpVirtualPiece
83 LwpLayoutGeometry(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
84 virtual ~LwpLayoutGeometry();
85 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
86 sal_Int32
GetWidth() { return m_nWidth
; }
87 sal_Int32
GetHeight() { return m_nHeight
; }
88 LwpPoint
GetOrigin() { return m_Origin
; }
89 LwpPoint
GetAbsoluteOrigin() { return m_AbsoluteOrigin
; }
90 sal_uInt8
GetContentOrientation(){ return m_ContentOrientation
;}
93 virtual void Read() SAL_OVERRIDE
;
98 LwpPoint m_AbsoluteOrigin
;
99 LwpRotor m_ContainerRotor
;
100 sal_uInt8 m_ContentOrientation
;
103 class LwpLayoutScale
: public LwpVirtualPiece
106 enum {ORIGINAL_SIZE
= 1, FIT_IN_FRAME
= 2, PERCENTAGE
= 4,
107 CUSTOM
= 8, MAINTAIN_ASPECT_RATIO
= 16};
109 enum {CENTERED
= 1, TILED
= 2};
110 LwpLayoutScale(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
111 virtual ~LwpLayoutScale();
112 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
113 sal_uInt16
GetScaleMode(){return m_nScaleMode
;}
114 sal_uInt32
GetScalePercentage(){return m_nScalePercentage
;}
115 void SetScalePercentage(sal_uInt32 nVal
){m_nScalePercentage
= nVal
;}
116 sal_Int32
GetScaleWidth(){return m_nScaleWidth
;}
117 void SetScaleWidth(sal_Int32 nVal
){m_nScaleWidth
= nVal
;}
118 sal_Int32
GetScaleHeight(){return m_nScaleHeight
;}
119 void SetScaleHeight(sal_Int32 nVal
){m_nScaleHeight
= nVal
;}
120 sal_uInt16
GetContentRotation(){return m_nContentRotation
;}
121 void SetContentRotation(sal_uInt16 nVal
){m_nContentRotation
= nVal
;}
122 sal_uInt16
GetPlacement(){return m_nPlacement
;}
123 void SetPlacement(sal_uInt16 nVal
){m_nPlacement
= nVal
;}
124 inline LwpPoint
* GetOffset() {return &m_Offset
;}
126 virtual void Read() SAL_OVERRIDE
;
128 sal_uInt16 m_nScaleMode
;
129 sal_uInt32 m_nScalePercentage
;
130 sal_Int32 m_nScaleWidth
;
131 sal_Int32 m_nScaleHeight
;
132 sal_uInt16 m_nContentRotation
;
134 sal_uInt16 m_nPlacement
;
137 #include "lwpmargins.hxx"
139 class LwpLayoutMargins
: public LwpVirtualPiece
142 LwpLayoutMargins(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
143 virtual ~LwpLayoutMargins();
144 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
145 LwpMargins
* GetMargins() { return &m_Margins
; }
146 LwpMargins
* GetExtMargins(){ return &m_ExtMargins
;}
148 virtual void Read() SAL_OVERRIDE
;
150 LwpMargins m_Margins
;
151 LwpMargins m_ExtMargins
;
152 LwpMargins m_ExtraMargins
;
155 #include "lwpborderstuff.hxx"
156 class LwpLayoutBorder
: public LwpVirtualPiece
159 LwpLayoutBorder(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
160 virtual ~LwpLayoutBorder();
161 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
162 LwpBorderStuff
* GetBorderStuff(){ return &m_BorderStuff
;}
164 virtual void Read() SAL_OVERRIDE
;
166 LwpBorderStuff m_BorderStuff
;
169 class LwpLayoutBackground
: public LwpVirtualPiece
172 LwpLayoutBackground(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
173 virtual ~LwpLayoutBackground();
174 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
175 LwpBackgroundStuff
* GetBackgoudStuff(){return &m_BackgroundStuff
;}
177 virtual void Read() SAL_OVERRIDE
;
179 LwpBackgroundStuff m_BackgroundStuff
;
182 class LwpExternalBorder
186 ~LwpExternalBorder();
187 void Read(LwpObjectStream
*pStrm
);
189 LwpAtomHolder m_LeftName
;
190 LwpAtomHolder m_TopName
;
191 LwpAtomHolder m_RightName
;
192 LwpAtomHolder m_BottomName
;
195 //It seems that this class is used for designer border. Only read now.
196 class LwpLayoutExternalBorder
: public LwpVirtualPiece
199 LwpLayoutExternalBorder(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
200 virtual ~LwpLayoutExternalBorder();
201 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
203 virtual void Read() SAL_OVERRIDE
;
205 LwpExternalBorder m_ExtranalBorder
;
213 void Read(LwpObjectStream
*pStrm
);
214 inline double GetWidth(){return LwpTools::ConvertFromUnitsToMetric(m_nWidth
);}
215 inline void SetWidth(sal_Int32 w
){m_nWidth
= w
;}
216 inline double GetGap(){return LwpTools::ConvertFromUnitsToMetric(m_nGap
);}
217 inline void SetGap(sal_Int32 g
){m_nGap
= g
;}
223 class LwpLayoutColumns
: public LwpVirtualPiece
226 LwpLayoutColumns(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
227 virtual ~LwpLayoutColumns();
228 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
229 inline sal_uInt16
GetNumCols(){return m_nNumCols
;}
230 double GetColWidth(sal_uInt16 nIndex
);
231 double GetColGap(sal_uInt16 nIndex
);
233 virtual void Read() SAL_OVERRIDE
;
235 sal_uInt16 m_nNumCols
;
236 LwpColumnInfo
* m_pColumns
;
239 class LwpLayoutGutters
: public LwpVirtualPiece
242 LwpLayoutGutters(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
243 virtual ~LwpLayoutGutters();
244 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
245 inline virtual LwpBorderStuff
* GetBorderStuff(){return &m_BorderBuffer
;}
247 virtual void Read() SAL_OVERRIDE
;
249 LwpBorderStuff m_BorderBuffer
;
257 void Read(LwpObjectStream
*pStrm
);
259 sal_uInt16 m_nPercentage
;
260 sal_uInt16 m_nCorners
;
293 sal_uInt16 m_nID
;//JoinType
294 sal_uInt16 m_nScaling
;
298 class LwpLayoutJoins
: public LwpVirtualPiece
301 LwpLayoutJoins(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
302 virtual ~LwpLayoutJoins();
303 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
305 virtual void Read() SAL_OVERRIDE
;
307 LwpJoinStuff m_JoinStuff
;
310 #include "lwpshadow.hxx"
312 class LwpLayoutShadow
: public LwpVirtualPiece
315 LwpLayoutShadow(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
316 virtual ~LwpLayoutShadow();
317 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
318 LwpShadow
* GetShadow(){return &m_Shadow
;}
320 virtual void Read() SAL_OVERRIDE
;
325 class LwpLayoutRelativityGuts
328 LwpLayoutRelativityGuts();
329 void Read(LwpObjectStream
*pStrm
);
330 sal_uInt8
GetRelativeType(){ return m_nRelType
;}
331 sal_uInt8
GetRelativeFromWhere(){ return m_nRelFromWhere
;}
332 LwpPoint
GetRelativeDistance(){ return m_RelDistance
;}
333 sal_uInt8
GetTetherType(){ return m_nTether
;}
334 sal_uInt8
GetTetherWhere(){ return m_nTetherWhere
;}
338 LAY_PARENT_RELATIVE
= 1,
342 LAY_CONTENT_RELATIVE
,
364 sal_uInt8 m_nRelType
;
365 sal_uInt8 m_nRelFromWhere
;
366 LwpPoint m_RelDistance
;
368 sal_uInt8 m_nTetherWhere
;
372 class LwpLayoutRelativity
: public LwpVirtualPiece
375 LwpLayoutRelativity(LwpObjectHeader
& objHdr
, LwpSvStream
* pStrm
);
376 virtual ~LwpLayoutRelativity();
377 virtual void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
378 LwpLayoutRelativityGuts
* GetRelGuts(){return &m_RelGuts
;}
380 virtual void Read() SAL_OVERRIDE
;
382 LwpLayoutRelativityGuts m_RelGuts
;
387 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */