update dev300-m58
[ooovba.git] / canvas / source / directx / dx_canvasbitmap.hxx
blobc7d4fc8aa5e72e5f07a48c56a9ddc7412ac52a10
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dx_canvasbitmap.hxx,v $
10 * $Revision: 1.4 $
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 */
59 namespace dxcanvas
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 >,
66 BitmapCanvasHelper,
67 ::osl::MutexGuard,
68 ::cppu::OWeakObject > CanvasBitmap_Base;
70 class CanvasBitmap : public CanvasBitmap_Base, public BitmapProvider
72 public:
73 /** Create a canvas bitmap for the given surface
75 @param rSurface
76 Surface to create API object for.
78 @param rDevice
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();
87 // XServiceInfo
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);
92 // BitmapProvider
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) {}
98 private:
99 /** MUST hold here, too, since CanvasHelper only contains a
100 raw pointer (without refcounting)
102 DeviceRef mpDevice;
103 IBitmapSharedPtr mpBitmap;
107 #endif /* _DXCANVAS_CANVASBITMAP_HXX */