skins/AknSkins/rlplugininc/AknsRlEffectPluginApplyGfx.h
changeset 0 05e9090e2422
equal deleted inserted replaced
-1:000000000000 0:05e9090e2422
       
     1 /*
       
     2 * Copyright (c) 2004-2008 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 "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Effect that applies the given bitmap or SVG icon to the layer.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef AKNSRLEFFECTPLUGINAPPLYGFX_H
       
    20 #define AKNSRLEFFECTPLUGINAPPLYGFX_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "AknsRlEffectPlugin.h"
       
    24 
       
    25 /**
       
    26 * Effect that applies the given bitmap or SVG icon to the layer.
       
    27 *
       
    28 * Supported effect parameters:
       
    29 *  - "f" (graphics) Fully qualified filename and indices of the graphics.
       
    30 *       Mandatory. Mask index may be -1 if unused. "Mask-only" operations
       
    31 *       must be done using bitmap index.
       
    32 *  - "ms" (number, 0..1) Scaling mode. Must be one of the following values:
       
    33 *       - 0: Stretch preserving aspect ration. Stretch to fill the
       
    34 *           target area size preserving the aspect ratio. Exceeding parts
       
    35 *           are cropped.
       
    36 *       - 1: Stretch. Stretch to target area size.
       
    37 *       Optional. If missing, default value 1 is used.
       
    38 *   - "tx" (number, 1..) Horizontal number of tiles. The target area
       
    39 *       x-axis is divided in the number of tiles specified by this parameter.
       
    40 *       Optional. If given, enables tiling. Default value is 1.
       
    41 *   - "ty" (number, 1..) Vertical number of tiles. The target area y-axis
       
    42 *       is divided in the number of tiles specified by this parameter.
       
    43 *       Optional. If given, enables tiling. Default value is 1.
       
    44 *   - "tw" (number, 1..) Width of a tile in pixels.
       
    45 *       Optional and mutually exclusive with "tx". If given, enables tiling.
       
    46 *   - "th" (number, 1..) Height of a tile in pixels.
       
    47 *       Optional and mutually exclusive with "tx". If given, enables tiling.
       
    48 *   - "alt" (number, 1..)
       
    49 *       Effect is applied only if aspect ratio of the layer is less than
       
    50 *       the given value. Number 256 represents aspect ratio 1:1.
       
    51 *   - "agt" (number, 1..)
       
    52 *       Effect is applied only if aspect ratio of the layer is greater than
       
    53 *       the given value.
       
    54 * Tiling is enabled if at least one parameter indicating tiling is given.
       
    55 *
       
    56 * Supported layer combinations:
       
    57 *  - Input layer A is supported, but optional. Supported only for interface
       
    58 *   completeness, and does not affect the actual operation.
       
    59 *  - Output layer RGB, A, and RGBA configurations are supported. If the output
       
    60 *   layer is previously unused, the usual initialization rules apply.
       
    61 *   If the output layer already exists, only the specified channels are
       
    62 *   modified (and the entire layer size is always covered for them).
       
    63 *   If A is requested and no mask parameter is given, the bitmap is outputted
       
    64 *   to alpha channel only (to allow mask-only application).
       
    65 *   If RGBA is requested and no mask parameter is given, the alpha channel
       
    66 *   is cleared with white color.
       
    67 *
       
    68 * @since 2.8
       
    69 */
       
    70 NONSHARABLE_CLASS(CAknsRlEffectPluginApplyGfx) :
       
    71     public CAknsRlEffectPlugin, public MAknsRlEffect
       
    72     {
       
    73     public: // Constructors and destructor
       
    74 
       
    75         /**
       
    76         * Default constructor.
       
    77         *
       
    78         * @since 2.8
       
    79         */
       
    80         CAknsRlEffectPluginApplyGfx();
       
    81 
       
    82         /**
       
    83         * Destructor.
       
    84         *
       
    85         * @since 2.8
       
    86         */
       
    87         virtual ~CAknsRlEffectPluginApplyGfx();
       
    88 
       
    89     public: // From CAknsRlEffectPlugin
       
    90 
       
    91         /**
       
    92         * @copydoc CAknsRlEffectPlugin::EffectUid
       
    93         */
       
    94         TUid EffectUid() const;
       
    95 
       
    96         /**
       
    97         * @copydoc CAknsRlEffectPlugin::Effect
       
    98         */
       
    99         MAknsRlEffect* Effect( const TInt aInterface );
       
   100 
       
   101     public: // From MAknsRlEffect
       
   102 
       
   103         /**
       
   104         * @copydoc MAknsRlEffect::InitializeL
       
   105         */
       
   106         void InitializeL();
       
   107 
       
   108         /**
       
   109         * @copydoc MAknsRlEffect::Release
       
   110         */
       
   111         void Release();
       
   112 
       
   113         /**
       
   114         * @copydoc MAknsRlEffect::ActivateL
       
   115         */
       
   116         void ActivateL( MAknsRlEffectContext* aContext );
       
   117 
       
   118         /**
       
   119         * @copydoc MAknsRlEffect::Deactivate
       
   120         */
       
   121         void Deactivate();
       
   122 
       
   123         /**
       
   124         * @copydoc MAknsRlEffect::SetParametersL
       
   125         */
       
   126         void SetParametersL(
       
   127             MAknsRlParameterIterator& aParameters );
       
   128 
       
   129         /**
       
   130         * @copydoc MAknsRlEffect::GetCapabilities
       
   131         */
       
   132         void GetCapabilities( TAknsRlEffectCaps& aCaps );
       
   133 
       
   134         /**
       
   135         * @copydoc MAknsRlEffect::Render
       
   136         */
       
   137         TInt Render( const TAknsRlRenderOpParam& aParam );
       
   138 
       
   139     private: // New methods
       
   140 
       
   141         void DoRenderL( const TAknsRlRenderOpParam& aParam );
       
   142 
       
   143     private: // Data
       
   144         MAknsRlEffectContext* iContext;
       
   145 
       
   146         HBufC16* iFilename;
       
   147         TInt iBmpIndex;
       
   148         TInt iMaskIndex;
       
   149 
       
   150         TInt iScaleMode;
       
   151 
       
   152         TBool iTiled;
       
   153         TInt iTilesX;
       
   154         TInt iTilesY;
       
   155         TInt iTileW;
       
   156         TInt iTileH;
       
   157 
       
   158         TInt iMaxAspect;
       
   159         TInt iMinAspect;
       
   160         TInt iGenericImage;
       
   161     };
       
   162 
       
   163 #endif // AKNSRLEFFECTPLUGINAPPLYGFX_H
       
   164 
       
   165 // End of File