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: dx_canvasbitmap.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 _DXCANVAS_CANVASBITMAP_HXX
32 #define _DXCANVAS_CANVASBITMAP_HXX
34 #include <cppuhelper/compbase4.hxx>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
38 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
39 #include <com/sun/star/beans/XFastPropertySet.hpp>
41 #include <basegfx/vector/b2isize.hxx>
43 #include <boost/shared_ptr.hpp>
45 #include <cppuhelper/compbase3.hxx>
46 #include <comphelper/uno3.hxx>
47 #include <canvas/base/basemutexhelper.hxx>
48 #include <canvas/base/integerbitmapbase.hxx>
50 #include "dx_bitmapprovider.hxx"
51 #include "dx_bitmapcanvashelper.hxx"
52 #include "dx_devicehelper.hxx"
53 #include "dx_impltools.hxx"
54 #include "dx_ibitmap.hxx"
57 /* Definition of CanvasBitmap class */
61 typedef ::cppu::WeakComponentImplHelper4
< ::com::sun::star::rendering::XBitmapCanvas
,
62 ::com::sun::star::rendering::XIntegerBitmap
,
63 ::com::sun::star::lang::XServiceInfo
,
64 ::com::sun::star::beans::XFastPropertySet
> CanvasBitmapBase_Base
;
65 typedef ::canvas::IntegerBitmapBase
< ::canvas::BaseMutexHelper
< CanvasBitmapBase_Base
>,
68 ::cppu::OWeakObject
> CanvasBitmap_Base
;
70 class CanvasBitmap
: public CanvasBitmap_Base
, public BitmapProvider
73 /** Create a canvas bitmap for the given surface
76 Surface to create API object for.
79 Reference device, with which bitmap should be compatible
81 CanvasBitmap( const IBitmapSharedPtr
& rSurface
,
82 const DeviceRef
& rDevice
);
84 /// Dispose all internal references
85 virtual void SAL_CALL
disposing();
88 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
89 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
90 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
93 virtual IBitmapSharedPtr
getBitmap() const { return mpBitmap
; }
95 virtual ::com::sun::star::uno::Any SAL_CALL
getFastPropertyValue(sal_Int32 nHandle
) throw (::com::sun::star::uno::RuntimeException
);
96 virtual void SAL_CALL
setFastPropertyValue(sal_Int32
, const ::com::sun::star::uno::Any
&) throw (::com::sun::star::uno::RuntimeException
) {}
99 /** MUST hold here, too, since CanvasHelper only contains a
100 raw pointer (without refcounting)
103 IBitmapSharedPtr mpBitmap
;
107 #endif /* _DXCANVAS_CANVASBITMAP_HXX */