epoc32/include/mw/aknsrleffectcontext.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknsrleffectcontext.h
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * 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
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSRLEFFECTCONTEXT_H
       
    20 #define AKNSRLEFFECTCONTEXT_H
       
    21 
       
    22 //  INCLUDES
       
    23 
       
    24 #include <fbs.h>
       
    25 #include <bitdev.h>
       
    26 
       
    27 // CONSTANTS
       
    28 
       
    29 /**
       
    30 * Constant value indicating a rendering operation where the layer is not given 
       
    31 * at all.
       
    32 *
       
    33 * @since 2.8
       
    34 */
       
    35 const TInt KAknsRlLayerNone         = 0x1;
       
    36 
       
    37 /**
       
    38 * Constant value indicating a rendering operation where the layer has only an 
       
    39 * RGB channel.
       
    40 *
       
    41 * @since 2.8
       
    42 */
       
    43 const TInt KAknsRlLayerRGBOnly      = 0x2;
       
    44 
       
    45 /**
       
    46 * Constant value indicating a rendering operation where the layer has only an 
       
    47 * alpha channel.
       
    48 *
       
    49 * @since 2.8
       
    50 */
       
    51 const TInt KAknsRlLayerAlphaOnly    = 0x4;
       
    52 
       
    53 /**
       
    54 * Constant value indicating a rendering operation where the layer has both an
       
    55 * RGB channel and an alpha channel.
       
    56 *
       
    57 * @since 2.8
       
    58 */
       
    59 const TInt KAknsRlLayerRGBA         = 0x8;
       
    60 
       
    61 // DATA TYPES
       
    62 
       
    63 /**
       
    64 * Structure that encapsulates information of a layer.
       
    65 *
       
    66 * @since 2.8
       
    67 */
       
    68 struct TAknsRlLayerData 
       
    69     {
       
    70     /**
       
    71     * Default constructor initializes to zero.
       
    72     *
       
    73     * @since 2.8
       
    74     */
       
    75     inline TAknsRlLayerData() : iRGBBitmap(0), iRGBDevice(0), iRGBGc(0),
       
    76         iAlphaBitmap(0), iAlphaDevice(0), iAlphaGc(0) {};
       
    77 
       
    78     /**
       
    79     * Bitmap for RGB channel.
       
    80     *
       
    81     * @since 2.8
       
    82     */
       
    83     CFbsBitmap* iRGBBitmap;
       
    84 
       
    85     /**
       
    86     * Bitmap device for RGB channel.
       
    87     *
       
    88     * @since 2.8
       
    89     */
       
    90     CFbsBitmapDevice* iRGBDevice;
       
    91 
       
    92     /**
       
    93     * Bitmap graphics context for RGB channel.
       
    94     *
       
    95     * @since 2.8
       
    96     */
       
    97     CFbsBitGc* iRGBGc;
       
    98 
       
    99     /**
       
   100     * Bitmap for alpha channel.
       
   101     *
       
   102     * @since 2.8
       
   103     */
       
   104     CFbsBitmap* iAlphaBitmap;
       
   105 
       
   106     /**
       
   107     * Bitmap device for alpha channel.
       
   108     *
       
   109     * @since 2.8
       
   110     */
       
   111     CFbsBitmapDevice* iAlphaDevice;
       
   112 
       
   113     /**
       
   114     * Bitmap graphics context for alpha channel.
       
   115     *
       
   116     * @since 2.8
       
   117     */
       
   118     CFbsBitGc* iAlphaGc;
       
   119     };
       
   120 
       
   121 // FORWARD DECLARATIONS
       
   122 
       
   123 class RAknsSrvSession;
       
   124 
       
   125 // CLASS DECLARATION
       
   126 
       
   127 /**
       
   128 * Interface to skin effect context.
       
   129 * 
       
   130 * Skin effect plugins receive a reference to their contexts upon activation.
       
   131 * The context is then used to retrieve and manipulate layer data.
       
   132 *
       
   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.
       
   138 *
       
   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.
       
   142 *
       
   143 * @since 2.8
       
   144 */
       
   145 class MAknsRlEffectContext
       
   146     {
       
   147     public: // Constructors and destructor
       
   148 
       
   149         /**
       
   150         * Destructor for internal use.
       
   151         *
       
   152         * Destructor is reserved for internal use. Client code must never
       
   153         * destroy effect contexts.
       
   154         */
       
   155         inline virtual ~MAknsRlEffectContext() {}
       
   156 
       
   157     public: // New functions - Layer support
       
   158 
       
   159         /**
       
   160         * Retrieves the size of the layers. Every layer has the same size.
       
   161         *
       
   162         * @since 2.8
       
   163         */
       
   164         virtual const TSize LayerSize() =0;
       
   165 
       
   166         /**
       
   167         * Retrieves the given layer data.
       
   168         *
       
   169         * Retrieves the required objects to manipulate layer content, and
       
   170         * optionally initializes the graphical content if the layer is
       
   171         * currently unused.
       
   172         *
       
   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.
       
   176         *
       
   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 
       
   181         * in any state.
       
   182         *
       
   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
       
   186         * set to @c NULL.
       
   187         *
       
   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.
       
   192         *
       
   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.
       
   197         *
       
   198         * @param aLayerIndex Index of the layer to be retrieved.
       
   199         *
       
   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
       
   203         *   of constants.
       
   204         *
       
   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
       
   212         *       filled with black.
       
   213         *    - If only RGB channel is requested, it is filled with black.
       
   214         *       Alpha channel (not visible to the effect) is filled with
       
   215         *       white.
       
   216         *    - If only alpha channel is requested, it is filled with black.
       
   217         *       RGB channel (not visible to the effect) is filled with
       
   218         *       black.
       
   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.
       
   224         *
       
   225         * @par Exceptions:
       
   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.
       
   230         */
       
   231         virtual void GetLayerDataL( TAknsRlLayerData& aData,
       
   232             const TInt aLayerIndex, const TInt aLayerStatus,
       
   233             const TBool aInitialize ) =0;
       
   234             
       
   235         /**
       
   236         * Retrieves current skin server session.
       
   237         *
       
   238         * @return Pointer to current skin server session. No ownership is
       
   239         *   transferred.
       
   240         *
       
   241         * @since 3.0 
       
   242         */
       
   243         virtual RAknsSrvSession* GetSkinSrvSession() = 0;
       
   244     };
       
   245 
       
   246 #endif // AKNSRLEFFECTCONTEXT_H
       
   247             
       
   248 // End of File