LibreOffice Module lotuswordpro (master) 1
lwpdrawobj.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*************************************************************************
3 *
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
6 *
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
9 *
10 * Sun Microsystems Inc., October, 2000
11 *
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
16 *
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.
20 *
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.
25 *
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
30 *
31 *
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.
38 *
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.
45 *
46 * The Initial Developer of the Original Code is: IBM Corporation
47 *
48 * Copyright: 2008 by IBM Corporation
49 *
50 * All Rights Reserved.
51 *
52 * Contributor(s): _______________________________________
53 *
54 *
55 ************************************************************************/
62#pragma once
63
64#include <sal/config.h>
65
66#include <rtl/ref.hxx>
67#include <rtl/ustring.hxx>
68
69#include "lwpsdwdrawheader.hxx"
70
71#include <memory>
72
73class SvStream;
74class XFFrame;
75class XFDrawStyle;
76
82{
83protected:
89
90public:
91 LwpDrawObj(SvStream* pStream, DrawingOffsetAndScale* pTransData = nullptr);
92 virtual ~LwpDrawObj() {}
93
94private:
96
97protected:
98 void ReadClosedObjStyle();
99 void SetFillStyle(XFDrawStyle* pStyle);
100 static void SetLineStyle(XFDrawStyle* pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle,
101 const SdwColor& rColor);
102 void SetPosition(XFFrame* pObj);
103 static void SetArrowHead(XFDrawStyle* pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth);
104 static OUString GetArrowName(sal_uInt8 nArrowStyle);
105
106protected:
110 virtual void Read() = 0;
111
116 virtual OUString RegisterStyle() = 0;
117
123 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) = 0;
124
130 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) = 0;
131
132public:
138
144};
145
151{
152public:
153 explicit LwpDrawGroup(SvStream* pStream) : LwpDrawObj(pStream) {}
154
155protected:
156 virtual void Read() override {}
157 virtual OUString RegisterStyle() override
158 {
159 return OUString();
160 }
161 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& /*rStyleName*/) override { return nullptr; }
162 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& /*rStyleName*/) override { return nullptr; }
163};
164
170{
171private:
173
174public:
175 LwpDrawLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
176
177protected:
178 virtual void Read() override;
179 virtual OUString RegisterStyle() override;
180 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
181 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
182};
183
189{
190private:
192 std::unique_ptr<SdwPoint[]> m_pVector;
193
194public:
195 LwpDrawPolyLine(SvStream * pStream, DrawingOffsetAndScale* pTransData);
196 virtual ~LwpDrawPolyLine() override;
197
198protected:
199 virtual void Read() override;
200 virtual OUString RegisterStyle() override;
201 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
202 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
203};
204
210{
211private:
212 sal_uInt16 m_nNumPoints;
213 std::unique_ptr<SdwPoint[]> m_pVector;
214
215public:
216 LwpDrawPolygon(SvStream * pStream, DrawingOffsetAndScale* pTransData);
217 virtual ~LwpDrawPolygon() override;
218
219protected:
220 virtual void Read() override;
221 virtual OUString RegisterStyle() override;
222 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
223 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
224};
225
231{
232private:
234
235public:
236 LwpDrawRectangle(SvStream* pStream, DrawingOffsetAndScale* pTransData);
237
238protected:
239 virtual void Read() override;
240 virtual OUString RegisterStyle() override;
241 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
242 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
243
244private:
245 XFFrame* CreateRoundedRect(const OUString& rStyleName);
246};
247
253{
254private:
256
257public:
258 LwpDrawEllipse(SvStream * pStream, DrawingOffsetAndScale* pTransData);
259
260protected:
261 virtual void Read() override;
262 virtual OUString RegisterStyle() override;
263 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
264 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
265};
266
271class LwpDrawArc : public LwpDrawObj
272{
273private:
276
277public:
278 LwpDrawArc(SvStream * pStream, DrawingOffsetAndScale* pTransData);
279
280protected:
281 virtual void Read() override;
282 virtual OUString RegisterStyle() override;
283 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
284 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
285};
286
291class XFFont;
293{
294private:
297
298public:
299 explicit LwpDrawTextBox(SvStream* pStream);
300 virtual ~LwpDrawTextBox() override;
301 static void SetFontStyle(rtl::Reference<XFFont> const & pFont, SdwTextBoxRecord const * pRec);
302
303protected:
304 virtual void Read() override;
305 virtual OUString RegisterStyle() override;
306 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
307 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
308};
309
314class XFDrawPath;
316{
317private:
320
321private:
322 void CreateFWPath(XFDrawPath* pPath);
323
324public:
325 LwpDrawTextArt(SvStream* pStream, DrawingOffsetAndScale* pTransData);
326 virtual ~LwpDrawTextArt() override;
327
328protected:
329 virtual void Read() override;
330 virtual OUString RegisterStyle() override;
331 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
332 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
333};
334
340{
341public:
342 explicit LwpDrawMetafile(SvStream* pStream);
343
344protected:
345 virtual void Read() override;
346 virtual OUString RegisterStyle() override
347 {
348 return OUString();
349 }
350 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& /*rStyleName*/) override {return nullptr;}
351 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& /*rStyleName*/) override {return nullptr;}
352};
353
359{
360private:
362 std::unique_ptr<sal_uInt8[]> m_pImageData;
363public:
364 explicit LwpDrawBitmap(SvStream* pStream);
365 virtual ~LwpDrawBitmap() override;
366
367protected:
368 virtual void Read() override;
369 virtual OUString RegisterStyle() override;
370 virtual rtl::Reference<XFFrame> CreateDrawObj(const OUString& rStyleName) override;
371 virtual rtl::Reference<XFFrame> CreateStandardDrawObj(const OUString& rStyleName) override;
372};
373
374/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Lwp-draw-arc object.
Definition: lwpdrawobj.hxx:272
SdwPoint m_aVector[4]
Definition: lwpdrawobj.hxx:275
SdwArcRecord m_aArcRec
Definition: lwpdrawobj.hxx:274
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:927
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:912
virtual void Read() override
@descr reading function of class LwpDrawArc
Definition: lwpdrawobj.cxx:893
LwpDrawArc(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawArc
Definition: lwpdrawobj.cxx:885
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:947
Lwp-draw-bitmap object.
Definition: lwpdrawobj.hxx:359
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
virtual void Read() override
@descr reading function of class LwpDrawBitmap
LwpDrawBitmap(SvStream *pStream)
@descr Constructor of class LwpDrawBitmap
std::unique_ptr< sal_uInt8[]> m_pImageData
Definition: lwpdrawobj.hxx:362
SdwBmpRecord m_aBmpRec
Definition: lwpdrawobj.hxx:361
virtual ~LwpDrawBitmap() override
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Lwp-draw-ellipse object.
Definition: lwpdrawobj.hxx:253
virtual void Read() override
@descr reading function of class LwpDrawEllipse
Definition: lwpdrawobj.cxx:822
SdwPoint m_aVector[13]
Definition: lwpdrawobj.hxx:255
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:833
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:848
LwpDrawEllipse(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawEllipse
Definition: lwpdrawobj.cxx:814
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:876
Lwp-draw-group object.
Definition: lwpdrawobj.hxx:151
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.hxx:162
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.hxx:161
virtual void Read() override
@descr read out the record of a draw object.
Definition: lwpdrawobj.hxx:156
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.hxx:157
LwpDrawGroup(SvStream *pStream)
Definition: lwpdrawobj.hxx:153
Lwp-draw-line object.
Definition: lwpdrawobj.hxx:170
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:438
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:452
LwpDrawLine(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawLine
Definition: lwpdrawobj.cxx:414
virtual void Read() override
@descr reading function of class LwpDrawLine
Definition: lwpdrawobj.cxx:422
SdwLineRecord m_aLineRec
Definition: lwpdrawobj.hxx:172
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:466
Lwp-draw-metafile object.
Definition: lwpdrawobj.hxx:340
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.hxx:350
virtual void Read() override
@descr reading function of class LwpDrawMetafile
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.hxx:346
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.hxx:351
LwpDrawMetafile(SvStream *pStream)
@descr Constructor of class LwpDrawMetafile
Lwp-base-draw object.
Definition: lwpdrawobj.hxx:82
virtual OUString RegisterStyle()=0
@descr register styles of a draw object according to the saved records data.
static void SetLineStyle(XFDrawStyle *pStyle, sal_uInt8 nWidth, sal_uInt8 nLineStyle, const SdwColor &rColor)
@descr set line/border style of drawing objects.
Definition: lwpdrawobj.cxx:234
void SetFillStyle(XFDrawStyle *pStyle)
@descr set fill style of drawing objects
Definition: lwpdrawobj.cxx:162
SdwDrawObjHeader m_aObjHeader
Definition: lwpdrawobj.hxx:86
rtl::Reference< XFFrame > CreateXFDrawObject()
@descr create a completed XF-draw object(read data, register styles and create XF-draw object)
Definition: lwpdrawobj.cxx:378
SdwClosedObjStyleRec m_aClosedObjStyleRec
Definition: lwpdrawobj.hxx:87
virtual void Read()=0
@descr read out the record of a draw object.
static OUString GetArrowName(sal_uInt8 nArrowStyle)
@descr get arrow style name according to the flag.
Definition: lwpdrawobj.cxx:334
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName)=0
@descr create XF-draw object and assign the style name to it.
void SetObjectType(DrawObjectType eType)
Definition: lwpdrawobj.hxx:143
void ReadClosedObjStyle()
@descr read the style of closed lwp-sdw-object like: rectangle, ellipse and so on.
Definition: lwpdrawobj.cxx:124
virtual ~LwpDrawObj()
Definition: lwpdrawobj.hxx:92
SvStream * m_pStream
Definition: lwpdrawobj.hxx:85
DrawObjectType m_eType
Definition: lwpdrawobj.hxx:84
static void SetArrowHead(XFDrawStyle *pOpenedObjStyle, sal_uInt8 nArrowFlag, sal_uInt8 nLineWidth)
@descr set arrowhead of a xf-drawing object.
Definition: lwpdrawobj.cxx:294
void ReadObjHeaderRecord()
@descr read the header record data of lwp-sdw-object
Definition: lwpdrawobj.cxx:103
void SetPosition(XFFrame *pObj)
@descr set position of a drawing object in the frame.
Definition: lwpdrawobj.cxx:271
DrawingOffsetAndScale * m_pTransData
Definition: lwpdrawobj.hxx:88
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName)=0
@descr create XF-draw object and assign the style name to it.
LwpDrawObj(SvStream *pStream, DrawingOffsetAndScale *pTransData=nullptr)
@descr Constructor of class LwpDrawObj
Definition: lwpdrawobj.cxx:92
Lwp-draw-polyline object.
Definition: lwpdrawobj.hxx:189
virtual ~LwpDrawPolyLine() override
Definition: lwpdrawobj.cxx:484
SdwPolyLineRecord m_aPolyLineRec
Definition: lwpdrawobj.hxx:191
virtual void Read() override
@descr reading function of class LwpDrawPolyLine
Definition: lwpdrawobj.cxx:491
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:514
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:546
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:529
LwpDrawPolyLine(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawPolyLine
Definition: lwpdrawobj.cxx:480
std::unique_ptr< SdwPoint[]> m_pVector
Definition: lwpdrawobj.hxx:192
Lwp-draw-polygon object.
Definition: lwpdrawobj.hxx:210
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:594
virtual void Read() override
@descr reading function of class LwpDrawPolygon
Definition: lwpdrawobj.cxx:577
virtual ~LwpDrawPolygon() override
Definition: lwpdrawobj.cxx:570
sal_uInt16 m_nNumPoints
Definition: lwpdrawobj.hxx:212
LwpDrawPolygon(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawPolygon
Definition: lwpdrawobj.cxx:564
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:609
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:626
std::unique_ptr< SdwPoint[]> m_pVector
Definition: lwpdrawobj.hxx:213
Lwp-draw-rectangle(rounded-corner rectangle) object.
Definition: lwpdrawobj.hxx:231
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:759
SdwPoint m_aVector[16]
Definition: lwpdrawobj.hxx:233
virtual void Read() override
@descr reading function of class LwpDrawRectangle
Definition: lwpdrawobj.cxx:652
LwpDrawRectangle(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawRectangle
Definition: lwpdrawobj.cxx:644
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
Definition: lwpdrawobj.cxx:689
XFFrame * CreateRoundedRect(const OUString &rStyleName)
Definition: lwpdrawobj.cxx:716
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
Definition: lwpdrawobj.cxx:674
virtual ~LwpDrawTextArt() override
SdwPoint m_aVector[4]
Definition: lwpdrawobj.hxx:319
virtual void Read() override
@descr read out the record of a draw object.
LwpDrawTextArt(SvStream *pStream, DrawingOffsetAndScale *pTransData)
@descr Constructor of class LwpDrawTextBox
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwTextArt m_aTextArtRec
Definition: lwpdrawobj.hxx:318
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
void CreateFWPath(XFDrawPath *pPath)
virtual ~LwpDrawTextBox() override
Definition: lwpdrawobj.cxx:960
virtual rtl::Reference< XFFrame > CreateStandardDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwPoint m_aVector
Definition: lwpdrawobj.hxx:296
static void SetFontStyle(rtl::Reference< XFFont > const &pFont, SdwTextBoxRecord const *pRec)
Definition: lwpdrawobj.cxx:969
virtual void Read() override
@descr reading function of class LwpDrawTextBox
virtual rtl::Reference< XFFrame > CreateDrawObj(const OUString &rStyleName) override
@descr create XF-draw object and assign the style name to it.
SdwTextBoxRecord m_aTextRec
Definition: lwpdrawobj.hxx:295
LwpDrawTextBox(SvStream *pStream)
@descr Constructor of class LwpDrawTextBox
Definition: lwpdrawobj.cxx:956
virtual OUString RegisterStyle() override
@descr register styles of a draw object according to the saved records data.
For svg path wrapper.
Definition: xfdrawpath.hxx:100
Style for all drawing object, which can includes line style, area style, wrap style.
Definition: xfdrawstyle.hxx:80
@descr The font struct of openoffice xml filter.
Definition: xffont.hxx:120
Base class for all frame object,include drawing,image,text-box.
Definition: xfframe.hxx:79
DocumentType eType
For LWP filter architecture prototype The file declares structures and enums used by Lwp-Drawing-Modu...
DrawObjectType
unsigned char sal_uInt8