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_VCL_INC_IMAGE_H
21 #define INCLUDED_VCL_INC_IMAGE_H
23 #include <vcl/bitmapex.hxx>
25 #include <unordered_map>
36 void Create( const BitmapEx
& rBmpEx
, long nItemWidth
, long nItemHeight
,sal_uInt16 nInitSize
);
37 void ColorTransform();
38 void Draw( sal_uInt16 nPos
, OutputDevice
* pDev
, const Point
& rPos
, DrawImageFlags nStyle
, const Size
* pSize
= NULL
);
43 BitmapChecksum maBitmapChecksum
;
45 BitmapEx maDisabledBmpEx
;
46 BitmapEx
* mpDisplayBmp
;
51 void ImplUpdateDisplayBmp( OutputDevice
* pOutDev
);
52 void ImplUpdateDisabledBmpEx( int nPos
);
55 ImplImageBmp( const ImplImageBmp
& ) SAL_DELETED_FUNCTION
;
56 void operator=( const ImplImageBmp
& ) SAL_DELETED_FUNCTION
;
61 enum ImageType
{ IMAGETYPE_BITMAP
, IMAGETYPE_IMAGE
};
68 // Images identified by either name, or by id
72 ImageAryData( const OUString
&aName
,
73 sal_uInt16 nId
, const BitmapEx
&aBitmap
);
74 ImageAryData( const ImageAryData
& rData
);
77 bool IsLoadable() { return maBitmapEx
.IsEmpty() && !maName
.isEmpty(); }
78 void Load(const OUString
&rPrefix
);
80 ImageAryData
& operator=( const ImageAryData
& rData
);
85 typedef std::vector
<ImageAryData
*> ImageAryDataVec
;
86 typedef std::unordered_map
< OUString
, ImageAryData
*, OUStringHash
>
89 ImageAryDataVec maImages
;
90 ImageAryDataNameHash maNameHash
;
93 sal_uIntPtr mnRefCount
;
96 ImplImageList( const ImplImageList
&aSrc
);
99 void AddImage( const OUString
&aName
,
100 sal_uInt16 nId
, const BitmapEx
&aBitmapEx
);
101 void RemoveImage( sal_uInt16 nPos
);
104 // - ImplImageRefData -
106 struct ImplImageRefData
108 ImplImageList
* mpImplData
;
111 ImplImageRefData() {} // Um Warning zu umgehen
114 bool IsEqual( const ImplImageRefData
& rData
);
121 ImplImageBmp
* mpImageBitmap
;
124 ImplImageData( const BitmapEx
& rBmpEx
);
127 bool IsEqual( const ImplImageData
& rData
);
134 sal_uIntPtr mnRefCount
;
135 // TODO: use inheritance to get rid of meType+mpData
143 ImplImage( const ImplImage
&) SAL_DELETED_FUNCTION
;
144 void operator=( const ImplImage
&) SAL_DELETED_FUNCTION
;
147 #endif // INCLUDED_VCL_INC_IMAGE_H
149 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */