build fix
[LibreOffice.git] / vcl / inc / impgraph.hxx
blobd016f55b40070405ab0f692205ab0278ae428a9a
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 INCLUDED_VCL_INC_IMPGRAPH_HXX
21 #define INCLUDED_VCL_INC_IMPGRAPH_HXX
23 struct ImpSwapInfo
25 MapMode maPrefMapMode;
26 Size maPrefSize;
29 class OutputDevice;
30 class GfxLink;
31 struct ImpSwapFile;
32 class GraphicConversionParameters;
34 class ImpGraphic final
36 friend class Graphic;
38 private:
40 GDIMetaFile maMetaFile;
41 BitmapEx maEx;
42 ImpSwapInfo maSwapInfo;
43 std::unique_ptr<Animation> mpAnimation;
44 std::shared_ptr<GraphicReader> mpContext;
45 std::shared_ptr<ImpSwapFile> mpSwapFile;
46 std::unique_ptr<GfxLink> mpGfxLink;
47 GraphicType meType;
48 mutable sal_uLong mnSizeBytes;
49 bool mbSwapOut;
50 bool mbSwapUnderway;
51 bool mbDummyContext;
52 SvgDataPtr maSvgData;
53 css::uno::Sequence<sal_Int8> maPdfData;
55 private:
57 ImpGraphic();
58 ImpGraphic( const ImpGraphic& rImpGraphic );
59 ImpGraphic( const Bitmap& rBmp );
60 ImpGraphic( const BitmapEx& rBmpEx );
61 ImpGraphic(const SvgDataPtr& rSvgDataPtr);
62 ImpGraphic( const Animation& rAnimation );
63 ImpGraphic( const GDIMetaFile& rMtf );
64 public:
65 ~ImpGraphic();
66 private:
68 ImpGraphic& operator=( const ImpGraphic& rImpGraphic );
69 bool operator==( const ImpGraphic& rImpGraphic ) const;
70 bool operator!=( const ImpGraphic& rImpGraphic ) const { return !( *this == rImpGraphic ); }
72 void ImplClearGraphics( bool bCreateSwapInfo );
73 void ImplClear();
75 GraphicType ImplGetType() const { return meType;}
76 void ImplSetDefaultType();
77 bool ImplIsSupportedGraphic() const;
79 bool ImplIsTransparent() const;
80 bool ImplIsAlpha() const;
81 bool ImplIsAnimated() const;
82 bool ImplIsEPS() const;
84 Bitmap ImplGetBitmap(const GraphicConversionParameters& rParameters) const;
85 BitmapEx ImplGetBitmapEx(const GraphicConversionParameters& rParameters) const;
86 Animation ImplGetAnimation() const;
87 const GDIMetaFile& ImplGetGDIMetaFile() const;
89 Size ImplGetPrefSize() const;
90 void ImplSetPrefSize( const Size& rPrefSize );
92 MapMode ImplGetPrefMapMode() const;
93 void ImplSetPrefMapMode( const MapMode& rPrefMapMode );
95 sal_uLong ImplGetSizeBytes() const;
97 void ImplDraw( OutputDevice* pOutDev,
98 const Point& rDestPt ) const;
99 void ImplDraw( OutputDevice* pOutDev,
100 const Point& rDestPt,
101 const Size& rDestSize ) const;
103 void ImplStartAnimation( OutputDevice* pOutDev,
104 const Point& rDestPt,
105 const Size& rDestSize,
106 long nExtraData,
107 OutputDevice* pFirstFrameOutDev );
108 void ImplStopAnimation( OutputDevice* pOutputDevice,
109 long nExtraData );
111 void ImplSetAnimationNotifyHdl( const Link<Animation*,void>& rLink );
112 Link<Animation*,void> ImplGetAnimationNotifyHdl() const;
114 sal_uLong ImplGetAnimationLoopCount() const;
116 private:
118 std::shared_ptr<GraphicReader>& ImplGetContext() { return mpContext;}
119 void ImplSetContext( const std::shared_ptr<GraphicReader>& pReader );
120 void ImplSetDummyContext( bool value ) { mbDummyContext = value; }
121 bool ImplReadEmbedded( SvStream& rIStream );
122 bool ImplWriteEmbedded( SvStream& rOStream );
124 bool ImplSwapIn();
125 bool ImplSwapIn( SvStream* pIStm );
127 bool ImplSwapOut();
128 void ImplSwapOutAsLink();
129 bool ImplSwapOut( SvStream* pOStm );
131 bool ImplIsSwapOut() const { return mbSwapOut;}
132 bool ImplIsDummyContext() const { return mbDummyContext; }
133 void ImplSetLink( const GfxLink& );
134 GfxLink ImplGetLink();
135 bool ImplIsLink() const;
137 BitmapChecksum ImplGetChecksum() const;
139 bool ImplExportNative( SvStream& rOStm ) const;
141 friend SvStream& WriteImpGraphic( SvStream& rOStm, const ImpGraphic& rImpGraphic );
142 friend SvStream& ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic );
144 const SvgDataPtr& getSvgData() const { return maSvgData; }
147 #endif // INCLUDED_VCL_INC_IMPGRAPH_HXX
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */