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 .
23 #include <vcl/bitmapex.hxx>
25 #include <boost/unordered_map.hpp>
38 void Create( const BitmapEx
& rBmpEx
, long nItemWidth
, long nItemHeight
,sal_uInt16 nInitSize
);
39 void ColorTransform();
40 void Draw( sal_uInt16 nPos
, OutputDevice
* pDev
, const Point
& rPos
, sal_uInt16 nStyle
, const Size
* pSize
= NULL
);
45 BitmapEx maDisabledBmpEx
;
46 BitmapEx
* mpDisplayBmp
;
51 void ImplUpdateDisplayBmp( OutputDevice
* pOutDev
);
52 void ImplUpdateDisabledBmpEx( int nPos
);
54 private: // prevent assignment and copy construction
55 ImplImageBmp( const ImplImageBmp
& );
56 void operator=( const ImplImageBmp
& );
63 enum ImageType
{ IMAGETYPE_BITMAP
, IMAGETYPE_IMAGE
};
71 ::rtl::OUString maName
;
72 // Images identified by either name, or by id
76 ImageAryData( const rtl::OUString
&aName
,
77 sal_uInt16 nId
, const BitmapEx
&aBitmap
);
78 ImageAryData( const ImageAryData
& rData
);
81 bool IsLoadable() { return maBitmapEx
.IsEmpty() && !maName
.isEmpty(); }
82 void Load(const rtl::OUString
&rPrefix
);
84 ImageAryData
& operator=( const ImageAryData
& rData
);
87 // ------------------------------------------------------------------------------
91 typedef std::vector
<ImageAryData
*> ImageAryDataVec
;
92 typedef boost::unordered_map
< rtl::OUString
, ImageAryData
*, rtl::OUStringHash
>
95 ImageAryDataVec maImages
;
96 ImageAryDataNameHash maNameHash
;
97 rtl::OUString maPrefix
;
99 sal_uIntPtr mnRefCount
;
102 ImplImageList( const ImplImageList
&aSrc
);
105 void AddImage( const ::rtl::OUString
&aName
,
106 sal_uInt16 nId
, const BitmapEx
&aBitmapEx
);
107 void RemoveImage( sal_uInt16 nPos
);
110 // --------------------
111 // - ImplImageRefData -
112 // --------------------
114 struct ImplImageRefData
116 ImplImageList
* mpImplData
;
119 ImplImageRefData() {} // Um Warning zu umgehen
122 sal_Bool
IsEqual( const ImplImageRefData
& rData
);
131 ImplImageBmp
* mpImageBitmap
;
134 ImplImageData( const BitmapEx
& rBmpEx
);
137 sal_Bool
IsEqual( const ImplImageData
& rData
);
146 sal_uIntPtr mnRefCount
;
147 // TODO: use inheritance to get rid of meType+mpData
154 private: // prevent assignment and copy construction
155 ImplImage( const ImplImage
&);
156 void operator=( const ImplImage
&);
159 #endif // _SV_IMAGE_H
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */