LibreOffice Module cppcanvas (master) 1
implcanvas.hxx
Go to the documentation of this file.
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>
28
29
30namespace basegfx
31{
32 class B2DHomMatrix;
33 class B2DPolyPolygon;
34}
35
37{
38 class XCanvas;
39}
40
41
42/* Definition of ImplCanvas */
43
44namespace cppcanvas::internal
45{
46
47 class ImplCanvas : public virtual Canvas
48 {
49 public:
50 explicit ImplCanvas( css::uno::Reference< css::rendering::XCanvas > xCanvas );
51 virtual ~ImplCanvas() override;
52
53 ImplCanvas(ImplCanvas const &) = default;
54 ImplCanvas(ImplCanvas &&) = default;
55 ImplCanvas & operator =(ImplCanvas const &) = delete; // due to const mxCanvas
56 ImplCanvas & operator =(ImplCanvas &&) = delete; // due to const mxCanvas
57
58 virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) override;
59 virtual ::basegfx::B2DHomMatrix getTransformation() const override;
60
61 virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) override;
62 virtual void setClip() override;
63 virtual ::basegfx::B2DPolyPolygon const* getClip() const override;
64
65 virtual CanvasSharedPtr clone() const override;
66
67 virtual void clear() const override;
68
69 virtual css::uno::Reference<
70 css::rendering::XCanvas > getUNOCanvas() const override;
71
72 virtual css::rendering::ViewState getViewState() const override;
73
74 private:
75 mutable css::rendering::ViewState maViewState;
76 std::optional<basegfx::B2DPolyPolygon> maClipPolyPolygon;
77 const css::uno::Reference< css::rendering::XCanvas > mxCanvas;
78 };
79
80}
81
82/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Canvas interface.
Definition: canvas.hxx:55
virtual void clear() const override
Definition: implcanvas.cxx:85
virtual css::rendering::ViewState getViewState() const override
Definition: implcanvas.cxx:98
virtual void setClip() override
Definition: implcanvas.cxx:69
const css::uno::Reference< css::rendering::XCanvas > mxCanvas
Definition: implcanvas.hxx:77
virtual CanvasSharedPtr clone() const override
Definition: implcanvas.cxx:80
css::rendering::ViewState maViewState
Definition: implcanvas.hxx:75
ImplCanvas(ImplCanvas const &)=default
virtual ::basegfx::B2DHomMatrix getTransformation() const override
Definition: implcanvas.cxx:55
virtual ~ImplCanvas() override
Definition: implcanvas.cxx:46
ImplCanvas(css::uno::Reference< css::rendering::XCanvas > xCanvas)
virtual ::basegfx::B2DPolyPolygon const * getClip() const override
Get current clip.
Definition: implcanvas.cxx:75
std::optional< basegfx::B2DPolyPolygon > maClipPolyPolygon
Definition: implcanvas.hxx:76
virtual void setTransformation(const ::basegfx::B2DHomMatrix &rMatrix) override
Definition: implcanvas.cxx:50
ImplCanvas(ImplCanvas &&)=default
virtual css::uno::Reference< css::rendering::XCanvas > getUNOCanvas() const override
Definition: implcanvas.cxx:91
ImplCanvas & operator=(ImplCanvas const &)=delete
std::shared_ptr< Canvas > CanvasSharedPtr