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: cgm.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 ************************************************************************/
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 // ---------------------------------------------------------------
65 class CGMBitmapDescriptor
;
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
85 sal_Bool mbAngReverse
; // AngularDirection
87 Graphic
* mpGraphic
; // ifdef CGM_EXPORT_META
88 SvStream
* mpCommentOut
; // ifdef CGM_EXPORT_COMMENT
92 sal_Bool mbIsFinished
;
94 sal_Bool mbPictureBody
;
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
;
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
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();
160 void ImplDoClass15();
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
;
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
);