1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_INC_SLIDEBITMAP_HXX
21 #define INCLUDED_SLIDESHOW_SOURCE_INC_SLIDEBITMAP_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <cppcanvas/canvas.hxx>
25 #include <cppcanvas/bitmap.hxx>
27 #include <basegfx/point/b2dpoint.hxx>
28 #include <basegfx/polygon/b2dpolypolygon.hxx>
32 namespace com::sun::star::rendering
{ class XBitmap
; }
35 /* Definition of SlideBitmap class */
37 namespace slideshow::internal
40 /** Little wrapper encapsulating an XBitmap
42 This is to insulate us from changes to the preferred
43 transport format for bitmaps (using a sole XBitmap here is
44 a hack, since it is not guaranteed to work, or to work
45 without data loss, across different canvases). And since
46 we don't want to revert to a VCL Bitmap here, have to wait
47 until basegfx bitmap tooling is ready.
49 TODO(F2): Add support for Canvas-independent bitmaps
50 here. Then, Slide::getInitialSlideBitmap and
51 Slide::getFinalSlideBitmap must also be adapted (they no
52 longer need a Canvas ptr, which is actually a hack now).
57 explicit SlideBitmap( const ::cppcanvas::BitmapSharedPtr
& rBitmap
);
58 SlideBitmap(const SlideBitmap
&) = delete;
59 SlideBitmap
& operator=(const SlideBitmap
&) = delete;
61 bool draw( const ::cppcanvas::CanvasSharedPtr
& rCanvas
) const;
62 ::basegfx::B2ISize
getSize() const;
63 void move( const ::basegfx::B2DPoint
& rNewPos
);
64 void clip( const ::basegfx::B2DPolyPolygon
& rClipPoly
);
66 const css::uno::Reference
< css::rendering::XBitmap
>& getXBitmap() const;
69 ::basegfx::B2DPoint maOutputPos
;
70 ::basegfx::B2DPolyPolygon maClipPoly
;
72 // TODO(Q2): Remove UNO bitmap as the transport medium
73 css::uno::Reference
< css::rendering::XBitmap
> mxBitmap
;
76 typedef ::std::shared_ptr
< SlideBitmap
> SlideBitmapSharedPtr
;
80 #endif // INCLUDED_SLIDESHOW_SOURCE_INC_SLIDEBITMAP_HXX
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */