LibreOffice Module cppcanvas (master) 1
implbitmap.hxx
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#pragma once
21
22#include <com/sun/star/uno/Reference.hxx>
23#include <com/sun/star/rendering/XBitmap.hpp>
24
25#include <cppcanvas/bitmap.hxx>
27
28
29/*Definition of ImplBitmap */
30
31namespace cppcanvas::internal
32{
33 // share partial CanvasGraphic implementation from CanvasGraphicHelper
34 class ImplBitmap : public virtual ::cppcanvas::Bitmap, protected CanvasGraphicHelper
35 {
36 public:
37
38 ImplBitmap( const CanvasSharedPtr& rParentCanvas,
39 const css::uno::Reference< css::rendering::XBitmap >& rBitmap );
40
41 virtual ~ImplBitmap() override;
42
43 // CanvasGraphic implementation (that was not already implemented by CanvasGraphicHelper)
44 virtual bool draw() const override;
45 virtual void drawAlphaModulated( double nAlphaModulation ) const override;
46
47 virtual BitmapCanvasSharedPtr getBitmapCanvas() const override;
48
49 // Bitmap implementation
50 virtual css::uno::Reference< css::rendering::XBitmap > getUNOBitmap() const override;
51
52 private:
53 ImplBitmap(const ImplBitmap&) = delete;
54 ImplBitmap& operator=( const ImplBitmap& ) = delete;
55
56 const css::uno::Reference< css::rendering::XBitmap > mxBitmap;
58 };
59
60}
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This interface defines a Bitmap canvas object.
Definition: bitmap.hxx:45
const css::uno::Reference< css::rendering::XBitmap > mxBitmap
Definition: implbitmap.hxx:56
virtual BitmapCanvasSharedPtr getBitmapCanvas() const override
Definition: implbitmap.cxx:96
BitmapCanvasSharedPtr mpBitmapCanvas
Definition: implbitmap.hxx:57
virtual void drawAlphaModulated(double nAlphaModulation) const override
Render to parent canvas, with global alpha.
Definition: implbitmap.cxx:72
virtual ~ImplBitmap() override
Definition: implbitmap.cxx:47
ImplBitmap(const CanvasSharedPtr &rParentCanvas, const css::uno::Reference< css::rendering::XBitmap > &rBitmap)
virtual css::uno::Reference< css::rendering::XBitmap > getUNOBitmap() const override
Definition: implbitmap.cxx:101
virtual bool draw() const override
Render to parent canvas.
Definition: implbitmap.cxx:51
ImplBitmap(const ImplBitmap &)=delete
ImplBitmap & operator=(const ImplBitmap &)=delete
std::shared_ptr< BitmapCanvas > BitmapCanvasSharedPtr
std::shared_ptr< Canvas > CanvasSharedPtr