1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <tools/stream.hxx>
25 #include <vcl/gdimtf.hxx>
26 #include <vcl/bitmap.hxx>
27 
28 /************************************************************************
29 |*    Impl_CacheElement
30 |*    Impl_Cache
31 |*
32 |*    Beschreibung
33 *************************************************************************/
34 class Impl_OlePres
35 {
36 	sal_uLong	nFormat;
37     sal_uInt16	nAspect;
38 	Bitmap *		pBmp;
39 	GDIMetaFile *	pMtf;
40 
41 	sal_uInt32  nAdvFlags;
42 	sal_Int32 	nJobLen;
43 	sal_uInt8*	pJob;
44 	Size	aSize;		// Groesse in 100TH_MM
45 public:
Impl_OlePres(sal_uLong nF)46 					Impl_OlePres( sal_uLong nF )
47 						: nFormat( nF )
48 						, pBmp( NULL )
49 						, pMtf( NULL )
50 						, nAdvFlags( 0x2 )	// in Dokument gefunden
51 						, nJobLen( 0 )
52 						, pJob( NULL )
53 					{}
~Impl_OlePres()54 					~Impl_OlePres()
55 					{
56 						delete pJob;
57 						delete pBmp;
58 						delete pMtf;
59 					}
SetMtf(const GDIMetaFile & rMtf)60 	void	SetMtf( const GDIMetaFile & rMtf )
61 			{
62 				if( pMtf )
63 					delete pMtf;
64 				pMtf = new GDIMetaFile( rMtf );
65 			}
GetBitmap() const66 	Bitmap *GetBitmap() const { return pBmp; }
GetMetaFile() const67 	GDIMetaFile *GetMetaFile() const { return pMtf; }
GetFormat() const68 	sal_uLong	GetFormat() const { return nFormat; }
SetAspect(sal_uInt16 nAsp)69 	void	SetAspect( sal_uInt16 nAsp ) { nAspect = nAsp; }
GetAdviseFlags() const70 	sal_uLong	GetAdviseFlags() const { return nAdvFlags; }
SetAdviseFlags(sal_uLong nAdv)71 	void	SetAdviseFlags( sal_uLong nAdv ) { nAdvFlags = nAdv; }
SetSize(const Size & rSize)72 	void	SetSize( const Size & rSize ) { aSize = rSize; }
73 			/// return sal_False => unknown format
74 	void 	Write( SvStream & rStm );
75 };
76 
77 
78