Update ooo320-m1
[ooovba.git] / svx / source / msfilter / eschesdo.hxx
blob9e74e1be4dfc446f61f582e2a09e3f754259501a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eschesdo.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _ESCHESDO_HXX
31 #define _ESCHESDO_HXX
32 #include <svx/escherex.hxx>
33 #include <svx/unopage.hxx>
34 #include <vcl/mapmod.hxx>
36 // ===================================================================
37 // fractions of Draw PPTWriter etc.
39 enum ImplEESdrPageType { NORMAL = 0, MASTER = 1, NOTICE = 2, UNDEFINED = 3 };
41 class ImplEESdrWriter;
42 class ImplEscherExSdr;
44 class ImplEESdrObject
46 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
47 // XTextRef mXText; // TextRef des globalen Text
48 ::com::sun::star::uno::Any mAny;
49 Rectangle maRect;
50 String mType;
51 UINT32 mnShapeId;
52 UINT32 mnTextSize;
53 INT32 mnAngle;
54 BOOL mbValid : 1;
55 BOOL mbPresObj : 1;
56 BOOL mbEmptyPresObj : 1;
58 void Init( ImplEESdrWriter& rEx );
59 public:
60 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mXPropSet;
62 ImplEESdrObject( ImplEscherExSdr& rEx, const SdrObject& rObj );
63 ImplEESdrObject( ImplEESdrWriter& rEx, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
64 ~ImplEESdrObject();
66 BOOL ImplGetPropertyValue( const sal_Unicode* pString );
68 INT32 ImplGetInt32PropertyValue( const sal_Unicode* pStr, UINT32 nDef = 0 )
69 { return ImplGetPropertyValue( pStr ) ? *(INT32*)mAny.getValue() : nDef; }
71 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& GetShapeRef() const { return mXShape; }
72 const ::com::sun::star::uno::Any& GetUsrAny() const { return mAny; }
73 const String& GetType() const { return mType; }
74 void SetType( const String& rS ) { mType = rS; }
76 const Rectangle& GetRect() const { return maRect; }
77 void SetRect( const Point& rPos, const Size& rSz );
78 void SetRect( const Rectangle& rRect )
79 { maRect = rRect; }
81 INT32 GetAngle() const { return mnAngle; }
82 void SetAngle( INT32 nVal ) { mnAngle = nVal; }
84 UINT32 GetTextSize() const { return mnTextSize; }
86 BOOL IsValid() const { return mbValid; }
87 BOOL IsPresObj() const { return mbPresObj; }
88 BOOL IsEmptyPresObj() const { return mbEmptyPresObj; }
89 UINT32 GetShapeId() const { return mnShapeId; }
90 void SetShapeId( UINT32 nVal ) { mnShapeId = nVal; }
92 const SdrObject* GetSdrObject() const;
94 UINT32 ImplGetText();
95 BOOL ImplHasText() const;
100 // -------------------------------------------------------------------
101 // fractions of the Draw PPTWriter
103 class EscherEx;
104 namespace com { namespace sun { namespace star {
105 namespace drawing {
106 class XDrawPage;
107 class XShape;
109 namespace task {
110 class XStatusIndicator;
113 class EscherExHostAppData;
114 class Polygon;
116 class ImplEESdrWriter
118 protected:
119 EscherEx* mpEscherEx;
120 MapMode maMapModeSrc;
121 MapMode maMapModeDest;
123 ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > mXStatusIndicator;
124 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > mXDrawPage;
125 ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mXShapes;
127 SvStream* mpPicStrm;
129 // own extensions
131 EscherExHostAppData* mpHostAppData;
133 UINT32 mnPagesWritten;
135 UINT32 mnShapeMasterTitle;
136 UINT32 mnShapeMasterBody;
138 // per page values
139 UINT32 mnIndices;
140 UINT32 mnOutlinerCount;
141 UINT32 mnPrevTextStyle;
142 UINT32 mnStatMaxValue;
144 UINT16 mnEffectCount;
146 BOOL mbIsTitlePossible;
147 BOOL mbStatusIndicator;
148 BOOL mbStatus;
151 ImplEESdrWriter( EscherEx& rEx );
153 BOOL ImplInitPageValues();
155 void ImplWritePage(
156 EscherSolverContainer& rSolver,
157 ImplEESdrPageType ePageType,
158 BOOL bBackGround = FALSE );
160 UINT32 ImplWriteShape( ImplEESdrObject& rObj,
161 EscherSolverContainer& rSolver,
162 ImplEESdrPageType ePageType ); // returns ShapeID
164 void ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherPropertyContainer& rPropOpt );
165 BOOL ImplGetText( ImplEESdrObject& rObj );
166 void ImplWriteAdditionalText(
167 ImplEESdrObject& rObj,
168 const Point& rTextRefPoint );
169 UINT32 ImplEnterAdditionalTextGroup(
170 const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
171 const Rectangle* pBoundRect = NULL );
174 public:
175 Point ImplMapPoint( const Point& rPoint );
176 Size ImplMapSize( const Size& rSize );
177 EscherExHostAppData* ImplGetHostData() { return mpHostAppData; }
178 void MapRect(ImplEESdrObject& rObj);
182 // ===================================================================
184 class SdrObject;
185 class SdrPage;
187 class ImplEscherExSdr : public ImplEESdrWriter
189 private:
190 const SdrPage* mpSdrPage;
191 EscherSolverContainer* mpSolverContainer;
193 public:
194 ImplEscherExSdr( EscherEx& rEx );
195 virtual ~ImplEscherExSdr();
197 SvxDrawPage* ImplInitPage( const SdrPage& rPage );
198 void ImplWriteCurrentPage();
200 UINT32 ImplWriteTheShape( ImplEESdrObject& rObj );
202 void ImplExitPage();
203 void ImplFlushSolverContainer();
208 #endif // _ESCHESDO_HXX