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: outact.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 ************************************************************************/
31 #ifndef CGM_OUTACT_HXX_
32 #define CGM_OUTACT_HXX_
34 #include <com/sun/star/awt/Gradient.hpp>
35 #include <com/sun/star/drawing/XDrawPages.hpp>
36 #include <com/sun/star/drawing/XDrawPage.hpp>
37 #include <com/sun/star/drawing/XShape.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 #include <com/sun/star/beans/XPropertySet.hpp>
42 #define CGM_OUTACT_MAX_GROUP_LEVEL 64
46 #include <tools/poly.hxx>
48 typedef struct NodeFrameSet
52 ::com::sun::star::awt::Size nSize
;
60 sal_uInt16 mnCurrentPage
; // defaulted to zero
62 sal_uInt32 mnGroupActCount
; // grouping
63 sal_uInt32 mnGroupLevel
;
64 sal_uInt32
* mpGroupLevel
;
66 USHORT mnIndex
; // figure
69 PolyPolygon maPolyPolygon
;
70 ::com::sun::star::awt::Gradient
* mpGradient
;
75 CGMOutAct( CGM
& rCGM
);
77 virtual void FirstOutPut() { mpCGM
->mbFirstOutPut
= sal_False
; } ;
78 virtual void InsertPage() { mnCurrentPage
++; } ;
79 virtual void BeginGroup() {} ;
80 virtual void EndGroup() {};
81 virtual void EndGrouping() {} ;
86 void RegPolyLine( Polygon
&, sal_Bool bReverse
= sal_False
) ;
87 void SetGradientOffset( long nHorzOfs
, long nVertOfs
, sal_uInt32 nType
);
88 void SetGradientAngle( long nAngle
);
89 void SetGradientDescriptor( sal_uInt32 nColorFrom
, sal_uInt32 nColorTo
);
90 void SetGradientStyle( sal_uInt32 nStyle
, double fRatio
);
91 virtual void DrawRectangle( FloatRect
& ) {} ;
92 virtual void DrawEllipse( FloatPoint
&, FloatPoint
&, double& ) {} ;
93 virtual void DrawEllipticalArc( FloatPoint
&, FloatPoint
&, double&,
94 sal_uInt32
, double&, double&) {} ;
95 virtual void DrawBitmap( CGMBitmapDescriptor
* ) {} ;
96 virtual void DrawPolygon( Polygon
& ) {} ;
97 virtual void DrawPolyLine( Polygon
& ) {} ;
98 virtual void DrawPolybezier( Polygon
& ) {} ;
99 virtual void DrawPolyPolygon( PolyPolygon
& ) {} ;
100 virtual void DrawText( ::com::sun::star::awt::Point
&, ::com::sun::star::awt::Size
&, char*, sal_uInt32
, FinalFlag
) {} ;
101 virtual void AppendText( char*, sal_uInt32
, FinalFlag
) {} ;
102 virtual sal_uInt32
DrawText( TextEntry
*, NodeFrameSet
&, sal_uInt32
) { return 0; } ;
103 virtual void DrawChart(){} ;
106 class CGMImpressOutAct
: public CGMOutAct
108 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPages
> maXDrawPages
;
109 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XDrawPage
> maXDrawPage
;
111 // ::com::sun::star::uno::Reference< XServiceRegistry > maXServiceRegistry;
112 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> maXMultiServiceFactory
;
113 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> maXServiceManagerSC
;
114 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
> maXShape
;
115 sal_Bool
ImplCreateShape( const ::rtl::OUString
& rType
);
117 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> maXPropSet
;
118 ::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShapes
> maXShapes
;
120 sal_uInt32 nFinalTextCount
;
122 sal_Bool
ImplInitPage();
123 void ImplSetOrientation( FloatPoint
& RefPoint
, double& Orientation
) ;
124 void ImplSetLineBundle() ;
125 void ImplSetFillBundle() ;
126 void ImplSetTextBundle( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> & ) ;
128 CGMImpressOutAct( CGM
&, const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> & ) ;
129 ~CGMImpressOutAct() {} ;
130 virtual void InsertPage() ;
131 virtual void BeginGroup() ;
132 virtual void EndGroup() ;
133 virtual void EndGrouping() ;
134 virtual void DrawRectangle( FloatRect
& ) ;
135 virtual void DrawEllipse( FloatPoint
& center
, FloatPoint
&, double& Orientation
) ;
136 virtual void DrawEllipticalArc( FloatPoint
& center
, FloatPoint
& size
, double& orientation
,
137 sal_uInt32 etype
, double& startangle
, double& endangle
) ;
138 virtual void DrawBitmap( CGMBitmapDescriptor
* ) ;
139 virtual void DrawPolygon( Polygon
& ) ;
140 virtual void DrawPolyLine( Polygon
& ) ;
141 virtual void DrawPolybezier( Polygon
& ) ;
142 virtual void DrawPolyPolygon( PolyPolygon
& ) ;
143 virtual void DrawText( ::com::sun::star::awt::Point
& TextRectPos
, ::com::sun::star::awt::Size
& TextRectSize
, char* String
, sal_uInt32 StringSize
, FinalFlag
) ;
144 virtual void AppendText( char* String
, sal_uInt32 StringSize
, FinalFlag
) ;
145 virtual sal_uInt32
DrawText( TextEntry
*, NodeFrameSet
&, sal_uInt32
) ;
146 virtual void DrawChart();