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: slidebitmap.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_SLIDEBITMAP_HXX
32 #define INCLUDED_SLIDESHOW_SLIDEBITMAP_HXX
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <cppcanvas/canvas.hxx>
36 #include <cppcanvas/bitmap.hxx>
38 #include <basegfx/point/b2dpoint.hxx>
39 #include <basegfx/polygon/b2dpolypolygon.hxx>
41 #include <boost/shared_ptr.hpp>
42 #include <boost/noncopyable.hpp>
44 namespace com
{ namespace sun
{ namespace star
{ namespace rendering
50 /* Definition of SlideBitmap class */
57 /** Little wrapper encapsulating an XBitmap
59 This is to insulate us from changes to the preferred
60 transport format for bitmaps (using a sole XBitmap here is
61 a hack, since it is not guaranteed to work, or to work
62 without data loss, across different canvases). And since
63 we don't want to revert to a VCL Bitmap here, have to wait
64 until basegfx bitmap tooling is ready.
66 TODO(F2): Add support for Canvas-independent bitmaps
67 here. Then, Slide::getInitialSlideBitmap and
68 Slide::getFinalSlideBitmap must also be adapted (they no
69 longer need a Canvas ptr, which is actually a hack now).
71 class SlideBitmap
: private boost::noncopyable
74 SlideBitmap( const ::cppcanvas::BitmapSharedPtr
& rBitmap
);
76 bool draw( const ::cppcanvas::CanvasSharedPtr
& rCanvas
) const;
77 ::basegfx::B2ISize
getSize() const;
78 ::basegfx::B2DPoint
getOutputPos() const{return maOutputPos
;}
79 void move( const ::basegfx::B2DPoint
& rNewPos
);
80 void clip( const ::basegfx::B2DPolyPolygon
& rClipPoly
);
82 ::com::sun::star::uno::Reference
<
83 ::com::sun::star::rendering::XBitmap
> getXBitmap();
86 ::basegfx::B2DPoint maOutputPos
;
87 ::basegfx::B2DPolyPolygon maClipPoly
;
89 // TODO(Q2): Remove UNO bitmap as the transport medium
90 ::com::sun::star::uno::Reference
<
91 ::com::sun::star::rendering::XBitmap
> mxBitmap
;
94 typedef ::boost::shared_ptr
< SlideBitmap
> SlideBitmapSharedPtr
;
98 #endif /* INCLUDED_SLIDESHOW_SLIDEBITMAP_HXX */