2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: ?Description
19 #ifndef AKNSRLEFFECTCONTEXT_H
20 #define AKNSRLEFFECTCONTEXT_H
30 * Constant value indicating a rendering operation where the layer is not given
35 const TInt KAknsRlLayerNone = 0x1;
38 * Constant value indicating a rendering operation where the layer has only an
43 const TInt KAknsRlLayerRGBOnly = 0x2;
46 * Constant value indicating a rendering operation where the layer has only an
51 const TInt KAknsRlLayerAlphaOnly = 0x4;
54 * Constant value indicating a rendering operation where the layer has both an
55 * RGB channel and an alpha channel.
59 const TInt KAknsRlLayerRGBA = 0x8;
64 * Structure that encapsulates information of a layer.
68 struct TAknsRlLayerData
71 * Default constructor initializes to zero.
75 inline TAknsRlLayerData() : iRGBBitmap(0), iRGBDevice(0), iRGBGc(0),
76 iAlphaBitmap(0), iAlphaDevice(0), iAlphaGc(0) {};
79 * Bitmap for RGB channel.
83 CFbsBitmap* iRGBBitmap;
86 * Bitmap device for RGB channel.
90 CFbsBitmapDevice* iRGBDevice;
93 * Bitmap graphics context for RGB channel.
100 * Bitmap for alpha channel.
104 CFbsBitmap* iAlphaBitmap;
107 * Bitmap device for alpha channel.
111 CFbsBitmapDevice* iAlphaDevice;
114 * Bitmap graphics context for alpha channel.
121 // FORWARD DECLARATIONS
123 class RAknsSrvSession;
128 * Interface to skin effect context.
130 * Skin effect plugins receive a reference to their contexts upon activation.
131 * The context is then used to retrieve and manipulate layer data.
133 * The skin renderer sets the size of the layers of the particular skin
134 * item being rendered, and may initialize the content of one or more
135 * layers. Then the effects are executed, one at a time, to manipulate
136 * layer content. Finally, one or more layers are used as the content
137 * of the skin item being rendered.
139 * All the layers have the same size. All the RGB channels have the same
140 * color depth, and the color depth is either @c EColor64K or @c EColor16MU.
141 * All the alpha channels have color depth @c EGray256.
145 class MAknsRlEffectContext
147 public: // Constructors and destructor
150 * Destructor for internal use.
152 * Destructor is reserved for internal use. Client code must never
153 * destroy effect contexts.
155 inline virtual ~MAknsRlEffectContext() {}
157 public: // New functions - Layer support
160 * Retrieves the size of the layers. Every layer has the same size.
164 virtual const TSize LayerSize() =0;
167 * Retrieves the given layer data.
169 * Retrieves the required objects to manipulate layer content, and
170 * optionally initializes the graphical content if the layer is
173 * The ownership of the objects included in @c aData structure stays
174 * with the effect context. Calling code must not deactivate, close,
175 * nor destroy any of the objects.
177 * Calling code must assume any initial brush, pen, or color
178 * configuration regarding the graphics devices. After rendering,
179 * the plugin must not leave any clipping configuration active in the
180 * graphics contexts. Brush, pen, and color configuration may be left
183 * Only the fields indicated by @c aLayerStatus parameter are
184 * assigned. Other fields are set to @c NULL. For example, if only
185 * the RGB channel is requested, fields for the alpha channel are
188 * Note that both RGB and alpha channels are created, even if
189 * the callers requests only one of them. Therefore it is strongly
190 * recommended to use aInitialize parameter with @c ETrue value,
191 * unless the caller knows that it will draw both the channels.
193 * @param aData Structure that will receive layer data. This is an
194 * output parameter created and owned by the caller. Ownership of
195 * the data objects themselves (i.e., the fields of the stucture)
196 * stays with the effect context.
198 * @param aLayerIndex Index of the layer to be retrieved.
200 * @param aLayerStatus One of the @c KAknsRlLayer constants
201 * indicating which channels of the layer are requested.
202 * This value must not be @c KAknsRlLayerNone nor a combination
205 * @param aInitialize @c ETrue if the context should initialize the
206 * layer content, @c EFalse otherwise. Regardless of this parameter,
207 * the objects included in layer data are always constructed and
208 * drawable. If the layer is currently unused (i.e., no effect
209 * plugin or renderer has yet drawn to it), @c ETrue value
210 * instructs the context to perform the following initialization:
211 * - If RGB and alpha channels are requested, both of them are
213 * - If only RGB channel is requested, it is filled with black.
214 * Alpha channel (not visible to the effect) is filled with
216 * - If only alpha channel is requested, it is filled with black.
217 * RGB channel (not visible to the effect) is filled with
219 * If @c EFalse is specified, the initial content of a previously
220 * unused layer is undefined. This also applies to the channel
221 * possibly not included in the request.
222 * Note that initialization is never done if the layer has been
223 * previously used by some effect or the renderer itself.
226 * The method leaves with an error code if the layer can not be
227 * retrieved or an invalid parameter is given. The result of the
228 * subsequent GetLayerDataL calls is undefined. The plugin must
229 * exit as soon as possible with an error code.
231 virtual void GetLayerDataL( TAknsRlLayerData& aData,
232 const TInt aLayerIndex, const TInt aLayerStatus,
233 const TBool aInitialize ) =0;
236 * Retrieves current skin server session.
238 * @return Pointer to current skin server session. No ownership is
243 virtual RAknsSrvSession* GetSkinSrvSession() = 0;
246 #endif // AKNSRLEFFECTCONTEXT_H