bump product version to 4.1.6.2
[LibreOffice.git] / include / cppcanvas / canvas.hxx
blob0a77e7129a435d14dde4b802ec132397f02cea20
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 _CPPCANVAS_CANVAS_HXX
21 #define _CPPCANVAS_CANVAS_HXX
23 #include <com/sun/star/uno/Reference.hxx>
25 #include <boost/shared_ptr.hpp>
26 #include <cppcanvas/font.hxx>
27 #include <cppcanvas/color.hxx>
30 namespace basegfx
32 class B2DHomMatrix;
33 class B2DPolyPolygon;
36 namespace com { namespace sun { namespace star { namespace rendering
38 class XCanvas;
39 struct ViewState;
40 } } } }
43 /* Definition of BitmapCanvas */
45 namespace cppcanvas
47 class PolyPolygon;
48 class Canvas;
50 // forward declaration, since PolyPolygon also references Canvas
51 typedef ::boost::shared_ptr< PolyPolygon > PolyPolygonSharedPtr;
53 // forward declaration, since cloneCanvas() also references Canvas
54 typedef ::boost::shared_ptr< Canvas > CanvasSharedPtr;
56 /** Canvas interface
58 class Canvas
60 public:
61 enum
63 /** Extra pixel used when canvas anti-aliases.
65 Enlarge the bounding box of drawing primitives by this
66 amount in both dimensions, and on both sides of the
67 bounds, to account for extra pixel touched outside the
68 actual primitive bounding box, when the canvas
69 performs anti-aliasing.
71 ANTIALIASING_EXTRA_SIZE=2
74 virtual ~Canvas() {}
76 virtual void setTransformation( const ::basegfx::B2DHomMatrix& rMatrix ) = 0;
77 virtual ::basegfx::B2DHomMatrix getTransformation() const = 0;
79 virtual void setClip( const ::basegfx::B2DPolyPolygon& rClipPoly ) = 0;
80 virtual void setClip() = 0;
82 /** Get current clip
84 @return NULL, if no clip is set, otherwise the current clip poly-polygon
86 virtual ::basegfx::B2DPolyPolygon const* getClip() const = 0;
88 virtual FontSharedPtr createFont( const OUString& rFontName, const double& rCellSize ) const = 0;
90 virtual ColorSharedPtr createColor() const = 0;
92 virtual CanvasSharedPtr clone() const = 0;
93 virtual void clear() const = 0;
95 // this should be considered private. if RTTI gets enabled
96 // someday, remove that to a separate interface
97 virtual ::com::sun::star::uno::Reference<
98 ::com::sun::star::rendering::XCanvas > getUNOCanvas() const = 0;
99 virtual ::com::sun::star::rendering::ViewState getViewState() const = 0;
104 #endif /* _CPPCANVAS_CANVAS_HXX */
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */