Version 3.6.0.2, tag libreoffice-3.6.0.2
[LibreOffice.git] / cppcanvas / source / mtfrenderer / transparencygroupaction.hxx
blob8f37aaeb02279044d7fbb569b914868cd3d69807
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _CPPCANVAS_TRANSPARENCYGROUPACTION_HXX
30 #define _CPPCANVAS_TRANSPARENCYGROUPACTION_HXX
32 #include <cppcanvas/canvas.hxx>
33 #include <cppcanvas/renderer.hxx>
34 #include <action.hxx>
36 #include <memory> // auto_ptr
38 namespace basegfx {
39 class B2DPoint;
40 class B2DVector;
43 class GDIMetaFile;
44 class Gradient;
47 /* Definition of internal::TransparencyGroupActionFactory class */
49 namespace cppcanvas
51 namespace internal
53 struct OutDevState;
55 typedef ::std::auto_ptr< GDIMetaFile > MtfAutoPtr;
56 typedef ::std::auto_ptr< Gradient > GradientAutoPtr;
58 /** Transparency group action.
60 This action groups a bunch of other actions, to be
61 rendered with the given transparency setting against the
62 background.
64 Creates encapsulated converters between GDIMetaFile and
65 XCanvas. The Canvas argument is deliberately placed at the
66 constructor, to force reconstruction of this object for a
67 new canvas. This considerably eases internal state
68 handling, since a lot of the internal state (e.g. fonts,
69 text layout) is Canvas-dependent.
71 class TransparencyGroupActionFactory
73 public:
74 /** Create new transparency group action.
76 @param rGroupMtf
77 Metafile that groups all actions to be rendered
78 transparent.
80 @param rAlphaGradient
81 VCL gradient, to be rendered into the action's alpha
82 channel.
84 @param rParms
85 Render parameters
87 @param rDstPoint
88 Left, top edge of destination, in current state
89 coordinate system
91 @param rDstSize
92 Size of the transparency group object, in current
93 state coordinate system.
95 static ActionSharedPtr createTransparencyGroupAction( MtfAutoPtr& rGroupMtf,
96 GradientAutoPtr& rAlphaGradient,
97 const Renderer::Parameters& rParms,
98 const ::basegfx::B2DPoint& rDstPoint,
99 const ::basegfx::B2DVector& rDstSize,
100 const CanvasSharedPtr& rCanvas,
101 const OutDevState& rState );
103 private:
104 // static factory, disable big four
105 TransparencyGroupActionFactory();
106 ~TransparencyGroupActionFactory();
107 TransparencyGroupActionFactory(const TransparencyGroupActionFactory&);
108 TransparencyGroupActionFactory& operator=( const TransparencyGroupActionFactory& );
113 #endif /*_CPPCANVAS_TRANSPARENCYGROUPACTION_HXX */
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */