merge the formfield patch from ooo-build
[ooovba.git] / goodies / source / filter.vcl / icgm / cgm.hxx
blob0e52fd4165ba20ff7039d0c13abf5e2e855d3901
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: cgm.hxx,v $
10 * $Revision: 1.7 $
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_HXX_
32 #define CGM_HXX_
34 #include <com/sun/star/frame/XModel.hpp>
36 // ---------------------------------------------------------------
37 #undef CGM_USER_BREAKPOINT
39 #define CGM_IMPORT_CGM 0x00000001
41 #define CGM_EXPORT_IMPRESS 0x00000100
42 #define CGM_EXPORT_META 0x00000200
43 //#define CGM_EXPORT_COMMENT 0x00000400
45 // ---------------------------------------------------------------
47 #include <tools/solar.h>
48 #include <rtl/ustring.hxx>
49 #include <tools/list.hxx>
50 #include "cgmtypes.hxx"
52 // ---------------------------------------------------------------
54 class List;
55 class Bundle;
56 class Graphic;
57 class SvStream;
58 class CGMChart;
59 class CGMBitmap;
60 class CGMOutAct;
61 class CGMElements;
62 class BitmapColor;
63 class GDIMetaFile;
64 class VirtualDevice;
65 class CGMBitmapDescriptor;
67 class CGM
69 friend class CGMChart;
70 friend class CGMBitmap;
71 friend class CGMElements;
72 friend class CGMOutAct;
73 friend class CGMImpressOutAct;
75 double mnOutdx; // Ausgabe Groesse in 1/100TH mm
76 double mnOutdy; // auf das gemappt wird
77 double mnVDCXadd;
78 double mnVDCYadd;
79 double mnVDCXmul;
80 double mnVDCYmul;
81 double mnVDCdx;
82 double mnVDCdy;
83 double mnXFraction;
84 double mnYFraction;
85 sal_Bool mbAngReverse; // AngularDirection
87 Graphic* mpGraphic; // ifdef CGM_EXPORT_META
88 SvStream* mpCommentOut; // ifdef CGM_EXPORT_COMMENT
90 sal_Bool mbStatus;
91 sal_Bool mbMetaFile;
92 sal_Bool mbIsFinished;
93 sal_Bool mbPicture;
94 sal_Bool mbPictureBody;
95 sal_Bool mbFigure;
96 sal_Bool mbFirstOutPut;
97 sal_uInt32 mnAct4PostReset;
98 CGMBitmap* mpBitmapInUse;
99 CGMChart* mpChart; // if sal_True->"SHWSLIDEREC"
100 // otherwise "BEGINPIC" commands
101 // controlls page inserting
102 CGMElements* pElement;
103 CGMElements* pCopyOfE;
104 CGMOutAct* mpOutAct;
105 List maDefRepList;
106 List maDefRepSizeList;
108 sal_uInt8* mpSource; // source buffer that is not increased
109 // ( instead use mnParaCount to index )
110 sal_uInt32 mnParaSize; // actual parameter size which has been done so far
111 sal_uInt32 mnActCount; // increased by each action
112 sal_uInt8* mpBuf; // source stream operation -> then this is allocated for
113 // the temp input buffer
115 sal_uInt32 mnMode; // source description
116 sal_uInt32 mnEscape; //
117 sal_uInt32 mnElementClass; //
118 sal_uInt32 mnElementID; //
119 sal_uInt32 mnElementSize; // full parameter size for the latest action
121 void ImplCGMInit();
122 sal_uInt32 ImplGetUI16( sal_uInt32 nAlign = 0 );
123 sal_uInt8 ImplGetByte( sal_uInt32 nSource, sal_uInt32 nPrecision );
124 long ImplGetI( sal_uInt32 nPrecision );
125 sal_uInt32 ImplGetUI( sal_uInt32 nPrecision );
126 void ImplGetSwitch4( sal_uInt8* pSource, sal_uInt8* pDest );
127 void ImplGetSwitch8( sal_uInt8* pSource, sal_uInt8* pDest );
128 double ImplGetFloat( RealPrecision, sal_uInt32 nRealSize );
129 sal_uInt32 ImplGetBitmapColor( sal_Bool bDirectColor = sal_False );
130 void ImplSetMapMode();
131 void ImplMapDouble( double& );
132 void ImplMapX( double& );
133 void ImplMapY( double& );
134 void ImplMapPoint( FloatPoint& );
135 inline double ImplGetIY();
136 inline double ImplGetFY();
137 inline double ImplGetIX();
138 inline double ImplGetFX();
139 sal_uInt32 ImplGetPointSize();
140 void ImplGetPoint( FloatPoint& rFloatPoint, sal_Bool bMap = sal_False );
141 void ImplGetRectangle( FloatRect&, sal_Bool bMap = sal_False );
142 void ImplGetRectangleNS( FloatRect& );
143 void ImplGetVector( double* );
144 double ImplGetOrientation( FloatPoint& rCenter, FloatPoint& rPoint );
145 void ImplSwitchStartEndAngle( double& rStartAngle, double& rEndAngle );
146 sal_Bool ImplGetEllipse( FloatPoint& rCenter, FloatPoint& rRadius, double& rOrientation );
148 void ImplDefaultReplacement();
149 void ImplDoClass();
150 void ImplDoClass0();
151 void ImplDoClass1();
152 void ImplDoClass2();
153 void ImplDoClass3();
154 void ImplDoClass4();
155 void ImplDoClass5();
156 void ImplDoClass6();
157 void ImplDoClass7();
158 void ImplDoClass8();
159 void ImplDoClass9();
160 void ImplDoClass15();
162 public:
164 ~CGM();
166 CGM( sal_uInt32 nMode, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & rModel );
167 #ifdef CGM_EXPORT_META
168 VirtualDevice* mpVirDev;
169 GDIMetaFile* mpGDIMetaFile;
170 #endif
171 void ImplComment( sal_uInt32, const char* );
172 sal_uInt32 GetBackGroundColor();
173 sal_Bool IsValid() { return mbStatus; };
174 sal_Bool IsFinished() { return mbIsFinished; };
175 sal_Bool Write( SvStream& rIStm );
177 friend SvStream& operator>>( SvStream& rOStm, CGM& rCGM );
180 #endif