Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / image.hxx
blob6ee8f897e94269596d5fe189ce981d499baf68bd
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_IMAGE_HXX
21 #define INCLUDED_VCL_IMAGE_HXX
23 #include <vcl/dllapi.h>
24 #include <tools/gen.hxx>
25 #include <tools/resid.hxx>
26 #include <tools/solar.h>
27 #include <vcl/bitmapex.hxx>
28 #include <vcl/outdev.hxx>
30 #include <com/sun/star/uno/Reference.hxx>
32 #include <memory>
33 #include <vector>
35 struct ImplImage;
36 struct ImplImageList;
37 namespace com { namespace sun { namespace star { namespace graphic { class XGraphic;} } } }
39 namespace vcl
41 enum class ImageType
43 Size16,
44 Size26,
45 Size32,
46 Small = Size16,
47 LAST = Size32,
51 #define IMAGELIST_IMAGE_NOTFOUND ((sal_uInt16)0xFFFF)
53 class SAL_WARN_UNUSED VCL_DLLPUBLIC Image
55 friend class ::OutputDevice;
57 public:
58 Image();
59 explicit Image( const BitmapEx& rBitmapEx );
60 explicit Image( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic );
61 explicit Image( const OUString &rPNGFileUrl );
63 Size GetSizePixel() const;
65 BitmapEx GetBitmapEx() const;
67 bool operator!() const { return !mpImplData; }
68 bool operator==( const Image& rImage ) const;
69 bool operator!=( const Image& rImage ) const { return !(Image::operator==( rImage )); }
71 void Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle, const Size* pSize = nullptr);
73 private:
75 std::shared_ptr<ImplImage> mpImplData;
77 SAL_DLLPRIVATE void ImplInit( const BitmapEx& rBmpEx );
80 #endif // INCLUDED_VCL_IMAGE_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */