1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: eschesdo.hxx,v $
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 ************************************************************************/
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
;
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
;
56 BOOL mbEmptyPresObj
: 1;
58 void Init( ImplEESdrWriter
& rEx
);
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
);
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
)
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;
95 BOOL
ImplHasText() const;
100 // -------------------------------------------------------------------
101 // fractions of the Draw PPTWriter
104 namespace com
{ namespace sun
{ namespace star
{
110 class XStatusIndicator
;
113 class EscherExHostAppData
;
116 class ImplEESdrWriter
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
;
131 EscherExHostAppData
* mpHostAppData
;
133 UINT32 mnPagesWritten
;
135 UINT32 mnShapeMasterTitle
;
136 UINT32 mnShapeMasterBody
;
140 UINT32 mnOutlinerCount
;
141 UINT32 mnPrevTextStyle
;
142 UINT32 mnStatMaxValue
;
144 UINT16 mnEffectCount
;
146 BOOL mbIsTitlePossible
;
147 BOOL mbStatusIndicator
;
151 ImplEESdrWriter( EscherEx
& rEx
);
153 BOOL
ImplInitPageValues();
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
);
175 Point
ImplMapPoint( const Point
& rPoint
);
176 Size
ImplMapSize( const Size
& rSize
);
177 EscherExHostAppData
* ImplGetHostData() { return mpHostAppData
; }
178 void MapRect(ImplEESdrObject
& rObj
);
182 // ===================================================================
187 class ImplEscherExSdr
: public ImplEESdrWriter
190 const SdrPage
* mpSdrPage
;
191 EscherSolverContainer
* mpSolverContainer
;
194 ImplEscherExSdr( EscherEx
& rEx
);
195 virtual ~ImplEscherExSdr();
197 SvxDrawPage
* ImplInitPage( const SdrPage
& rPage
);
198 void ImplWriteCurrentPage();
200 UINT32
ImplWriteTheShape( ImplEESdrObject
& rObj
);
203 void ImplFlushSolverContainer();
208 #endif // _ESCHESDO_HXX