update dev300-m58
[ooovba.git] / canvas / source / cairo / cairo_surfaceprovider.hxx
blob5150c8d0933b96c9075abc93c2edc1198d13d24b
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: cairo_surfaceprovider.hxx,v $
10 * $Revision: 1.2 $
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 _CAIROCANVAS_SURFACEPROVIDER_HXX
32 #define _CAIROCANVAS_SURFACEPROVIDER_HXX
34 #include <rtl/ref.hxx>
35 #include <com/sun/star/uno/XInterface.hpp>
37 #include "cairo_cairo.hxx"
39 using namespace ::cairo;
41 class OutputDevice;
42 class Bitmap;
44 namespace cairocanvas
46 class Bitmap;
48 /* Definition of RepaintTarget interface */
50 /** Target interface for XCachedPrimitive implementations
52 This interface must be implemented on all canvas
53 implementations that hand out XCachedPrimitives
55 class SurfaceProvider : public ::com::sun::star::uno::XInterface
57 public:
58 virtual ~SurfaceProvider() {}
60 /** Query surface from this provider
62 This should return the default surface to render on.
64 virtual SurfaceSharedPtr getSurface() = 0;
66 /// create new surface in given size
67 virtual SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize,
68 Content aContent = CAIRO_CONTENT_COLOR_ALPHA ) = 0;
69 /// create new surface from given bitmap
70 virtual SurfaceSharedPtr createSurface( ::Bitmap& rBitmap ) = 0;
72 /** convert surface between alpha and non-alpha
73 channel. returns new surface on success, NULL otherwise
75 virtual SurfaceSharedPtr changeSurface( bool bHasAlpha, bool bCopyContent ) = 0;
77 /** Provides the underlying vcl outputdevice this surface renders on
79 virtual OutputDevice* getOutputDevice() = 0;
82 typedef ::rtl::Reference< SurfaceProvider > SurfaceProviderRef;
85 #endif