williamr@2: /* williamr@2: * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: ?Description williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef AKNSRLEFFECTCONTEXT_H williamr@2: #define AKNSRLEFFECTCONTEXT_H williamr@2: williamr@2: // INCLUDES williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: /** williamr@2: * Constant value indicating a rendering operation where the layer is not given williamr@2: * at all. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: const TInt KAknsRlLayerNone = 0x1; williamr@2: williamr@2: /** williamr@2: * Constant value indicating a rendering operation where the layer has only an williamr@2: * RGB channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: const TInt KAknsRlLayerRGBOnly = 0x2; williamr@2: williamr@2: /** williamr@2: * Constant value indicating a rendering operation where the layer has only an williamr@2: * alpha channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: const TInt KAknsRlLayerAlphaOnly = 0x4; williamr@2: williamr@2: /** williamr@2: * Constant value indicating a rendering operation where the layer has both an williamr@2: * RGB channel and an alpha channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: const TInt KAknsRlLayerRGBA = 0x8; williamr@2: williamr@2: // DATA TYPES williamr@2: williamr@2: /** williamr@2: * Structure that encapsulates information of a layer. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: struct TAknsRlLayerData williamr@2: { williamr@2: /** williamr@2: * Default constructor initializes to zero. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: inline TAknsRlLayerData() : iRGBBitmap(0), iRGBDevice(0), iRGBGc(0), williamr@2: iAlphaBitmap(0), iAlphaDevice(0), iAlphaGc(0) {}; williamr@2: williamr@2: /** williamr@2: * Bitmap for RGB channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitmap* iRGBBitmap; williamr@2: williamr@2: /** williamr@2: * Bitmap device for RGB channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitmapDevice* iRGBDevice; williamr@2: williamr@2: /** williamr@2: * Bitmap graphics context for RGB channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitGc* iRGBGc; williamr@2: williamr@2: /** williamr@2: * Bitmap for alpha channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitmap* iAlphaBitmap; williamr@2: williamr@2: /** williamr@2: * Bitmap device for alpha channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitmapDevice* iAlphaDevice; williamr@2: williamr@2: /** williamr@2: * Bitmap graphics context for alpha channel. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: CFbsBitGc* iAlphaGc; williamr@2: }; williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: williamr@2: class RAknsSrvSession; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Interface to skin effect context. williamr@2: * williamr@2: * Skin effect plugins receive a reference to their contexts upon activation. williamr@2: * The context is then used to retrieve and manipulate layer data. williamr@2: * williamr@2: * The skin renderer sets the size of the layers of the particular skin williamr@2: * item being rendered, and may initialize the content of one or more williamr@2: * layers. Then the effects are executed, one at a time, to manipulate williamr@2: * layer content. Finally, one or more layers are used as the content williamr@2: * of the skin item being rendered. williamr@2: * williamr@2: * All the layers have the same size. All the RGB channels have the same williamr@2: * color depth, and the color depth is either @c EColor64K or @c EColor16MU. williamr@2: * All the alpha channels have color depth @c EGray256. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: class MAknsRlEffectContext williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Destructor for internal use. williamr@2: * williamr@2: * Destructor is reserved for internal use. Client code must never williamr@2: * destroy effect contexts. williamr@2: */ williamr@2: inline virtual ~MAknsRlEffectContext() {} williamr@2: williamr@2: public: // New functions - Layer support williamr@2: williamr@2: /** williamr@2: * Retrieves the size of the layers. Every layer has the same size. williamr@2: * williamr@2: * @since 2.8 williamr@2: */ williamr@2: virtual const TSize LayerSize() =0; williamr@2: williamr@2: /** williamr@2: * Retrieves the given layer data. williamr@2: * williamr@2: * Retrieves the required objects to manipulate layer content, and williamr@2: * optionally initializes the graphical content if the layer is williamr@2: * currently unused. williamr@2: * williamr@2: * The ownership of the objects included in @c aData structure stays williamr@2: * with the effect context. Calling code must not deactivate, close, williamr@2: * nor destroy any of the objects. williamr@2: * williamr@2: * Calling code must assume any initial brush, pen, or color williamr@2: * configuration regarding the graphics devices. After rendering, williamr@2: * the plugin must not leave any clipping configuration active in the williamr@2: * graphics contexts. Brush, pen, and color configuration may be left williamr@2: * in any state. williamr@2: * williamr@2: * Only the fields indicated by @c aLayerStatus parameter are williamr@2: * assigned. Other fields are set to @c NULL. For example, if only williamr@2: * the RGB channel is requested, fields for the alpha channel are williamr@2: * set to @c NULL. williamr@2: * williamr@2: * Note that both RGB and alpha channels are created, even if williamr@2: * the callers requests only one of them. Therefore it is strongly williamr@2: * recommended to use aInitialize parameter with @c ETrue value, williamr@2: * unless the caller knows that it will draw both the channels. williamr@2: * williamr@2: * @param aData Structure that will receive layer data. This is an williamr@2: * output parameter created and owned by the caller. Ownership of williamr@2: * the data objects themselves (i.e., the fields of the stucture) williamr@2: * stays with the effect context. williamr@2: * williamr@2: * @param aLayerIndex Index of the layer to be retrieved. williamr@2: * williamr@2: * @param aLayerStatus One of the @c KAknsRlLayer constants williamr@2: * indicating which channels of the layer are requested. williamr@2: * This value must not be @c KAknsRlLayerNone nor a combination williamr@2: * of constants. williamr@2: * williamr@2: * @param aInitialize @c ETrue if the context should initialize the williamr@2: * layer content, @c EFalse otherwise. Regardless of this parameter, williamr@2: * the objects included in layer data are always constructed and williamr@2: * drawable. If the layer is currently unused (i.e., no effect williamr@2: * plugin or renderer has yet drawn to it), @c ETrue value williamr@2: * instructs the context to perform the following initialization: williamr@2: * - If RGB and alpha channels are requested, both of them are williamr@2: * filled with black. williamr@2: * - If only RGB channel is requested, it is filled with black. williamr@2: * Alpha channel (not visible to the effect) is filled with williamr@2: * white. williamr@2: * - If only alpha channel is requested, it is filled with black. williamr@2: * RGB channel (not visible to the effect) is filled with williamr@2: * black. williamr@2: * If @c EFalse is specified, the initial content of a previously williamr@2: * unused layer is undefined. This also applies to the channel williamr@2: * possibly not included in the request. williamr@2: * Note that initialization is never done if the layer has been williamr@2: * previously used by some effect or the renderer itself. williamr@2: * williamr@2: * @par Exceptions: williamr@2: * The method leaves with an error code if the layer can not be williamr@2: * retrieved or an invalid parameter is given. The result of the williamr@2: * subsequent GetLayerDataL calls is undefined. The plugin must williamr@2: * exit as soon as possible with an error code. williamr@2: */ williamr@2: virtual void GetLayerDataL( TAknsRlLayerData& aData, williamr@2: const TInt aLayerIndex, const TInt aLayerStatus, williamr@2: const TBool aInitialize ) =0; williamr@2: williamr@2: /** williamr@2: * Retrieves current skin server session. williamr@2: * williamr@2: * @return Pointer to current skin server session. No ownership is williamr@2: * transferred. williamr@2: * williamr@2: * @since 3.0 williamr@2: */ williamr@2: virtual RAknsSrvSession* GetSkinSrvSession() = 0; williamr@2: }; williamr@2: williamr@2: #endif // AKNSRLEFFECTCONTEXT_H williamr@2: williamr@2: // End of File