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 .
22 #include <rtl/ref.hxx>
23 #include <com/sun/star/uno/XInterface.hpp>
25 #include <basegfx/vector/b2isize.hxx>
26 #include <vcl/cairo.hxx>
33 /* Definition of RepaintTarget interface */
35 /** Target interface for XCachedPrimitive implementations
37 This interface must be implemented on all canvas
38 implementations that hand out XCachedPrimitives
40 class SAL_LOPLUGIN_ANNOTATE("crosscast") SurfaceProvider
: public css::uno::XInterface
43 virtual ~SurfaceProvider() {}
45 /** Query surface from this provider
47 This should return the default surface to render on.
49 virtual ::cairo::SurfaceSharedPtr
getSurface() = 0;
51 /// create new surface in given size
52 virtual ::cairo::SurfaceSharedPtr
createSurface( const ::basegfx::B2ISize
& rSize
,
54 /// create new surface from given bitmap
55 virtual ::cairo::SurfaceSharedPtr
createSurface( ::Bitmap
& rBitmap
) = 0;
57 /** convert surface from alpha to non-alpha, does not copy content
58 channel. returns new surface on success, NULL otherwise
60 virtual ::cairo::SurfaceSharedPtr
changeSurface() = 0;
62 /** Provides the underlying vcl outputdevice this surface renders on
64 virtual OutputDevice
* getOutputDevice() = 0;
67 typedef ::rtl::Reference
< SurfaceProvider
> SurfaceProviderRef
;
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */