tdf#131098 docx export: write fill property of graphic
[LibreOffice.git] / lotuswordpro / source / filter / lwplaypiece.hxx
blob3e5080915d0de9ddea8c0b99706d37402e26d68f
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,
29 * MA 02111-1307 USA
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 /*************************************************************************
57 * @file
58 * For LWP filter architecture prototype
59 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
62 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPLAYPIECE_HXX
64 #include "lwppiece.hxx"
65 #include <lwpbasetype.hxx>
66 #include "lwpmargins.hxx"
67 #include "lwpborderstuff.hxx"
68 #include "lwpshadow.hxx"
70 class LwpRotor
72 public:
73 LwpRotor();
74 void Read(LwpObjectStream* pStrm);
76 private:
77 sal_Int16 m_nRotation; //angle
80 class LwpLayoutGeometry final : public LwpVirtualPiece
82 public:
83 LwpLayoutGeometry(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
84 virtual void Parse(IXFStream* pOutputStream) override;
85 sal_Int32 GetWidth() const { return m_nWidth; }
86 sal_Int32 GetHeight() const { return m_nHeight; }
87 const LwpPoint& GetOrigin() const { return m_Origin; }
88 const LwpPoint& GetAbsoluteOrigin() const { return m_AbsoluteOrigin; }
89 sal_uInt8 GetContentOrientation() const { return m_ContentOrientation; }
91 private:
92 virtual void Read() override;
93 virtual ~LwpLayoutGeometry() override;
95 sal_Int32 m_nWidth;
96 sal_Int32 m_nHeight;
97 LwpPoint m_Origin;
98 LwpPoint m_AbsoluteOrigin;
99 LwpRotor m_ContainerRotor;
100 sal_uInt8 m_ContentOrientation;
103 class LwpLayoutScale final : public LwpVirtualPiece
105 public:
106 enum
108 ORIGINAL_SIZE = 1,
109 FIT_IN_FRAME = 2,
110 PERCENTAGE = 4,
111 CUSTOM = 8,
112 MAINTAIN_ASPECT_RATIO = 16
115 enum
117 CENTERED = 1,
118 TILED = 2
120 LwpLayoutScale(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
121 virtual void Parse(IXFStream* pOutputStream) override;
122 sal_uInt16 GetScaleMode() const { return m_nScaleMode; }
123 sal_uInt32 GetScalePercentage() const { return m_nScalePercentage; }
124 sal_Int32 GetScaleWidth() const { return m_nScaleWidth; }
125 sal_Int32 GetScaleHeight() const { return m_nScaleHeight; }
126 sal_uInt16 GetPlacement() const { return m_nPlacement; }
127 LwpPoint& GetOffset() { return m_Offset; }
129 private:
130 virtual void Read() override;
131 virtual ~LwpLayoutScale() override;
133 sal_uInt16 m_nScaleMode;
134 sal_uInt32 m_nScalePercentage;
135 sal_Int32 m_nScaleWidth;
136 sal_Int32 m_nScaleHeight;
137 sal_uInt16 m_nContentRotation;
138 LwpPoint m_Offset;
139 sal_uInt16 m_nPlacement;
142 class LwpLayoutMargins final : public LwpVirtualPiece
144 public:
145 LwpLayoutMargins(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
146 virtual void Parse(IXFStream* pOutputStream) override;
147 LwpMargins& GetMargins() { return m_Margins; }
148 LwpMargins& GetExtMargins() { return m_ExtMargins; }
150 private:
151 virtual void Read() override;
152 virtual ~LwpLayoutMargins() override;
154 LwpMargins m_Margins;
155 LwpMargins m_ExtMargins;
156 LwpMargins m_ExtraMargins;
159 class LwpLayoutBorder final : public LwpVirtualPiece
161 public:
162 LwpLayoutBorder(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
163 virtual void Parse(IXFStream* pOutputStream) override;
164 LwpBorderStuff& GetBorderStuff() { return m_BorderStuff; }
166 private:
167 virtual void Read() override;
168 virtual ~LwpLayoutBorder() override;
170 LwpBorderStuff m_BorderStuff;
173 class LwpLayoutBackground final : public LwpVirtualPiece
175 public:
176 LwpLayoutBackground(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
177 virtual void Parse(IXFStream* pOutputStream) override;
178 LwpBackgroundStuff& GetBackgoudStuff() { return m_BackgroundStuff; }
180 private:
181 virtual void Read() override;
182 virtual ~LwpLayoutBackground() override;
184 LwpBackgroundStuff m_BackgroundStuff;
187 class LwpExternalBorder
189 public:
190 LwpExternalBorder();
191 ~LwpExternalBorder();
192 void Read(LwpObjectStream* pStrm);
194 private:
195 LwpAtomHolder m_LeftName;
196 LwpAtomHolder m_TopName;
197 LwpAtomHolder m_RightName;
198 LwpAtomHolder m_BottomName;
201 //It seems that this class is used for designer border. Only read now.
202 class LwpLayoutExternalBorder final : public LwpVirtualPiece
204 public:
205 LwpLayoutExternalBorder(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
206 virtual void Parse(IXFStream* pOutputStream) override;
208 private:
209 virtual void Read() override;
210 virtual ~LwpLayoutExternalBorder() override;
212 LwpExternalBorder m_ExtranalBorder;
215 class LwpColumnInfo
217 public:
218 LwpColumnInfo();
219 void Read(LwpObjectStream* pStrm);
220 double GetGap() { return LwpTools::ConvertFromUnits(m_nGap); }
222 private:
223 sal_Int32 m_nWidth;
224 sal_Int32 m_nGap;
227 class LwpLayoutColumns final : public LwpVirtualPiece
229 public:
230 LwpLayoutColumns(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
231 virtual void Parse(IXFStream* pOutputStream) override;
232 sal_uInt16 GetNumCols() const { return m_nNumCols; }
233 double GetColGap(sal_uInt16 nIndex);
235 private:
236 virtual void Read() override;
237 virtual ~LwpLayoutColumns() override;
239 sal_uInt16 m_nNumCols;
240 std::unique_ptr<LwpColumnInfo[]> m_pColumns;
243 class LwpLayoutGutters final : public LwpVirtualPiece
245 public:
246 LwpLayoutGutters(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
247 virtual void Parse(IXFStream* pOutputStream) override;
248 LwpBorderStuff& GetBorderStuff() { return m_BorderBuffer; }
250 private:
251 virtual void Read() override;
252 virtual ~LwpLayoutGutters() override;
254 LwpBorderStuff m_BorderBuffer;
257 class LwpJoinStuff
259 public:
260 LwpJoinStuff();
261 void Read(LwpObjectStream* pStrm);
263 private:
264 sal_uInt16 m_nPercentage;
265 sal_uInt16 m_nCorners;
266 sal_Int32 m_nWidth;
267 sal_Int32 m_nHeight;
269 enum JoinType
271 MITRE = 1,
272 NEGATE = 2,
273 ROUNDED = 3,
274 RECTANGLE = 4,
275 SPECIAL = 5,
276 DIAGONAL = 6,
277 NEGATE_NO_CROSS = 7,
278 DOG_EAR_PAGE = 8,
279 DESKTOP = 9,
280 BOX_HIGHLIGHT = 10,
281 STAR = 11,
282 ROPE = 12,
283 DECO1 = 13,
284 DECO2 = 14,
285 RAIN = 15,
286 PIN = 16,
287 ROSE = 17,
288 SUNF = 18,
289 DECO3 = 19,
290 WARNING = 20,
291 BUBBLE = 21,
292 GIRDER = 22,
293 SMILE = 23,
294 ARROW = 24,
295 MAXJOIN = 24
298 sal_uInt16 m_nID; //JoinType
299 sal_uInt16 m_nScaling;
300 LwpColor m_Color;
303 class LwpLayoutJoins final : public LwpVirtualPiece
305 public:
306 LwpLayoutJoins(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
307 virtual void Parse(IXFStream* pOutputStream) override;
309 private:
310 virtual void Read() override;
311 virtual ~LwpLayoutJoins() override;
313 LwpJoinStuff m_JoinStuff;
316 class LwpLayoutShadow final : public LwpVirtualPiece
318 public:
319 LwpLayoutShadow(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
320 virtual void Parse(IXFStream* pOutputStream) override;
321 LwpShadow& GetShadow() { return m_Shadow; }
323 private:
324 virtual void Read() override;
325 virtual ~LwpLayoutShadow() override;
327 LwpShadow m_Shadow;
330 class LwpLayoutRelativityGuts
332 public:
333 LwpLayoutRelativityGuts();
334 void Read(LwpObjectStream* pStrm);
335 sal_uInt8 GetRelativeType() const { return m_nRelType; }
336 enum RelativeType
338 LAY_PARENT_RELATIVE = 1,
339 LAY_PARA_RELATIVE,
340 LAY_INLINE,
341 LAY_INLINE_NEWLINE,
342 LAY_CONTENT_RELATIVE,
343 LAY_INLINE_VERTICAL
345 enum WhereType
347 LAY_UPPERLEFT = 1,
348 LAY_MIDDLETOP,
349 LAY_UPPERRIGHT,
350 LAY_MIDDLELEFT,
351 LAY_MIDDLERIGHT,
352 LAY_LOWERLEFT,
353 LAY_MIDDLEBOTTOM,
354 LAY_LOWERRIGHT,
355 LAY_MIDDLE
357 enum TetherWhereType
359 LAY_INTERNAL = 1,
360 LAY_EXTERNAL,
361 LAY_BORDER
364 private:
365 sal_uInt8 m_nRelType;
366 sal_uInt8 m_nRelFromWhere;
367 LwpPoint m_RelDistance;
368 sal_uInt8 m_nTether;
369 sal_uInt8 m_nTetherWhere;
370 sal_uInt8 m_nFlags;
373 class LwpLayoutRelativity final : public LwpVirtualPiece
375 public:
376 LwpLayoutRelativity(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
377 virtual void Parse(IXFStream* pOutputStream) override;
378 LwpLayoutRelativityGuts& GetRelGuts() { return m_RelGuts; }
380 private:
381 virtual void Read() override;
382 virtual ~LwpLayoutRelativity() override;
384 LwpLayoutRelativityGuts m_RelGuts;
387 #endif
389 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */