Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / vcl / inc / impgraph.hxx
blob0b09c1261452f06efb1dc43a8ddd7eca92b0cb02
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 _SV_IMPGRAPH_HXX
21 #define _SV_IMPGRAPH_HXX
23 #include <vcl/bitmap.hxx>
24 #include <vcl/bitmapex.hxx>
25 #include <vcl/animate.hxx>
26 #include <vcl/gdimtf.hxx>
27 #include <vcl/graph.h>
28 #include <vcl/svgdata.hxx>
30 // ---------------
31 // - ImpSwapInfo -
32 // ---------------
34 struct ImpSwapInfo
36 MapMode maPrefMapMode;
37 Size maPrefSize;
40 // --------------
41 // - ImpGraphic -
42 // --------------
44 class OutputDevice;
45 class GfxLink;
46 struct ImpSwapFile;
47 class GraphicConversionParameters;
49 class ImpGraphic
51 friend class Graphic;
53 private:
55 GDIMetaFile maMetaFile;
56 BitmapEx maEx;
57 ImpSwapInfo maSwapInfo;
58 Animation* mpAnimation;
59 GraphicReader* mpContext;
60 ImpSwapFile* mpSwapFile;
61 GfxLink* mpGfxLink;
62 GraphicType meType;
63 String maDocFileURLStr;
64 sal_uLong mnDocFilePos;
65 mutable sal_uLong mnSizeBytes;
66 sal_uLong mnRefCount;
67 sal_Bool mbSwapOut;
68 sal_Bool mbSwapUnderway;
70 // SvgData support
71 SvgDataPtr maSvgData;
73 private:
75 ImpGraphic();
76 ImpGraphic( const ImpGraphic& rImpGraphic );
77 ImpGraphic( const Bitmap& rBmp );
78 ImpGraphic( const BitmapEx& rBmpEx );
79 ImpGraphic(const SvgDataPtr& rSvgDataPtr);
80 ImpGraphic( const Animation& rAnimation );
81 ImpGraphic( const GDIMetaFile& rMtf );
82 virtual ~ImpGraphic();
84 ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
85 sal_Bool operator==( const ImpGraphic& rImpGraphic ) const;
86 sal_Bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
88 void ImplClearGraphics( sal_Bool bCreateSwapInfo );
89 void ImplClear();
91 GraphicType ImplGetType() const;
92 void ImplSetDefaultType();
93 sal_Bool ImplIsSupportedGraphic() const;
95 sal_Bool ImplIsTransparent() const;
96 sal_Bool ImplIsAlpha() const;
97 sal_Bool ImplIsAnimated() const;
98 sal_Bool ImplIsEPS() const;
100 Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
101 BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
102 Animation ImplGetAnimation() const;
103 const GDIMetaFile& ImplGetGDIMetaFile() const;
106 Size ImplGetPrefSize() const;
107 void ImplSetPrefSize( const Size& rPrefSize );
109 MapMode ImplGetPrefMapMode() const;
110 void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
112 sal_uLong ImplGetSizeBytes() const;
114 void ImplDraw( OutputDevice* pOutDev,
115 const Point& rDestPt ) const;
116 void ImplDraw( OutputDevice* pOutDev,
117 const Point& rDestPt,
118 const Size& rDestSize ) const;
120 void ImplStartAnimation( OutputDevice* pOutDev,
121 const Point& rDestPt,
122 const Size& rDestSize,
123 long nExtraData = 0,
124 OutputDevice* pFirstFrameOutDev = NULL );
125 void ImplStopAnimation( OutputDevice* pOutputDevice = NULL,
126 long nExtraData = 0 );
128 void ImplSetAnimationNotifyHdl( const Link& rLink );
129 Link ImplGetAnimationNotifyHdl() const;
131 sal_uLong ImplGetAnimationLoopCount() const;
133 private:
135 GraphicReader* ImplGetContext();
136 void ImplSetContext( GraphicReader* pReader );
138 private:
140 void ImplSetDocFileName( const String& rName, sal_uLong nFilePos );
141 const String& ImplGetDocFileName() const;
142 sal_uLong ImplGetDocFilePos() const;
144 sal_Bool ImplReadEmbedded( SvStream& rIStream, sal_Bool bSwap = sal_False );
145 sal_Bool ImplWriteEmbedded( SvStream& rOStream );
147 sal_Bool ImplSwapIn();
148 sal_Bool ImplSwapIn( SvStream* pIStm );
150 sal_Bool ImplSwapOut();
151 sal_Bool ImplSwapOut( SvStream* pOStm );
153 sal_Bool ImplIsSwapOut() const;
155 void ImplSetLink( const GfxLink& );
156 GfxLink ImplGetLink();
157 sal_Bool ImplIsLink() const;
159 sal_uLong ImplGetChecksum() const;
161 sal_Bool ImplExportNative( SvStream& rOStm ) const;
163 friend SvStream& operator<<( SvStream& rOStm, const ImpGraphic& rImpGraphic );
164 friend SvStream& operator>>( SvStream& rIStm, ImpGraphic& rImpGraphic );
166 // SvgData support
167 const SvgDataPtr& getSvgData() const;
170 #endif // _SV_IMPGRAPH_HXX
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */