Debian Codegraph @

cppcanvas/source/wrapper/implcanvas.hxx

raw
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 <com/sun/star/uno/Reference.hxx>
23 #include <com/sun/star/rendering/ViewState.hpp>
24 #include <cppcanvas/canvas.hxx>
25
26 #include <optional>
27 #include <basegfx/polygon/b2dpolypolygon.hxx>
28
29
30 namespace com::sun::star::rendering
31 {
32 class XCanvas;
33 }
34
35
36 /* Definition of ImplCanvas */
37
38 namespace cppcanvas::internal
39 {
40
41 class ImplCanvas : public virtual Canvas
42 {
43 public:
44 explicit ImplCanvas( css::uno::Reference< css::rendering::XCanvas > xCanvas );
45 virtual ~ImplCanvas() override;
46
47 ImplCanvas(ImplCanvas const &) = default;
48 ImplCanvas(ImplCanvas &&) = default;
49 ImplCanvas & operator =(ImplCanvas const &) = delete; // due to const mxCanvas
50 ImplCanvas & operator =(ImplCanvas &&) = delete; // due to const mxCanvas
51
52 virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) override;
53 virtual ::basegfx::B2DHomMatrix getTransformation() const override;
54
55 virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) override;
56 virtual void setClip() override;
57 virtual ::basegfx::B2DPolyPolygon const* getClip() const override;
58
59 virtual CanvasSharedPtr clone() const override;
60
61 virtual void clear() const override;
62
63 virtual css::uno::Reference<
64 css::rendering::XCanvas > getUNOCanvas() const override;
65
66 virtual css::rendering::ViewState getViewState() const override;
67
68 private:
69 mutable css::rendering::ViewState maViewState;
70 std::optional<basegfx::B2DPolyPolygon> maClipPolyPolygon;
71 const css::uno::Reference< css::rendering::XCanvas > mxCanvas;
72 };
73
74 }
75
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */