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_POLYPOLYACTION_HXX
29 #define _CPPCANVAS_POLYPOLYACTION_HXX
30 
31 #include <action.hxx>
32 #include <cppcanvas/canvas.hxx>
33 
34 
35 namespace basegfx {
36     class B2DPolyPolygon;
37 }
38 namespace com { namespace sun { namespace star { namespace rendering
39 {
40     struct Texture;
41     struct StrokeAttributes;
42 } } } }
43 
44 
45 /* Definition of internal::PolyPolyActionFactory class */
46 
47 namespace cppcanvas
48 {
49     namespace internal
50     {
51         struct OutDevState;
52 
53         /** Creates encapsulated converters between GDIMetaFile and
54             XCanvas. The Canvas argument is deliberately placed at the
55             constructor, to force reconstruction of this object for a
56             new canvas. This considerably eases internal state
57             handling, since a lot of the internal state (e.g. fonts,
58             text layout) is Canvas-dependent.
59          */
60         class PolyPolyActionFactory
61         {
62         public:
63             /// Create polygon, fill/stroke according to state
64             static ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
65                                                          const CanvasSharedPtr&,
66                                                          const OutDevState& 	);
67 
68             /// Create texture-filled polygon
69             static ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
70                                                          const CanvasSharedPtr&,
71                                                          const OutDevState&,
72                                                          const ::com::sun::star::rendering::Texture& );
73 
74             /// Create line polygon (always stroked, not filled)
75             static ActionSharedPtr createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon&,
76                                                              const CanvasSharedPtr&,
77                                                              const OutDevState& );
78 
79             /// Create stroked polygon
80             static ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
81                                                          const CanvasSharedPtr&,
82                                                          const OutDevState&,
83                                                          const ::com::sun::star::rendering::StrokeAttributes& );
84 
85             /// For transparent painting of the given polygon (normally, we take the colors always opaque)
86             static ActionSharedPtr createPolyPolyAction( const ::basegfx::B2DPolyPolygon&,
87                                                          const CanvasSharedPtr&,
88                                                          const OutDevState&,
89                                                          int nTransparency );
90 
91         private:
92             // static factory, disable big four
93             PolyPolyActionFactory();
94             ~PolyPolyActionFactory();
95             PolyPolyActionFactory(const PolyPolyActionFactory&);
96             PolyPolyActionFactory& operator=( const PolyPolyActionFactory& );
97         };
98     }
99 }
100 
101 #endif /* _CPPCANVAS_POLYPOLYACTION_HXX */
102