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 
25 class ImplImage
26 {
27 private:
33  OUString maStockName;
34 
35 
39 
40  bool loadStockAtScale(double fScale, BitmapEx &rBitmapEx);
41 
42 public:
43  ImplImage(const BitmapEx& rBitmapEx);
44  ImplImage(const OUString &aStockName, Size const & rPreferedSize);
45 
46  bool isStock() const
47  {
48  return maStockName.getLength() > 0;
49  }
50 
51  OUString getStock() const
52  {
53  return maStockName;
54  }
55 
59  BitmapEx const & getBitmapEx(bool bDisabled = false);
61  BitmapEx const & getBitmapExForHiDPI(bool bDisabled = false);
62 
63  bool isEqual(const ImplImage &ref) const;
64  bool isSizeEmpty() const
65  {
66  return maSizePixel == Size();
67  }
68 };
69 
70 #endif // INCLUDED_VCL_INC_IMAGE_H
71 
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_uInt64 BitmapChecksum
Definition: checksum.hxx:30
BitmapEx maBitmapEx
Original bitmap - or cache of a potentially scaled bitmap.
Definition: image.h:37
bool isEqual(const ImplImage &ref) const
Definition: ImplImage.cxx:132
OUString getStock() const
Definition: image.h:51
Size maPreferedSizePixel
Definition: image.h:31
bool isStock() const
Definition: image.h:46
Size maSizePixel
if non-empty: cached original size of maStockName else Size of maBitmap
Definition: image.h:30
BitmapEx const & getBitmapExForHiDPI(bool bDisabled=false)
Taking account of HiDPI scaling.
Definition: ImplImage.cxx:142
OUString maStockName
If set - defines the bitmap via images.zip*.
Definition: image.h:33
BitmapChecksum maBitmapChecksum
Definition: image.h:28
BitmapEx const & getBitmapEx(bool bDisabled=false)
Legacy - the original bitmap.
Definition: ImplImage.cxx:112
bool loadStockAtScale(double fScale, BitmapEx &rBitmapEx)
Definition: ImplImage.cxx:47
bool isSizeEmpty() const
Definition: image.h:64
ImplImage(const BitmapEx &rBitmapEx)
Definition: ImplImage.cxx:31
BitmapEx maDisabledBitmapEx
Definition: image.h:38
Size getSizePixel()
get size in co-ordinates not scaled for HiDPI
Definition: ImplImage.cxx:91