update dev300-m58
[ooovba.git] / cppcanvas / source / mtfrenderer / transparencygroupaction.hxx
blob103b7631316fc5a971961a342546207b3021c8e0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transparencygroupaction.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _CPPCANVAS_TRANSPARENCYGROUPACTION_HXX
32 #define _CPPCANVAS_TRANSPARENCYGROUPACTION_HXX
34 #include <cppcanvas/canvas.hxx>
35 #include <cppcanvas/renderer.hxx>
36 #include <action.hxx>
38 #include <memory> // auto_ptr
40 namespace basegfx {
41 class B2DPoint;
42 class B2DVector;
45 class GDIMetaFile;
46 class Gradient;
49 /* Definition of internal::TransparencyGroupActionFactory class */
51 namespace cppcanvas
53 namespace internal
55 struct OutDevState;
57 typedef ::std::auto_ptr< GDIMetaFile > MtfAutoPtr;
58 typedef ::std::auto_ptr< Gradient > GradientAutoPtr;
60 /** Transparency group action.
62 This action groups a bunch of other actions, to be
63 rendered with the given transparency setting against the
64 background.
66 Creates encapsulated converters between GDIMetaFile and
67 XCanvas. The Canvas argument is deliberately placed at the
68 constructor, to force reconstruction of this object for a
69 new canvas. This considerably eases internal state
70 handling, since a lot of the internal state (e.g. fonts,
71 text layout) is Canvas-dependent.
73 class TransparencyGroupActionFactory
75 public:
76 /** Create new transparency group action.
78 @param rGroupMtf
79 Metafile that groups all actions to be rendered
80 transparent
82 @param rParms
83 Render parameters
85 @param rDstPoint
86 Left, top edge of destination, in current state
87 coordinate system
89 @param rDstSize
90 Size of the transparency group object, in current
91 state coordinate system.
93 @param nAlpha
94 Alpha value, must be in the range [0,1]
96 static ActionSharedPtr createTransparencyGroupAction( MtfAutoPtr& rGroupMtf,
97 const Renderer::Parameters& rParms,
98 const ::basegfx::B2DPoint& rDstPoint,
99 const ::basegfx::B2DVector& rDstSize,
100 double nAlpha,
101 const CanvasSharedPtr& rCanvas,
102 const OutDevState& rState );
104 /** Create new transparency group action.
106 @param rGroupMtf
107 Metafile that groups all actions to be rendered
108 transparent.
110 @param rAlphaGradient
111 VCL gradient, to be rendered into the action's alpha
112 channel.
114 @param rParms
115 Render parameters
117 @param rDstPoint
118 Left, top edge of destination, in current state
119 coordinate system
121 @param rDstSize
122 Size of the transparency group object, in current
123 state coordinate system.
125 static ActionSharedPtr createTransparencyGroupAction( MtfAutoPtr& rGroupMtf,
126 GradientAutoPtr& rAlphaGradient,
127 const Renderer::Parameters& rParms,
128 const ::basegfx::B2DPoint& rDstPoint,
129 const ::basegfx::B2DVector& rDstSize,
130 const CanvasSharedPtr& rCanvas,
131 const OutDevState& rState );
133 private:
134 // static factory, disable big four
135 TransparencyGroupActionFactory();
136 ~TransparencyGroupActionFactory();
137 TransparencyGroupActionFactory(const TransparencyGroupActionFactory&);
138 TransparencyGroupActionFactory& operator=( const TransparencyGroupActionFactory& );
143 #endif /*_CPPCANVAS_TRANSPARENCYGROUPACTION_HXX */