fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / lotuswordpro / source / filter / lwpdrawobj.hxx
bloba379478c5969ed2b142bdd94329129719ed742f1
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 <sal/config.h>
67 #include <rtl/ref.hxx>
69 #include "lwpsdwdrawheader.hxx"
71 class SvStream;
72 class XFFrame;
73 class XFDrawStyle;
75 /**
76 * @brief
77 * Lwp-base-draw object.
79 class LwpDrawObj
81 protected:
82 DrawObjectType m_eType;
83 SvStream* m_pStream;
84 SdwDrawObjHeader m_aObjHeader;
85 SdwClosedObjStyleRec m_aClosedObjStyleRec;
86 DrawingOffsetAndScale* m_pTransData;
88 public:
89 LwpDrawObj(SvStream* pStream, DrawingOffsetAndScale* pTransData = NULL);
90 virtual ~LwpDrawObj() {}
92 private:
93 void ReadObjHeaderRecord();
95 protected:
96 void ReadClosedObjStyle();
97 void SetFillStyle(XFDrawStyle* pStyle);
98 static void SetLineStyle(XFDrawStyle* pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle,
99 const SdwColor& rColor);
100 void SetPosition(XFFrame* pObj);
101 static void SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth);
102 static OUString GetArrowName(sal_uInt8 nArrowStyle);
104 protected:
106 * @descr read out the record of a draw object.
108 virtual void Read() = 0;
111 * @descr register styles of a draw object according to the saved records data.
112 * @return the style name which has been registered.
114 virtual OUString RegisterStyle() = 0;
117 * @descr create XF-draw object and assign the style name to it.
118 * @param style name.
119 * @return pointer of the created XF-draw object.
121 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) = 0;
124 * @descr create XF-draw object and assign the style name to it.
125 * @param style name.
126 * @return pointer of the created XF-draw object.
128 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) = 0;
130 public:
132 * @descr create a completed XF-draw object(read data, register styles and create XF-draw object)
133 * @return pointer of the created competed XF-draw object.
135 XFFrame* CreateXFDrawObject();
138 * @param type of the object.
139 * @descr set the type to the draw object.
141 inline void SetObjectType(DrawObjectType eType) { m_eType = eType; }
144 * @descr get the type of the draw object.
145 * @return the type of the object.
147 inline DrawObjectType GetObjectType() const { return m_eType; }
151 * @brief
152 * Lwp-draw-group object.
154 class LwpDrawGroup : public LwpDrawObj
156 public:
157 LwpDrawGroup(SvStream* pStream) : LwpDrawObj(pStream) {}
158 virtual ~LwpDrawGroup() {}
160 protected:
161 virtual void Read() SAL_OVERRIDE {}
162 virtual OUString RegisterStyle() SAL_OVERRIDE
164 return OUString();
166 virtual XFFrame* CreateDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE { return NULL; }
167 virtual XFFrame* CreateStandardDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE { return NULL; }
171 * @brief
172 * Lwp-draw-line object.
174 class LwpDrawLine : public LwpDrawObj
176 private:
177 SdwLineRecord m_aLineRec;
179 public:
180 LwpDrawLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
181 virtual ~LwpDrawLine() {}
183 protected:
184 virtual void Read() SAL_OVERRIDE;
185 virtual OUString RegisterStyle() SAL_OVERRIDE;
186 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
187 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
191 * @brief
192 * Lwp-draw-polyline object.
194 class LwpDrawPolyLine : public LwpDrawObj
196 private:
197 SdwPolyLineRecord m_aPolyLineRec;
198 SdwPoint* m_pVector;
200 public:
201 LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
202 virtual ~LwpDrawPolyLine();
204 protected:
205 virtual void Read() SAL_OVERRIDE;
206 virtual OUString RegisterStyle() SAL_OVERRIDE;
207 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
208 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
212 * @brief
213 * Lwp-draw-polygon object.
215 class LwpDrawPolygon : public LwpDrawObj
217 private:
218 sal_uInt16 m_nNumPoints;
219 SdwPoint* m_pVector;
221 public:
222 LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData);
223 virtual ~LwpDrawPolygon();
225 protected:
226 virtual void Read() SAL_OVERRIDE;
227 virtual OUString RegisterStyle() SAL_OVERRIDE;
228 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
229 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
233 * @brief
234 * Lwp-draw-rectangle(rounded-corner rectangle) object.
236 class LwpDrawRectangle : public LwpDrawObj
238 private:
239 SdwPoint m_aVector[16];
241 public:
242 LwpDrawRectangle(SvStream* pStream, DrawingOffsetAndScale* pTransData);
243 virtual ~LwpDrawRectangle(){}
245 protected:
246 virtual void Read() SAL_OVERRIDE;
247 virtual OUString RegisterStyle() SAL_OVERRIDE;
248 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
249 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
251 private:
252 XFFrame* CreateRoundedRect(const OUString& rStyleName);
256 * @brief
257 * Lwp-draw-ellipse object.
259 class LwpDrawEllipse : public LwpDrawObj
261 private:
262 SdwPoint m_aVector[13];
264 public:
265 LwpDrawEllipse(SvStream * pStream, DrawingOffsetAndScale* pTransData);
266 virtual ~LwpDrawEllipse(){}
268 protected:
269 virtual void Read() SAL_OVERRIDE;
270 virtual OUString RegisterStyle() SAL_OVERRIDE;
271 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
272 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
276 * @brief
277 * Lwp-draw-arc object.
279 class LwpDrawArc : public LwpDrawObj
281 private:
282 SdwArcRecord m_aArcRec;
283 SdwPoint m_aVector[4];
285 public:
286 LwpDrawArc(SvStream * pStream, DrawingOffsetAndScale* pTransData);
287 virtual ~LwpDrawArc() {}
289 protected:
290 virtual void Read() SAL_OVERRIDE;
291 virtual OUString RegisterStyle() SAL_OVERRIDE;
292 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
293 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
297 * @brief
298 * Lwp-draw-textbox object.
300 class XFFont;
301 class LwpDrawTextBox : public LwpDrawObj
303 private:
304 SdwTextBoxRecord m_aTextRec;
305 SdwPoint m_aVector;
307 public:
308 LwpDrawTextBox(SvStream* pStream);
309 virtual ~LwpDrawTextBox();
310 static void SetFontStyle(rtl::Reference<XFFont> const & pFont, SdwTextBoxRecord* pRec);
312 protected:
313 virtual void Read() SAL_OVERRIDE;
314 virtual OUString RegisterStyle() SAL_OVERRIDE;
315 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
316 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
320 * @brief
321 * Lwp-draw-curved-text object.
323 class XFDrawPath;
324 class LwpDrawTextArt : public LwpDrawObj
326 private:
327 SdwTextArt m_aTextArtRec;
328 SdwPoint m_aVector[4];
330 private:
331 void CreateFWPath(XFDrawPath* pPath);
333 public:
334 LwpDrawTextArt(SvStream* pStream, DrawingOffsetAndScale* pTransData);
335 virtual ~LwpDrawTextArt();
337 protected:
338 virtual void Read() SAL_OVERRIDE;
339 virtual OUString RegisterStyle() SAL_OVERRIDE;
340 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
341 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
345 * @brief
346 * Lwp-draw-metafile object.
348 class LwpDrawMetafile : public LwpDrawObj
350 public:
351 LwpDrawMetafile(SvStream* pStream);
352 virtual ~LwpDrawMetafile() {}
354 protected:
355 virtual void Read() SAL_OVERRIDE;
356 virtual OUString RegisterStyle() SAL_OVERRIDE
358 return OUString();
360 virtual XFFrame* CreateDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE {return NULL;}
361 virtual XFFrame* CreateStandardDrawObj(const OUString& /*rStyleName*/) SAL_OVERRIDE {return NULL;}
365 * @brief
366 * Lwp-draw-bitmap object.
368 class LwpDrawBitmap : public LwpDrawObj
370 private:
371 SdwBmpRecord m_aBmpRec;
372 sal_uInt8* m_pImageData;
373 public:
374 LwpDrawBitmap(SvStream* pStream);
375 virtual ~LwpDrawBitmap();
377 protected:
378 virtual void Read() SAL_OVERRIDE;
379 virtual OUString RegisterStyle() SAL_OVERRIDE;
380 virtual XFFrame* CreateDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
381 virtual XFFrame* CreateStandardDrawObj(const OUString& rStyleName) SAL_OVERRIDE;
383 #endif
385 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */