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 _DXCANVAS_CANVASBITMAP_HXX
21 #define _DXCANVAS_CANVASBITMAP_HXX
23 #include <cppuhelper/compbase4.hxx>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/rendering/XBitmapCanvas.hpp>
27 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
28 #include <com/sun/star/beans/XFastPropertySet.hpp>
30 #include <basegfx/vector/b2isize.hxx>
32 #include <boost/shared_ptr.hpp>
34 #include <cppuhelper/compbase3.hxx>
35 #include <comphelper/uno3.hxx>
36 #include <canvas/base/disambiguationhelper.hxx>
37 #include <canvas/base/integerbitmapbase.hxx>
39 #include "dx_bitmapprovider.hxx"
40 #include "dx_bitmapcanvashelper.hxx"
41 #include "dx_devicehelper.hxx"
42 #include "dx_impltools.hxx"
43 #include "dx_ibitmap.hxx"
46 /* Definition of CanvasBitmap class */
50 typedef ::cppu::WeakComponentImplHelper4
< ::com::sun::star::rendering::XBitmapCanvas
,
51 ::com::sun::star::rendering::XIntegerBitmap
,
52 ::com::sun::star::lang::XServiceInfo
,
53 ::com::sun::star::beans::XFastPropertySet
> CanvasBitmapBase_Base
;
54 typedef ::canvas::IntegerBitmapBase
< ::canvas::DisambiguationHelper
< CanvasBitmapBase_Base
>,
57 ::cppu::OWeakObject
> CanvasBitmap_Base
;
59 class CanvasBitmap
: public CanvasBitmap_Base
, public BitmapProvider
62 /** Create a canvas bitmap for the given surface
65 Surface to create API object for.
68 Reference device, with which bitmap should be compatible
70 CanvasBitmap( const IBitmapSharedPtr
& rSurface
,
71 const DeviceRef
& rDevice
);
73 /// Dispose all internal references
74 virtual void disposeThis();
77 virtual OUString SAL_CALL
getImplementationName( ) throw (::com::sun::star::uno::RuntimeException
);
78 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
79 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException
);
82 virtual IBitmapSharedPtr
getBitmap() const { return mpBitmap
; }
84 virtual ::com::sun::star::uno::Any SAL_CALL
getFastPropertyValue(sal_Int32 nHandle
) throw (::com::sun::star::uno::RuntimeException
);
85 virtual void SAL_CALL
setFastPropertyValue(sal_Int32
, const ::com::sun::star::uno::Any
&) throw (::com::sun::star::uno::RuntimeException
) {}
88 /** MUST hold here, too, since CanvasHelper only contains a
89 raw pointer (without refcounting)
92 IBitmapSharedPtr mpBitmap
;
96 #endif /* _DXCANVAS_CANVASBITMAP_HXX */
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */