1.1 --- a/epoc32/include/mw/aknsrleffectcontext.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/mw/aknsrleffectcontext.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,248 @@
1.4 -aknsrleffectcontext.h
1.5 +/*
1.6 +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description: ?Description
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef AKNSRLEFFECTCONTEXT_H
1.24 +#define AKNSRLEFFECTCONTEXT_H
1.25 +
1.26 +// INCLUDES
1.27 +
1.28 +#include <fbs.h>
1.29 +#include <bitdev.h>
1.30 +
1.31 +// CONSTANTS
1.32 +
1.33 +/**
1.34 +* Constant value indicating a rendering operation where the layer is not given
1.35 +* at all.
1.36 +*
1.37 +* @since 2.8
1.38 +*/
1.39 +const TInt KAknsRlLayerNone = 0x1;
1.40 +
1.41 +/**
1.42 +* Constant value indicating a rendering operation where the layer has only an
1.43 +* RGB channel.
1.44 +*
1.45 +* @since 2.8
1.46 +*/
1.47 +const TInt KAknsRlLayerRGBOnly = 0x2;
1.48 +
1.49 +/**
1.50 +* Constant value indicating a rendering operation where the layer has only an
1.51 +* alpha channel.
1.52 +*
1.53 +* @since 2.8
1.54 +*/
1.55 +const TInt KAknsRlLayerAlphaOnly = 0x4;
1.56 +
1.57 +/**
1.58 +* Constant value indicating a rendering operation where the layer has both an
1.59 +* RGB channel and an alpha channel.
1.60 +*
1.61 +* @since 2.8
1.62 +*/
1.63 +const TInt KAknsRlLayerRGBA = 0x8;
1.64 +
1.65 +// DATA TYPES
1.66 +
1.67 +/**
1.68 +* Structure that encapsulates information of a layer.
1.69 +*
1.70 +* @since 2.8
1.71 +*/
1.72 +struct TAknsRlLayerData
1.73 + {
1.74 + /**
1.75 + * Default constructor initializes to zero.
1.76 + *
1.77 + * @since 2.8
1.78 + */
1.79 + inline TAknsRlLayerData() : iRGBBitmap(0), iRGBDevice(0), iRGBGc(0),
1.80 + iAlphaBitmap(0), iAlphaDevice(0), iAlphaGc(0) {};
1.81 +
1.82 + /**
1.83 + * Bitmap for RGB channel.
1.84 + *
1.85 + * @since 2.8
1.86 + */
1.87 + CFbsBitmap* iRGBBitmap;
1.88 +
1.89 + /**
1.90 + * Bitmap device for RGB channel.
1.91 + *
1.92 + * @since 2.8
1.93 + */
1.94 + CFbsBitmapDevice* iRGBDevice;
1.95 +
1.96 + /**
1.97 + * Bitmap graphics context for RGB channel.
1.98 + *
1.99 + * @since 2.8
1.100 + */
1.101 + CFbsBitGc* iRGBGc;
1.102 +
1.103 + /**
1.104 + * Bitmap for alpha channel.
1.105 + *
1.106 + * @since 2.8
1.107 + */
1.108 + CFbsBitmap* iAlphaBitmap;
1.109 +
1.110 + /**
1.111 + * Bitmap device for alpha channel.
1.112 + *
1.113 + * @since 2.8
1.114 + */
1.115 + CFbsBitmapDevice* iAlphaDevice;
1.116 +
1.117 + /**
1.118 + * Bitmap graphics context for alpha channel.
1.119 + *
1.120 + * @since 2.8
1.121 + */
1.122 + CFbsBitGc* iAlphaGc;
1.123 + };
1.124 +
1.125 +// FORWARD DECLARATIONS
1.126 +
1.127 +class RAknsSrvSession;
1.128 +
1.129 +// CLASS DECLARATION
1.130 +
1.131 +/**
1.132 +* Interface to skin effect context.
1.133 +*
1.134 +* Skin effect plugins receive a reference to their contexts upon activation.
1.135 +* The context is then used to retrieve and manipulate layer data.
1.136 +*
1.137 +* The skin renderer sets the size of the layers of the particular skin
1.138 +* item being rendered, and may initialize the content of one or more
1.139 +* layers. Then the effects are executed, one at a time, to manipulate
1.140 +* layer content. Finally, one or more layers are used as the content
1.141 +* of the skin item being rendered.
1.142 +*
1.143 +* All the layers have the same size. All the RGB channels have the same
1.144 +* color depth, and the color depth is either @c EColor64K or @c EColor16MU.
1.145 +* All the alpha channels have color depth @c EGray256.
1.146 +*
1.147 +* @since 2.8
1.148 +*/
1.149 +class MAknsRlEffectContext
1.150 + {
1.151 + public: // Constructors and destructor
1.152 +
1.153 + /**
1.154 + * Destructor for internal use.
1.155 + *
1.156 + * Destructor is reserved for internal use. Client code must never
1.157 + * destroy effect contexts.
1.158 + */
1.159 + inline virtual ~MAknsRlEffectContext() {}
1.160 +
1.161 + public: // New functions - Layer support
1.162 +
1.163 + /**
1.164 + * Retrieves the size of the layers. Every layer has the same size.
1.165 + *
1.166 + * @since 2.8
1.167 + */
1.168 + virtual const TSize LayerSize() =0;
1.169 +
1.170 + /**
1.171 + * Retrieves the given layer data.
1.172 + *
1.173 + * Retrieves the required objects to manipulate layer content, and
1.174 + * optionally initializes the graphical content if the layer is
1.175 + * currently unused.
1.176 + *
1.177 + * The ownership of the objects included in @c aData structure stays
1.178 + * with the effect context. Calling code must not deactivate, close,
1.179 + * nor destroy any of the objects.
1.180 + *
1.181 + * Calling code must assume any initial brush, pen, or color
1.182 + * configuration regarding the graphics devices. After rendering,
1.183 + * the plugin must not leave any clipping configuration active in the
1.184 + * graphics contexts. Brush, pen, and color configuration may be left
1.185 + * in any state.
1.186 + *
1.187 + * Only the fields indicated by @c aLayerStatus parameter are
1.188 + * assigned. Other fields are set to @c NULL. For example, if only
1.189 + * the RGB channel is requested, fields for the alpha channel are
1.190 + * set to @c NULL.
1.191 + *
1.192 + * Note that both RGB and alpha channels are created, even if
1.193 + * the callers requests only one of them. Therefore it is strongly
1.194 + * recommended to use aInitialize parameter with @c ETrue value,
1.195 + * unless the caller knows that it will draw both the channels.
1.196 + *
1.197 + * @param aData Structure that will receive layer data. This is an
1.198 + * output parameter created and owned by the caller. Ownership of
1.199 + * the data objects themselves (i.e., the fields of the stucture)
1.200 + * stays with the effect context.
1.201 + *
1.202 + * @param aLayerIndex Index of the layer to be retrieved.
1.203 + *
1.204 + * @param aLayerStatus One of the @c KAknsRlLayer constants
1.205 + * indicating which channels of the layer are requested.
1.206 + * This value must not be @c KAknsRlLayerNone nor a combination
1.207 + * of constants.
1.208 + *
1.209 + * @param aInitialize @c ETrue if the context should initialize the
1.210 + * layer content, @c EFalse otherwise. Regardless of this parameter,
1.211 + * the objects included in layer data are always constructed and
1.212 + * drawable. If the layer is currently unused (i.e., no effect
1.213 + * plugin or renderer has yet drawn to it), @c ETrue value
1.214 + * instructs the context to perform the following initialization:
1.215 + * - If RGB and alpha channels are requested, both of them are
1.216 + * filled with black.
1.217 + * - If only RGB channel is requested, it is filled with black.
1.218 + * Alpha channel (not visible to the effect) is filled with
1.219 + * white.
1.220 + * - If only alpha channel is requested, it is filled with black.
1.221 + * RGB channel (not visible to the effect) is filled with
1.222 + * black.
1.223 + * If @c EFalse is specified, the initial content of a previously
1.224 + * unused layer is undefined. This also applies to the channel
1.225 + * possibly not included in the request.
1.226 + * Note that initialization is never done if the layer has been
1.227 + * previously used by some effect or the renderer itself.
1.228 + *
1.229 + * @par Exceptions:
1.230 + * The method leaves with an error code if the layer can not be
1.231 + * retrieved or an invalid parameter is given. The result of the
1.232 + * subsequent GetLayerDataL calls is undefined. The plugin must
1.233 + * exit as soon as possible with an error code.
1.234 + */
1.235 + virtual void GetLayerDataL( TAknsRlLayerData& aData,
1.236 + const TInt aLayerIndex, const TInt aLayerStatus,
1.237 + const TBool aInitialize ) =0;
1.238 +
1.239 + /**
1.240 + * Retrieves current skin server session.
1.241 + *
1.242 + * @return Pointer to current skin server session. No ownership is
1.243 + * transferred.
1.244 + *
1.245 + * @since 3.0
1.246 + */
1.247 + virtual RAknsSrvSession* GetSkinSrvSession() = 0;
1.248 + };
1.249 +
1.250 +#endif // AKNSRLEFFECTCONTEXT_H
1.251 +
1.252 +// End of File