Get the style color and number just once
[LibreOffice.git] / cppcanvas / source / wrapper / implbitmap.hxx
blob1b60669497376c6cbc6f893d81b221af2bcd2183
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 #pragma once
22 #include <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/rendering/XBitmap.hpp>
25 #include <cppcanvas/bitmap.hxx>
26 #include <canvasgraphichelper.hxx>
29 /*Definition of ImplBitmap */
31 namespace cppcanvas::internal
33 // share partial CanvasGraphic implementation from CanvasGraphicHelper
34 class ImplBitmap : public virtual ::cppcanvas::Bitmap, protected CanvasGraphicHelper
36 public:
38 ImplBitmap( const CanvasSharedPtr& rParentCanvas,
39 const css::uno::Reference< css::rendering::XBitmap >& rBitmap );
41 virtual ~ImplBitmap() override;
43 // CanvasGraphic implementation (that was not already implemented by CanvasGraphicHelper)
44 virtual bool draw() const override;
45 virtual void drawAlphaModulated( double nAlphaModulation ) const override;
47 virtual BitmapCanvasSharedPtr getBitmapCanvas() const override;
49 // Bitmap implementation
50 virtual css::uno::Reference< css::rendering::XBitmap > getUNOBitmap() const override;
52 private:
53 ImplBitmap(const ImplBitmap&) = delete;
54 ImplBitmap& operator=( const ImplBitmap& ) = delete;
56 const css::uno::Reference< css::rendering::XBitmap > mxBitmap;
57 BitmapCanvasSharedPtr mpBitmapCanvas;
62 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */