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_CANVASGRAPHICHELPER_HXX
29 #define _CPPCANVAS_CANVASGRAPHICHELPER_HXX
30 
31 #include <com/sun/star/rendering/RenderState.hpp>
32 #include <basegfx/polygon/b2dpolypolygon.hxx>
33 
34 #include <cppcanvas/canvasgraphic.hxx>
35 
36 #include <boost/optional.hpp>
37 
38 namespace com { namespace sun { namespace star { namespace rendering
39 {
40     class  XGraphicDevice;
41 } } } }
42 
43 
44 /* Definition of CanvasGraphicHelper class */
45 
46 namespace cppcanvas
47 {
48 
49     namespace internal
50     {
51 
52         class CanvasGraphicHelper : public virtual CanvasGraphic
53         {
54         public:
55             CanvasGraphicHelper( const CanvasSharedPtr& rParentCanvas );
56 
57             // CanvasGraphic implementation
58             virtual void 						     setTransformation( const ::basegfx::B2DHomMatrix& rMatrix );
59             virtual ::basegfx::B2DHomMatrix          getTransformation() const;
60             virtual void                             setClip( const ::basegfx::B2DPolyPolygon& rClipPoly );
61             virtual void                             setClip();
62             virtual ::basegfx::B2DPolyPolygon const* getClip() const;
63             virtual void                             setRGBAColor( Color::IntSRGBA );
64             virtual Color::IntSRGBA                  getRGBAColor() const;
65             virtual void                             setCompositeOp( CompositeOp aOp );
66             virtual CompositeOp                      getCompositeOp() const;
67 
68         protected:
69             // for our clients
70             // ===============
71             CanvasSharedPtr																	getCanvas() const;
72             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >	getGraphicDevice() const;
73             const ::com::sun::star::rendering::RenderState&                                 getRenderState() const;
74 
75         private:
76             mutable ::com::sun::star::rendering::RenderState 								maRenderState;
77 
78             boost::optional<basegfx::B2DPolyPolygon>                                        maClipPolyPolygon;
79             CanvasSharedPtr 																mpCanvas;
80             ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice > mxGraphicDevice;
81         };
82 
83     }
84 }
85 
86 #endif /* _CPPCANVAS_CANVASGRAPHICHELPER_HXX */
87