1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: transparencygroupaction.hxx,v $
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>
38 #include <memory> // auto_ptr
49 /* Definition of internal::TransparencyGroupActionFactory class */
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
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
76 /** Create new transparency group action.
79 Metafile that groups all actions to be rendered
86 Left, top edge of destination, in current state
90 Size of the transparency group object, in current
91 state coordinate system.
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
,
101 const CanvasSharedPtr
& rCanvas
,
102 const OutDevState
& rState
);
104 /** Create new transparency group action.
107 Metafile that groups all actions to be rendered
110 @param rAlphaGradient
111 VCL gradient, to be rendered into the action's alpha
118 Left, top edge of destination, in current state
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
);
134 // static factory, disable big four
135 TransparencyGroupActionFactory();
136 ~TransparencyGroupActionFactory();
137 TransparencyGroupActionFactory(const TransparencyGroupActionFactory
&);
138 TransparencyGroupActionFactory
& operator=( const TransparencyGroupActionFactory
& );
143 #endif /*_CPPCANVAS_TRANSPARENCYGROUPACTION_HXX */