Implement getDirectory, signal+slot
[LibreOffice.git] / include / cppcanvas / canvas.hxx
blob425d38e44213f4279ef097ea63ef6815c4e6ef8b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_CPPCANVAS_CANVAS_HXX
21 #define INCLUDED_CPPCANVAS_CANVAS_HXX
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <cppcanvas/font.hxx>
25 #include <cppcanvas/color.hxx>
26 #include <memory>
28 namespace basegfx
30 class B2DHomMatrix;
31 class B2DPolyPolygon;
34 namespace com { namespace sun { namespace star { namespace rendering
36 class XCanvas;
37 struct ViewState;
38 } } } }
41 /* Definition of BitmapCanvas */
43 namespace cppcanvas
45 class PolyPolygon;
46 class Canvas;
48 // forward declaration, since tools::PolyPolygon also references Canvas
49 typedef std::shared_ptr< PolyPolygon > PolyPolygonSharedPtr;
51 // forward declaration, since cloneCanvas() also references Canvas
52 typedef std::shared_ptr< Canvas > CanvasSharedPtr;
54 /** Canvas interface
56 class Canvas
58 public:
59 enum
61 /** Extra pixel used when canvas anti-aliases.
63 Enlarge the bounding box of drawing primitives by this
64 amount in both dimensions, and on both sides of the
65 bounds, to account for extra pixel touched outside the
66 actual primitive bounding box, when the canvas
67 performs anti-aliasing.
69 ANTIALIASING_EXTRA_SIZE=2
72 virtual ~Canvas() {}
74 virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
75 virtual ::basegfx::B2DHomMatrix getTransformation() const = 0;
77 virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
78 virtual void setClip() = 0;
80 /** Get current clip
82 @return NULL, if no clip is set, otherwise the current clip poly-polygon
84 virtual ::basegfx::B2DPolyPolygon const* getClip() const = 0;
86 virtual CanvasSharedPtr clone() const = 0;
87 virtual void clear() const = 0;
89 // this should be considered private. if RTTI gets enabled
90 // someday, remove that to a separate interface
91 virtual css::uno::Reference<
92 css::rendering::XCanvas > getUNOCanvas() const = 0;
93 virtual css::rendering::ViewState getViewState() const = 0;
98 #endif // INCLUDED_CPPCANVAS_CANVAS_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */