epoc32/include/mw/aknsrleffectcontext.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  ?Description
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef AKNSRLEFFECTCONTEXT_H
williamr@2
    20
#define AKNSRLEFFECTCONTEXT_H
williamr@2
    21
williamr@2
    22
//  INCLUDES
williamr@2
    23
williamr@2
    24
#include <fbs.h>
williamr@2
    25
#include <bitdev.h>
williamr@2
    26
williamr@2
    27
// CONSTANTS
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
* Constant value indicating a rendering operation where the layer is not given 
williamr@2
    31
* at all.
williamr@2
    32
*
williamr@2
    33
* @since 2.8
williamr@2
    34
*/
williamr@2
    35
const TInt KAknsRlLayerNone         = 0x1;
williamr@2
    36
williamr@2
    37
/**
williamr@2
    38
* Constant value indicating a rendering operation where the layer has only an 
williamr@2
    39
* RGB channel.
williamr@2
    40
*
williamr@2
    41
* @since 2.8
williamr@2
    42
*/
williamr@2
    43
const TInt KAknsRlLayerRGBOnly      = 0x2;
williamr@2
    44
williamr@2
    45
/**
williamr@2
    46
* Constant value indicating a rendering operation where the layer has only an 
williamr@2
    47
* alpha channel.
williamr@2
    48
*
williamr@2
    49
* @since 2.8
williamr@2
    50
*/
williamr@2
    51
const TInt KAknsRlLayerAlphaOnly    = 0x4;
williamr@2
    52
williamr@2
    53
/**
williamr@2
    54
* Constant value indicating a rendering operation where the layer has both an
williamr@2
    55
* RGB channel and an alpha channel.
williamr@2
    56
*
williamr@2
    57
* @since 2.8
williamr@2
    58
*/
williamr@2
    59
const TInt KAknsRlLayerRGBA         = 0x8;
williamr@2
    60
williamr@2
    61
// DATA TYPES
williamr@2
    62
williamr@2
    63
/**
williamr@2
    64
* Structure that encapsulates information of a layer.
williamr@2
    65
*
williamr@2
    66
* @since 2.8
williamr@2
    67
*/
williamr@2
    68
struct TAknsRlLayerData 
williamr@2
    69
    {
williamr@2
    70
    /**
williamr@2
    71
    * Default constructor initializes to zero.
williamr@2
    72
    *
williamr@2
    73
    * @since 2.8
williamr@2
    74
    */
williamr@2
    75
    inline TAknsRlLayerData() : iRGBBitmap(0), iRGBDevice(0), iRGBGc(0),
williamr@2
    76
        iAlphaBitmap(0), iAlphaDevice(0), iAlphaGc(0) {};
williamr@2
    77
williamr@2
    78
    /**
williamr@2
    79
    * Bitmap for RGB channel.
williamr@2
    80
    *
williamr@2
    81
    * @since 2.8
williamr@2
    82
    */
williamr@2
    83
    CFbsBitmap* iRGBBitmap;
williamr@2
    84
williamr@2
    85
    /**
williamr@2
    86
    * Bitmap device for RGB channel.
williamr@2
    87
    *
williamr@2
    88
    * @since 2.8
williamr@2
    89
    */
williamr@2
    90
    CFbsBitmapDevice* iRGBDevice;
williamr@2
    91
williamr@2
    92
    /**
williamr@2
    93
    * Bitmap graphics context for RGB channel.
williamr@2
    94
    *
williamr@2
    95
    * @since 2.8
williamr@2
    96
    */
williamr@2
    97
    CFbsBitGc* iRGBGc;
williamr@2
    98
williamr@2
    99
    /**
williamr@2
   100
    * Bitmap for alpha channel.
williamr@2
   101
    *
williamr@2
   102
    * @since 2.8
williamr@2
   103
    */
williamr@2
   104
    CFbsBitmap* iAlphaBitmap;
williamr@2
   105
williamr@2
   106
    /**
williamr@2
   107
    * Bitmap device for alpha channel.
williamr@2
   108
    *
williamr@2
   109
    * @since 2.8
williamr@2
   110
    */
williamr@2
   111
    CFbsBitmapDevice* iAlphaDevice;
williamr@2
   112
williamr@2
   113
    /**
williamr@2
   114
    * Bitmap graphics context for alpha channel.
williamr@2
   115
    *
williamr@2
   116
    * @since 2.8
williamr@2
   117
    */
williamr@2
   118
    CFbsBitGc* iAlphaGc;
williamr@2
   119
    };
williamr@2
   120
williamr@2
   121
// FORWARD DECLARATIONS
williamr@2
   122
williamr@2
   123
class RAknsSrvSession;
williamr@2
   124
williamr@2
   125
// CLASS DECLARATION
williamr@2
   126
williamr@2
   127
/**
williamr@2
   128
* Interface to skin effect context.
williamr@2
   129
* 
williamr@2
   130
* Skin effect plugins receive a reference to their contexts upon activation.
williamr@2
   131
* The context is then used to retrieve and manipulate layer data.
williamr@2
   132
*
williamr@2
   133
* The skin renderer sets the size of the layers of the particular skin
williamr@2
   134
* item being rendered, and may initialize the content of one or more
williamr@2
   135
* layers. Then the effects are executed, one at a time, to manipulate
williamr@2
   136
* layer content. Finally, one or more layers are used as the content
williamr@2
   137
* of the skin item being rendered.
williamr@2
   138
*
williamr@2
   139
* All the layers have the same size. All the RGB channels have the same
williamr@2
   140
* color depth, and the color depth is either @c EColor64K or @c EColor16MU.
williamr@2
   141
* All the alpha channels have color depth @c EGray256.
williamr@2
   142
*
williamr@2
   143
* @since 2.8
williamr@2
   144
*/
williamr@2
   145
class MAknsRlEffectContext
williamr@2
   146
    {
williamr@2
   147
    public: // Constructors and destructor
williamr@2
   148
williamr@2
   149
        /**
williamr@2
   150
        * Destructor for internal use.
williamr@2
   151
        *
williamr@2
   152
        * Destructor is reserved for internal use. Client code must never
williamr@2
   153
        * destroy effect contexts.
williamr@2
   154
        */
williamr@2
   155
        inline virtual ~MAknsRlEffectContext() {}
williamr@2
   156
williamr@2
   157
    public: // New functions - Layer support
williamr@2
   158
williamr@2
   159
        /**
williamr@2
   160
        * Retrieves the size of the layers. Every layer has the same size.
williamr@2
   161
        *
williamr@2
   162
        * @since 2.8
williamr@2
   163
        */
williamr@2
   164
        virtual const TSize LayerSize() =0;
williamr@2
   165
williamr@2
   166
        /**
williamr@2
   167
        * Retrieves the given layer data.
williamr@2
   168
        *
williamr@2
   169
        * Retrieves the required objects to manipulate layer content, and
williamr@2
   170
        * optionally initializes the graphical content if the layer is
williamr@2
   171
        * currently unused.
williamr@2
   172
        *
williamr@2
   173
        * The ownership of the objects included in @c aData structure stays
williamr@2
   174
        * with the effect context. Calling code must not deactivate, close,
williamr@2
   175
        * nor destroy any of the objects.
williamr@2
   176
        *
williamr@2
   177
        * Calling code must assume any initial brush, pen, or color 
williamr@2
   178
        * configuration regarding the graphics devices. After rendering, 
williamr@2
   179
        * the plugin must not leave any clipping configuration active in the 
williamr@2
   180
        * graphics contexts. Brush, pen, and color configuration may be left 
williamr@2
   181
        * in any state.
williamr@2
   182
        *
williamr@2
   183
        * Only the fields indicated by @c aLayerStatus parameter are
williamr@2
   184
        * assigned. Other fields are set to @c NULL. For example, if only
williamr@2
   185
        * the RGB channel is requested, fields for the alpha channel are
williamr@2
   186
        * set to @c NULL.
williamr@2
   187
        *
williamr@2
   188
        * Note that both RGB and alpha channels are created, even if
williamr@2
   189
        * the callers requests only one of them. Therefore it is strongly
williamr@2
   190
        * recommended to use aInitialize parameter with @c ETrue value,
williamr@2
   191
        * unless the caller knows that it will draw both the channels.
williamr@2
   192
        *
williamr@2
   193
        * @param aData Structure that will receive layer data. This is an 
williamr@2
   194
        *   output parameter created and owned by the caller. Ownership of 
williamr@2
   195
        *   the data objects themselves (i.e., the fields of the stucture)
williamr@2
   196
        *   stays with the effect context.
williamr@2
   197
        *
williamr@2
   198
        * @param aLayerIndex Index of the layer to be retrieved.
williamr@2
   199
        *
williamr@2
   200
        * @param aLayerStatus One of the @c KAknsRlLayer constants
williamr@2
   201
        *   indicating which channels of the layer are requested.
williamr@2
   202
        *   This value must not be @c KAknsRlLayerNone nor a combination
williamr@2
   203
        *   of constants.
williamr@2
   204
        *
williamr@2
   205
        * @param aInitialize @c ETrue if the context should initialize the
williamr@2
   206
        *   layer content, @c EFalse otherwise. Regardless of this parameter,
williamr@2
   207
        *   the objects included in layer data are always constructed and 
williamr@2
   208
        *   drawable. If the layer is currently unused (i.e., no effect
williamr@2
   209
        *   plugin or renderer has yet drawn to it), @c ETrue value
williamr@2
   210
        *   instructs the context to perform the following initialization:
williamr@2
   211
        *    - If RGB and alpha channels are requested, both of them are
williamr@2
   212
        *       filled with black.
williamr@2
   213
        *    - If only RGB channel is requested, it is filled with black.
williamr@2
   214
        *       Alpha channel (not visible to the effect) is filled with
williamr@2
   215
        *       white.
williamr@2
   216
        *    - If only alpha channel is requested, it is filled with black.
williamr@2
   217
        *       RGB channel (not visible to the effect) is filled with
williamr@2
   218
        *       black.
williamr@2
   219
        *   If @c EFalse is specified, the initial content of a previously
williamr@2
   220
        *   unused layer is undefined. This also applies to the channel
williamr@2
   221
        *   possibly not included in the request.
williamr@2
   222
        *   Note that initialization is never done if the layer has been
williamr@2
   223
        *   previously used by some effect or the renderer itself.
williamr@2
   224
        *
williamr@2
   225
        * @par Exceptions:
williamr@2
   226
        * The method leaves with an error code if the layer can not be
williamr@2
   227
        * retrieved or an invalid parameter is given. The result of the
williamr@2
   228
        * subsequent GetLayerDataL calls is undefined. The plugin must
williamr@2
   229
        * exit as soon as possible with an error code.
williamr@2
   230
        */
williamr@2
   231
        virtual void GetLayerDataL( TAknsRlLayerData& aData,
williamr@2
   232
            const TInt aLayerIndex, const TInt aLayerStatus,
williamr@2
   233
            const TBool aInitialize ) =0;
williamr@2
   234
            
williamr@2
   235
        /**
williamr@2
   236
        * Retrieves current skin server session.
williamr@2
   237
        *
williamr@2
   238
        * @return Pointer to current skin server session. No ownership is
williamr@2
   239
        *   transferred.
williamr@2
   240
        *
williamr@2
   241
        * @since 3.0 
williamr@2
   242
        */
williamr@2
   243
        virtual RAknsSrvSession* GetSkinSrvSession() = 0;
williamr@2
   244
    };
williamr@2
   245
williamr@2
   246
#endif // AKNSRLEFFECTCONTEXT_H
williamr@2
   247
            
williamr@2
   248
// End of File