1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _CPPCANVAS_IMPLCANVAS_HXX
29 #define _CPPCANVAS_IMPLCANVAS_HXX
30 
31 #include <com/sun/star/uno/Reference.hxx>
32 #include <com/sun/star/rendering/ViewState.hpp>
33 #include <cppcanvas/canvas.hxx>
34 
35 #include <boost/optional.hpp>
36 
37 namespace rtl
38 {
39     class OUString;
40 }
41 
42 namespace basegfx
43 {
44     class B2DHomMatrix;
45     class B2DPolyPolygon;
46 }
47 
48 namespace com { namespace sun { namespace star { namespace rendering
49 {
50     class  XCanvas;
51 } } } }
52 
53 
54 /* Definition of ImplCanvas */
55 
56 namespace cppcanvas
57 {
58 
59     namespace internal
60     {
61 
62         class ImplCanvas : public virtual Canvas
63         {
64         public:
65             ImplCanvas( const ::com::sun::star::uno::Reference<
66                         	::com::sun::star::rendering::XCanvas >& rCanvas );
67             virtual ~ImplCanvas();
68 
69             virtual void                             setTransformation( const ::basegfx::B2DHomMatrix& rMatrix );
70             virtual ::basegfx::B2DHomMatrix          getTransformation() const;
71 
72             virtual void                             setClip( const ::basegfx::B2DPolyPolygon& rClipPoly );
73             virtual void                             setClip();
74             virtual ::basegfx::B2DPolyPolygon const* getClip() const;
75 
76             virtual FontSharedPtr                    createFont( const ::rtl::OUString& rFontName, const double& rCellSize ) const;
77 
78             virtual ColorSharedPtr                   createColor() const;
79 
80             virtual CanvasSharedPtr                  clone() const;
81 
82             virtual void                             clear() const;
83 
84             virtual ::com::sun::star::uno::Reference<
85                 ::com::sun::star::rendering::XCanvas > 		getUNOCanvas() const;
86 
87             virtual ::com::sun::star::rendering::ViewState	getViewState() const;
88 
89             // take compiler-provided default copy constructor
90             //ImplCanvas(const ImplCanvas&);
91 
92         private:
93             // default: disabled assignment
94             ImplCanvas& operator=( const ImplCanvas& );
95 
96             mutable ::com::sun::star::rendering::ViewState									maViewState;
97             boost::optional<basegfx::B2DPolyPolygon>                                        maClipPolyPolygon;
98             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > 	mxCanvas;
99 		};
100 
101 	}
102 }
103 
104 #endif /* _CPPCANVAS_IMPLCANVAS_HXX */
105