Bump version to 4.3-4
[LibreOffice.git] / lotuswordpro / source / filter / lwpdrawobj.hxx
blob33dad651c6e05e17ecc8ee2986dd0cec21f61eaf
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 * The file declares the LwpDrawObjcts and associated class like LwpDrawGroup, LwpDrawRectange
59 * and so on.
62 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDRAWOBJ_HXX
63 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDRAWOBJ_HXX
65 #include "lwpsdwdrawheader.hxx"
67 class SvStream;
68 class XFFrame;
69 class XFDrawStyle;
71 /**
72 * @brief
73 * Lwp-base-draw object.
75 class LwpDrawObj
77 protected:
78 DrawObjectType m_eType;
79 SvStream* m_pStream;
80 SdwDrawObjHeader m_aObjHeader;
81 SdwClosedObjStyleRec m_aClosedObjStyleRec;
82 DrawingOffsetAndScale* m_pTransData;
84 public:
85 LwpDrawObj(SvStream* pStream, DrawingOffsetAndScale* pTransData = NULL);
86 virtual ~LwpDrawObj() {}
88 private:
89 void ReadObjHeaderRecord();
91 protected:
92 void ReadClosedObjStyle();
93 void SetFillStyle(XFDrawStyle* pStyle);
94 void SetLineStyle(XFDrawStyle* pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle,
95 const SdwColor& rColor);
96 void SetPosition(XFFrame* pObj);
97 void SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth);
98 OUString GetArrowName(sal_uInt8 nArrowStyle);
100 protected:
102 * @descr read out the record of a draw object.
104 virtual void Read() = 0;
107 * @descr register styles of a draw object according to the saved records data.
108 * @return the style name which has been registered.
110 virtual OUString RegisterStyle() = 0;
113 * @descr create XF-draw object and assign the style name to it.
114 * @param style name.
115 * @return pointer of the created XF-draw object.
117 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) = 0;
120 * @descr create XF-draw object and assign the style name to it.
121 * @param style name.
122 * @return pointer of the created XF-draw object.
124 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) = 0;
126 public:
128 * @descr create a completed XF-draw object(read data, register styles and create XF-draw object)
129 * @return pointer of the created competed XF-draw object.
131 XFFrame* CreateXFDrawObject();
134 * @param type of the object.
135 * @descr set the type to the draw object.
137 inline void SetObjectType(DrawObjectType eType) { m_eType = eType; }
140 * @descr get the type of the draw object.
141 * @return the type of the object.
143 inline DrawObjectType GetObjectType() const { return m_eType; }
147 * @brief
148 * Lwp-draw-group object.
150 class LwpDrawGroup : public LwpDrawObj
152 public:
153 LwpDrawGroup(SvStream* pStream) : LwpDrawObj(pStream) {}
154 virtual ~LwpDrawGroup() {}
156 protected:
157 virtual void Read() SAL_OVERRIDE {}
158 virtual OUString RegisterStyle() SAL_OVERRIDE
160 return OUString();
162 virtual XFFrame* CreateDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE { return NULL; }
163 virtual XFFrame* CreateStandardDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE { return NULL; }
167 * @brief
168 * Lwp-draw-line object.
170 class LwpDrawLine : public LwpDrawObj
172 private:
173 SdwLineRecord m_aLineRec;
175 public:
176 LwpDrawLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
177 virtual ~LwpDrawLine() {}
179 protected:
180 virtual void Read() SAL_OVERRIDE;
181 virtual OUString RegisterStyle() SAL_OVERRIDE;
182 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
183 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
187 * @brief
188 * Lwp-draw-polyline object.
190 class LwpDrawPolyLine : public LwpDrawObj
192 private:
193 SdwPolyLineRecord m_aPolyLineRec;
194 SdwPoint* m_pVector;
196 public:
197 LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
198 virtual ~LwpDrawPolyLine();
200 protected:
201 virtual void Read() SAL_OVERRIDE;
202 virtual OUString RegisterStyle() SAL_OVERRIDE;
203 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
204 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
208 * @brief
209 * Lwp-draw-polygon object.
211 class LwpDrawPolygon : public LwpDrawObj
213 private:
214 sal_uInt16 m_nNumPoints;
215 SdwPoint* m_pVector;
217 public:
218 LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData);
219 virtual ~LwpDrawPolygon();
221 protected:
222 virtual void Read() SAL_OVERRIDE;
223 virtual OUString RegisterStyle() SAL_OVERRIDE;
224 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
225 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
229 * @brief
230 * Lwp-draw-rectangle(rounded-corner rectangle) object.
232 class LwpDrawRectangle : public LwpDrawObj
234 private:
235 SdwPoint m_aVector[16];
237 public:
238 LwpDrawRectangle(SvStream* pStream, DrawingOffsetAndScale* pTransData);
239 virtual ~LwpDrawRectangle(){}
241 protected:
242 virtual void Read() SAL_OVERRIDE;
243 virtual OUString RegisterStyle() SAL_OVERRIDE;
244 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
245 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
247 private:
248 XFFrame* CreateRoundedRect(const OUString& rStyleName);
252 * @brief
253 * Lwp-draw-ellipse object.
255 class LwpDrawEllipse : public LwpDrawObj
257 private:
258 SdwPoint m_aVector[13];
260 public:
261 LwpDrawEllipse(SvStream * pStream, DrawingOffsetAndScale* pTransData);
262 virtual ~LwpDrawEllipse(){}
264 protected:
265 virtual void Read() SAL_OVERRIDE;
266 virtual OUString RegisterStyle() SAL_OVERRIDE;
267 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
268 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
272 * @brief
273 * Lwp-draw-arc object.
275 class LwpDrawArc : public LwpDrawObj
277 private:
278 SdwArcRecord m_aArcRec;
279 SdwPoint m_aVector[4];
281 public:
282 LwpDrawArc(SvStream * pStream, DrawingOffsetAndScale* pTransData);
283 virtual ~LwpDrawArc() {}
285 protected:
286 virtual void Read() SAL_OVERRIDE;
287 virtual OUString RegisterStyle() SAL_OVERRIDE;
288 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
289 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
293 * @brief
294 * Lwp-draw-textbox object.
296 class XFFont;
297 class LwpDrawTextBox : public LwpDrawObj
299 private:
300 SdwTextBoxRecord m_aTextRec;
301 SdwPoint m_aVector;
303 public:
304 LwpDrawTextBox(SvStream* pStream);
305 virtual ~LwpDrawTextBox();
306 static void SetFontStyle(XFFont* pFont, SdwTextBoxRecord* pRec);
308 protected:
309 virtual void Read() SAL_OVERRIDE;
310 virtual OUString RegisterStyle() SAL_OVERRIDE;
311 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
312 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
316 * @brief
317 * Lwp-draw-curved-text object.
319 class XFDrawPath;
320 class LwpDrawTextArt : public LwpDrawObj
322 private:
323 SdwTextArt m_aTextArtRec;
324 SdwPoint m_aVector[4];
326 private:
327 void CreateFWPath(XFDrawPath* pPath);
329 public:
330 LwpDrawTextArt(SvStream* pStream, DrawingOffsetAndScale* pTransData);
331 virtual ~LwpDrawTextArt();
333 protected:
334 virtual void Read() SAL_OVERRIDE;
335 virtual OUString RegisterStyle() SAL_OVERRIDE;
336 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
337 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
341 * @brief
342 * Lwp-draw-metafile object.
344 class LwpDrawMetafile : public LwpDrawObj
346 public:
347 LwpDrawMetafile(SvStream* pStream);
348 virtual ~LwpDrawMetafile() {}
350 protected:
351 virtual void Read() SAL_OVERRIDE;
352 virtual OUString RegisterStyle() SAL_OVERRIDE
354 return OUString();
356 virtual XFFrame* CreateDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE {return NULL;}
357 virtual XFFrame* CreateStandardDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE {return NULL;}
361 * @brief
362 * Lwp-draw-bitmap object.
364 class LwpDrawBitmap : public LwpDrawObj
366 private:
367 SdwBmpRecord m_aBmpRec;
368 sal_uInt8* m_pImageData;
369 public:
370 LwpDrawBitmap(SvStream* pStream);
371 virtual ~LwpDrawBitmap();
373 protected:
374 virtual void Read() SAL_OVERRIDE;
375 virtual OUString RegisterStyle() SAL_OVERRIDE;
376 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
377 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
379 #endif
381 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */