1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGM_HXX
21 #define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_ICGM_CGM_HXX
23 #include <com/sun/star/frame/XModel.hpp>
27 #include "cgmtypes.hxx"
33 class CGMImpressOutAct
;
40 friend class CGMChart
;
41 friend class CGMBitmap
;
42 friend class CGMElements
;
43 friend class CGMImpressOutAct
;
53 bool mbAngReverse
; // AngularDirection
62 bool mbInDefaultReplacement
;
63 sal_uInt32 mnAct4PostReset
;
64 std::unique_ptr
<CGMBitmap
> mpBitmapInUse
;
65 std::unique_ptr
<CGMChart
> mpChart
; // if sal_True->"SHWSLIDEREC"
66 // otherwise "BEGINPIC" commands
67 // controls page inserting
68 std::unique_ptr
<CGMElements
> pElement
;
69 std::unique_ptr
<CGMElements
> pCopyOfE
;
70 std::unique_ptr
<CGMImpressOutAct
> mpOutAct
;
71 ::std::vector
< std::unique_ptr
<sal_uInt8
[]> > maDefRepList
;
72 ::std::vector
< sal_uInt32
> maDefRepSizeList
;
74 sal_uInt8
* mpSource
; // start of source buffer that is not increased
75 // ( instead use mnParaCount to index )
76 sal_uInt8
* mpEndValidSource
; // end position in source buffer of last valid data
77 sal_uInt32 mnParaSize
; // actual parameter size which has been done so far
78 sal_uInt32 mnActCount
; // increased by each action
79 std::unique_ptr
<sal_uInt8
[]>
80 mpBuf
; // source stream operation -> then this is allocated for
81 // the temp input buffer
84 sal_uInt32 mnElementClass
;
85 sal_uInt32 mnElementID
;
86 sal_uInt32 mnElementSize
; // full parameter size for the latest action
88 sal_uInt32
ImplGetUI16();
89 static sal_uInt8
ImplGetByte( sal_uInt32 nSource
, sal_uInt32 nPrecision
);
90 sal_Int32
ImplGetI( sal_uInt32 nPrecision
);
91 sal_uInt32
ImplGetUI( sal_uInt32 nPrecision
);
92 static void ImplGetSwitch4( const sal_uInt8
* pSource
, sal_uInt8
* pDest
);
93 static void ImplGetSwitch8( const sal_uInt8
* pSource
, sal_uInt8
* pDest
);
94 double ImplGetFloat( RealPrecision
, sal_uInt32 nRealSize
);
95 sal_uInt32
ImplGetBitmapColor( bool bDirectColor
= false );
96 void ImplSetMapMode();
97 void ImplSetUnderlineMode();
98 void ImplMapDouble( double& );
99 void ImplMapX( double& );
100 void ImplMapY( double& );
101 void ImplMapPoint( FloatPoint
& );
102 inline double ImplGetIY();
103 inline double ImplGetFY();
104 inline double ImplGetIX();
105 inline double ImplGetFX();
106 sal_uInt32
ImplGetPointSize();
107 void ImplGetPoint( FloatPoint
& rFloatPoint
, bool bMap
= false );
108 void ImplGetRectangle( FloatRect
&, bool bMap
= false );
109 void ImplGetRectangleNS( FloatRect
& );
110 void ImplGetVector( double* );
111 static double ImplGetOrientation( FloatPoint
const & rCenter
, FloatPoint
const & rPoint
);
112 static void ImplSwitchStartEndAngle( double& rStartAngle
, double& rEndAngle
);
113 bool ImplGetEllipse( FloatPoint
& rCenter
, FloatPoint
& rRadius
, double& rOrientation
);
115 void ImplDefaultReplacement();
127 void ImplDoClass15();
133 CGM(css::uno::Reference
< css::frame::XModel
> const & rModel
);
134 sal_uInt32
GetBackGroundColor() const;
135 bool IsValid() const { return mbStatus
; };
136 bool IsFinished() const { return mbIsFinished
; };
137 bool Write( SvStream
& rIStm
);
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */