Bump version to 6.0-36
[LibreOffice.git] / slideshow / source / engine / shapes / viewbackgroundshape.hxx
blob57598c15dad7a36c8201cf355ce4a94af4e71f24
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_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWBACKGROUNDSHAPE_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWBACKGROUNDSHAPE_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/rendering/XBitmap.hpp>
26 #include <basegfx/range/b2drectangle.hxx>
27 #include <basegfx/matrix/b2dhommatrix.hxx>
28 #include <cppcanvas/spritecanvas.hxx>
30 #include <memory>
32 #include "gdimtftools.hxx"
33 #include <viewlayer.hxx>
36 namespace slideshow
38 namespace internal
40 /** This class is the viewable representation of a draw
41 document's background, associated to a specific View
43 The class is able to render the associated background on
44 View implementations.
46 class ViewBackgroundShape
48 public:
49 /** Create a ViewBackgroundShape for the given View
51 @param rView
52 The associated View object.
54 @param rShapeBounds
55 Bounds of the background shape, in document coordinate
56 system.
58 ViewBackgroundShape( const ViewLayerSharedPtr& rViewLayer,
59 const ::basegfx::B2DRectangle& rShapeBounds );
60 /// Forbid copy construction
61 ViewBackgroundShape(const ViewBackgroundShape&) = delete;
62 /// Forbid copy assignment
63 ViewBackgroundShape& operator=(const ViewBackgroundShape&) = delete;
65 /** Query the associated view layer of this shape
67 const ViewLayerSharedPtr& getViewLayer() const;
69 bool render( const GDIMetaFileSharedPtr& rMtf ) const;
71 private:
72 /** Prefetch bitmap for given canvas
74 bool prefetch( const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas,
75 const GDIMetaFileSharedPtr& rMtf ) const;
77 /** The view layer this object is part of.
79 ViewLayerSharedPtr mpViewLayer;
81 /// Generated content bitmap, already with correct output size
82 mutable css::uno::Reference< css::rendering::XBitmap > mxBitmap;
84 /// The last metafile a render object was generated for
85 mutable GDIMetaFileSharedPtr mpLastMtf;
87 /// The canvas, mpRenderer is associated with
88 mutable ::basegfx::B2DHomMatrix maLastTransformation;
90 const ::basegfx::B2DRectangle maBounds;
93 typedef ::std::shared_ptr< ViewBackgroundShape > ViewBackgroundShapeSharedPtr;
98 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_SHAPES_VIEWBACKGROUNDSHAPE_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */