merge the formfield patch from ooo-build
[ooovba.git] / canvas / source / null / null_canvasbitmap.hxx
bloba43d75e1b9e29a6d79fa39f127322b3cbd75fd3c
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: null_canvasbitmap.hxx,v $
10 * $Revision: 1.3 $
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 _NULLCANVAS_CANVASBITMAP_HXX
32 #define _NULLCANVAS_CANVASBITMAP_HXX
34 #include <cppuhelper/compbase3.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>
40 #include <basegfx/vector/b2isize.hxx>
42 #include <boost/shared_ptr.hpp>
44 #include <canvas/base/integerbitmapbase.hxx>
46 #include "null_canvashelper.hxx"
47 #include "null_spritecanvas.hxx"
48 #include "null_usagecounter.hxx"
51 /* Definition of CanvasBitmap class */
53 namespace nullcanvas
55 typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas,
56 ::com::sun::star::rendering::XIntegerBitmap,
57 ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base;
58 typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >,
59 CanvasHelper,
60 ::osl::MutexGuard,
61 ::cppu::OWeakObject > CanvasBitmap_Base;
63 class CanvasBitmap : public CanvasBitmap_Base,
64 private UsageCounter< CanvasBitmap >
66 public:
67 /** Create a canvas bitmap for the given surface
69 @param rSize
70 Size of the bitmap
72 @param rDevice
73 Reference device, with which bitmap should be compatible
75 CanvasBitmap( const ::basegfx::B2ISize& rSize,
76 const DeviceRef& rDevice,
77 bool bHasAlpha );
79 /// Dispose all internal references
80 virtual void SAL_CALL disposing();
82 // XServiceInfo
83 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
84 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
85 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
87 private:
88 /** MUST hold here, too, since CanvasHelper only contains a
89 raw pointer (without refcounting)
91 DeviceRef mpDevice;
95 #endif /* _NULLCANVAS_CANVASBITMAP_HXX */