1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _CPPCANVAS_IMPLCANVAS_HXX
25 #define _CPPCANVAS_IMPLCANVAS_HXX
26 
27 #include <com/sun/star/uno/Reference.hxx>
28 #include <com/sun/star/rendering/ViewState.hpp>
29 #include <cppcanvas/canvas.hxx>
30 
31 #include <boost/optional.hpp>
32 
33 namespace rtl
34 {
35     class OUString;
36 }
37 
38 namespace basegfx
39 {
40     class B2DHomMatrix;
41     class B2DPolyPolygon;
42 }
43 
44 namespace com { namespace sun { namespace star { namespace rendering
45 {
46     class  XCanvas;
47 } } } }
48 
49 
50 /* Definition of ImplCanvas */
51 
52 namespace cppcanvas
53 {
54 
55     namespace internal
56     {
57 
58         class ImplCanvas : public virtual Canvas
59         {
60         public:
61             ImplCanvas( const ::com::sun::star::uno::Reference<
62                         	::com::sun::star::rendering::XCanvas >& rCanvas );
63             virtual ~ImplCanvas();
64 
65             virtual void                             setTransformation( const ::basegfx::B2DHomMatrix& rMatrix );
66             virtual ::basegfx::B2DHomMatrix          getTransformation() const;
67 
68             virtual void                             setClip( const ::basegfx::B2DPolyPolygon& rClipPoly );
69             virtual void                             setClip();
70             virtual ::basegfx::B2DPolyPolygon const* getClip() const;
71 
72             virtual FontSharedPtr                    createFont( const ::rtl::OUString& rFontName, const double& rCellSize ) const;
73 
74             virtual ColorSharedPtr                   createColor() const;
75 
76             virtual CanvasSharedPtr                  clone() const;
77 
78             virtual void                             clear() const;
79 
80             virtual ::com::sun::star::uno::Reference<
81                 ::com::sun::star::rendering::XCanvas > 		getUNOCanvas() const;
82 
83             virtual ::com::sun::star::rendering::ViewState	getViewState() const;
84 
85             // take compiler-provided default copy constructor
86             //ImplCanvas(const ImplCanvas&);
87 
88         private:
89             // default: disabled assignment
90             ImplCanvas& operator=( const ImplCanvas& );
91 
92             mutable ::com::sun::star::rendering::ViewState									maViewState;
93             boost::optional<basegfx::B2DPolyPolygon>                                        maClipPolyPolygon;
94             const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvas > 	mxCanvas;
95 		};
96 
97 	}
98 }
99 
100 #endif /* _CPPCANVAS_IMPLCANVAS_HXX */
101