/src/libreoffice/include/cppcanvas/canvasgraphic.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #pragma once |
21 | | |
22 | | #include <sal/types.h> |
23 | | #include <memory> |
24 | | |
25 | | namespace basegfx |
26 | | { |
27 | | class B2DHomMatrix; |
28 | | class B2DPolyPolygon; |
29 | | } |
30 | | |
31 | | |
32 | | /* Definition of CanvasGraphic interface */ |
33 | | |
34 | | namespace cppcanvas |
35 | | { |
36 | | // forward declaration, since tools::PolyPolygon also derives from CanvasGraphic |
37 | | typedef std::shared_ptr< class PolyPolygon > PolyPolygonSharedPtr; |
38 | | |
39 | | |
40 | | /** This interface defines basic properties of |
41 | | objects that can be painted on a Canvas |
42 | | */ |
43 | | class CanvasGraphic |
44 | | { |
45 | | public: |
46 | | |
47 | 0 | virtual ~CanvasGraphic() {} |
48 | | |
49 | | /** Set object transformation matrix |
50 | | */ |
51 | | virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) = 0; |
52 | | |
53 | | /** Set object clipping polygon |
54 | | */ |
55 | | virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0; |
56 | | /** Clear object clipping polygon |
57 | | */ |
58 | | virtual void setClip() = 0; |
59 | | |
60 | | /** Set object composite mode |
61 | | * @see css::rendering::CompositeOperation |
62 | | */ |
63 | | virtual void setCompositeOp( sal_Int8 aOp ) = 0; |
64 | | |
65 | | /** Render to parent canvas |
66 | | |
67 | | This method renders the content to the parent canvas, |
68 | | i.e. the canvas this object was constructed for. |
69 | | |
70 | | @return whether the rendering finished successfully. |
71 | | */ |
72 | | virtual bool draw() const = 0; |
73 | | |
74 | | }; |
75 | | } |
76 | | |
77 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |