LibreOffice Module vcl (master) 1
image.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_VCL_INC_IMAGE_H
21#define INCLUDED_VCL_INC_IMAGE_H
22
23#include <vcl/bitmapex.hxx>
24#include <vcl/gdimtf.hxx>
25
26class SalGraphics;
27
29{
30private:
35 OUString maStockName;
37 std::unique_ptr<GDIMetaFile> mxMetaFile;
38
42
43 bool loadStockAtScale(SalGraphics* pGraphics, BitmapEx &rBitmapEx);
44
45public:
46 ImplImage(const BitmapEx& rBitmapEx);
47 ImplImage(const GDIMetaFile& rMetaFile);
48 ImplImage(OUString aStockName);
49
50 bool isStock() const
51 {
52 return maStockName.getLength() > 0;
53 }
54
55 const OUString & getStock() const
56 {
57 return maStockName;
58 }
59
63 BitmapEx const & getBitmapEx(bool bDisabled = false);
65 BitmapEx const & getBitmapExForHiDPI(bool bDisabled, SalGraphics* pGraphics);
66
67 bool isEqual(const ImplImage &ref) const;
68 bool isSizeEmpty() const
69 {
70 return maSizePixel == Size();
71 }
72};
73
74#endif // INCLUDED_VCL_INC_IMAGE_H
75
76/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
BitmapChecksum maBitmapChecksum
Definition: image.h:31
BitmapEx const & getBitmapEx(bool bDisabled=false)
Legacy - the original bitmap.
Definition: ImplImage.cxx:123
BitmapEx maBitmapEx
Original bitmap - or cache of a potentially scaled bitmap.
Definition: image.h:40
const OUString & getStock() const
Definition: image.h:55
bool isSizeEmpty() const
Definition: image.h:68
bool isStock() const
Definition: image.h:50
BitmapEx maDisabledBitmapEx
Definition: image.h:41
Size maSizePixel
if non-empty: cached original size of maStockName else Size of maBitmap
Definition: image.h:33
Size getSizePixel()
get size in co-ordinates not scaled for HiDPI
Definition: ImplImage.cxx:102
bool loadStockAtScale(SalGraphics *pGraphics, BitmapEx &rBitmapEx)
Definition: ImplImage.cxx:56
BitmapEx const & getBitmapExForHiDPI(bool bDisabled, SalGraphics *pGraphics)
Taking account of HiDPI scaling.
Definition: ImplImage.cxx:153
ImplImage(const BitmapEx &rBitmapEx)
Definition: ImplImage.cxx:36
std::unique_ptr< GDIMetaFile > mxMetaFile
rare case of dynamically created Image contents
Definition: image.h:37
bool isEqual(const ImplImage &ref) const
Definition: ImplImage.cxx:143
OUString maStockName
If set - defines the bitmap via images.zip*.
Definition: image.h:35