1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: viewbackgroundshape.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef INCLUDED_SLIDESHOW_VIEWBACKGROUNDSHAPE_HXX
32 #define INCLUDED_SLIDESHOW_VIEWBACKGROUNDSHAPE_HXX
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <com/sun/star/rendering/XBitmap.hpp>
37 #include <basegfx/range/b2drectangle.hxx>
38 #include <basegfx/matrix/b2dhommatrix.hxx>
39 #include <cppcanvas/spritecanvas.hxx>
41 #include <boost/shared_ptr.hpp>
42 #include <boost/utility.hpp>
44 #include "gdimtftools.hxx"
45 #include "viewlayer.hxx"
52 /** This class is the viewable representation of a draw
53 document's background, associated to a specific View
55 The class is able to render the associated background on
58 class ViewBackgroundShape
: private boost::noncopyable
61 /** Create a ViewBackgroundShape for the given View
64 The associated View object.
67 Bounds of the background shape, in document coordinate
70 ViewBackgroundShape( const ViewLayerSharedPtr
& rViewLayer
,
71 const ::basegfx::B2DRectangle
& rShapeBounds
);
73 /** Query the associated view layer of this shape
75 ViewLayerSharedPtr
getViewLayer() const;
77 bool render( const GDIMetaFileSharedPtr
& rMtf
) const;
80 /** Prefetch bitmap for given canvas
82 bool prefetch( const ::cppcanvas::CanvasSharedPtr
& rDestinationCanvas
,
83 const GDIMetaFileSharedPtr
& rMtf
) const;
85 /** The view layer this object is part of.
87 ViewLayerSharedPtr mpViewLayer
;
89 /// Generated content bitmap, already with correct output size
90 mutable ::com::sun::star::uno::Reference
<
91 ::com::sun::star::rendering::XBitmap
> mxBitmap
;
93 /// The last metafile a render object was generated for
94 mutable GDIMetaFileSharedPtr mpLastMtf
;
96 /// The canvas, mpRenderer is associated with
97 mutable ::basegfx::B2DHomMatrix maLastTransformation
;
99 const ::basegfx::B2DRectangle maBounds
;
102 typedef ::boost::shared_ptr
< ViewBackgroundShape
> ViewBackgroundShapeSharedPtr
;
107 #endif /* INCLUDED_SLIDESHOW_VIEWBACKGROUNDSHAPE_HXX */